/* =============================================================================
   cim360-list.css - the one stylesheet every Cim360 list view is built on.

   Global, and linked from App.razor and the MAUI index.html, on purpose. A
   .razor.css is rewritten per component: every rule becomes
   `.cim-list-page[b-<hash>]` and stamps only the markup of the component that
   owns the file. That is not a style choice, it is why this file exists.

   Until 2026-08-31 the list-page shell lived in Item.razor.css as scoped CSS
   under the names `inventory-page`, `inventory-body`,
   `inventory-item-grid-container`, `inventory-grid-wrap`,
   `inventory-grid-host` and `inventory-card-host`. Stocktake.razor reused all
   six class names and had no .razor.css of its own, so it carried no scope
   attribute and not one of those rules could reach it - its columns and chips
   rendered correctly while its page frame had no padding, no flex column and
   no scroll containment. Quarantine.razor sidestepped the whole thing with a
   409-line inline <style> block defining a parallel `q-*` vocabulary.

   Two sections:
     1. The list-page shell   - owned by Cim360ListPage.razor
     2. Grid internals        - lifted out of Cim360Grid.razor's <style> block,
                                which injected 647 lines into the DOM once per
                                grid instance

   Screen-specific cell and card styling still belongs in that screen's own
   .razor.css. The rule is about reach, not about scoping being wrong: a class
   used by exactly one component is correctly scoped to it, and a class shared
   across components has to be here.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. The list-page shell
   -------------------------------------------------------------------------- */

.cim-list-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.cim-list-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: .35rem .5rem 0 .5rem;
}

.cim-list-container,
.cim-list-grid-wrap,
.cim-list-card-host,
.cim-list-status-host {
    height: 100%;
    min-height: 0;
    min-width: 0;
}

.cim-list-grid-wrap {
    display: flex;
    flex-direction: column;
}

.cim-list-grid-host {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cim-list-card-host {
    overflow: hidden;
}

/* A board's columns end above the floating action bar. The bar floats 70px above the window's foot
   and stands about 46px tall; a column runs to the bottom of the list, so without this the middle
   columns' last cards - and the purchase board's value footers, which do not scroll - sat behind it
   (DEV-743, measured at 1900x1100 and 1366x768). 5.25rem is the track's own 0.75rem plus 4.5rem of
   clearance, which leaves the column foot about 9px above the bar. */
.cim-list-card-host.has-fam .cim-kanban-track {
    padding-bottom: 5.25rem;
}

/* The Status body (ListViewMode.Status) - the same rows banded by status. Sized like the card host,
   but a flex column rather than a wrapping grid: a banded list is one tall column, and the band view
   inside is the scroll container. That is what makes its band headers stick to the list rather than
   to the page. */
.cim-list-status-host {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cim-list-body .dxbl-grid,
.cim-list-body .grid-viewport {
    height: 100%;
    min-height: 0;
}

/* The loading / failed placeholder that Cim360ListPage renders in place of the list body.
   Centred in the body rather than pinned to the top: it stands in for the whole grid, so it reads
   as the page's state rather than as a message above an empty table.

   Rules for `.dxbl-loading-panel` used to sit here, from when Inventory and Quarantine each
   wrapped their grid in a DxLoadingPanel and Stocktake did not. No list view uses one now - the
   shell owns loading - and the item tabs that still do are rendered inside Cim360Window, not
   inside a .cim-list-body, so those rules could not reach them either. */
.cim-list-placeholder {
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* A refresh that failed after the list was drawn: one line above the rows it leaves on screen,
   not a placeholder in their place. See Cim360ListPage.ShowFailureBanner. */
.cim-list-failed-banner {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: .5rem .75rem;
}

/* Shared by every list view that links a record from a cell - Inventory,
   Stocktake and Quarantine all do. It was in Item.razor.css, so the other two
   were relying on a rule scoped to a page they are not. */
.stock-link {
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 768px) {
    .cim-list-page {
        height: calc(100dvh - 2.875rem);
        max-height: calc(100dvh - 2.875rem);
    }

    .cim-list-body {
        padding: .35rem .35rem env(safe-area-inset-bottom) .35rem;
    }
}

/* -----------------------------------------------------------------------------
   2. Grid internals - lifted verbatim out of Cim360Grid.razor
   -------------------------------------------------------------------------- */
/* A `:root` block declaring --cim-brand-100/200/300 used to sit here, inherited from
   Cim360Grid.razor's inline <style>. It was an exact duplicate of --cim360-primary,
   --cim360-accent and --cim360-soft (app.css and css/themes/theme-fluent.css), referenced by
   nothing anywhere in the solution, and it redefined :root from inside what was then a
   component. Deleted rather than moved - a second brand palette is how two controls end up the
   same colour by coincidence instead of by definition. */

.grid-viewport {
    border: none;
    min-height: 0;
}

.header-bold span {
    font-weight: 700;
    color: var(--cim360-headerband-fg);
}

.dxbl-grid-header-content .dxbl-btn {
    font-weight: 700;
    color: var(--cim360-headerband-fg) !important;
}

.dxbl-grid-header-content .dxbl-checkbox .dxbl-checkbox-check-element {
    border: 1.5px solid var(--cim360-headerband-fg);
    border-radius: 0.25rem;
}


/* The group panel only while something is grouped. Empty, it shows "Drag a column header here to
   group by that column" - an invitation that does nothing on a list where only some columns can
   group, and grouping is offered from the column's right-click menu anyway. The top panel goes too
   when the group panel is all it holds, so no empty band is left behind. DEV-620. */
.grid-viewport .dxbl-grid-group-panel-container:not(:has(> .dxbl-grid-header)) {
    display: none;
}

.grid-viewport .dxbl-grid-top-panel:not(:has(> :not(.dxbl-grid-group-panel-container))):not(:has(.dxbl-grid-group-panel-container > .dxbl-grid-header)) {
    display: none;
}

/* A group's header band, in the primary tint so a month reads as one block. The tint is
   translucent over the card, so the text keeps the card's contrast in both themes. DEV-620. */
.grid-viewport .cim-grid-group-row > td {
    background-color: var(--cim360-primary-tint);
    color: var(--cim360-text);
}

/* A group row's label and its totals. The row is one cell spanning every column, so each total is
   positioned absolutely inside this box and the grid's script sets its `right` so its right edge meets
   its column's header cell (Cim360Grid AlignGroupSummaries). Hidden until placed, so a total never
   flashes at the wrong edge. The box keeps the row's height; a total is out of flow. */
.grid-viewport .cim-group-totals {
    position: relative;
    display: block;
    min-height: 1.5em;
}

.grid-viewport .cim-group-total {
    position: absolute;
    top: 0;
    right: 0;
    white-space: nowrap;
    font-weight: 700;
}

/* A group of a list grouped by a column's value: "Currency: GBP · 12 rows". The caption and the count
   are secondary to the value, in the muted text the band's tint was measured against. DEV-624. */
.grid-viewport .cim-value-group {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
    white-space: nowrap;
}

.grid-viewport .cim-value-group-caption,
.grid-viewport .cim-value-group-count {
    color: var(--cim360-text-muted);
}

.grid-viewport .cim-value-group-count::before {
    content: "·";
    margin-right: 0.375rem;
}

.grid-viewport .cim-grid-row.alt-item > td:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell):not(.dxbl-grid-selection-cell) {
    background-color: color-mix(in srgb, var(--cim360-text) 2.5%, var(--cim360-card));
}

.grid-viewport.dxbl-grid .dxbl-grid-table tr.cim-grid-row:hover,
.grid-viewport.dxbl-grid .dxbl-grid-table tr.cim-grid-row:hover > td:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell) {
    background-color: color-mix(in srgb, var(--cim360-primary) 09%, transparent) !important;
    background-image: none !important;
    color: var(--cim360-text) !important;
}

/* FOCUSED IS NOT SELECTED, and the two must not look the same.

   DEV-307: focus was a 18% fill and selection a 22% fill - two percent apart, so the row the
   caret happened to be on was indistinguishable from a row the person had chosen. With only
   the first and last of a multi-selection marked at all, that made "6 Selected" look like two
   selected rows, one of which was not selected at all.

   Three states now sit apart on one scale - hover 9%, focus 14%, selected 22% - and only
   selection carries the left bar below, so the bar reads as "chosen" and nothing else does.
   Focus is not dropped to an outline alone: this row is reachable by keyboard, and removing its
   visible indicator to fix a confusion would trade one failure (4.1.2) for another (2.4.7
   Focus Visible). */
/* THE TINTS ARE MIXED AGAINST WHITE, NOT TRANSPARENT, AND THAT IS THE WHOLE POINT.

   Each rule below paints its colour on the ROW and again on every CELL in it - both selectors
   are needed, because DevExpress paints the td and a row-only rule is invisible behind it.
   Mixed against `transparent` the result keeps an alpha, so the cell's copy composites over the
   row's and the tint lands TWICE: the 32% selected-and-focused row measured as rgb(134,181,218)
   where the value here says rgb(183,211,233).

   That took the link on such a row to 3.66:1 against a required 4.5 - axe reported it on the
   purchase document list on 2026-09-15, and it was true of every list in the product at once.
   Reading the source could not find it: the arithmetic on the value as written gives 5.14, which
   passes. It needed the computed style off a real selected row.

   Mixed against #fff the colour is opaque, so painting it twice is identical to painting it once
   and the measured ratio matches the arithmetic again. Do not put `transparent` back without
   re-measuring a selected AND focused row - that is the worst case, not the selected one. */
.grid-viewport.dxbl-grid .dxbl-grid-table tr.dxbl-grid-focused-row,
.grid-viewport.dxbl-grid .dxbl-grid-table tr.dxbl-grid-focused-row > td:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell) {
    background-color: color-mix(in srgb, var(--cim360-primary) 14%, var(--cim360-card)) !important;
    background-image: none !important;
    color: var(--cim360-text) !important;
}

