/* =============================================================================
   cim360-card.css - the shared primitives every document card tab is built from.

   GLOBAL, not scoped, and for the same reason css/lists/cim360-list.css is: these
   classes are used by tab components AND by the templates those components render
   from their parent, and Blazor CSS isolation scopes a selector to the component
   that WROTE the markup. A table drawn by a parent's RenderFragment inside a child
   component carries the parent's scope, so a scoped sheet on the child cannot
   reach it.

   Linked from Cim360.cloud.Web/Components/App.razor AND
   Cim360.cloud/wwwroot/index.html. Both, or the styling works on one host only.

   Written after three tabs of the sales card (Lines, Fulfilment, Invoices) had
   each grown their own copy of the same table, status chip, sub-line, empty row,
   section heading and spinner. Six more tabs and the whole of purchasing follow
   the same shape, so the copies were going to reach fifteen.

   Every class is prefixed c360-ct- ("card tab").
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Section headings
   -------------------------------------------------------------------------- */

.c360-ct-subhead {
    margin: 1.125rem 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-primary);
}

/* The first heading in a tab sits against the body's own padding. */
.c360-ct-subhead:first-child {
    margin-top: 0;
}

/* -----------------------------------------------------------------------------
   2. Tables

   Each table gets its own horizontal scroller. Nine columns do not fit a narrow
   card, and the alternative is the card body scrolling sideways - which moves the
   tab rail out of view.
   -------------------------------------------------------------------------- */

.c360-ct-wrap {
    overflow-x: auto;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);

    /* The gap above a grid, which used to belong to the <h3> that sat there. Once the title bar
       took over the heading's job the headings came out, and every one of them took its 18px with
       it - so on the Fulfilment tab the KPI tiles ended up touching the Delivery Schedules box.
       The spacing is the SECTION's, not the heading's, and it belongs on the thing that is still
       there. Reported 2026-09-11. */
    margin-top: 1.125rem;
}

/* The first block in a tab sits against the body's own padding - same rule as .c360-ct-subhead. */
.c360-ct-wrap:first-child {
    margin-top: 0;
}

/* A heading immediately above still spaces its own table, so the two must not both do it. */
.c360-ct-subhead + .c360-ct-wrap {
    margin-top: 0;
}

/* The table itself - width, type, header band, cell padding, hover, the empty cell and the
   numeric columns - is THE grid table in css/forms/cim360-dialog.css, which names `.c360-ct`
   alongside `.c360-grid-table`. A settings grid, an in-card grid and a card tab are the same
   object and now say so.

   Below is only what is this table's own. */

/* Sticky, because the scroller is the table's own: a long line list otherwise loses its column
   names on the first flick of the wheel. A settings grid scrolls with its page and does not
   need this, which is why it is here and not in the shared rule.

   `white-space: nowrap` for the same reason it is on a list view's header: a wrapped column
   name changes the header's height and pushes the first row about as the table is resized. */
.c360-ct thead th {
    position: sticky;
    top: calc(-1 * var(--c360-sticky-inset, 0px));
    z-index: 2;
    white-space: nowrap;
}

/* WHICH SCROLLER THE HEADER DOCKS IN DECIDES ITS `top`. A sticky header docks at its scroller's
   PADDING edge, not its border. So in a padded scroller, `top: 0` stopped the header a padding's
   height short of the top, and the rows scrolled through the strip above it and showed behind the
   column names: the custom fields on a new order, 2026-09-25, measured as 8px at 760px tall.
   The padded scrollers that hold a table directly (.c360-de-body, .c360-lw-body, .c360-dlg-body)
   pad through --c360-sticky-inset, and the header is pulled up by exactly that much, so it docks
   flush. Custom properties inherit, so a table reads the value from the nearest scroller that
   declares one. A grid's own body is a scroller with NO padding, so it puts the value back to 0
   for every table inside it. Any new scroller that holds a .c360-ct table does one or the other. */
.c360-grid-body,
.c360-grid-body-virtual {
    --c360-sticky-inset: 0px;
}

/* EVERY IN-CARD GRID DOCKS ITS COLUMN HEADER - and which way depends on one question: does it fill?
   Every grid body is a scroll box (overflow-y:auto), so the sticky header above docks only when that
   body has a BOUNDED height. There are exactly two ways to get one, and every grid takes one:
     - Fill (the default, is-fill) - for a grid whose host really is a bounded flex column: the item
       tabs' hosts (and the QC tab's .qc-rules-card), .c360-clt-scroll on the Lines tabs, and
       .c360-cfg WHERE its own host is bounded (a custom fields tab - not when it sits in content).
       The body is the flex child.
     - Fill="false" - for EVERY other grid: one stacked with others on a tab (the order card's
       Fulfilment, Invoices, Tax, Profit, Links, Audit; the item's Financials, Logistics,
       Plannings), one inside a record card's body (the purchase order card, the delivery card) or a dialog,
       and the address list and custom field grid wherever they sit in content. The body is capped
       here, so it scrolls in its own box.
   A grid left on the default where its host is NOT a flex column grows to every row and its header
   scrolls away - DEV-483's "column header bar stays docked" failing, which is how 22 grids were
   found this way on 2026-09-25. Choosing Fill is choosing this; there is no third case. .is-bounded
   opts any other body in. Capped rather than fixed, so a short table is as short as its rows. */
.c360-grid.c360-grid-incard:not(.is-fill) > .c360-grid-body,
.c360-grid-body.is-bounded {
    max-height: min(60vh, 35rem);
    overflow-y: auto;
}

/* The header's bottom rule, drawn as an inset shadow on every in-card grid: the table collapses its
   borders, and a collapsed border stays with the row it was drawn on rather than the sticky header -
   so once the rows scroll, a docked header would sit on them with no line under it. */
.c360-grid.c360-grid-incard > .c360-grid-body .c360-ct thead th {
    box-shadow: inset 0 -1px 0 var(--cim360-border);
}

/* The solid-primary header band with white uppercase text, the 12.5px rows, the 9px padding and
   the blue zebra that used to be here are gone: they made this table a different object from
   every other grid in the product. The shared rule draws it now. The zebra went with them -
   .c360-grid-table does not band, and one of the two had to give. */

/* ---- a selected row.

   The SAME treatment as a list view's selected row - a 22% primary wash across the
   cells and a 3px bar down the left of the first one. Written against the list's own
   values (css/lists/cim360-list.css) rather than approximated, so a line selected on a
   card and a row selected on a list look identical.

   Deliberately NOT a ring around each cell, which is what this used to draw: that reads
   as "this cell is selected" when the unit of selection is the LINE. */
/* Two selectors, not four: the :nth-child(even) pair existed to beat the zebra, and there is no
   zebra now. A rule that overrides something that no longer exists reads as a rule that matters. */
.c360-ct tbody tr.is-sel td,
.c360-ct tbody tr.is-sel:hover td {
    background: color-mix(in srgb, var(--cim360-primary) 22%, transparent);
}

.c360-ct tbody tr.is-sel td:first-child {
    box-shadow: inset 0.1875rem 0 0 var(--cim360-primary);
}

.c360-ct td.strong { font-weight: 800; }

/* Semantic cell tones. Amber is reserved for a value that asks for action, so
   "not there yet" is muted rather than amber - on a six-line order, colouring
   every incomplete cell hides the one that matters. */
.c360-ct td.is-ok    { color: var(--cim360-success-fg); }
.c360-ct td.is-warn  { color: var(--cim360-warning-fg); }
.c360-ct td.is-muted { color: var(--cim360-text-muted); }

/* A totals row, ruled off above and not striped. */
.c360-ct tbody tr.c360-ct-total td {
    background: var(--cim360-surface-2) !important;
    border-top: 2px solid var(--cim360-border);
    font-weight: 800;
    color: var(--cim360-text);
}

.c360-ct-empty td,
td.c360-ct-empty {
    padding: 1.75rem 0.6875rem !important;
    text-align: center;
    color: var(--cim360-text-muted);
    font-style: italic;
    background: var(--cim360-card) !important;
}

.c360-ct-empty i {
    margin-right: 0.4375rem;
    opacity: .6;
}

/* -----------------------------------------------------------------------------
   3. Cell furniture
   -------------------------------------------------------------------------- */

/* An identifier cell - an item code, a line number, an invoice or despatch number. In the page's
   typeface, like every other cell: the monospace stack that used to be here made these columns a
   different font from the rows they belong to, which is the same objection that took the mono out
   of .stock-link and .td-num on the list views.

   `tabular-nums` because these are read down the column and compared - equal-width digits are what
   monospace was really being used for. Weight carries "this is the identifier" on its own. */
.c360-ct-code {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* A second line under a cell's main value - a carrier's service, a line's
   description. Muted and smaller so the column still scans on its first line. */
.c360-ct-sub {
    margin-top: 2px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
    line-height: 1.35;
}

/* A reference nobody reads as prose: a tracking number, a transaction id. Tabular figures rather
   than a monospace face, for the same reason as .c360-ct-code above. */
.c360-ct-ref {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--cim360-text-muted);
}

/* A small qualifier beside a value - a line type, "Credit note", "Zero-rated". */
.c360-ct-tag {
    display: inline-flex;
    margin-left: 0.375rem;
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    background: rgba(148, 163, 184, .2);
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   4. Status chips

   Five tones, named by what they mean rather than by colour, so a status can be
   re-toned in one place. Deliberately NOT Cim360Chip: that carries a full swatch
   and a dot for a status axis a whole screen is organised around, where these are
   one cell of one table.
   -------------------------------------------------------------------------- */

.c360-ct-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 0.5625rem;
    border-radius: 62.4375rem;
    border: 1px solid;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .03em;
    white-space: nowrap;
}

.c360-ct-status.is-done    { background: var(--cim360-success-bg); border-color: var(--cim360-success-border); color: var(--cim360-success-fg); }
.c360-ct-status.is-partial { background: var(--cim360-warning-bg); border-color: var(--cim360-warning-border); color: var(--cim360-warning-fg); }
.c360-ct-status.is-open    { background: var(--cim360-info-bg); border-color: var(--cim360-info-border); color: var(--cim360-info-fg); }
.c360-ct-status.is-void    { background: var(--cim360-surface-2); border-color: var(--cim360-border); color: var(--cim360-text-muted); }
.c360-ct-status.is-bad     { background: var(--cim360-danger-bg); border-color: var(--cim360-danger-border); color: var(--cim360-danger-fg); }
/* Nothing done yet - Awaiting stock, Unscheduled. Deliberately plain: the card's own ground and the
   ordinary border, so a brand-new order's tree is not a column of coloured pills. It was returned
   by StatusTone with no rule behind it, so it rendered a currentColor border on nothing. */
.c360-ct-status.is-idle    { background: var(--cim360-card); border-color: var(--cim360-border); color: var(--cim360-text-muted); }
/* Picked (DEV-483): the goods are in hand and waiting to go - past Allocated, not yet Despatched.
   Its own colour, because sharing Allocated's green would make the step the ticket asks for invisible. */
.c360-ct-status.is-staged  { background: var(--cim360-violet-bg); border-color: var(--cim360-violet-border); color: var(--cim360-violet-fg); }

/* -----------------------------------------------------------------------------
   5. Notes

   A one-line statement of a rule that applies to the tab - what the company's
   settings allow. Informational blue; a warning tone would suggest something is
   wrong when nothing is.
   -------------------------------------------------------------------------- */

.c360-ct-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.625rem;
    padding: 0.5rem 0.6875rem;
    border: 1px solid var(--cim360-info-border);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--cim360-primary) 7%, var(--cim360-card));
    color: var(--cim360-info-fg);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}

.c360-ct-note > i { font-size: 0.8125rem; margin-top: 1px; }
.c360-ct-note .sep { margin: 0 0.3125rem; opacity: .5; }

/* Something inside a note that IS a caution - "despatch held pending
   authorisation". Amber text in a blue note, rather than a second note. */
.c360-ct-note .warn { color: var(--cim360-warning-fg); }

.c360-ct-emptyrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.125rem 0.875rem;
    border: 1px dashed var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card);
    color: var(--cim360-text-muted);
    font-size: 0.7813rem;
    font-style: italic;
}

/* -----------------------------------------------------------------------------
   6. Key/value grid

   For a section that is a set of named facts rather than a list of rows - the
   customs declaration, a document's own properties.
   -------------------------------------------------------------------------- */

.c360-ct-kv {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13.125rem, 1fr));
    gap: 1px;
    background: var(--cim360-border);
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.c360-ct-kv > div {
    background: var(--cim360-card);
    padding: 0.5rem 0.6875rem;
    min-width: 0;
}

/* 10.5px rather than the 9.5px the uppercase form used: lowercase letters at 9.5px are
   appreciably smaller than capitals were, and this is a field label, not a footnote. */
.c360-ct-kv .k {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-caption);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c360-ct-kv .v {
    margin-top: 2px;
    font-size: 0.7813rem;
    font-weight: 700;
    color: var(--cim360-text);
    overflow-wrap: anywhere;
}

/* -----------------------------------------------------------------------------
   7. Loading and failure

   Every tab fetches its own body, so every tab has these two states. The third -
   "empty" - is a table row or a c360-ct-emptyrow, because an empty table still
   wants its headings.
   -------------------------------------------------------------------------- */

.c360-ct-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 2.75rem 1.25rem;
    color: var(--cim360-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
}

.c360-ct-state.is-bad { color: var(--cim360-danger-fg); }

.c360-ct-spin {
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    border: 0.1875rem solid rgba(29, 117, 187, .18);
    border-top-color: var(--cim360-primary);
    border-radius: 50%;
    animation: c360CtSpin .8s linear infinite;
}

@keyframes c360CtSpin {
    to { transform: rotate(360deg); }
}

/* Somebody who has asked for less motion gets a pulse instead of a spin. */
@media (prefers-reduced-motion: reduce) {
    .c360-ct-spin {
        animation: c360CtPulse 1.4s ease-in-out infinite;
    }
}

@keyframes c360CtPulse {
    0%, 100% { opacity: .35; }
    50%      { opacity: 1; }
}

/* -----------------------------------------------------------------------------
   8. Address panels

   Global rather than scoped to Cim360AddressPanel because the tab that lays two
   of them out side by side needs the wrapper too, and that wrapper is markup the
   TAB writes - a scoped sheet on the panel cannot reach it.
   -------------------------------------------------------------------------- */

/* Two panels side by side, one under the other once the card is narrow. The card
   already loses 188px to its tab rail, so the breakpoint is generous. */
.c360-addr-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
}

/* The stack, not the viewport - a two-up pair of addresses is deciding about the width IT has,
   which is the card less the tab rail. See .c360-rcs. */
@container c360stack (max-width: 1050px) {
    .c360-addr-wrap { grid-template-columns: minmax(0, 1fr); }
}

.c360-addr {
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    overflow: hidden;
    background: var(--cim360-card);
    min-width: 0;
}

.c360-addr-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5625rem 0.8125rem;
    background: color-mix(in srgb, var(--cim360-primary) 5%, var(--cim360-card));
    border-bottom: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

.c360-addr-note {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: none;
    color: var(--cim360-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

.c360-addr-body { padding: 0.8125rem 0.875rem; }

.c360-addr-block {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--cim360-text);
}

/* The contact name is who the driver asks for, so it leads. */
.c360-addr-block > div:first-child { font-weight: 700; }

/* The address on the left and its telephone and email on the right; once the BOX is too narrow to
   hold both, the contact drops under the address. A container query on the box rather than a media
   query, because the pair of boxes decides its own width from the card - DEV-495. */
.c360-addr-body { container: c360addr / inline-size; }

.c360-addr-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.625rem 1.25rem;
    align-items: start;
}

.c360-addr-contact {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    max-width: 16rem;
    padding-left: 1rem;
    border-left: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text);
}

.c360-addr-contact > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.c360-addr-contact > span > .bi {
    flex: 0 0 auto;
    color: var(--cim360-primary);
    font-size: 0.8125rem;
}

.c360-addr-contact a {
    color: inherit;
    text-decoration: none;
}

.c360-addr-contact a:hover,
.c360-addr-contact a:focus-visible {
    color: var(--cim360-primary);
    text-decoration: underline;
}

.c360-addr-contact em {
    font-style: italic;
    font-weight: 500;
    color: var(--cim360-text-muted);
}

@container c360addr (max-width: 26rem) {
    .c360-addr-main { grid-template-columns: minmax(0, 1fr); }

    .c360-addr-contact {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.375rem 1rem;
        max-width: none;
        padding-left: 0;
        padding-top: 0.625rem;
        border-left: 0;
        border-top: 1px solid var(--cim360-border);
    }
}

.c360-addr-flags { margin-top: 0.5625rem; }

/* The invoice address's VAT number - a labelled line, because a bare number under an address reads as
   part of it. DEV-870. */
.c360-addr-vat { margin-top: 0.5625rem; font-size: 0.75rem; color: var(--cim360-text-muted); }
.c360-addr-vat b { margin-left: 0.25rem; color: var(--cim360-text); font-weight: 700; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* The panel's own buttons, at the right of its heading (the design's sop-secta) - DEV-495. After a
   lock note they sit beside it; without one they take the right-hand edge themselves. */
.c360-addr-acts {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 0 0 auto;
}

.c360-addr-note + .c360-addr-acts { margin-left: 0.5rem; }

.c360-addr-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.7813rem;
    font-weight: 600;
    letter-spacing: normal;
    cursor: pointer;
}

.c360-addr-btn:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.c360-addr-btn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-addr-btn:disabled {
    cursor: default;
    color: var(--cim360-text-muted);
    background: var(--cim360-surface-2);
}

/* The ink is --cim360-on-primary, never --cim360-card: the card is white in light and nearly black
   in dark, so the dark theme drew dark text on the blue fill. And the hover darkens the SURFACE
   token rather than reaching for --cim360-primary-hover, which is a text colour that lightens in
   dark mode (2026-10-06 sweep). Light mode is unchanged - card and on-primary are both white. */
.c360-addr-btn.is-primary {
    background: var(--cim360-primary-surface);
    border-color: var(--cim360-primary-surface);
    color: var(--cim360-on-primary);
}

/* The hover above paints the ink primary, which on the primary button is the colour of its own
   fill - "Save addresses" vanished under the pointer. The primary button keeps its light ink and
   darkens instead. Found on Plan delivery's Delivery tab, DEV-500; the order card had it too. */
.c360-addr-btn.is-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--cim360-primary-surface) 85%, #000);
    color: var(--cim360-on-primary);
}

/* After .is-primary on purpose: same specificity, so order decides, and without this a disabled
   primary button kept its blue fill and looked pressable. It takes the plain disabled look. DEV-689. */
.c360-addr-btn.is-primary:disabled {
    background: var(--cim360-surface-2);
    border-color: var(--cim360-border);
    color: var(--cim360-text-muted);
    cursor: default;
}

.c360-addr-btn > .bi { font-size: 0.8125rem; }

.c360-addr-count {
    min-width: 1.125rem;
    padding: 0.0625rem 0.3125rem;
    border-radius: 62.4375rem;
    background: var(--cim360-primary-surface);
    color: var(--cim360-card);
    font-size: 0.6875rem;
    font-weight: 800;
    text-align: center;
}

/* A line that belongs with this address - the account's currency and terms, the site it came from. */
.c360-addr-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.875rem;
    margin-top: 0.5625rem;
    padding-top: 0.5625rem;
    border-top: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-addr-foot .bi { color: var(--cim360-primary); margin-right: 0.3125rem; }
.c360-addr-foot b { color: var(--cim360-text); font-weight: 700; }

.c360-addr-notes {
    margin-top: 0.5625rem;
    padding-top: 0.5625rem;
    border-top: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--cim360-text-muted);
}

.c360-addr-empty {
    padding: 0.875rem 0;
    font-size: 0.7813rem;
    font-style: italic;
    color: var(--cim360-text-muted);
}


/* =============================================================================
   Record card chrome - the blue header and footer bands.

   Cim360RecordCardHeader and Cim360RecordCardFooter, rendered into
   Cim360Window's Header and Footer fragments. Global for the same reason
   everything else in this file is: the fragments are written by the CARD and
   rendered inside the WINDOW, and Blazor scopes a selector to the component that
   wrote the markup - so a scoped sheet on either one cannot reach the other.

   Measurements are the design's own (sop-page.css .sop-dh / .sop-dfoot), which
   is why they are spelled out rather than inherited from the window's default
   head: that one is two lines at 14px padding and this is three at 18px, and the
   difference in height is the point.

   c360-rch- = record card header. c360-rcf- = record card footer.
   ============================================================================= */

.c360-rch {
    /* FLAT, not the window default's three-stop gradient. The design's band is one
       colour; the gradient is what made the two look like different products. */
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);

    /* 18px top / 24px sides / 16px bottom - the design's own padding, and with the
       three lines below it puts the band at about 110px against the window
       default's 72px. */
    padding: 1.125rem 1.5rem 1rem;

    /* Room for the window's minimise and close buttons, which are absolutely
       positioned at top:14px right:16px over this band. Without it a long
       reference or a wide pill runs underneath them. */
    padding-right: 6rem;

    /* The two text sizes that identify the record, defined ONCE here and read by everything on the
       band that has to match them - the reference, the description beside it, the party line, and
       the inputs that stand in for the first two while they are edited - so the band never changes
       shape between viewing and editing, and a tier changes one number.

       The design's own sizes, in rem: 23px, 14px and 11px. NOT floored to those pixels. The interactive design
       is itself scaled to the window - 90% at 1080p, 80% at 768p, the same clamp as the root font size here -
       so its 23px is 20.7px on a 1080p screen and its header is 105px tall there, not the 116px it reports in
       its own units. A rem size scales exactly as the design does, at every window size and at any root; a px
       floor made this header's text larger than the design's on screen and took the card's room with it. */
    --c360-rch-code-size: 1.4375rem;
    --c360-rch-sub-size: 0.875rem;
    --c360-rch-chip-size: 0.6875rem;
}

/* One height for every pill on the band - the document type, every chip, the Viewing / Editing flag: the
   design's 24px pill. Each used to be sized by its own padding and font, which is how the flag came out
   about 3px shorter than the pills beside it.

   On :root, not on the card header, because the flag is drawn in more places than a card header: a line
   window's top line, a settings dialog's head, a settings page's header. Defined on the header, the flag
   outside it had no height to read and measured 18.8px against the card's 21.6px. */
:root {
    --c360-rch-pill-h: 1.5rem;
}

/* The path - "Sales · Order processing" - drawn by Cim360CardPath, and styled HERE and nowhere else:
   no card sheet carries a rule for it.

   The design's own line, value for value: 10.5px, bold, .14em of tracking, a 1.45 line box, an 8px gap
   between parts, and CAPITALS (the owner's call, 2026-11-10, after seeing it in sentence case: the design's
   tracked capitals are what make a line this small legible, and sentence case "looked off"). The one
   deliberate difference, for contrast: the design sets the line in 80% white, which is under WCAG 2.2
   1.4.3 at this size (85% white on this band measured 3.98:1, and 80% is lower), so this is the band's
   full ink. A part of the path that is a link keeps the capitals - see .c360-path-link, which has to ask
   for them because a button's own style turns them off. It scales with the root as everything on the
   band does (see the note on .c360-rch). */
.c360-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-size: 0.65625rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    line-height: 1.45;
    /* The ink of whatever band it sits on: a record card's header sets --cim360-headerband-fg, the generic
       window head --cim360-on-primary. */
    color: inherit;
}