.grid-viewport.dxbl-grid .dxbl-grid-table tr.dxbl-grid-selected-row,
.grid-viewport.dxbl-grid .dxbl-grid-table tr.dxbl-grid-selected-row > td:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell) {
    background-color: color-mix(in srgb, var(--cim-chip-dot, var(--cim360-primary)) 22%, var(--cim360-card)) !important;
    background-image: none !important;
    color: var(--cim360-row-selected-fg) !important;
}

.grid-viewport.dxbl-grid .dxbl-grid-table tr.dxbl-grid-selected-row.dxbl-grid-focused-row,
.grid-viewport.dxbl-grid .dxbl-grid-table tr.dxbl-grid-selected-row.dxbl-grid-focused-row > td:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell) {
    background-color: color-mix(in srgb, var(--cim360-primary) 32%, var(--cim360-card)) !important;
    background-image: none !important;
    color: var(--cim360-row-selected-fg) !important;
}

.grid-viewport .dxbl-grid-table .cim-grid-row > td:first-child:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell) {
    box-shadow: inset 0.1875rem 0 0 transparent;
}

/* The left bar means SELECTED, and only selected. It used to be on the focused row too, which
   is half of why a focused row read as a chosen one - DEV-307. */
.grid-viewport .dxbl-grid-table .dxbl-grid-selected-row > td:first-child:not(.dxbl-grid-empty-cell):not(.dxbl-grid-indent-cell) {
    box-shadow: inset 0.1875rem 0 0 var(--cim360-primary);
}

    /* -dark on these rows, and only these rows. The focused row paints a 14% tint of the primary
       behind the link, so the primary ON that tint measured 3.41:1 - the link is legible on a white
       row at 4.87:1 and stops being so the moment the row is focused, which is precisely when
       somebody is looking at it. The dark token clears the tint at 5.59:1. WCAG 1.4.3. */
    .grid-viewport .dxbl-grid-table .dxbl-grid-focused-row .stock-link,
    .grid-viewport .dxbl-grid-table .dxbl-grid-selected-row .stock-link,
    .grid-viewport .dxbl-grid-table [aria-selected="true"] .stock-link {
        color: var(--cim360-primary-dark) !important;
        font-weight: 700;
    }

/* This radius must equal the header row's, and that is the whole story behind the grey square
   edge that showed at the top corners. `overflow: auto` makes this a scroll container, so the
   radius CLIPS what paints inside it. At 5px here against an 8px header corner, the 3px sliver
   outside the header's arc but inside this one fell through to the viewport's own corner - which
   reads as a grey square peeking out from behind the blue. Change one, change the other. */
.grid-viewport.dxbl-grid {
    border-radius: 0.5rem;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0;
    scroll-padding-bottom: 0.375rem;
}

.grid-viewport .dxbl-grid-data-container,
.grid-viewport .dxbl-grid-virtual-data-container {
    padding-bottom: 0.375rem;
}

.grid-viewport .dxbl-grid-table .cim-grid-row:last-child > td {
    border-bottom: 1px solid var(--cim360-border, var(--cim360-border)) !important;
}

/* Header-row corners. Two things were wrong here until 2026-08-31:

   1. The radius was 5px. This bar is the same thing as `.c360-grid-head` - the blue header on
      Service Items, Charge Items, Users, Custom Fields and Role Members - which is 8px, as are
      the two screens that copy it (LocationsGridHeader, LayoutPanel). There are two radius
      families in this product and they are easy to mix up:
        - grid / panel header bars  -> 8px 8px 0 0   (this one)
        - form / group section headers -> 5px 5px 0 0  (Cim360FormSection, .inv-group-header,
          WarehousesTileSection - all three say so)
      A list's column header belongs to the first family.

   2. It rounded its BOTTOM corners too, which is wrong for the same reason `.c360-grid-head`
      does not: the header is the top of something, and data rows sit directly beneath it. A
      radius there pulls the blue away from the row below and leaves a light notch at each end
      of the join.

   These rules are NOT the only thing shaping the top corners: `.grid-viewport.dxbl-grid` sets
   its own `border-radius` with `overflow: auto`, which clips everything painted inside it. The
   two must be kept equal - see the note on that rule. (`.grid-viewport` on its own sets no
   radius, which is what made this easy to miss.)                                     */

.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-indent-cell {
    background-color: var(--cim360-headerband-bg) !important;
    border-top-left-radius: 0.5rem;
    background-clip: padding-box;
}

.grid-viewport .dxbl-grid-header-row > th:first-child:not(.dxbl-grid-header-indent-cell) {
    border-top-left-radius: 0.5rem;
}

.grid-viewport .dxbl-grid-header-row th:nth-last-child(2) {
    border-top-right-radius: 0.5rem;
}

.grid-viewport .dxbl-grid-footer-row > td {
    background: color-mix(in srgb, var(--cim360-primary) 06%, transparent) !important;
    border-top: 1px solid var(--cim360-border, var(--cim360-border)) !important;
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
    font-weight: 700;
    color: var(--cim360-text);
    font-variant-numeric: tabular-nums;
}

/* The footer keeps its radius - it genuinely is the bottom - matched to the header's 8px so the
   two ends of the grid agree. */
.grid-viewport .dxbl-grid-footer-row td:first-child {
    border-bottom-left-radius: 0.5rem;
}

.grid-viewport .dxbl-grid-footer-row td:nth-last-child(2) {
    border-bottom-right-radius: 0.5rem;
}

/* Match header gradient to the window header */
.grid-viewport .dxbl-grid-header-row > th {
    background: var(--cim360-headerband-bg) !important;
    border-bottom: 1px solid var(--cim360-headerband-line) !important;
}

/* Header height and typography.

   Until 2026-08-31 this row set neither: no height, no padding, no font-size, no font-family.
   Everything came from the DevExpress Fluent theme, which is why it read as unrelated to the
   rest of the product - it was the one header in the application nobody had styled.

   The treatment is the house column-header convention, not the title-bar one. Two different
   things get confused here:
     - `.c360-grid-head`  - a TITLE bar (44px / 14px / 600, sentence case). Service Items' blue
                            bar is one. We match its 8px top radius, above, because both are the
                            top of something - but not its type.
     - column headers and field labels - 11px / 700 / uppercase / .06em. That is
                            `.pc-table thead th` (Service Items' own column header) and
                            `.c360-dlg-label` (every field label in the product).
   A list's column header is the second kind. 11px is small, but uppercase at 700 with .06em
   tracking holds up reversed out of the blue, and it keeps a list dense - which is the whole
   point of a list.

   Font family is deliberately absent: Nunito cascades from app.css to everything. */

/* Height only - deliberately NOT horizontal padding.

   Briefly on 2026-08-31 this rule also set `padding: 0 16px !important`, and that is what made
   captions truncate so easily. DevExpress 26.1.3 sets `--dxbl-grid-text-cell-padding-x:
   0.4375rem` (7px), so the header went from 7px a side to 16px a side - 18px of caption width
   gone from every column, on top of the uppercasing, which is wider per character than sentence
   case. Narrow columns (FreeStockQty is 90px) had almost nothing left.

   Leaving horizontal padding to the theme also keeps the header aligned with the data cells: we
   set no horizontal padding on those either, only vertical, per density. */