.c360-path .sep {
    opacity: .55;
}

.c360-path-part {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Steps after the area. One link look for all of them: the build card's bill and the bill card's
   drill-down. Underlined because a link has to be told from its surroundings by more than colour
   (WCAG 2.2 1.4.1). A drill-down is a row of steps in a nav. */
.c360-path-crumbs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.c360-path-link {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
    text-underline-offset: 2px;
}

.c360-path-link:hover {
    text-decoration-color: currentColor;
}

.c360-path-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 0.125rem;
}

/* The step the person is on: the words, not a link. */
.c360-path-link.is-current {
    text-decoration: none;
    cursor: default;
}

/* The same words without the link - for a person who may not open it, or a note after one. */
.c360-path-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Steps in a drill-down trail are told apart by a chevron. */
.c360-path-link + .c360-path-link::before {
    content: "›";
    margin-right: 0.25rem;
    opacity: .6;
    text-decoration: none;
    display: inline-block;
}

.c360-rch-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    min-width: 0;
}

/* The record's reference, in the card's blue band.

   In the page's typeface, NOT monospace: the owner ruled monospace out of every card header on
   2026-11-10 (the interactive design sets this line in monospace, and DEV-479 asked for it, so a later
   pass will want to put it back - it is deliberate). It made the one line that says WHICH record this is
   a different font from everything around it, as it had already done to every identifier cell and
   list reference (see .stock-link in cim360-list.css and .c360-ct-code below).

   `tabular-nums` is what monospace was really being used for: references are read down a column of
   open windows on the bottom bar and compared, and SO-01167 and SO-01191 must line up. */
.c360-rch-code {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-size: var(--c360-rch-code-size);
    font-weight: 800;
    letter-spacing: -.01em;

    /* The design's: its reference sits in a 1.45 line box (33px for 23px of type), which is what gives the
       room between the number and the party line under it. At 1.1 the two were jammed together. */
    line-height: 1.45;
}

/* ---- the code and description, while they are being EDITED ------------------------------------

   They are edited in the header because that is where the design puts them and where they are
   already shown. They were also two fields in the stock item card's summary band, which cost that
   band a whole row to repeat what sits a centimetre above it - and that row is what pushed the
   stock grid off the bottom of the screen.

   Each input INHERITS the size and weight of the text it replaces, so the header does not change
   shape between viewing and editing. A card that reflows when you press Edit reads as a different
   screen rather than the same one in another mode.

   Transparent with a soft outline rather than a white box: this band is a saturated colour, and a
   filled input on it would be the loudest thing on the card. The outline is what says it is a
   field; the placeholder is what says what goes in it. */
.iw-head-edit {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: var(--cim360-headerband-fg);
    background: rgba(0, 0, 0, .09);
    border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 35%, transparent);
    border-radius: 0.375rem;
    padding: 2px 0.5rem;
    min-width: 0;
}

/* Placeholder text is text (WCAG 1.4.3), and axe never scores it: at 55% it measured 2.56:1 on the band.
   Full strength, and told apart from what somebody typed by being italic. Opacity is set because Firefox
   fades a placeholder on its own. */
.iw-head-edit::placeholder {
    color: var(--cim360-headerband-fg);
    opacity: 1;
    font-style: italic;
    font-weight: 500;
}

/* A visible focus ring, because the border alone is already the resting state and a keyboard user
   would have nothing new to see. WCAG 2.4.7, and A11Y-19 for the outline:none half of it. */
.iw-head-edit:focus-visible {
    outline: 2px solid var(--cim360-headerband-fg);
    outline-offset: 1px;
}

/* The reference is edited in the same typeface it is read in - the page's, as .c360-rch-code is - and
   keeps its tabular figures. */
.iw-head-edit.is-code {
    font-variant-numeric: tabular-nums;
    font-size: var(--c360-rch-code-size);
    font-weight: 800;
    letter-spacing: -.01em;
    text-transform: uppercase;

    /* As wide as its code, not a fixed 15ch that cut a longer one off - the width comes from the
       input's `size`, which the card sets from the code (CodeBoxSize). flex: 0 0 auto so the row
       does not squeeze it back; the cap leaves the description beside it at least 40% of the line.
       Past the cap a long code scrolls inside the box. */
    width: auto;
    flex: 0 0 auto;
    max-width: 60%;
}

/* Disabled while the code is going to be generated: nothing to type, so it says "Auto" in the
   placeholder's colour and does not invite a click. Contrast is exempt for a disabled control
   (WCAG 1.4.3), but the word is the whole message, so it keeps the placeholder's legible tint rather
   than fading further. */
.iw-head-edit.is-code:disabled {
    cursor: default;
    border-style: dashed;
}

/* The description sits BESIDE the reference on the identity line, which is where the design puts it
   and which saves the header a whole row - the third line was carrying nothing else on this card.

   flex: 1 1 auto against a min-width of 0, so it takes what is left of the row and is allowed to
   shrink below its content. Without the min-width a flex item refuses to go under its intrinsic
   width, and a long description would push the row wider than the card instead of ellipsing. */
.iw-head-edit.is-desc {
    font-size: var(--c360-rch-sub-size);
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    align-self: center;
}

/* The same line, read-only. Sized and coloured like the subtitle it replaces rather than like the
   reference beside it: it is the record's name, not a second identifier. */
.c360-rch-trailing {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--c360-rch-sub-size);
    font-weight: 600;
    color: var(--cim360-headerband-fg); /* Full band ink: a fade of it is under WCAG 2.2 1.4.3 at this size. DEV-502. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: center;
}

.c360-rch-sub {
    margin-top: 0.3125rem;
    font-size: var(--c360-rch-sub-size);
    line-height: 1.45;
    font-weight: 600;
    color: var(--cim360-headerband-fg); /* Full band ink: a fade of it is under WCAG 2.2 1.4.3 at this size. DEV-502. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A chip on the blue. A translucent dark tint, because a chip in its own palette on a
   coloured ground either fights it or disappears into it - the ONE exception is
   the document-type pill, which the design colours by type and which comes
   through the Pill slot carrying its own inline colours. */
.c360-rch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    flex: 0 0 auto;
    --c360-pill-drop: 0.07em;
    padding: calc(0.34rem + var(--c360-pill-drop)) 0.625rem calc(0.34rem - var(--c360-pill-drop));
    line-height: 1;
    border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 40%, transparent);
    border-radius: 62.4375rem;
    background: rgba(0, 0, 0, .105);
    color: var(--cim360-headerband-fg);
    font-size: var(--c360-rch-chip-size);
    font-weight: 700;
    white-space: nowrap;
}

/* The document-type pill (Cim360Chip, through the Pill slot) at the design's own size - its .cell-pill is
   11px, 3px 10px of padding and a line height of 1.4, which makes it 24px tall - instead of the 12px
   control-sized chip it inherits, which was 9.6px on screen at an 80% root and 28px tall at 100%. */
.c360-rch .c360-chip {
    --c360-pill-drop: 0.07em;
    font-size: var(--c360-rch-chip-size);
    padding: calc(0.34rem + var(--c360-pill-drop)) 0.625rem calc(0.34rem - var(--c360-pill-drop));
    line-height: 1;
}

/* The same height, from the one variable. The padding above and below only moves the text within it (see
   --c360-pill-drop), it no longer decides how tall the pill is. The flag takes it wherever it is drawn, not only
   inside a card header. */
.c360-rch .c360-chip,
.c360-rch .c360-rch-chip,
.c360-rch-mode {
    box-sizing: border-box;
    height: var(--c360-rch-pill-h);
}

/* Every pill on the band - the document type, the chips, the Viewing / Editing flag - is centred the same way,
   and the way is by construction, not by a nudge: a line box of exactly the type's size (line-height 1) with
   equal padding above and below, so the text sits in the middle, and an icon that is the same size, a box of
   its own, and not shifted. Bootstrap's icon font moves every glyph down by .125em (vertical-align) to sit on a
   text baseline, which in a flex pill is what dropped the padlock and the eye below their words; and the
   padlock's own component set its text at 12px on a 1.35 line, a different size from the pill it sat in. */
.c360-rch-chip i,
.c360-rch-mode i {
    display: inline-flex;
    line-height: 1;

    /* The text sits a little high in a pill however the box is balanced - the browser puts a baseline on a
       whole pixel and the capitals' centre lands above the pill's (measured: 0.45px at 1080p, 0.9px at 768p,
       and about 1px in the flag). Each pill drops its text by --c360-pill-drop with its padding, which would
       carry the icon down too, so the icon is lifted back by the same amount and stays exactly where it was. */
    position: relative;
    top: calc(-1 * var(--c360-pill-drop));
}

.c360-rch-chip i::before,
.c360-rch-mode i::before {
    vertical-align: 0;
}

.c360-rch-chip .c360-locked,
.c360-rch-chip .c360-locked.is-inline {
    margin-left: 0;
    font-size: inherit;
    line-height: 1;
}

.c360-rch-chip .d {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: var(--cim360-card);
    flex: 0 0 auto;
}

/* ---- the footer ---------------------------------------------------------- */

.c360-rcf {
    display: flex;
    align-items: center;
    gap: 1.375rem;
    flex-wrap: wrap;
    padding: 0.8125rem 1.25rem;
    background: var(--cim360-headerband-bg);

    /* A darker line, not a lighter one. It separates the band from the body above
       while keeping it obviously the same chrome as the header. */
    border-top: 1px solid var(--cim360-primary-dark);
}

.c360-rcf-updated {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-headerband-fg); /* Full band ink: a fade of it is under WCAG 2.2 1.4.3 at this size. DEV-502. */
    min-width: 0;
}

.c360-rcf-updated i {
    margin-right: 0.375rem;
    flex: 0 0 auto;
}

.c360-rcf-note {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-headerband-fg); /* Full band ink: a fade of it is under WCAG 2.2 1.4.3 at this size. DEV-502. */
    min-width: 0;
}

/* Callers wrap their icon and words in a span of their own, which puts both one level below the
   gap above - so the icon sat flush against the text. The same spacing, one level down. DEV-649. */
.c360-rcf-note > span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.c360-rcf-acts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-wrap: wrap;
}

/* The two button treatments the design defines, and no third. A translucent dark tint
   for a secondary action; solid white with primary-coloured text for the one that
   acts. */
.c360-rcf-btn {
}

.c360-rcf-btn i {
    color: var(--cim360-headerband-fg);
}


.c360-rcf-btn:focus-visible {
    outline: 2px solid var(--cim360-headerband-fg);
    outline-offset: 2px;
}

.c360-rcf-btn.is-primary {
    background: var(--cim360-card);
    border-color: var(--cim360-headerband-fg);
    color: var(--cim360-primary);
}

.c360-rcf-btn.is-primary i {
    color: var(--cim360-primary);
}

/* ─── A footer button that opens a menu (DEV-479's print menu) ───
   The geometry is the row menu's, deliberately: .row-actions-menu in css/lists/cim360-list.css is
   the product's menu box and this is the same object in a different place, so the two agree on
   radius, shadow, padding and item height. What differs is only the direction - a card footer is at
   the bottom of the card, so the menu opens UPWARDS. */

.c360-rcf-menuhost {
    position: relative;
    display: inline-flex;
}

/* The caret turns over when the menu is open, so the button says which way it is about to go. */
/* How many of a footer menu's entries can be chosen now - the purchase card's Print menu. DEV-780. */
.c360-rcf-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    margin-left: 0.375rem;
    border-radius: 0.625rem;
    background: var(--cim360-surface-2);
    color: var(--cim360-text);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.c360-rcf-caret {
    font-size: 0.75rem;
    margin-left: 2px;
    transition: transform 140ms ease;
}

.c360-rcf-btn[aria-expanded="true"] .c360-rcf-caret {
    transform: rotate(180deg);
}