.grid-viewport .dxbl-grid-header-row > th {
    height: 2.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* In a flex row a child will not shrink below its content width unless told it may. Without
   these the caption pushes the column wider or gets clipped instead of ellipsising - the theme
   already puts `text-overflow: ellipsis` on the span, it just never got the chance to apply. */
.grid-viewport .dxbl-grid-header-row > th > .dxbl-grid-header-content {
    min-width: 0;
}

/* The caption span deliberately does NOT get min-width: 0.
   It had it briefly on 2026-08-31 and that is what truncated captions with room to spare. A flex
   item defaults to `min-width: auto`, which stops it shrinking below its min-content width;
   setting 0 permits it to shrink to nothing, and because the theme puts `overflow: hidden;
   text-overflow: ellipsis` on this span, any pressure from a sibling flex item then ellipsised the
   caption rather than leaving it alone. min-width: 0 on the CONTENT box above is enough - that is
   what lets the box fit a narrow column - and the span keeps its natural floor. */

/* A permanent gutter at the right of the caption on any SORTABLE column, so the hover chevron
   never lands on top of the text.

   Why 16px: the chevron is a 12px glyph placed `right: var(--dxbl-grid-text-cell-padding-x)`
   from the cell, and the content box's own right edge already sits at that same inset - so from
   the caption's point of view the glyph occupies the first 12px inside its right edge. 16px
   clears it with a little air. The two numbers are related, but not by a calc: they are measured
   from different boxes, and a calc here would only look precise.

   Applied to every sortable column, sorted or not, rather than only where the chevron can
   appear. A gutter that came and went as you sorted would reflow the caption on click, which is
   the same jitter that moving the chevron out of the flex flow was meant to remove. Columns with
   AllowSort="false" get no chevron, no arrow and no gutter. */
/* The chevron gutter lives on the CONTENT BOX, not on the caption span.
   On the span its padding sat inside the span's own overflow box, so it came straight off the text
   area and brought the ellipsis forward. On the content box it reduces the space available to the
   flex items instead, which is what reserving a gutter is supposed to mean: the caption keeps its
   full natural width up to the gutter and only ellipsises when it genuinely runs out.

   It also puts the real sort arrow in the same place the chevron appears - that arrow is a flex
   item with `margin-inline-start: auto`, so it lands on the padding edge - which means a column
   looks identical sorted and unsorted. */
.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable > .dxbl-grid-header-content {
    padding-right: 1rem;
}

/* RIGHT-ALIGNED CAPTIONS FOR NUMERIC COLUMNS. DEV-620, 2026-10-02.

   `TextAlignment` on a DxGridDataColumn aligns the CELL only and leaves no trace on the header -
   read out of the live DOM on 2026-08-31, when four attempts keyed on classes that were never
   there. `HeaderCssClass` and `HeaderTextAlignment` both collapsed every column when set.

   `CaptionAlignment` is the parameter that works. Set to Right it adds `dxbl-align-right` to the
   header's CONTENT box and nothing else - the th, its classes and every column width unchanged,
   read out of the live DOM on 2026-10-02 on the Financial Audit Trail. The theme styles that
   class but not as `justify-content`, so the caption still sat left inside a flex row; this rule
   is what moves it. Every list built from a column catalogue passes
   `CaptionAlignment="col.Alignment"`, so a numeric column's caption follows its cells.

   The sort gutter moves to the LEFT on these. Kept on the right, it ended every right-aligned
   caption 1rem short of the figures beneath it, which reads as misalignment. Mirrored instead:
   the row runs right to left so the caption sits flush with the content edge the figures share,
   the real sort arrow is pushed to the far left, and the hover chevron is placed there too - so,
   as on the left-aligned columns, sorting never moves the caption. */
.grid-viewport .dxbl-grid-header-row > th > .dxbl-grid-header-content.dxbl-align-right {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable > .dxbl-grid-header-content.dxbl-align-right {
    padding-right: 0;
    padding-left: 1rem;
}

/* The theme puts a 4.8px right margin on the caption while a sort arrow follows it, which on a
   mirrored row pulled the caption off the figures' edge on every sort. The gap belongs on the side
   the arrow is now on. */
.grid-viewport .dxbl-grid-header-row > th > .dxbl-grid-header-content.dxbl-align-right > span:first-child {
    margin-right: 0;
    margin-left: 0.3rem;
}

.grid-viewport .dxbl-grid-header-row > th > .dxbl-grid-header-content.dxbl-align-right > .dxbl-grid-sort-asc,
.grid-viewport .dxbl-grid-header-row > th > .dxbl-grid-header-content.dxbl-align-right > .dxbl-grid-sort-desc {
    margin-inline-start: 0;
    margin-inline-end: auto;
}

.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable > .dxbl-grid-header-content.dxbl-align-right::after {
    right: auto;
    left: var(--dxbl-grid-text-cell-padding-x, .4375rem);
}

.grid-viewport .dxbl-grid-header-row > th,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-header-content,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-header-content .dxbl-btn {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .06em;
    line-height: 1.2;
    /* White was only ever set on sortable captions (.dxbl-btn) and on the icons, so a column with
       AllowSort="false" took whatever colour the DevExpress theme gave it - on a blue bar. Same
       token .c360-grid-head uses. */
    color: var(--cim360-headerband-fg);
}

/* ─── The card tables are framed, not blue-headed ───
   `.c360-ct` is the sales document card's tables. They wear THE grid table's quiet column-header
   band (css/forms/cim360-dialog.css), and the brand bar above them is Cim360InCardGrid's title
   bar - which says what the list is and how many rows are in it.

   That is the project owner's own description, 2026-09-11: "the blue bar should describe what the
   list is showing with the number of records in there, the next row should be the column headers."
   A blue COLUMN header was the other reading of "look like the register lists" and it was wrong:
   a register list's blue is its title bar, and its columns sit under it.

   The zebra and the selection wash stay, because those are the list's and a card table is still a
   list of records. */
.c360-ct tbody tr:nth-child(even) > td {
    background-color: color-mix(in srgb, var(--cim360-text) 2.5%, var(--cim360-card));
}

.c360-ct tbody tr:hover > td {
    background-color: color-mix(in srgb, var(--cim360-primary) 09%, transparent);
}

/* A link on a washed row - hovered or selected - is drawn in the deeper primary every theme
   defines: the primary on the 9% hover wash measured 4.16:1 (WCAG 2.2 1.4.3; axe on Raise
   invoice's Will be raised grid, DEV-506), and the 22% selection wash is darker still. */
.c360-ct tbody tr:hover .c360-grid-link,
.c360-ct tbody tr:hover .stock-link,
.c360-ct tbody tr.is-sel .c360-grid-link,
.c360-ct tbody tr.is-sel .stock-link {
    color: var(--cim360-primary-dark);
}

/* A selected row, and the 3px bar down its first cell - the list's own treatment, so a line
   picked on a card and a row picked on a register look identical. */
.c360-ct tbody tr.is-sel > td,
.c360-ct tbody tr.is-sel:hover > td {
    background-color: color-mix(in srgb, var(--cim360-primary) 22%, transparent);
}

/* The sort/chevron glyphs are icon fonts sitting inside the header, so they inherit the
   tracking and the uppercasing above - which pushes them off the caption and, for a
   Bootstrap-icons codepoint, risks transforming the glyph itself. Reset both on the icons. */
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-asc,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-desc,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-header-content::after {
    letter-spacing: normal;
    text-transform: none;
}

.grid-viewport .dxbl-grid-table th,
.grid-viewport .dxbl-grid-table td {
    background-clip: padding-box;
    border-left: none !important;
    border-right: none !important;
}

.grid-viewport .dxbl-grid-header-content,
.grid-viewport .dxbl-grid-header-row th,
.grid-viewport .dxbl-grid-footer-row td {
    box-shadow: none !important;
}

    .grid-viewport .dxbl-grid-header-row th::before,
    .grid-viewport .dxbl-grid-header-row th::after,
    .grid-viewport .dxbl-grid-table td::before,
    .grid-viewport .dxbl-grid-table td::after {
        border: 0 !important;
        box-shadow: none !important;
    }

.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-indent-cell::before,
.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-indent-cell::after {
    border: 0 !important;
    box-shadow: none !important;
}

.dxbl-context-menu-separator {
    margin: 0 !important;
}

/* Selected / focused rows run edge to edge - square at both ends, no radius. A highlighted row
   is part of the table, not a pill floating in it, and the rounded version left a gap of page
   colour at each end of the row. The left edge is marked by the 3px inset accent above instead,
   which is square for the same reason. `overflow: hidden` went with the radius it was clipping. */
.grid-viewport .dxbl-grid-table tr.dxbl-grid-selected-row > td:first-child:not(.dxbl-grid-expand-button-cell):not(.dxbl-grid-indent-cell):not(.dxbl-grid-empty-cell),
.grid-viewport .dxbl-grid-table tr.dxbl-grid-focused-row > td:first-child:not(.dxbl-grid-expand-button-cell):not(.dxbl-grid-indent-cell):not(.dxbl-grid-empty-cell),
.grid-viewport .dxbl-grid-table tr.alt-item > td:first-child:not(.dxbl-grid-expand-button-cell):not(.dxbl-grid-indent-cell):not(.dxbl-grid-empty-cell) {
    border-radius: 0;
}

.grid-viewport .dxbl-grid-table tr.dxbl-grid-selected-row > td.dxbl-grid-expand-button-cell,
.grid-viewport .dxbl-grid-table tr.dxbl-grid-focused-row > td.dxbl-grid-expand-button-cell,
.grid-viewport .dxbl-grid-table tr.alt-item > td.dxbl-grid-expand-button-cell {
    background-color: inherit !important;
    border-radius: 0;
}

    .grid-viewport .dxbl-grid-table tr.dxbl-grid-selected-row > td.dxbl-grid-expand-button-cell .dxbl-grid-expand-button,
    .grid-viewport .dxbl-grid-table tr.dxbl-grid-focused-row > td.dxbl-grid-expand-button-cell .dxbl-grid-expand-button,
    .grid-viewport .dxbl-grid-table tr.alt-item > td.dxbl-grid-expand-button-cell .dxbl-grid-expand-button {
        color: inherit !important;
    }

.grid-viewport .dxbl-grid-table tr.dxbl-grid-selected-row > td.dxbl-grid-selection-cell,
.grid-viewport .dxbl-grid-table tr.dxbl-grid-focused-row > td.dxbl-grid-selection-cell,
.grid-viewport .dxbl-grid-table tr.alt-item > td.dxbl-grid-selection-cell {
    background-color: inherit !important;
}

.grid-viewport .dxbl-grid-table tr.dxbl-grid-selected-row > td:nth-last-child(2),
.grid-viewport .dxbl-grid-table tr.dxbl-grid-focused-row > td:nth-last-child(2),
.grid-viewport .dxbl-grid-table tr.alt-item > td:nth-last-child(2) {
    border-radius: 0;
}

.grid-viewport .dxbl-grid-table tr.dxbl-grid-selected-row > td,
.grid-viewport .dxbl-grid-table tr.dxbl-grid-focused-row > td,
.grid-viewport .dxbl-grid-table tr.alt-item > td {
    background-clip: padding-box;
}

/* overflow:hidden with no text-overflow cuts a value off mid-character and says nothing about it -
   the reader cannot tell "Composite Deck Prototy" from a description that genuinely ends there.
   An ellipsis makes the truncation visible, which is the difference between a value that is
   shortened and a value that is wrong.
   It matters most under WCAG 1.4.12: with the criterion's letter-spacing applied, cells that fitted
   at default spacing stop fitting - measured on the Stocktake SCOPE column (overflowing by 42px)
   and Quarantine's DESCRIPTION (35px and 13px) - and without this they were cut silently.
   text-overflow only acts on non-wrapping text, so the two-line cells that wrap are unaffected. */
.grid-viewport .dxbl-grid-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-viewport .dxbl-grid-detail-cell {
    padding: 0.625rem !important;
    vertical-align: top;
}

    .grid-viewport .dxbl-grid-detail-cell .dxbl-group-body-content,
    .grid-viewport .dxbl-grid-detail-cell .dxbl-fl-group,
    .grid-viewport .dxbl-grid-detail-cell .dxbl-row,
    .grid-viewport .dxbl-grid-detail-cell .dxbl-fl-ctrl {
        margin: 0 !important;
        padding: 0 !important;
    }

    .grid-viewport .dxbl-grid-detail-cell .dxbl-fl-item {
        margin: 0 !important;
        padding-top: 1px !important;
        padding-bottom: 0.625rem !important;
    }

/* ---------- Header filter + sort polish ---------- */
.grid-viewport .dxbl-grid-header-filter-button,
.grid-viewport .dxbl-grid-header-filter-row {
    display: none !important;
}

.grid-viewport .dxbl-grid-header-row .dxbl-grid-header-content {
    cursor: pointer;
}

/* All header icons / SVGs (sort, group, filter etc.) render in white at small size */
.grid-viewport .dxbl-grid-header-row .dxbl-image,
.grid-viewport .dxbl-grid-header-row .dxbl-button-icon,
.grid-viewport .dxbl-grid-header-row svg {
    color: var(--cim360-headerband-fg) !important;
    fill: var(--cim360-headerband-fg) !important;
    opacity: 1 !important;
}

/* THE SORT INDICATOR. Exactly one is ever visible.

   Clicking a column used to give you two: a permanent chevron plus DevExpress's own sort arrow.
   The rule meant to prevent that keyed on `.dxbl-grid-sort-button` and never fired.

   `.dxbl-grid-sort-asc` and `.dxbl-grid-sort-desc` ARE real - both appear in
   devexpress.blazor.themes.fluent 26.1.3 (the version this solution references) with
   `margin-inline-start: auto; display: flex`, which is why the arrow sits at the right-hand end
   of the cell. `.dxbl-grid-sort-button` appears in none of the shipped CSS, and the class names
   are not string literals in DevExpress.Blazor.Grid.v26.1.dll either, so absence from both
   cannot settle whether a class is rendered.

   This paragraph used to argue that absence proved nothing, on the grounds that
   `.dxbl-grid-data-row` was equally absent "and our striping and hover rules on it demonstrably
   work". That was false, and it cost a diagnosis: measured in the browser on 2026-09-10, no row
   matched `.dxbl-grid-data-row`, six consecutive rows returned one identical background, and a
   cell's padding sat at DevExpress's own 6.0005px while the grid reported density-relaxed. All
   sixteen rules keyed on that name were inert. Data rows now carry `.cim-grid-row`, added in
   Cim360Grid's OnCustomizeElement, and the rules key on that.

   So the conclusion stands but the reasoning does not: absence from the shipped CSS is not proof
   of anything, in EITHER direction. Only the rendered DOM settles it.

   The hide below is therefore deliberately redundant - it keys on asc, desc AND the old
   button class. Each selector only ever matches an already-sorted column, so a spare one costs
   nothing and cannot hide the chevron when it should show.

   Standing rule for this file: a selector written against a DevExpress class name gets verified
   IN THE BROWSER - `row.matches('.the-selector')`, or the computed style it is supposed to change
   - and not against the shipped CSS, which answers a different question. An inert rule looks
   exactly like a working one, sixteen of these sat here looking fine, and the comment claiming
   they worked was written from the same static evidence it warned against. Prefer keying on a
   `cim-` class this codebase adds itself, which cannot be renamed by a DevExpress upgrade. */

/* The real arrow, once a column is sorted. The theme gives it `margin-left: auto`, so it sits
   at the right-hand end of the cell. */
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-asc,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-desc {
    flex: 0 0 auto;
    color: var(--cim360-headerband-fg) !important;
}

.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-asc svg,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-desc svg,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-asc .dxbl-image,
.grid-viewport .dxbl-grid-header-row .dxbl-grid-sort-desc .dxbl-image {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--cim360-headerband-fg) !important;
    fill: var(--cim360-headerband-fg) !important;
}

/* The "you can sort this" chevron on an UNSORTED sortable column: revealed on hover or keyboard
   focus, and ABSOLUTE rather than a flex item.

   Absolute rather than a flex item so that revealing it cannot reflow the caption - a hover that
   reshuffles the header is worse than no affordance at all. The caption keeps clear of it via a
   permanent 16px gutter (see the rule on the caption span above) rather than by the chevron
   reserving flex space, which is what makes the layout stable in both states. The theme already
   sets `position: relative` on the `th`, so this positions against the cell.

   `right` matches the theme's own cell padding so the chevron lands where the real sort arrow
   will appear, and focus-within is there because a keyboard user never hovers. */
.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable > .dxbl-grid-header-content::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--cim360-headerband-fg) 70%, transparent);
    position: absolute;
    right: var(--dxbl-grid-text-cell-padding-x, .4375rem);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    font-weight: 400;
    line-height: 1;
    transition: opacity .12s ease-in-out;
}

.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable:hover > .dxbl-grid-header-content::after,
.grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable:focus-within > .dxbl-grid-header-content::after {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .grid-viewport .dxbl-grid-header-row > th.dxbl-grid-header-sortable > .dxbl-grid-header-content::after {
        transition: none;
    }
}

/* ...and it goes the moment a real arrow exists. Scoped to the `th` rather than to
   `.dxbl-grid-header-content`, so it holds whether DevExpress renders the indicator inside the
   content box or as a sibling of it. */
.grid-viewport .dxbl-grid-header-row > th:has(.dxbl-grid-sort-asc) > .dxbl-grid-header-content::after,
.grid-viewport .dxbl-grid-header-row > th:has(.dxbl-grid-sort-desc) > .dxbl-grid-header-content::after,
.grid-viewport .dxbl-grid-header-row > th:has(.dxbl-grid-sort-button) > .dxbl-grid-header-content::after,
.grid-viewport .dxbl-grid-header-row > th[aria-sort="ascending"] > .dxbl-grid-header-content::after,
.grid-viewport .dxbl-grid-header-row > th[aria-sort="descending"] > .dxbl-grid-header-content::after {
    content: none !important;
    display: none !important;
}

/* ---------- Selection checkbox styling ---------- */
.grid-viewport .dxbl-grid-selection-cell .dxbl-checkbox-check-element,
.grid-viewport .dxbl-grid-header-row .dxbl-checkbox-check-element {
    border-radius: 0.25rem !important;
    border: 1.5px solid var(--cim360-border-strong) !important;
    transition: background .14s, border-color .14s;
}

.grid-viewport .dxbl-grid-header-row .dxbl-checkbox-check-element {
    border-color: color-mix(in srgb, var(--cim360-headerband-fg) 80%, transparent) !important;
}

.grid-viewport .dxbl-grid-selection-cell .dxbl-checkbox[aria-checked="true"] .dxbl-checkbox-check-element,
.grid-viewport .dxbl-grid-header-row .dxbl-checkbox[aria-checked="true"] .dxbl-checkbox-check-element {
    background: var(--cim360-primary-surface) !important;
    border-color: var(--cim360-primary) !important;
}

/* ---------- Custom scrollbar ---------- */
.grid-viewport ::-webkit-scrollbar {
    width: 0.625rem;
    height: 0.625rem;
}

.grid-viewport ::-webkit-scrollbar-track {
    background: transparent;
}

.grid-viewport ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--cim360-primary) 22%, transparent);
    border-radius: 62.4375rem;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.grid-viewport ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--cim360-primary) 42%, transparent);
    background-clip: padding-box;
    border: 2px solid transparent;
}