/* Transparent and fixed: a click-catcher, not a scrim. Below the menu and above everything else,
   which is what makes a click anywhere else close it without reaching what it landed on. */
.c360-rcf-menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 49;
}

.c360-rcf-menu {
    position: absolute;
    bottom: calc(100% + 0.375rem);
    right: 0;
    min-width: 13.75rem;
    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;
}

.c360-rcf-menu:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-rcf-menuitem {
    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: inherit;
    text-align: left;
    cursor: pointer;
}

/* The band's own foreground does NOT apply in here. .c360-rcf-btn i paints icons white for the
   blue footer, and the menu is a white card sitting off it - an inherited white icon would be
   invisible. */
.c360-rcf-menuitem i {
    color: var(--cim360-text-muted);
}

.c360-rcf-menuitem:hover:not(:disabled),
.c360-rcf-menuitem:focus-visible {
    background: color-mix(in srgb, var(--cim360-primary) 8%, transparent);
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

.c360-rcf-menuitem:hover:not(:disabled) i,
.c360-rcf-menuitem:focus-visible i {
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

/* A decision that does not apply right now - its reason is the tooltip. DEV-493. */
.c360-rcf-menuitem:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Between the process areas on a card's Actions menu, where the list's row menu has its groups. DEV-877. */
.c360-rcf-menusep {
    height: 1px;
    margin: 0.25rem 0;
    background: var(--cim360-border);
}

.c360-rcf-btn.is-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .88);
}

/* The 88% white lets the blue band through, and the primary label on it measured 4.14:1 (WCAG 2.2
   1.4.3 - axe on the customer card's Save, UK VAT review). The deeper primary every theme defines. */
.c360-rcf-btn.is-primary:hover:not(:disabled),
.c360-rcf-btn.is-primary:hover:not(:disabled) i {
    color: var(--cim360-primary-dark);
}

/* Disabled rather than hidden, so the card's shape does not change as its state
   does - and every disabled button here carries a title saying why. */
.c360-rcf-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ---- narrow windows ------------------------------------------------------
   The card, not the viewport. "Narrow windows" is what this always said it was about; it was the
   browser window it measured. See .c360-rcs. */

@container c360card (max-width: 720px) {
    .c360-rch {
        padding: 0.75rem 1rem 0.75rem;
        padding-right: 5.5rem;
    }

    /* The path is the first thing to go: it is context, and the reference and
       the customer are the content. A header that sets AlwaysShowPath carries
       .is-path-kept and keeps it. */
    .c360-rch:not(.is-path-kept) .c360-path {
        display: none;
    }

    .c360-rch:not(.is-path-kept) .c360-rch-mode.is-in-row {
        display: inline-flex;
    }

    .c360-rch {
        --c360-rch-code-size: 1.0625rem;
    }

    .c360-rch-sub {
        font-size: 0.7813rem;
        white-space: normal;
    }

    .c360-rcf {
        padding: 0.5rem 0.875rem;
        gap: 0.625rem;
    }

    .c360-rcf-acts {
        margin-left: 0;
        width: 100%;
    }
}


/* -----------------------------------------------------------------------------
   A sortable header cell, IN A CARD.

   The button itself - its type, padding, hover, focus ring and the three sort
   glyphs - is `.c360-sort` in css/forms/cim360-dialog.css, rendered by
   Cim360SortHeader. This block restated all of it until 2026-09-11, which is how
   a card ended up hovering WHITE text on a band that stopped being blue months
   ago: the band moved to the shared rule and the copy of its hover did not.

   What is left is only what the card's cell genuinely needs.
   -------------------------------------------------------------------------- */

/* The button fills the cell, so the click target is the whole heading rather than
   the width of its own words. */
.c360-ct-sort {
    width: 100%;
}

/* The number columns are right-aligned, and `text-align: inherit` is not enough
   for a flex container - the flex line has to move too, or the label sits left
   in a right-aligned cell. */
.c360-ct th.n .c360-ct-sort {
    justify-content: flex-end;
}

/* The sorted column is underlined as well as arrowed. Two signals rather than one,
   because a card's nine columns are close together and a 10px glyph on its own is
   easy to lose. */
.c360-ct-sort.is-active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.1875rem;
}


/* -----------------------------------------------------------------------------
   The card's mode pill - Viewing or Editing.

   The design's .sop-editflag, which it shows only while editing. Shown in both
   states here: "which mode am I in" is a question with two answers, and a badge
   that appears only for one of them means its absence has to be interpreted.
   -------------------------------------------------------------------------- */

.c360-rch-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    flex: 0 0 auto;
    margin-left: auto;
    --c360-pill-drop: 0.12em;
    padding: calc(0.27rem + var(--c360-pill-drop)) 0.5625rem calc(0.27rem - var(--c360-pill-drop));
    line-height: 1;
    border-radius: 62.4375rem;
    /* The design's 10px, in rem. */
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;

    /* The flag is always shown, so it sits in the path row of EVERY card and would set that row's height
       - 26px against the design's 15px - with the pill's own padding and border. The negative margin takes
       that back: the flag keeps its place in the row (so the path text can never run under it) and the
       padding above and the gap below the row absorb the few pixels it overhangs. */
    margin-block: -0.3125rem;

    /* Viewing: the translucent-dark treatment every other chip on this band uses,
       so it reads as chrome rather than as something needing attention. */
    background: rgba(0, 0, 0, .12);
    border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 38%, transparent);
    color: var(--cim360-headerband-fg);
}

/* On a LIGHT ground - a settings page's own header, which is not a blue band. The same flag, the same size and
   wording, in the muted ink and surface that header's other chrome uses. At the right-hand end of the title row,
   as on a card (the row is a full-width flex row, see SettingsPageHeader). Before the amber rule below so
   Editing keeps its amber. */
.c360-rch-mode.is-on-light {
    margin-block: 0;
    background: var(--cim360-surface-2);
    border-color: var(--cim360-border);
    color: var(--cim360-text-muted);
}

/* In a dialog's title, on the dialog head's blue: at the right-hand end of the head's text column, as on a card.
   The title becomes a flex row while it holds the flag (see .c360-dlg-head-title in cim360-dialog.css), so the
   flag's auto margin has the row's spare width to push against. */
.c360-rch-mode.is-in-title {
    margin-block: 0;
}

/* Editing: the design's amber, which is the one state that should catch the eye -
   it means what is on screen is not yet what is stored. */
.c360-rch-mode.is-editing {
    background: var(--cim360-warning-bg);
    border-color: var(--cim360-warning-border);
    color: var(--cim360-warning-fg);
}

/* The flag's second copy, at the end of the identity row. The first sits in the path line, and the path is
   dropped on a short window and on a narrow card - taking the flag with it, so the one thing that says whether
   what is on screen is stored would be lost exactly when space is tight. This copy is hidden until the path
   is (the two rules that hide it show this), so only one is ever drawn; a header that keeps its path
   (.is-path-kept) never shows it. */
.c360-rch-mode.is-in-row {
    display: none;
}


/* A chip on the header band that is actually a control - the "read a document"
   affordance, which is a <label> driving a hidden file input. It needs the cursor
   and the hover a chip does not have. */
.c360-rch-chip-btn {
    cursor: pointer;
    transition: background .12s ease;
}

.c360-rch-chip-btn:hover {
    background: rgba(0, 0, 0, .225);
}


/* -----------------------------------------------------------------------------
   A CARD'S LINES TAB - the scrolling table with the action bar and totals pinned
   under it, on BOTH the sales card and the purchase card.

   ONE definition, here, for the same reason the line TABLE below it has one.
   These were .solt-* in SalesOrderLinesTab.razor.css - a scoped sheet, so
   purchasing could not reach them and grew its own .po-linebar-* with different
   numbers in it: a different label size, a different layout and a grand total
   that was not the primary colour. The two bars looked nothing like each other
   because they were written twice.

   Do not put a copy in a .razor.css. Add here.
   -------------------------------------------------------------------------- */

.c360-clt {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* The table scrolls and the bar below it does not - the design's .sop-dbody.is-lines
   arrangement, and what keeps the totals readable on a 200-line document. */
/* A flex COLUMN, so the Lines grid inside - an is-fill grid - fills this box and scrolls in its own
   body, which is what lets its column header dock. As a plain block the grid grew to every row,
   this box scrolled instead, and the header scrolled away with the lines. DEV-483. */
.c360-clt-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* THE LINES PANEL'S OWN FLOOR, on the body that holds it. The shell's generic body floor (9.375rem,
   .c360-rcs-stack > .c360-rcs-body) is sized for a body that scrolls itself, and a lines panel does
   not: its bar never shrinks, so at 150px the bar's 102px took the box and the grid got 0px - PO 2
   and SO-01192 at 875 x 794 showed "Lines", no rows, and totals under the footer. This floor is,
   as MEASURED: the grid's title bar (44px) + column header (40px) + three line rows (3 x 53px - a
   line row is two-line, not a cosy 44px) + the grid foot (34px) + the bar on one row (~55px with its
   margin) + the body's padding (23px); the narrow container below adds the bar's second row and the
   title bar wrapping its search box onto a line of its own (86px). Sized from 44px rows it was 21rem
   there and left the grid 78px - one row. Re-test 4. Below it the shell stack scrolls the notes and
   summary band away - it is the last-
   resort scroller - instead of the grid collapsing. Direct child only, as the shell's rule is, and
   only when the body holds a lines panel: the BOM and Operation cards' bodies scroll themselves and
   keep the generic floor. */
.c360-rcs-stack > .c360-rcs-body:has(> .c360-clt) {
    min-height: 22.5rem;
}

.c360-clt-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.625rem;
    padding: 0.5625rem 2px 0;
    border-top: 1px solid var(--cim360-border);
}

.c360-clt-acts {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

/* Why the controls are not there, when they are not. */
.c360-clt-why {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-text-muted);
}

.c360-clt-totals {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1.125rem;
}

/* Label above figure, right-aligned: a column of totals is read down the numbers,
   and a label to the left of each one puts a word between every pair of them. */
.c360-clt-tot {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.c360-clt-tot em {
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-caption);
}

.c360-clt-tot b {
    font-size: 0.8438rem;
    font-weight: 800;
    color: var(--cim360-text);
    font-variant-numeric: tabular-nums;
}

/* The one figure somebody came to read. */
.c360-clt-tot.is-grand b {
    font-size: 1rem;
    color: var(--cim360-primary);
}

/* On a narrow card the bar stacks, so the totals keep their own line rather than
   being squeezed against the buttons. */
@container c360stack (max-width: 820px) {
    .c360-clt-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .c360-clt-totals {
        justify-content: flex-end;
    }

    /* The stacked bar is two rows (measured 103px at 875 x 794) and the grid's title bar wraps to
       86px, so the floor above gains both: 23 + 103 + 86 + 40 + 3 x 53 + 34 + 2 = 447px. */
    .c360-rcs-stack > .c360-rcs-body:has(> .c360-clt) {
        min-height: 28rem;
    }
}


/* -----------------------------------------------------------------------------
   A DOCUMENT LINE TABLE - the seven columns a sales or purchase document's lines
   are drawn in, on BOTH the card that amends one and the screen that raises one.

   ONE definition, here, for both of them. There were two, and that is the whole
   reason the two screens kept looking different after the table classes had been
   put right three times: these .c360-ct-* rules dressed the New document screen,
   while SalesOrderLinesTab.razor.css carried a private ::deep .solt-* set for the
   card. Same table, same seven columns, different numbers - 74px against 80px,
   200 against 190, 76 against 80, 110 against 120 - and the description column
   truncated with an ellipsis on one screen and wrapped on the other. Neither file
   mentioned the other, so every fix to one left the other where it was.

   A scoped .razor.css CANNOT hold these. It is rewritten per component and cannot
   reach a second one, so anything two line tables share has to live here. What
   stays in the tab's own sheet is what only that tab has: its pinned action bar
   and its totals.

   Reported 2026-09-11, three times running, as "the lines grid is STILL
   different".
   -------------------------------------------------------------------------- */