.grid-viewport {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--cim360-primary) 22%, transparent) transparent;
}

/* ---------- Empty state ---------- */
.grid-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--cim360-text-muted);
}

.grid-empty .bi {
    font-size: 2.375rem;
    color: var(--cim360-muted-soft);
    opacity: .6;
}

.grid-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cim360-text);
}

.grid-empty-sub {
    font-size: 0.7813rem;
    color: var(--cim360-text-muted);
}

/* The plain genuinely-empty form, on a grid that opts in with Cim360Grid PlainEmpty (the Bills of
   Materials list): the design's .cim-grid .grid-empty - 48px of padding, centred, the glyph inline
   before one muted line at the grid's own size (styles.css:1111). Every other grid, and loading
   and failed everywhere, keep the stacked form above. */
.grid-empty.is-plain {
    gap: 0.25rem;
    padding: 3rem;
}

.grid-empty-line {
    font-size: 0.8125rem;
    color: var(--cim360-text-muted);
}

.grid-empty.is-plain .grid-empty-line .bi {
    font-size: inherit;
    color: inherit;
    opacity: 1;
    margin-right: 0.25rem;
}

/* ---------- Density variants ---------- */
.grid-viewport.density-compact .cim-grid-row > td {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    line-height: 1.2;
}

.grid-viewport.density-compact .cim-grid-row {
    font-size: 0.75rem;
}

.grid-viewport.density-compact .td-desc .desc-sub {
    display: none;
}

.grid-viewport.density-cosy .cim-grid-row > td {
    padding-top: 0.4375rem !important;
    padding-bottom: 0.4375rem !important;
}

.grid-viewport.density-relaxed .cim-grid-row > td {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    line-height: 1.55;
}

.grid-viewport.density-relaxed .cim-grid-row {
    font-size: 0.8438rem;
}

/* Chip wrapping: only Relaxed lets chips wrap.
   Compact and Cosy clamp to a single line + ellipsis so the chip-bearing
   columns (Category, Type) don't stretch the row's intrinsic height. */
.grid-viewport.density-compact .cim-chip,
.grid-viewport.density-cosy .cim-chip {
    overflow: hidden;
    max-width: 100%;
    align-items: center !important;
}

.grid-viewport.density-compact .cim-chip-text,
.grid-viewport.density-cosy .cim-chip-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0;
}

.grid-viewport.density-compact .cim-chip-dot,
.grid-viewport.density-cosy .cim-chip-dot {
    margin-top: 0 !important;
    align-self: center;
}

.grid-viewport.density-compact .td-code .health-bar { height: 1.125rem; }
.grid-viewport.density-relaxed .td-code .health-bar { height: 1.75rem; }

/* ---------- Cell templates ---------- */
.td-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.td-code .health-bar {
    display: inline-block;
    width: 0.1875rem;
    height: 1.375rem;
    border-radius: 2px;
    flex: 0 0 auto;
}

/* The record link in the first column - stock code, count reference, quarantine item code.
   In the page's typeface, like every other cell: the monospace stack and 12.5px override that
   used to be here made the first column a different font and size from the row it belongs to,
   which is the same objection that took the mono out of .td-num.

   `tabular-nums` because these are identifiers that get read down the column and compared -
   equal-width digits are what monospace was really being used for. Weight and colour carry the
   "this is a link" job on their own. */