.c360-ct-row {
    cursor: pointer;
}

.c360-ct-row:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: -2px;
}

/* Column widths. One flexible column - the description - so the others cannot be
   squeezed out at narrow widths. */
.c360-ct-seq { width: 5rem; }
/* The item cell holds a code and, on anything that is not an ordinary stock line, a type chip
   beside it. They were adjacent inline elements with nothing between them, so the chip sat hard
   against the last character of the code and read as part of it. A flex row with a gap, rather
   than a margin on the chip: the gap then applies however many things the cell ends up holding,
   and it collapses to nothing on the majority of lines that have only the code. */
.c360-ct-itemcol { width: 11.875rem; }

/* Anything AFTER the code in that cell - the line-type chip - gets a gap. They were adjacent
   inline elements with nothing between them, so the chip sat hard against the last character of
   the code and read as part of it.

   An adjacent-sibling margin rather than flex on the cell: the cell is a <td>, and display:flex
   there REPLACES display:table-cell and drops it out of the table layout - the same trap the
   description column's comment records for -webkit-box. This also costs nothing on the majority of
   lines, which hold the code alone and have no sibling to match. */
.c360-ct-itemcol > * + * {
    margin-left: 0.5rem;
}
.c360-ct-qtycol { width: 5rem; }
.c360-ct-unitcol { width: 6.875rem; }
.c360-ct-disccol { width: 5rem; }
.c360-ct-netcol { width: 7.5rem; font-weight: 700; }

/* The line number is an identifier rather than a figure, so it recedes. */
.c360-ct-seq .c360-ct-code {
    color: var(--cim360-text-muted);
}

/* Wraps rather than truncating: the description is the part somebody actually
   reads, and this is the one flexible column. `max-width: 0` is what makes a
   table cell take its width from the table rather than from its own content. */
.c360-ct-desccol {
    white-space: normal;
    line-height: 1.45;
    max-width: 0;
}


/* -----------------------------------------------------------------------------
   DENSITY - how much of a line is shown. The same three the list views offer,
   over the same ListDensity enum and the same stored preference, but read here
   as an amount of LINE rather than as a bare row height:

     c360-ct-compact   one line per row, description truncated. For scanning a
                       long document.
     (none)            Cosy, the default: the description may take a second line.
     c360-ct-relaxed   adds the picture column. The tallest row, because the
                       image is what makes it tall.

   The class goes on the WRAPPER, not on the table. Two reasons, and both matter:
   R-057 reads the table's own class list as a literal to prove it carries both
   c360-grid-table and c360-ct, and an interpolated class is one it cannot see
   through; and these names are prefixed rather than a bare is-compact because
   the despatch and reverse dialogs already put THAT class on their own tables
   with their own rules behind it.

   Here rather than in the tab's own .razor.css for the reason the block above
   was written: a scoped sheet is rewritten per component and cannot reach a
   second one, and the New document screen's line table is the same table. It can
   adopt these by putting the same class on its wrapper, with nothing to redefine.
   -------------------------------------------------------------------------- */

/* THE CLAMP GOES ON .c360-ct-desc, THE SPAN INSIDE THE CELL - NEVER ON THE CELL.

   `display: -webkit-box` is what -webkit-line-clamp requires, and setting it on a
   <td> replaces `display: table-cell`, which takes the cell OUT of the table
   layout algorithm. The column then stops being sized by the table and the row
   collapses around it: reported as "a big white space on the grid - the
   description column looks all messed up", on Cosy and With images but not on
   Compact, because Compact truncates with an ellipsis and needs no -webkit-box.

   So the cell keeps every property that makes it a cell, and an inner span -
   which may be any display it likes - does the clamping. Both line tables render
   that span for exactly this reason. */
.c360-ct-desc {
    display: block;
}

/* Compact. The description stops wrapping and truncates, which is the whole
   difference - everything else follows from the row being one line tall. */
.c360-ct-compact .c360-ct .c360-ct-desccol .c360-ct-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* THE THREE DENSITIES ARE THE LIST VIEW'S THREE DENSITIES, to the pixel - 2px, 7px and 24px of
   cell padding (`css/lists/cim360-list.css`, `.grid-viewport.density-*`). A line on a card and a
   row on a list are the same object at the same setting, and until 2026-09-23 they were not:
   compact was 4px against the list's 2px, cosy - the default - was 14px against 7px, and

   RELAXED HAD NO RULE AT ALL. It set `c360-ct-relaxed` on the wrapper, turned the image column on
   and changed nothing else, so the loosest density on a card was the same height as the middle
   one. Nothing reported it, because a density control that moves one of its three settings looks
   like a density control that works.

   Each sets tokens rather than padding, so it cannot lose a specificity race with the shared rule
   the way the old override had to win one. `--c360-row-h` comes with them: the shared 44px floor
   is what stops a chip setting the row height, and a compact row has to get under it. */
.c360-ct-compact .c360-ct {
    --c360-row-pad-y: 2px;
    --c360-row-h: 1.875rem;
}

.c360-ct-relaxed .c360-ct {
    --c360-row-pad-y: 1.5rem;
    --c360-row-h: 4.5rem;
}

/* Cosy caps the description at two lines rather than letting it run. A line
   carrying three hundred characters would otherwise set the height of every row
   after it in the reader's eye, and the line panel is where the whole text
   belongs. The -webkit- prefixes are not legacy: they are the only spelling any
   browser ships for line-clamp today, and the standard `line-clamp` is listed
   beside them so this needs no edit when they catch up. */
.c360-ct-wrap:not(.c360-ct-compact) .c360-ct .c360-ct-desccol .c360-ct-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* The picture column. Fixed width so the columns beside it do not shift as
   thumbnails arrive one response at a time. */
.c360-ct-imgcol {
    width: 3.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.c360-ct-thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);

    /* contain, not cover: an item photographed against white is a picture of the
       item, and cropping to fill the square is how the part somebody recognises
       gets cut off. */
    object-fit: contain;
    display: block;
}

/* No picture. A glyph rather than an empty cell, so the column keeps its rhythm
   down the table and a thumbnail still loading does not read as a hole. */
.c360-ct-thumb.is-none {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cim360-text-muted);
    font-size: 1rem;
}

/* Relaxed lets the description use the height the image has already taken.

   `.c360-ct-wrap` is doubled up on purpose: the Cosy rule above matches through
   :not(.c360-ct-compact), which counts as a class, so it carries FIVE. Written
   the obvious way this rule would have four, lost the cascade, and left Relaxed
   silently clamped at two lines - R-003's "compute the specificity it is
   fighting", applied before shipping it rather than after. */
.c360-ct-wrap.c360-ct-relaxed .c360-ct .c360-ct-desccol .c360-ct-desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* A discount reduces the document, so the row is tinted rather than left looking
   like an ordinary line that happens to hold a negative number. */
.c360-ct tbody tr.is-disc td {
    background: color-mix(in srgb, var(--cim360-warning) 10%, var(--cim360-card));
}

.c360-ct tbody tr.is-disc:nth-child(even) td {
    background: color-mix(in srgb, var(--cim360-warning) 18%, var(--cim360-card));
}

/* The tint takes the primary link below 4.5:1 (4.02:1 on the even row, WCAG 2.2 1.4.3 - axe, DEV-505),
   so a link on a discount row is drawn in the deeper primary every theme defines. */
.c360-ct tbody tr.is-disc .c360-grid-link,
.c360-ct tbody tr.is-disc .stock-link {
    color: var(--cim360-primary-dark);
}

/* A comment is narrative in a table of figures - italic and muted, so the eye
   skips it when adding up. */
.c360-ct tbody tr.is-note .c360-ct-desccol {
    font-style: italic;
    color: var(--cim360-text-muted);
}

/* A line with too little on it to be sent. Draft tables only - a stored line is
   always complete - and marked because Create silently drops it, so somebody has
   to be able to see which one. */
.c360-ct-row.is-incomplete .c360-ct-desccol {
    color: var(--cim360-warning-fg);
    font-style: italic;
}

/* Which lines a document reader suggested. On a forty-line read document this is
   the difference between checking four lines and checking all of them. */
.c360-ct-read {
    margin-left: 0.3125rem;
    color: var(--cim360-primary);
}


/* The Save button's spinner, while a save is in flight.

   The card's save is not instant - it writes the item, then traceability, then the lifecycle state,
   then every tab holding buffered child rows - so there is a real gap between the press and the
   card closing. The button is disabled for that gap; this is what says why, rather than leaving a
   dead primary button under the pointer looking broken.

   Only the spacing lives here. The mark itself is Cim360Spinner, styled in
   css/forms/cim360-dialog.css so every caller gets the same thing. */
.c360-rcf-spinner {
    margin-right: 0.375rem;
    vertical-align: -2px;
}

/* =====================================================================================
   RECORD CARD SHELL  .c360-rcs-*
   =====================================================================================
   The frame every record card inside a Cim360Window is built from: the container, the status
   stripe, the note band, the scrolling body and the loading / not-found states.

   GLOBAL, and that is the whole point of moving it here. These rules lived in
   SalesOrderCard.razor.css - a SCOPED stylesheet - so they reached exactly one component. The
   delivery card reused the class names, got none of it, and arrived with no padding, no stripe and
   no spacing, which read as "the header and footer did not inherit". It is the same fault
   Cim360ListPage was written to remove: Item.razor.css held the list shell and Stocktake, which
   reused its class names, got none of it either.

   A scoped .razor.css is rewritten per component. It can only ever style the markup of the one
   component it belongs to - never a second component that copies the names, and never markup a
   caller passes in through a RenderFragment. Shared chrome therefore lives in a global sheet
   linked from the host page; component-specific rules stay scoped.

   Measurements are the design's own (sop-page.css), unchanged by the move.
   ===================================================================================== */

/* THE CARD IS THE CONTAINER, NOT THE VIEWPORT, and everything in this file that used to ask
   `@media (max-width:)` now asks this instead.

   A record card is a window inside the page. It is never the width of the browser - it loses the
   window host's chrome, and inside it the tab rail takes another ~190px - so the two numbers are
   about 350px apart on a sales order card. Every layout threshold here was written about the CARD
   ("when the card is narrow, stack the rail") and measured against the BROWSER, so each one fired
   350px too late. On a 960px browser the summary band was 611px wide and still drawing its five
   tags across, at 122px each, because 960 is not under 900.

   That is the identical fault that made the stock item card's grid disappear (see
   Cim360ItemCard.razor.css, .iw-stack) and it fails the same quiet way: the rule looks present,
   reads correctly, and cannot fire.

   Two containers, because two different widths are being asked about. `c360card` is the whole
   card, for anything deciding where the rail goes. `c360stack` is the column beside the rail, for
   anything laid out INSIDE a tab - which is the width that content actually gets. */
.c360-rcs {
    container-type: inline-size;
    container-name: c360card;

    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
    background: var(--cim360-card);
    font-family: 'Nunito', "Segoe UI", system-ui, sans-serif;
}

.c360-rcs-stripe {
    flex: 0 0 auto;
    /* 26px at full size, and 1.5rem either side so the dot lines up with the header's text above it:
       the design's own figures. The whole UI scales with the window, so these are rem. */
    min-height: 1.625rem;
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    padding: 0.125rem 1.5rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .02em;

    /* The stripe's background is the status colour, set inline - the swatch's INK shade through
       Cim360ChipPalette.StripeFill, never its dot, so white clears 4.5:1 on every status (the dots
       did not: despatched teal measured 4.37:1, cyan and lime near 2:1). The shadow is depth only;
       contrast does not lean on it. */
    text-shadow: 0 1px 1px rgba(15, 23, 42, .28);
    flex-wrap: wrap;
}

.c360-rcs-stripe-dot {
    flex: 0 0 auto;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: var(--cim360-card);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}

/* The status or health message, in the case it was written: sentence case, never a transform. A
   caption on a coloured band keeps the band's colour and only loses the capitals. */
.c360-rcs-stripe-status {
    flex: 0 0 auto;
}

/* Anything the stripe carries after the status - a count, a date - reads as secondary, by weight and
   not by fading: there is no headroom to fade small text on a saturated fill, and axe cannot decide
   the contrast of text that is partly transparent. */
.c360-rcs-stripe-aside {
    margin-left: auto;
    font-weight: 700;
    letter-spacing: 0;
}

/* The Show / Hide summary pill at the stripe's right end (Cim360RecordCardStripe). The one control for
   a card's summary, so every card has it in the same place and drawn the same way.

   A dark tint over the band, never a light one: a light wash lifts the band under the white label and
   takes it below 4.5:1, while white on the bare band is already clear and a darker one only adds to it.
   The label is full strength for the same reason - there is no headroom on a saturated fill to fade.

   It DRAWS at the design's size - 19px tall at full size, in rem so it scales with everything else on
   the card (a pill held at a fixed pixel height stands out as chunky once the UI scales down) - and
   its POINTER TARGET is a transparent 24px band behind it (the ::after below), because the whole UI
   scales with the window and a target drawn at the minimum is under it as soon as the root shrinks.
   The px half of that max() is the one that must not scale. The focus ring is a real outline, because
   a box-shadow is discarded in forced-colours mode. */
.c360-rcs-sumtoggle {
    position: relative;
    /* Above the summary band under the stripe, whose containment paints over a sibling's overflow, so
       the pointer target below is not clipped to the stripe. */
    z-index: 1;
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 1.1875rem;
    line-height: 1;
    padding: 0 0.5625rem;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 62.4375rem;
    background: rgba(0, 0, 0, .16);
    color: #fff;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    text-shadow: none;
    cursor: pointer;
}

.c360-rcs-sumtoggle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: max(1.5rem, 24px);
    transform: translateY(-50%);
}

.c360-rcs-sumtoggle:hover {
    background: rgba(0, 0, 0, .28);
}

.c360-rcs-sumtoggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.c360-rcs-sumtoggle i {
    font-size: 0.75rem;
}

.c360-rcs-split {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 11.75rem minmax(0, 1fr);
    background: var(--cim360-card);
}

.c360-rcs-stack {
    /* The width a tab's content actually gets - the card less the rail. See .c360-rcs. */
    container-type: inline-size;
    container-name: c360stack;

    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;

    /* The same shape as the entry shell's .c360-de-stack, which put its line bar under the footer
       and outside the card (R16): notes and the summary band never shrink, so on a short, narrow
       card with a note or two they could outgrow the stack once the body was at zero, and the
       overflow painted over the footer. With the body's floor below, the stack scrolls instead. The
       620px tier hands the scroll back to the whole card; see "STOP FITTING". */
    overflow-y: auto;
}

/* Direct children only: .c360-rcs-body is also a pane inside a split elsewhere (the BOM operation
   editor), where a floor would be a layout change rather than a guard. This floor suits a body that
   scrolls itself; one holding a lines panel has a fixed bar in it and its own, higher floor - see
   "THE LINES PANEL'S OWN FLOOR" at .c360-clt. */
.c360-rcs-stack > .c360-rcs-body {
    min-height: 9.375rem;
}

.c360-rcs-note {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 0.5625rem;
    margin: 0.75rem 1.25rem 0;
    padding: 0.5625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid;
    font-size: 0.7813rem;
    font-weight: 600;
    line-height: 1.45;
}

/* Notes space themselves from above only, so the last one would sit flush on the summary band or body under it. */
.c360-rcs-note:has(+ :not(.c360-rcs-note)) {
    margin-bottom: 0.75rem;
}

.c360-rcs-note i {
    flex: 0 0 auto;
    font-size: 0.875rem;
    margin-top: 1px;
}

.c360-rcs-note.warn { background: color-mix(in srgb, var(--cim360-warning) 9%, var(--cim360-card)); border-color: var(--cim360-warning-border); color: var(--cim360-warning-fg); }
.c360-rcs-note.bad  { background: var(--cim360-danger-bg); border-color: var(--cim360-danger-border); color: var(--cim360-danger-fg); }
.c360-rcs-note.ok   { background: color-mix(in srgb, var(--cim360-success) 9%, var(--cim360-card)); border-color: var(--cim360-success-border); color: var(--cim360-success-fg); }
.c360-rcs-note.info { background: var(--cim360-surface-2); border-color: var(--cim360-border-cool); color: var(--cim360-text-muted); }

/* A link inside a note keeps the note's colour (its contrast is already chosen) and is told apart by its underline, not by colour. */
.c360-rcs-note a { color: inherit; text-decoration: underline; }

.c360-rcs-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    padding: 0.875rem 1.25rem 1.25rem;
    background: var(--cim360-surface-3);
    border-top: 1px solid var(--cim360-border);
}

/* A card with no rail beside it: the body is the whole width, and the top border would draw a line
   immediately under the stripe. */
.c360-rcs-body.is-full {
    border-top: 0;
}

.c360-rcs-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 100%;
    padding: 2.5rem;
    text-align: center;
    color: var(--cim360-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.c360-rcs-state > i {
    font-size: 1.875rem;
    opacity: .5;
}

.c360-rcs-state-detail {
    max-width: 60ch;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--cim360-text-muted);
}

.c360-rcs-spinner {
    width: 1.625rem;
    height: 1.625rem;
    border: 0.1875rem solid rgba(29, 117, 187, .18);
    border-top-color: var(--cim360-primary);
    border-radius: 50%;
    animation: c360RcsSpin .8s linear infinite;
}

@keyframes c360RcsSpin {
    to { transform: rotate(360deg); }
}

/* Somebody who has asked for less motion gets a pulse instead of a spin. */
@media (prefers-reduced-motion: reduce) {
    .c360-rcs-spinner {
        animation: c360RcsPulse 1.4s ease-in-out infinite;
    }
}

@keyframes c360RcsPulse {
    0%, 100% { opacity: .35; }
    50%      { opacity: 1; }
}

/* Below the rail's own width plus a usable body, the rail goes horizontal rather than squeezing the
   content to nothing. */
/* THE RAIL GOES ON TOP WHEN THE CARD IS NARROW - the card, which is the thing the rail is inside
   and the only width that can decide this. Against the viewport it was 350px out: a card in a
   960px browser kept its 190px rail beside a 611px stack, which is the shape this rule exists to
   break up. See .c360-rcs. */
@container c360card (max-width: 900px) {
    .c360-rcs-split {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }
}

/* ---------- values a card reads rather than edits ---------- */

/* A stored value shown in a form field's control slot. Sized and weighted like the editors beside
   it so a read-only card does not look like a broken form. */
.c360-rcs-readonly {
    min-height: 1.875rem;
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-text);
    word-break: break-word;
}

/* A section with nothing in it says so, rather than leaving a gap that reads as a fault. */
.c360-rcs-empty {
    padding: 1.125rem 0.25rem;
    text-align: center;
    font-size: 0.7813rem;
    font-style: italic;
    color: var(--cim360-text-muted);
}

/* The second line of a table cell - a service under its carrier, a subject under a record. */
.c360-rcs-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
}

/* A card with no rail: the stack is the whole card below the stripe, so it has to grow. In the
   two-pane arrangement the stack sits in a grid cell and fills it without this. */
.c360-rcs-stack.is-full {
    flex: 1 1 auto;
}

/* ═══ A STATUS TIMELINE ═══════════════════════════════════════════════════════════════════════
   The card's History tab — every status the document has been through.

   GLOBAL, not scoped, because the sales card and the purchase card both draw it. It began as
   .soh-* inside SalesOrderHistoryTab.razor.css, where purchasing could not reach a line of it -
   the same trap that had the two cards' line tables sitting at two type sizes. Promoted, and
   renamed off the sales prefix, when purchasing gained the tab.

   A timeline rather than a table: the transitions are a sequence, and a table of four columns
   makes the reader reconstruct the order from the dates. */
.c360-cth-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.25rem;
}

.c360-cth-timeline > li {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding: 0 0 1rem 0;
}

/* The connecting line, drawn behind the dots. On the LAST entry it stops, or the timeline appears
   to continue into nothing. */
.c360-cth-timeline > li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 0.3125rem;
    top: 1rem;
    bottom: 0;
    width: 2px;
    background: var(--cim360-border);
}

.c360-cth-dot {
    flex: 0 0 auto;
    width: 0.75rem;
    height: 0.75rem;
    margin-top: 0.1875rem;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--cim360-card);
    position: relative;
    z-index: 1;
}

.c360-cth-body {
    flex: 1 1 auto;
    min-width: 0;
}

.c360-cth-title {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--cim360-text-muted);
}

.c360-cth-title strong {
    color: var(--cim360-text);
    font-weight: 800;
}

.c360-cth-title i {
    font-size: 0.75rem;
    opacity: .7;
}

/* Tabular numerals, because a column of timestamps that do not line up is read as a list rather
   than as a sequence. */
.c360-cth-meta {
    margin-top: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
}

.c360-cth-meta .sep { margin: 0 0.3125rem; opacity: .5; }

/* The reason somebody typed. Set apart, because it is their words rather than the system's. */
.c360-cth-reason {
    margin-top: 0.3125rem;
    padding: 0.375rem 0.625rem;
    border-left: 0.1875rem solid var(--cim360-border);
    background: var(--cim360-surface-2);
    border-radius: 0 0.375rem 0.375rem 0;
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--cim360-text-muted);
}

/* ═══ AN AUDIT TRAIL ══════════════════════════════════════════════════════════════════════════
   The card's Audit tab — the cells of the change table.

   GLOBAL for the same reason as the timeline above, and promoted in the same pass. Nothing here
   sizes the TABLE: the width, the type size, the cell padding, the row rule and the overflow are
   .c360-grid-table / .c360-ct and .c360-ct-wrap. Three cards each declaring their own is what had
   three grids on one screen at three type sizes.

   Colours are measured against the tint they sit on, not against white - see cim360-accessibility,
   "Measure against the background it actually sits on". */

/* Never wrapped. A timestamp broken across two lines is unreadable and makes every row taller. */
.c360-cta-when {
    white-space: nowrap;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
}

.c360-cta-record {
    font-weight: 600;
    color: var(--cim360-text-strong);
}

.c360-cta-subject {
    color: var(--cim360-text-muted);
    font-size: .78rem;
}

/* Values can be long - an address line, a description - so they wrap rather than forcing the
   table wider. anywhere rather than break-all so a word breaks only when it has to. */
.c360-cta-value {
    overflow-wrap: anywhere;
    min-width: 8ch;
}

.c360-cta-chip {
    display: inline-block;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
    background: color-mix(in srgb, var(--cim360-text-muted) 12%, transparent);
    color: var(--cim360-text-muted);
}

/* A row appearing and a row disappearing are the two events somebody scanning for "what happened
   to this line" is looking for. A field change is the ordinary case and stays neutral above -
   marking everything marks nothing. */
.c360-cta-chip.is-added {
    background: var(--cim360-success-bg);
    color: var(--cim360-success-fg);
}

/* Not red. A line removed from an order is ordinary editing, not a fault, and red here would send
   the reader looking for a problem that is not there. */
.c360-cta-chip.is-removed {
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
}

.c360-cta-chip.is-restored {
    background: var(--cim360-info-bg);
    color: var(--cim360-info-fg);
}

/* ═══ ATTACHMENTS ═════════════════════════════════════════════════════════════════════════════
   The upload bar and the per-row actions on a card's Attachments tab.

   GLOBAL, because the sales card and the purchase card both draw them, and the two lay their
   LISTS out differently on purpose - sales as stacked cards, purchase as a table. What is shared
   is the chrome around the list, not the list itself, so only the chrome is here. Putting it in
   either card's scoped sheet is how the two would end up with an upload button at two sizes. */