.grid-viewport .stock-link {
    /* A 24px target without moving anything (2.5.8). The link's line is 16px at the smallest scale,
       so it passed only on clearance - and an open Print menu or dialog edge within 12px took that
       away (2026-10-06). 4px of padding each side makes the box 24px; the matching negative margins
       give the space back, so the row and the sub-line beneath sit exactly where they did. A px
       floor inside max(), because this is the part that must not shrink. */
    padding-block: max(0.25rem, 4px);
    margin-block: calc(-1 * max(0.25rem, 4px));
    color: var(--cim360-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-viewport .stock-link:hover {
    text-decoration: underline;
}

.desc-health {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    font-weight: 600;
}

.desc-health-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.desc-health-label {
    font-size: 0.75rem;
}

.desc-sub-sep {
    margin: 0 0.375rem;
    opacity: .45;
    color: var(--cim360-text-muted);
}

/* A status dot on a description sub-line - the sales list's customer column, and anything else
   that needs to carry a state next to a name.

   NOT the same thing as .td-code .health-bar, which is the vertical stripe in the first column.
   Both take their colour from the row's status swatch, so they always agree; this one sits inline
   with text and therefore needs the baseline nudge that a flex-centred bar does not. */
.desc-sub .desc-dot {
    display: inline-block;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    flex: 0 0 auto;
    margin-right: 0.3125rem;
    vertical-align: baseline;

    /* The same faint ring the design puts on its health dots. It keeps a pale status - a light
       amber, a light grey - from disappearing into the row background. */
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .05);
}

.td-desc {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.td-desc .desc-main {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cim360-text);
}

.td-desc .desc-sub {
    font-size: 0.75rem;
    /* #4B5563, and the value is chosen against the DARKEST row state rather than the first one
       anybody hit. The principle here is the previous fix's and still holds - one value that works
       on every background cannot fall out of step with the row colours, where a per-row override
       can - but that fix measured only the 14% FOCUSED tint and left #565d68, which is 6.64:1 on
       white and 4.65:1 there.

       A row that is selected AND focused takes a 32% tint, and on that #565d68 is 4.27:1: under
       4.5 at 11.5px. So the sub-line still dimmed below the threshold, just one row state further
       in than the fix reached. axe found it on the purchase document list on 2026-09-15, and every
       list in the product draws this line.

       #4B5563 is 7.56:1 on white and 4.86:1 on the 32% tint. Deliberately not #374151, which the
       `strong` in this same line uses - the sub-line has to stay visibly secondary to it, and 7.56
       against 10.31 keeps that while clearing the threshold. MEASURE THE WORST ROW STATE, not the
       one in front of you. WCAG 1.4.3. */
    color: var(--cim360-text-muted);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-desc .desc-sub strong {
    color: var(--cim360-caption);
    font-weight: 600;
}

/* Figures stay in the page's own typeface. The monospace stack that used to be here made every
   numeric column visibly a different font from the text columns beside it, which is a bigger
   inconsistency than the digit alignment it bought.
   `font-variant-numeric: tabular-nums` is what actually matters for a column of figures: it makes
   Nunito's digits equal-width, so they line up on the decimal without changing the face. The
   font-size override is gone with it - a figure has no reason to be a different size from the
   text next to it. */
.td-num {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    text-align: right;
    width: 100%;
}

.td-num.strong,
.td-strong {
    font-weight: 700;
    color: var(--cim360-text-strong);
}

/* The dash in a flag column whose flag is not set (ListCell.Flag). Muted: it is the absence of the
   chip, not a value. DEV-744. */
.td-none {
    color: var(--cim360-text-muted);
}

/* An Outstanding quantity: amber and bold while anything is still to come, green once nothing is.
   The figure says how much; the ink says whether it is done, at a glance down a column. Weight
   carries it as well as colour, so it does not rest on colour alone (1.4.1). Sales and purchase
   lists both; DEV-744. */
.td-num.td-outstanding {
    font-weight: 700;
    color: var(--cim360-warning-fg);
}

.td-num.td-outstanding.is-clear {
    font-weight: 600;
    color: var(--cim360-success-fg);
}

/* A foreign-currency total's base value, beneath it. Muted and smaller: it is the comparison, not
   the figure on the document. A Total column sorts on the base value, so without it a column of
   mixed currencies reads as out of order. Sales and purchase lists both; DEV-741. */
.td-base-value {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* ---------- Optional code cell ----------

   A column holding a code the record MAY override - a customer's currency, tax code or revenue
   nominal, each of which falls back to a company-wide setting when the account has not negotiated
   one. Two states, and the difference between them matters: a code that is set, and a deliberate
   absence.

   An empty cell was the obvious rendering of the second and is the wrong one - it reads as missing
   data, which sends somebody looking for a fault that is not there. So the cell says the fallback
   in words, and this dims it.

   The distinction is carried by the TEXT, not by the colour: `.is-default` renders a sentence and
   a set code renders a code, so somebody who cannot tell the two greys apart still reads which is
   which (WCAG 1.4.1). The dimming is the scan, not the answer - which is why it may use the muted
   token at all. It is muted text on the row's own ground, which is the 4.5:1 pairing the theme
   already guarantees; it is never applied over a tint or a selected row's fill.

   HERE rather than in a .razor.css, for the reason the progress cell below gives: more than one
   list draws this shape, and the supplier list will draw it next. */
.td-optcode {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.td-optcode.is-default {
    color: var(--cim360-text-muted);
    font-style: italic;
}

/* ---------- Progress cell ----------

   A bar and the figure beside it. The bar alone cannot be read precisely and the figure alone
   cannot be scanned down a column, so a progress cell is always both.

   HERE rather than in a .razor.css, and named c360- rather than so-: the sales list and the
   purchase list both draw this cell. It was `.so-prog` and was defined in NO stylesheet at all -
   not scoped, not global - so both lists rendered a bare div and a number with no bar at all, and
   nothing reported it. R-066 could not: it catches a class owned by another component's scoped
   sheet, and a class owned by nobody is invisible to it. */
.c360-lprog {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.c360-lprog-track {
    position: relative;
    flex: 1 1 auto;
    height: 0.375rem;
    min-width: 2.5rem;
    border-radius: 62.4375rem;
    background: var(--cim360-surface-2);
    overflow: hidden;
}

/* Two fills on one track, stacked rather than side by side: billed is a SUBSET of moved, because
   goods are invoiced after they arrive. The billed bar therefore sits INSIDE the moved one, and the
   gap between the two is what has come in and not yet been billed - which is the thing somebody
   scanning this column is actually looking for. */
.c360-lprog-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 62.4375rem;

    /* The bar is decoration over a figure that is already in the cell, so it animates without
       anything depending on the animation having finished. */
    transition: width .2s ease;
}

/* Received, or despatched on a return. Teal, matching the "goods have moved" colour the line
   editor's quantity panel uses for the same fact. */
.c360-lprog-fill.is-moved {
    background: var(--cim360-teal);
}

/* Invoiced or credited. Green, and drawn over the teal - the same layering and the same two
   colours as that panel, so one bar is read the same way in both places. */
.c360-lprog-fill.is-billed {
    background: var(--cim360-success);
}

/* A single-fill bar - anything that has not moved to the two-value form - keeps the primary. */
.c360-lprog-fill:only-child {
    background: var(--cim360-primary-surface);
}

.c360-lprog-pct {
    flex: 0 0 auto;
    min-width: 2.125rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* Compact hides the bar and keeps the figure: at 2px of row padding the track is most of the row's
   height, and the number is the part that can still be read. */
.grid-viewport.density-compact .c360-lprog-track {
    display: none;
}

/* ---------- Suppress native text-selection on data rows ---------- */
.grid-viewport .cim-grid-row,
.grid-viewport .cim-grid-row * {
    user-select: none;
    -webkit-user-select: none;
}

/* ...but still allow text selection inside inputs and textareas */
.grid-viewport .cim-grid-row input,
.grid-viewport .cim-grid-row textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* ---------- Drag-select state ---------- */
.grid-viewport.grid-dragging,
.grid-viewport.grid-dragging * {
    cursor: cell !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.grid-viewport.grid-dragging .cim-grid-row {
    -webkit-user-drag: none;
}

/* ---------- Per-row actions menu ---------- */
/* The row's three-dots menu, at the END of the row rather than centred in its own cell.

   Centred, it floated in the middle of a 56px column and read as belonging to nothing - the eye
   looks for a row's actions at the row's edge, which is also where every other grid in the product
   puts them. Shared by Cim360SettingsGrid and Cim360InCardGrid, so this is one change for both. */
.td-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

/* 28px at full size, and never under 24 (2.5.8) when the root scales to 80% - these sit one per
   row, stacked, so the spacing exception cannot rescue them. */
.row-actions-trigger {
    width: max(1.75rem, 24px);
    height: max(1.75rem, 24px);
    /* A floored width is still shrinkable in a flex row: the reports hubs' trailing cell squeezed
       this to 22.4px (2026-10-06). flex: none keeps the floor a floor. */
    flex: none;
    border-radius: 0.375rem;
    border: 0;
    background: transparent;
    color: var(--cim360-caption);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s, color .15s;
}

.row-actions-trigger:hover,
.row-actions-trigger.open {
    background: color-mix(in srgb, var(--cim360-primary) 10%, transparent);
    color: var(--cim360-primary);
}

.row-actions-trigger .bi {
    font-size: 1rem;
    line-height: 1;
}

.row-actions-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 49;
}

.row-actions-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    min-width: 10rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    box-shadow: 0 0.875rem 2.25rem rgba(15, 32, 55, .18);
    z-index: 50;
    overflow: hidden;
    padding: 0.25rem 0;
    /* backwards, not both. A transform animation still filling after it ends keeps the menu the
       containing block for anything fixed inside it, and the group fly-outs are fixed inside it:
       they were laid out against the menu - on top of it, clipped by it - instead of beside it.
       DEV-498. The end state is the element's own style anyway, so forwards fill adds nothing. */
    animation: rowMenuPop .18s cubic-bezier(.4, 0, .2, 1) backwards;
}

/* Opens at the pointer - a right-click on the row, or the click on the three-dots button - instead
   of in flow under the button. Fixed rather than absolute so the row's own positioning context (or
   the grid body's scroll edge) cannot drag or clip it; left/top arrive inline from
   Cim360RowActions.Anchor, clamped to the viewport. */
.row-actions-menu.is-anchored {
    position: fixed;
    right: auto;
    z-index: 1000;

    /* RowMenuAnchor caps the height at the room the menu has, so a menu with more actions than
       will fit scrolls to the rest of them. The base rule's overflow:hidden would cap it and then
       hide what the cap excluded, which is the truncation this is here to stop. Horizontal stays
       hidden, because that is what keeps the rounded corners clipping the items. */
    overflow: hidden auto;
}

/* A pinned cell is position: sticky WITH a z-index of its own, which makes every one of them a
   stacking context. The menu is rendered inside one, so its z-index is resolved against that
   cell's contents and not against the page: position: fixed lifted it clear of the grid, exactly
   as intended, but the three-dots cell of every other row sits at that same level and the ones
   later in the DOM painted straight over it. On screen that is a menu opening above the rows and
   behind the buttons.

   Raising the cell currently holding a menu lifts its whole stacking context and the menu rides up
   with it. Keyed on the menu being present rather than on a class of our own, because the cell is
   DevExpress's markup and a CellDisplayTemplate has no way to put a class on it.

   60 clears the other pinned cells and the result banner at 40, and stays below the dialog layer,
   so a row menu can never be drawn over a dialog. */
.dxbl-grid .dxbl-grid-table > tbody > tr > td.dxbl-grid-fixed-cell:has(.row-actions-menu) {
    z-index: 60;
}

/* DEV-891: raising the cell above is not the whole fix. <thead> is DevExpress's own sticky header
   (position: sticky; z-index: 2) and <tbody> is its sibling (position: relative; z-index: 0) - both
   stacking contexts, both children of the same scroll-viewer ancestor. The rule above raises the
   MENU's cell within <tbody>'s own stacking context, which only ever wins fights inside <tbody>; it
   cannot put the cell above a stacking context ranked ABOVE <tbody> itself. A position: fixed
   element escapes layout (clipping, scroll, containing block) when nothing between it and the
   viewport carries a transform, but it never escapes the STACKING order its ancestors already set -
   so the menu's own z-index: 1000 painted dutifully on top of everything inside <tbody> and still
   lost to <thead> wholesale. Raise <tbody> itself past <thead>'s 2 while one of its rows holds an
   open menu - the header's band stayed over an early row's three-dots menu (click a row near the
   top, column header painted over "Edit"/"Print") until this. The right-click menu was never
   affected: it renders through DxContextMenu outside the grid entirely, never inside <tbody>.

   The selector has to MATCH DevExpress's own chain, not just outrank it on paper: their rule is
   ".dxbl-grid > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > .dxbl-grid-table > tbody" - four
   chained classes - against which a shorter ".dxbl-grid .dxbl-grid-table > tbody:has(...)" (three)
   LOSES on specificity regardless of source order, and silently computed z-index: 0 right through
   this rule sitting later in the file. Confirmed via CDP's CSS.getMatchedStylesForNode, not guessed -
   a computed style showing the "wrong" value never says why on its own. */
.dxbl-grid > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > .dxbl-grid-table > tbody:has(.row-actions-menu) {
    z-index: 3;
}

.row-actions-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 0;
    color: var(--cim360-text);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: 'Nunito', "Segoe UI", system-ui, sans-serif;
    text-align: left;
    cursor: pointer;
}

.row-actions-menu-item:hover {
    background: color-mix(in srgb, var(--cim360-primary) 08%, transparent);
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

.row-actions-menu-item .bi {
    font-size: 0.875rem;
    width: 1rem;
    color: var(--cim360-text-muted);
}

.row-actions-menu-item:hover .bi {
    color: var(--cim360-primary);
}

/* No entry in a list menu is drawn as the lead: every one reads with the same weight and colour
   in the row menu, the right-click menu and the docked bar. Only a destructive entry differs. */

/* The DevExpress right-click menu's entries carry the danger class from Cim360Grid and
   Cim360ActionContextMenu. The menu is drawn in a popup root, so it is global by necessity.
   The Fluent theme (26.1) paints an entry with color: var(--dxbl-context-menu-item-color) under a
   selector no plain colour rule here can outweigh. The variable is declared on the menu root, so
   re-declaring it on the entry wins at rest, and the theme's own hover, pressed and disabled
   values still take over. */
.dxbl-context-menu .cim-menu-danger {
    --dxbl-context-menu-item-color: var(--cim360-danger-fg);
}

.row-actions-menu-item.danger {
    color: var(--cim360-danger-fg);
}

.row-actions-menu-item.danger .bi {
    color: var(--cim360-danger-fg);
}

.row-actions-menu-item.danger:hover {
    background: rgba(220, 38, 38, .08);
    color: var(--cim360-danger-fg);
}

/* A disabled action is SHOWN, not dropped: a menu whose items come and go teaches nobody where
   anything is, and the reason it cannot be used is on the item's title. Matches how the same
   FamActionItem renders in the right-click menu and the selection bar. */
.row-actions-menu-item:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.row-actions-menu-item:disabled:hover {
    background: transparent;
    color: var(--cim360-text);
}

.row-actions-menu-item:disabled:hover .bi {
    color: var(--cim360-text-muted);
}

/* FamActionItem.Separator() renders as this. The rule is drawn by the element rather than as a
   border on the item after it, because a separator with nothing following it would otherwise leave
   a line against the bottom of the menu. */
.row-actions-sep {
    height: 1px;
    margin: 0.25rem 0;
    background: var(--cim360-border);
}

/* A single @. This file is served as-is, so the doubled @@ - the escape a <style> block inside a
   .razor file needs - was an invalid rule here and the menu never animated at all. */
@keyframes rowMenuPop {
    from { opacity: 0; transform: translateY(-0.25rem) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Search highlight ----------
   Painted by Cim360ListPage.razor.js through the CSS Custom Highlight API, which colours ranges
   without putting anything in the DOM - see that file for why marking up the cells instead is not
   an option next to Blazor's renderer.

   Global rather than scoped, and it has to be: ::highlight() addresses a named registry on the
   document, not an element, so a component-scoped stylesheet has nothing to stamp its hash onto
   and the rule would never match.

   Amber on inherited text, not a colour swap: the point is to show WHERE the match is, and a row
   that changes colour reads as a state - selected, warned, invalid - which it is not. */
::highlight(cim-search) {
    background-color: var(--cim360-search-highlight);
    color: inherit;
}

/* ─── The density group ─── */
/* Lifted OUT of Cim360FilterBar.razor.css, unchanged. A scoped rule carries that component's
   own [b-xxxx] attribute, so .filter-density[b-w18orlrljk] reached the filter bar and nothing
   else - and the allocation dialog, which offers the same three densities over the same enum
   and the same stored preference, got three unstyled buttons. This is R-002's own advice
   applied to a control with a second caller: move it to the shared stylesheet.

   The colours are still the caller's where a caller needs different ones - the dialog puts
   this group on a blue bar and recolours it through a class of its own. */
/* 30px, up from 28px, so the buttons inside can be 24px tall and still keep their 2px inset. The
   filter bar's other controls are 28px and this stands 2px proud of them; the alternative was to
   drop the inset, which is what separates the group's ground from the active button sitting on
   it. */
.filter-density {
    display: inline-flex;
    align-items: center;
    height: max(1.875rem, 30px);
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    border-radius: 0.25rem;
    padding: 2px;
    gap: 0;
}

    /* 24x24 minimum target - 2.5.8. These were 28x22, and there are seven of them on a list view:
       four view modes and three densities. They sit hard against each other inside the group, so
       the spacing exception does not apply to any of them. The glyph stays 12px. */
    .filter-density button {
        width: max(1.75rem, 24px);
        height: max(1.5rem, 24px);
        border: 0;
        background: transparent;
        color: var(--cim360-text);
        border-radius: 0.1875rem;
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        font-family: inherit;
        transition: background .15s, color .15s;
    }

        .filter-density button:hover:not(.active):not(:disabled) {
            background: rgba(29, 117, 187, .08);
            color: var(--cim360-primary);
        }

        .filter-density button.active {
            background: var(--cim360-primary-surface);
            color: #fff;
        }

        /* Cim360DensityToggle takes Disabled. The chosen option stays at full strength, since it
           still states the density in use; the others fade and refuse the pointer. DEV-554. */
        .filter-density button:disabled {
            cursor: not-allowed;
        }

        .filter-density button:disabled:not(.active) {
            opacity: .45;
        }

        .filter-density button .bi {
            font-size: 0.75rem;
            line-height: 1;
        }

/* =====================================================================================
   THE RESULT BANNER  .c360-list-result
   =====================================================================================
   What a list says after an action that ran against a selection - a bulk hold, a posting. Fixed to
   the bottom-right rather than pushed into the page: the grid has just reloaded under it, so a
   banner in the flow would move the rows the reader was looking at.

   GLOBAL, because two lists want it. It lived in SalesOrderList.razor.css - a SCOPED stylesheet -
   and the invoices list, which reused the class names, would have rendered it with no background,
   no border and no position at all: a bare sentence somewhere in the page. R-066 caught that before
   it shipped, which is the whole reason that rule exists.
   ===================================================================================== */

.c360-list-result {
    position: fixed;
    right: 1.5rem;
    bottom: 4.5rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-width: 26.25rem;
    padding: 0.75rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgb(16 24 40 / 12%);
}

.c360-list-result-dismiss {
    align-self: flex-end;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--cim360-text);
    font-size: 0.75rem;
    cursor: pointer;
}

.c360-list-result-dismiss:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

/* =====================================================================================
   THE TRACKING LINK  .c360-track-*
   =====================================================================================
   A consignment number that leads to the carrier's own tracking page. Cim360TrackingLink
   renders it; these are the rules that make it legible and operable wherever it lands -
   a grid cell, a card's despatch table, a package row.
   ===================================================================================== */

/* --cim360-primary-dark (#155389), NOT --cim360-primary. Measured against the four
   backgrounds this text actually sits on, which is the whole point - a colour chosen
   against white and then used on a selected row is the commonest way small text lands
   just under 4.5:1:

     white card               7.98:1
     zebra row     #f4f8fc    7.48:1
     selected row  14% tint   6.64:1
     selected AND focused     5.14:1   <- the worst case, and still clear of 4.5

   --cim360-primary measures 4.87 / 4.56 / 4.05 / 3.13 on those same four. It passes on
   white, which is where anybody would have checked it, and fails on the two a reader
   sees the moment they click a row. WCAG 1.4.3. */
.c360-track-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--cim360-primary-dark);

    /* Underlined, always. A link told apart from the text beside it only by being a
       different colour is not told apart at all by a reader who cannot distinguish the
       two, and a grid column of numbers gives no other clue that some of them lead
       somewhere. WCAG 1.4.1. */
    text-decoration: underline;
    text-underline-offset: 2px;

    /* 24px of height, not the ~20px the text alone would give. A link in a table cell is
       not "in a sentence", so it does not get 2.5.8's inline exemption and has to be a
       24x24 target in its own right. The padding rather than a height so the box grows
       with the text at 200% zoom instead of clipping it. WCAG 2.5.8. */
    min-height: max(1.5rem, 24px);
    padding: 2px 0;
}

.c360-track-link:hover,
.c360-track-link:focus-visible {
    color: var(--cim360-primary-dark);
    text-decoration-thickness: 2px;
}

/* A ring of its own. The grid paints its own focused-ROW styling, and a row highlight is
   not a focus indicator for one control inside it - tabbing to the link inside an already
   focused row would otherwise change nothing on screen. WCAG 2.4.7. */
.c360-track-link:focus-visible {
    outline: 2px solid var(--cim360-primary-dark);
    outline-offset: 2px;
    border-radius: 0.1875rem;
}

/* Sized in em so it scales with the text rather than staying put at 200% zoom, and never
   allowed to shrink - a flex item with a long consignment number beside it would
   otherwise be squashed to a sliver. */
.c360-track-icon {
    font-size: .85em;
    flex: 0 0 auto;
}

/* No link to give. Deliberately the ordinary text colour and not a faded one: there is
   nothing wrong with this row, the carrier simply has no tracking page, and fading it
   would say "unavailable" about a perfectly good consignment number. */
.c360-track-plain {
    color: inherit;
}

.c360-track-empty {
    color: var(--cim360-text-muted);
}

/* =====================================================================================
   THE CARRIER CELL  .c360-carrier-*
   =====================================================================================
   The carrier's name, with its logo beside it at the loosest density. The logo is
   decoration - the name is right there in the same cell - so it is alt="" and carries
   no information of its own.
   ===================================================================================== */

/* flex, not inline-flex: an inline-flex box is as wide as its widest unbreakable line, so a long
   carrier name made the cell's content wider than the cell. The name's own max-width: 100% then
   measured against that wider box, the ellipsis below never drew, and the cell's clip cut the name
   off mid-word with nothing to say it was cut. A block-level flex box is the cell's width. */
.c360-carrier-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* Fixed box and object-fit: carriers' logos arrive at whatever shape the customer
   uploaded, and a tall one would otherwise stretch the row it sits in. contain rather
   than cover so a wide logo is letterboxed instead of cropped - a cropped courier mark is
   worse than a small one. */
/* 32px, and it only ever draws at Relaxed. That density gives a row 24px of padding top
   and bottom over 13.5px text - a little over 60px of row - so a mark this size sits in it
   comfortably, where the same image in a Compact row would set the row height on its own.
   The carrier's mark is the point of showing it at all: at 24px the couriers with wordmark
   logos were unreadable, which is a logo doing none of the work a logo is for. */
.c360-carrier-logo {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 0.1875rem;
}

/* The name gives up the space when the column is narrow, not the logo: an ellipsised
   carrier name is still readable as a name, while a squashed logo is a smear. */
.c360-carrier-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================================================
   CHIPS IN DARK
   =====================================================================================
   THE PROBLEM THIS SOLVES IS THE WHOLE REASON DARK MODE IS NOT A STYLESHEET.

   Cim360ChipPalette holds 42 swatches as hex literals in C#, and Cim360Chip writes them
   into an inline style attribute. An inline style cannot be themed - no stylesheet can
   override one - so every chip in the product would stay in its light colours on a dark
   ground, which is precisely where a pale pastel fill with dark text is least readable.

   Rewriting 42 swatches x 4 values x every future mode is the obvious answer and the
   wrong one. Instead the dark values are DERIVED from the one value that carries the
   meaning - the dot, which is the hue that says which status this is - and computed here.
   One rule themes all 42, and greyscale, high contrast and colour-blind become one more
   rule each rather than 168 more hand-picked colours.

   The chip sets --cim-chip-dot inline alongside its colours; that is the only addition to
   the component, and a custom property in an inline style DOES cascade into these rules.

   !important is load-bearing here and not laziness: the values being overridden are
   inline, and nothing else beats an inline declaration.

   The mix percentages are chosen so the result clears 4.5:1 against the dark card for
   every hue in the palette - the text is mixed towards white, the fill towards the card,
   so a hue that is already light and one that is already dark both land in range. This is
   the same rule the accessibility notes state for a user-chosen accent: derive the text
   colour from it, never store a second hand-picked value beside it. */
[data-fluent-darkmode] .cim-chip {
    background: color-mix(in srgb, var(--cim-chip-dot, var(--cim360-primary)) 22%, var(--cim360-card)) !important;
    color: color-mix(in srgb, var(--cim-chip-dot, var(--cim360-primary)) 45%, var(--cim360-text-tint-base)) !important;
    border-color: color-mix(in srgb, var(--cim-chip-dot, var(--cim360-primary)) 50%, transparent) !important;
}

/* The dot keeps its own hue at full strength. It is a 9px shape against the chip's fill,
   which only has to clear 3:1 as a non-text element, and it is the thing that makes one
   status tellable from another at a glance. */
[data-fluent-darkmode] .cim-chip .cim-chip-dot {
    background: var(--cim-chip-dot, var(--cim360-primary)) !important;
}

/* =====================================================================================
   THE APPEARANCE TOGGLE  .c360-appearance-*
   ===================================================================================== */

.c360-appearance {
    display: inline-flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

/* .c360-appearance-second has gone with the control that used it. Contrast and palette were two
   button groups stacked inside one component under one caption; they are now two components in
   two form fields, so the separation comes from the fields rather than from a margin - and each
   carries a caption saying which question it is answering, which the margin never could. */

/* Every colour here is a token, which is the point of the pilot: this control is styled
   once and is already correct in dark, because the tokens beneath it change and it does
   not. Any rule here with a hex in it would be a rule to revisit for every future mode. */
.c360-appearance-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0 0.875rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-size: 0.8125rem;
    cursor: pointer;
}

.c360-appearance-btn:hover {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-soft);
}

.c360-appearance-btn.is-on {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-tint);
    color: var(--cim360-primary-dark);
    font-weight: 600;
}

.c360-appearance-btn:focus-visible {
    outline: 2px solid var(--cim360-primary-dark);
    outline-offset: 2px;
}

/* Name over description, so every option says what it does rather than only what it is called.
   align-items: flex-start on the button and a 1px nudge on the icon, because a two-line label
   centred against a single icon leaves the icon floating between the two lines. */
.c360-appearance-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    min-width: 0;
}

.c360-appearance-name {
    font-size: 0.8125rem;
    line-height: 1.2;
}

.c360-appearance-hint {
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    line-height: 1.25;

    /* Not inherited from .is-on. The name goes bold and primary-coloured when chosen; the
       description staying muted is what keeps it reading as a description rather than as a second
       label, and --cim360-text-muted is measured against the tint that .is-on paints behind it. */
    font-weight: 400;
}

.c360-appearance-btn.is-on .c360-appearance-hint {
    color: var(--cim360-text-muted);
}

/* Two lines of text make these taller than 36px on their own; the floor stays for the unbound
   copy in the profile menu, where only the system option carries a second line. */
.c360-appearance-btn {
    align-items: flex-start;
    padding-block: 0.5rem;
}

.c360-appearance-btn > .bi {
    margin-top: 1px;
    flex: 0 0 auto;
}

/* ===================================================================================== */
/* Action groups - Cim360ActionGroup. DEV-498.                                            */
/*                                                                                        */
/* Off the docked bar the fly-out IS the docked bar: the same surface, radius and shadow  */
/* tokens, so the button appears to grow into the list. The three-dots menu opens the     */
/* same list, so the two surfaces read as one vocabulary. Tokens rather than the design's */
/* literal #1D75BB, so the dark theme's card-coloured bar gets a card-coloured fly-out.   */
/* ===================================================================================== */