.c360-att-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

/* The label IS the control - the input beside it is off-screen - so it has to look and behave like
   a button rather than like text that happens to be clickable. */
.c360-att-bar label {
    cursor: pointer;
    margin: 0;
}

.c360-att-hint {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* Kept on one line and out of the way. The buttons are the point of the cell; a wrap here makes
   every row in the table taller to fit something that never needed two lines. */
.c360-att-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.c360-att-actionscol { width: 5.625rem; }

/* The file name column. Wide enough for a real name - a scanned purchase order is rarely called
   "po.pdf" - and it wraps rather than pushing the figures off the right. */
.c360-att-name {
    min-width: 13.75rem;
    overflow-wrap: anywhere;
}

.c360-att-name > i { margin-right: 0.375rem; opacity: .75; }

/* ═══ AN ICON BUTTON ══════════════════════════════════════════════════════════════════════════
   A button that is only an icon, for a row's own actions.

   Sized by a MINIMUM rather than a fixed height, and to 32px rather than to the icon - WCAG 2.2
   AA's 2.5.8 Target Size wants 24px of pointer target and a row of 16px icons does not have it.
   The padding is the target; the icon just sits in it. */
.c360-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.4375rem;
    background: transparent;
    color: var(--cim360-text-muted);
    font-size: 0.8125rem;
    line-height: 1;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.c360-iconbtn:hover:not(:disabled) {
    background: var(--cim360-surface-2);
    border-color: var(--cim360-border);
    color: var(--cim360-text);
}

/* Never outline:none. A keyboard user navigating a table of these has nothing else to go on. */
.c360-iconbtn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-iconbtn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Red on HOVER only. A row of permanently red bins reads as six things being wrong rather than as
   six things that can be removed. */
.c360-iconbtn.is-danger:hover:not(:disabled) {
    background: rgba(185, 28, 28, .10);
    border-color: rgba(185, 28, 28, .25);
    color: var(--cim360-danger-fg);
}

/* ═══ A LINK INSIDE A CARD TABLE ══════════════════════════════════════════════════════════════
   For a cell that navigates - a file to download, a record to open - where Cim360GridLink's own
   button semantics are wrong because this really is an anchor with an href. */
.c360-gridlink {
    color: var(--cim360-primary);
    text-decoration: none;
    font-weight: 600;
}

.c360-gridlink:hover { text-decoration: underline; }

.c360-gridlink:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
    border-radius: 0.1875rem;
}

/* ═══ THE CUSTOM FIELDS TAB ═══════════════════════════════════════════════════════════════════
   Column widths for the purchase card's table. The sales card's equivalent is .socf-col-* in its
   own scoped sheet; these are the same numbers, and the two will be merged the next time either
   is touched for a reason of its own. */
.pocf-col-name { width: 12.5rem; font-weight: 600; }
.pocf-col-req { width: 5.625rem; }
.pocf-col-value { overflow-wrap: anywhere; }

/* ═══ A CARD TAB'S HEADLINE TILES ═════════════════════════════════════════════════════════════
   The row of figures a fulfilment-shaped tab opens with: how much was ordered, how much has been
   promised, how much has moved, what is left.

   GLOBAL, and that is the whole point. These lived in SalesOrderFulfilmentTab.razor.css as
   .sof-tile, which is a SCOPED sheet - so the purchase card's Deliveries tab, written to look the
   same, got none of it and was built as a list of cards instead. A .razor.css is rewritten per
   component and cannot reach another one; shared chrome has to live here. */
.c360-card-tiles {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.625rem;
}

.c360-card-tile {
    border: 1px solid var(--cim360-border);
    border-radius: 0.5625rem;
    background: var(--cim360-card);
    padding: 0.625rem 0.75rem;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.c360-card-tile .l {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-caption);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c360-card-tile .v {
    margin-top: 2px;
    font-size: 1.3125rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--cim360-text);
    font-variant-numeric: tabular-nums;
}

/* Amber when something is still owed, green when nothing is - the tile's colour answers "is this
   document done?", which is what it exists to say. */
.c360-card-tile .v.is-warn { color: var(--cim360-warning-fg); }
.c360-card-tile .v.is-ok   { color: var(--cim360-success-fg); }

/* Red for what is late - the purchase Receipts tab's Overdue tile (DEV-757). */
.c360-card-tile .v.is-bad  { color: var(--cim360-danger-fg); }

.c360-card-tile .s {
    margin-top: 1px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c360-card-mini {
    margin-top: 0.4375rem;
    height: 0.25rem;
    border-radius: 62.4375rem;
    background: rgba(148, 163, 184, .26);
    overflow: hidden;
}

.c360-card-mini > i {
    display: block;
    height: 100%;
    border-radius: 62.4375rem;

    /* So a stage that has barely begun still shows a mark rather than nothing. */
    min-width: 2px;
    transition: width .18s ease;
}

/* Five tiles do not fit a narrow card; three then two reads better than five squeezed. */
@container c360stack (max-width: 1000px) {
    .c360-card-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container c360stack (max-width: 700px) {
    .c360-card-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══ A SCHEDULE TREE'S CHILD ROWS ════════════════════════════════════════════════════════════
   The line number and description inside an expanded delivery. Global for the same reason as the
   tiles: both document cards draw this tree now, and the rules were reachable from one of them. */
.c360-sch-seq {
    display: inline-block;
    min-width: 1.5rem;
    margin-right: .375rem;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
}

/* The child row's description, which has no parent column above it to take a width from. */
.c360-sch-desc {
    color: var(--cim360-text-muted);
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-ct-muted { color: var(--cim360-text-muted); }

/* ═══ AN ICON BUTTON IN A CARD TABLE ══════════════════════════════════════════════════════════
   A row's own actions, where words in every row would be wider than the figures beside them. Each
   one carries a title AND an aria-label - an icon alone says nothing to a screen reader. */
.c360-ct-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    padding: 0;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text-muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.c360-ct-iconbtn:hover:not(:disabled) {
    background: var(--cim360-surface-2);
    color: var(--cim360-text);
}

.c360-ct-iconbtn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
}

.c360-ct-iconbtn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.c360-ct-iconbtn.is-danger:hover:not(:disabled) {
    background: rgba(185, 28, 28, .10);
    border-color: rgba(185, 28, 28, .25);
    color: var(--cim360-danger-fg);
}

/* ==========================================================================
   The list card - c360-lc-*

   One list card's five bands: a status stripe, a head (media tile, reference, title, meta), a
   stat strip, a progress bar with its legend, and an action row. Rendered by Cim360RecordCard;
   the surface, border, radius, selection ring and the grid it sits in all belong to
   Cim360CardView, which is why nothing here paints a background or a border on the card itself.

   Global rather than a .razor.css for one specific reason: every band is a slot, so the content
   inside it is declared by the CALLER. A scoped stylesheet is rewritten with the declaring
   component's [b-xxxx] attribute, so a rule here for `.c360-lc-meta .sep` could never reach a
   `<span class="sep">` written in a card template. Same reason the dialog chrome and the list
   shell are global. It lives in this file rather than a new one so it is linked in both hosts
   automatically - cim360-card.css already is, and a shared sheet linked in one host is a shared
   look in one host.

   These metrics are Inventory's item card, which is the design this pattern was taken from. That
   card declared them in an inline <style> element, which the Razor compiler emits as the first
   statement of BuildRenderTree - so with Cim360CardView calling the template once per row, the
   whole stylesheet went into the DOM once per card. Here it is one sheet, once.

   Its tints were raw rgba(29, 117, 187, ...) literals; they are color-mix over --cim360-primary
   here so they follow the theme rather than being pinned to one blue.
   ========================================================================== */

/* Absolute, so it spans the card's full width rather than sitting inside its padding. The card
   wrap is position: relative with overflow: hidden, so this clips to the card's radius. */
.c360-lc-stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.1875rem;
}

.c360-lc-head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    /* Clears the stripe. Without it the reference sits tight under a coloured line. */
    padding-top: 0.375rem;
    min-width: 0;
}

/* The media tile - a thumbnail where the record has one, an icon where it does not. A fixed
   square, so a card with an image and a card without are the same height. */
.c360-lc-media {
    flex: 0 0 5.25rem;
    height: 5.25rem;
    border-radius: 0.3125rem;
    background: color-mix(in srgb, var(--cim360-primary) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--cim360-primary) 12%, transparent);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c360-lc-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c360-lc-media .bi {
    color: color-mix(in srgb, var(--cim360-primary) 35%, transparent);
    font-size: 2rem;
}

/* A record with no picture of its own shows its initials. Full primary rather than the icon's
   35% tint: these are letters someone reads, so they carry text contrast. DEV-648. */
.c360-lc-media .c360-lc-initials {
    color: var(--cim360-primary);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

/* min-width: 0, or a long unbroken title stretches the grid column instead of ellipsing - a
   flex item's default min-width is auto, which refuses to shrink below its content. */
.c360-lc-head-body {
    flex: 1;
    min-width: 0;
}

.c360-lc-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.c360-lc-code {
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    color: var(--cim360-primary);
    font-weight: 700;
    letter-spacing: .02em;
    min-width: 0;
}

.c360-lc-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cim360-text);
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* min-height, so a record with no meta leaves the same gap as one with meta and the stat strips
   across a row of cards stay on one line. */
.c360-lc-meta {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    margin-top: 0.3125rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.3em;
    line-height: 1.3;
}

.c360-lc-meta .sep {
    opacity: .5;
    margin: 0 0.25rem;
}

.c360-lc-meta .bi {
    font-size: 0.75rem;
    margin-right: 0.1875rem;
    color: var(--cim360-primary);
    opacity: .75;
    vertical-align: -1px;
}

/* The flag row. Wraps, unlike the meta line above it - a record carrying four exceptional states
   is precisely the one whose fourth must not be the one that gets cut off. */
.c360-lc-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3125rem;
    align-items: center;
}

/* Razor does not allow an @if around a named slot, so a card whose flags all evaluate false still
   passes the band. This collapses it, rather than leaving the card wrap's 12px gap around an
   empty row - which would make an ordinary record taller than one carrying a flag is wide. */
.c360-lc-flags:empty {
    display: none;
}

/* auto-fit rather than a fixed repeat(4), so a card with three stats fills its strip instead of
   leaving a gap where a fourth would have been. */
.c360-lc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    background: color-mix(in srgb, var(--cim360-primary) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--cim360-primary) 10%, transparent);
    border-radius: 0.3125rem;
}

.c360-lc-stat {
    min-width: 0;
}

/* A stat tile's label is a caption - it names the figure under it - so sentence case and
   --cim360-caption, not capitals. It is not a grid column heading, a pill or a status band, which
   are the three things that keep their capitals. The eight labels behind it were already properly
   cased in en.json, so removing the transform revealed nothing; kept at 10px/700 because a tile's
   own scale is genuinely its own, and R-049 does not list this among the field-caption rules. */
.c360-lc-stat-label {
    font-size: 0.75rem;
    color: var(--cim360-caption);
    letter-spacing: .01em;
    font-weight: 700;
}

/* tabular-nums, so the figures down a column of cards line up on their digits. */
.c360-lc-stat-value {
    font-size: 0.9063rem;
    font-weight: 700;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    color: var(--cim360-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c360-lc-bar {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.c360-lc-bar-track {
    height: 0.375rem;
    border-radius: 62.4375rem;
    background: var(--cim360-surface-muted);
    display: flex;
    overflow: hidden;
    position: relative;
}

.c360-lc-bar-seg {
    transition: width .3s;
    min-width: 0;
}

.c360-lc-bar-legend {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text);
}

.c360-lc-bar-legend > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-lc-bar-legend .lg-dot {
    display: inline-block;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    margin-right: 0.3125rem;
    vertical-align: middle;
    flex: none;
}

.c360-lc-bar-legend .muted {
    color: var(--cim360-text-muted);
    font-weight: 500;
}

/* margin-top: auto pins the actions to the bottom edge, so a row of cards whose meta lines wrap
   to different heights still has its buttons on one line. */
.c360-lc-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.c360-lc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.3125rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
    font-size: 0.7813rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 0;
    transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}

.c360-lc-btn:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

/* The house focus indicator, matching .cim-cardview-card-wrap and .cim360-select-trigger. These
   buttons sit inside a card that is itself a role="button", so a keyboard user tabbing in has to
   be able to see which of the two holds focus. */
.c360-lc-btn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-lc-btn.is-primary {
    background: var(--cim360-primary-surface);
    color: #fff;
    border-color: var(--cim360-primary);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--cim360-primary) 25%, transparent);
}

.c360-lc-btn.is-primary:hover:not(:disabled) {
    background: var(--cim360-primary-surface-hover);
    border-color: var(--cim360-primary-hover);
    color: #fff;
    box-shadow: 0 2px 0.375rem color-mix(in srgb, var(--cim360-primary) 32%, transparent);
}

.c360-lc-btn.is-danger {
    color: var(--cim360-danger-fg);
}

.c360-lc-btn.is-danger:hover:not(:disabled) {
    border-color: var(--cim360-danger-fg);
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
}

/* Recede with colour rather than by fading - see cim360-accessibility. A disabled action still
   has to be readable, because the reason it is disabled is usually on the card rather than in a
   tooltip nobody opens. */
.c360-lc-btn:disabled {
    cursor: default;
    color: var(--cim360-text-muted);
    border-color: var(--cim360-border);
    background: var(--cim360-surface-2);
    box-shadow: none;
}

.c360-lc-btn .bi {
    font-size: 0.8125rem;
}

/* The label goes at narrow widths before the icon does - two icon-only buttons are still
   distinguishable from each other, whereas two truncated words are not. The accessible name
   comes from the button's own title/aria-label, so hiding the span costs nothing there. */
@media screen and (max-width: 420px) {
    .c360-lc-btn span {
        display: none;
    }
}

/* -----------------------------------------------------------------------------
   A SHORT window
   -----------------------------------------------------------------------------
   A card holding a grid showed its column headers and no rows once the window got
   short. The shell was never at fault: .c360-rcs-body is flex: 1 1 auto with
   min-height: 0 and overflow: auto, so the body yields. Everything around it is
   flex: 0 0 auto and keeps its full height however little there is to share:

     header ~110px (its own note above says so) + stripe 38 + summary band ~90
     + body padding 34 + footer ~60  =  about 330px before a row draws.

   On a 768px laptop the viewport is ~600px, and an in-card grid then spends 44px
   on its title bar and 36px on its column header before any data.

   WHY IT HAD NEVER COME UP. Every breakpoint in this file - and 668 of the 669 in
   the product - is max-WIDTH. A window that is short but not narrow matched none
   of them, so the chrome never yielded, and the grids looked like the only thing
   that scaled because they were.

   UNGATED, on the shared chrome itself. Both card shells draw this header and this
   footer - the document cards through .c360-rcs, the stock card through .iw-window
   - as do the two New-document screens, both line editors and the document entry
   shell. A modifier class would have meant deciding which of those deserve to be
   readable on a laptop, which is not a real question.

   Compressing padding, not content: nothing is hidden, no layout changes and no
   control moves. The header is not in these tiers: it has its own at 780px, below.

   The summary band compresses itself, in Cim360CardSummaryBand.razor.css. Its own
   rules are scoped and ::deep, so a rule here could not out-specify them without a
   gate class or a repeated-class hack - and that component's responsive behaviour
   is its own to own anyway. */
@media (max-height: 900px) {
    .c360-rcs-stripe {
        min-height: 1.625rem;
        padding: 0.0625rem 1.5rem;
    }

    .c360-rcs-body {
        padding: 0.625rem 1rem 0.75rem;
    }

    .c360-rcf {
        padding: 0.5625rem 1.25rem;
        gap: 0.875rem;
    }
}

/* The HEADER's one compact tier, at the design's own 780px (its sales, purchase and plan windows
   all tighten there). It is the header's alone: the 900px and 740px tiers above and below leave the
   header at its full size, so it reads as the design's full header or the design's compact one and
   never a third in between.

   Compact is the design's: the path drops (it is context, and the 720px width rule makes the same
   call) unless the header carries .is-path-kept, the band tightens to 10px top and bottom, and the
   reference comes down to 17px. The party line and the flag keep their size. */
@media (max-height: 780px) {
    .c360-rch {
        padding: 0.625rem 1.5rem;
        padding-right: 6rem;
        --c360-rch-code-size: 1.0625rem;
    }

    .c360-rch:not(.is-path-kept) .c360-path {
        display: none;
    }

    .c360-rch:not(.is-path-kept) .c360-rch-mode.is-in-row {
        display: inline-flex;
    }
}

/* Shorter still - a 768px laptop, or any window with devtools docked underneath. */
@media (max-height: 740px) {
    .c360-rcs-stripe {
        min-height: 1.5rem;
        padding: 1px 1.5rem;
    }

    .c360-rcs-body {
        padding: 0.5rem 0.875rem 0.625rem;
    }

    /* The footer is the one band that GROWS as the window narrows: it wraps, and
       .c360-rcf-acts takes a full row of its own under 720px wide. A short AND
       narrow window is where that costs most, so the gap comes down rather than
       the buttons being allowed to stack further. */
    .c360-rcf {
        padding: 0.4375rem 1rem;
        gap: 0.625rem;
    }
}

/* -----------------------------------------------------------------------------
   Shorter than the chrome can be compressed to. STOP FITTING, START SCROLLING.
   -----------------------------------------------------------------------------
   The two tiers above buy about 120px and then run out, and what happened past
   that point was not a tighter card - it was an empty one. Every level of the
   stack is height: 100% with min-height: 0, which together say "be exactly as
   tall as the viewport, and you may shrink to nothing". So the body's share went
   to zero, the shell clipped what would not fit, and the card showed nothing at
   all rather than showing less.

   min-height: 0 is right on a flex child that has to shrink - it is what makes
   the body's own overflow work. What was missing is a FLOOR. Below it the card
   stops pretending to fit and scrolls as a whole, which is the honest answer: a
   400px-tall window cannot show a header, a summary band, a grid and a footer at
   once, and squeezing them all to nothing serves nobody.

   The header and footer scroll away with everything else here, deliberately.
   Pinning them would spend the little height there is on the two bands that
   carry the least, and the reader came for the body. */
@media (max-height: 620px) {
    .c360-rcs-stripe {
        min-height: 1.375rem;
        padding: 0 1.5rem;
    }

    .c360-rcf {
        padding: 0.3125rem 0.875rem;
        gap: 0.5rem;
    }

    /* The card scrolls itself rather than being clipped by whatever contains it.
       max-height keeps it inside its parent; overflow-y gives the overflow
       somewhere to go. */
    .c360-rcs {
        max-height: 100%;
        overflow-y: auto;
    }

    /* And the body stops collapsing. flex-shrink: 0 with a floor means the body
       keeps its height and the card overflows instead - which is now safe,
       because the rule above made the card scroll.

       overflow stays auto on both axes: a grid too wide for a short window is
       exactly when a horizontal scrollbar is wanted, and clipping a column is
       the same failure as clipping a row. */
    .c360-rcs-body {
        flex: 1 0 auto;
        min-height: 9.375rem;
    }

    /* The stack's own scroller would catch the body's overflow first and pin the
       header and footer, which is the opposite of the call made above. */
    .c360-rcs-stack {
        overflow-y: visible;
    }
}

/* ============================================================================
   RECORD CARD FIELDS  (.c360-rcf-*)

   The control inside a Cim360FormField on a record card: a text box while amending, and the same
   value rendered as text while viewing. Two components already draw both - the customer card and
   its code picker - which is why they are HERE rather than in either one's .razor.css.

   That is not a style preference. Blazor rewrites a .razor.css per component, so a class defined
   in one component's scoped sheet and used in another renders with NO styling at all, and nothing
   reports it. The customer card was written against the stock item card's `.iw-field-input` and
   `.iw-field-static` and would have rendered as unstyled browser defaults - R-066 caught it before
   a browser did. Those classes stay where they are: they belong to Cim360ItemCard, which is the
   only component that uses them, and moving a working card's chrome is a change to that card.

   ---------------------------------------------------------------------------- */

/* 38px and 8px so a text box and a dropdown in the same row line up rather than nearly lining up -
   the same measurements the stock item card settled on. */
.c360-rcf-input {
    width: 100%;
    height: 2.375rem;
    padding: 0 0.75rem;
    box-sizing: border-box;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* A visible focus ring, because `outline: none` on its own removes the only indication a keyboard
   user has of where they are (WCAG 2.4.7). The ring is a border colour change AND a shadow, so it
   survives a high-contrast mode that drops shadows. */
.c360-rcf-input:focus-visible {
    outline: none;
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--cim360-primary) 18%, transparent);
}

/* Account numbers and postcodes are written in capitals. Display only - the VALUE is upper-cased
   server-side where it matters, so what is stored never depends on a stylesheet. */
.c360-rcf-input.is-upper {
    text-transform: uppercase;
}

/* The read-only rendering of the same field. Given the control's height so a row does not change
   shape between viewing and amending - a card that jumps as the mode flips reads as a reload. */
.c360-rcf-static {
    display: flex;
    align-items: center;
    min-height: 2.375rem;
    padding: 0 2px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A reference somebody reads out on the phone. Letter-spaced rather than monospaced, matching the
   item card: the face stays the product's, and the spacing is what separates the characters. */
.c360-rcf-static.is-code {
    letter-spacing: .02em;
}

/* An optional value with no override set. The span says so in WORDS - "Use the company default" -
   so the dimming is how the state is scanned rather than how it is understood (WCAG 1.4.1), and it
   is muted text on the pane's own ground, which is the pairing the theme guarantees at 4.5:1. */
.c360-rcf-static.is-unset {
    color: var(--cim360-text-muted);
    font-style: italic;
}

/* A card tab's own toolbar - Edit, Cancel and Save for what that tab alone changes, above the panels
   they change. The card's footer carries Edit and Save for the DOCUMENT. Moved here from the
   Addresses tab's scoped sheet when the Tax tab needed the same bar (DEV-496): one set of buttons for
   every tab that edits itself. */

.c360-ct-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.625rem;
}

.c360-ct-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.7813rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}

.c360-ct-btn:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.c360-ct-btn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-ct-btn.is-primary {
    background: var(--cim360-primary-surface);
    border-color: var(--cim360-primary);
    color: var(--cim360-card);
}

.c360-ct-btn.is-primary:hover:not(:disabled) {
    background: var(--cim360-primary-surface-hover);
    color: var(--cim360-card);
}

/* Recede it with a colour rather than by fading it. An opacity below about .7 takes 12.5px text
   under 4.5:1, and a disabled Save still has to be readable to explain itself through its title. */
.c360-ct-btn:disabled {
    background: var(--cim360-surface);
    border-color: var(--cim360-border);
    color: var(--cim360-text-muted);
    cursor: not-allowed;
}

/* The customs export note in the Tax tab editor sits above its field grid. DEV-496. */
.sce-note {
    margin-bottom: 0.625rem;
}

/* ---- Booking a delivery through a logistics connection (DEV-689): the delivery card's Book Delivery
        and Cancel booking, with the reason a button is off written beside it - a tooltip never shows on
        touch. Tokens only. */
.c360-dc-book {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.c360-dc-book-reason {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--cim360-caption);
}

.c360-dc-book > .c360-rcs-note {
    flex-basis: 100%;
}