.cim-flyout-group {
    position: relative;
    display: inline-flex;
}

/* In the three-dots menu the trigger is a full-width row like the actions around it. */
.row-actions-menu .cim-flyout-group {
    display: flex;
}

.cim-flyout-caret {
    margin-left: auto;
    font-size: 0.625rem !important;
}

/* The trigger stays lit while its list is open. */
.cim-fam-btn.is-open {
    background: var(--cim360-actionbar-lift-strong);
}

.row-actions-menu-item.is-open {
    background: color-mix(in srgb, var(--cim360-primary) 08%, transparent);
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

.cim-flyout {
    position: fixed;
    left: 0;
    top: 0;
    visibility: hidden;
    z-index: 1070;
    min-width: 13.375rem;
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--cim360-actionbar-bg);
    border: 1px solid var(--cim360-actionbar-lift);
    border-radius: 0.875rem;
    box-shadow: 0 1.125rem 2.5rem -0.75rem var(--cim360-actionbar-shadow),
                0 0.5rem 1.125rem -0.375rem color-mix(in srgb, var(--cim360-actionbar-shadow) 70%, transparent),
                0 2px 0.375rem color-mix(in srgb, var(--cim360-actionbar-shadow) 30%, transparent);
    font-family: 'Nunito', "Segoe UI", system-ui, sans-serif;
    transform-origin: top left;
    animation: cimFlyOutIn .18s cubic-bezier(.2, .9, .3, 1.2);
}

.cim-flyout:focus { outline: none; }

/* It grows out of whichever edge it hangs off. */
.cim-flyout.is-up { transform-origin: bottom left; }
.cim-flyout.is-side { transform-origin: right center; }
.cim-flyout.is-beside.is-flipped { transform-origin: top right; }

/* An invisible bridge over the gap between the trigger and the list, so the pointer is never over
   nothing on its way across. The grace period covers the rest. */
.cim-flyout::before {
    content: "";
    position: absolute;
}

.cim-flyout.is-up::before { left: 0; right: 0; bottom: -0.75rem; height: 0.75rem; }
.cim-flyout.is-side::before { top: 0; bottom: 0; right: -0.75rem; width: 0.75rem; }

/* The heading names the group and says how many of its actions can be chosen. */
.cim-flyout-h {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3125rem 0.5625rem 0.4375rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--cim360-actionbar-fg) 72%, transparent);
}

.cim-flyout-h > .bi { font-size: 0.8125rem; }

.cim-flyout-h-n {
    margin-left: auto;
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    background: var(--cim360-actionbar-lift);
    color: var(--cim360-actionbar-fg);
    letter-spacing: 0;
    font-weight: 700;
}

.cim-flyout-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    /* WCAG 2.5.8: every row clears 24px. */
    min-height: max(1.5rem, 24px);
    padding: 0.5rem 0.5625rem;
    background: transparent;
    border: 0;
    border-radius: 0.5625rem;
    font-family: inherit;
    font-size: 0.7813rem;
    font-weight: 600;
    color: var(--cim360-actionbar-fg);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s;
}

.cim-flyout-item > .bi {
    flex: 0 0 auto;
    width: 1.125rem;
    font-size: 0.9375rem;
    color: color-mix(in srgb, var(--cim360-actionbar-fg) 92%, transparent);
}

.cim-flyout-item-l { flex: 1 1 auto; }

.cim-flyout-item:hover:not(:disabled),
.cim-flyout-item:focus-visible {
    background: var(--cim360-actionbar-lift-strong);
    outline: none;
}

.cim-flyout-item:disabled {
    cursor: not-allowed;
    color: color-mix(in srgb, var(--cim360-actionbar-fg) 45%, transparent);
}

.cim-flyout-item:disabled > .bi {
    color: color-mix(in srgb, var(--cim360-actionbar-fg) 35%, transparent);
}

.cim-flyout-item.is-danger,
.cim-flyout-item.is-danger > .bi {
    color: var(--cim360-actionbar-danger);
}

.cim-flyout-sep {
    height: 1px;
    margin: 0.25rem 0.5rem;
    background: var(--cim360-actionbar-hairline);
}

@keyframes cimFlyOutIn {
    from { opacity: 0; transform: scale(.86) translateY(0.375rem); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cim-flyout { animation: none; }
}
