/* =============================================================================
   cim360-document-entry.css - the shared primitives a "new document" screen is
   built from.

   GLOBAL, not scoped, for the same reason cim360-card.css and
   css/lists/cim360-list.css are: these classes are used by the shell component
   AND by the markup the screen passes into its RenderFragments, and Blazor CSS
   isolation scopes a selector to the component that WROTE the markup. A field
   band drawn by SalesOrderNew inside Cim360DocumentEntryShell carries
   SalesOrderNew's scope, so a scoped sheet on the shell cannot reach it.

   Linked from Cim360.cloud.Web/Components/App.razor AND
   Cim360.cloud/wwwroot/index.html. Both, or it works on one host only.

   Written for the sales New-document screen and deliberately named for a
   document rather than for sales: purchasing's equivalent is the same eight
   components, and a second copy of this file is what these prefixes exist to
   prevent.

   Prefixes, and what owns each:

     c360-ddz-   the drop zone and its overlay
     c360-de-    the entry shell: stripe, rail, band, body, action bar, footer
     c360-ef-    GONE - see the form-controls note below
     c360-dlt-   GONE - the draft line table is .c360-ct now, see section 5
     c360-dlb-   the line action bar, its buttons and the totals
     c360-af-    the editable address form
     c360-sp-    the search picker
     c360-dip-   the document import panel
     c360-lw-    the line editor modal

   A NOTE ON --cim360-soft, WHICH IS NOT A SOFT NEUTRAL. It is #73e6e6 - a
   turquoise accent - and this file used it nine times as a pale-surface fallback
   on the assumption that the name meant one. That is where the turquoise on the
   line grid, the read-only fields, the rail and the footers came from. They are
   --cim360-surface-2 now. If you want a pale ground, that is the token, and
   --cim360-surface / -3 are the other two.

   THE FORM CONTROLS ARE NOT DEFINED HERE EITHER, and they used to be. This file
   carried .c360-de-in and .c360-ef-* - a 30px input and its own label - which was
   a second form system beside the 36px .c360-dlg-input every settings dialog
   uses. The screens now use .c360-dlg-grid, Cim360DialogField and
   .c360-dlg-input from css/forms/cim360-dialog.css, which is what the Add
   warehouse popup uses.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   1. The drop zone

   The overlay is always in the DOM and hidden with opacity + pointer-events, not
   display:none. Toggling display forces a layout on every dragenter, and on a
   window this size that is visible as a jump.
   -------------------------------------------------------------------------- */

.c360-ddz {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.c360-ddz-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
    background: color-mix(in srgb, var(--cim360-primary) 12%, transparent);
    backdrop-filter: blur(2px);
}

/* Added by Cim360DocumentDropZone.razor.js, never by .NET - see that file. */
.c360-ddz.is-dragover .c360-ddz-overlay {
    opacity: 1;
}

.c360-ddz-overlay-in {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 1.75rem 2.25rem;
    border: 2px dashed var(--cim360-primary);
    border-radius: 0.875rem;
    background: var(--cim360-card);
    box-shadow: 0 1.125rem 2.5rem rgba(15, 23, 42, .18);
    text-align: center;
}

.c360-ddz-overlay-in > i {
    font-size: 1.875rem;
    color: var(--cim360-primary);
}

.c360-ddz-t {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--cim360-text-strong, var(--cim360-text));
}

.c360-ddz-s {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    max-width: 34ch;
}


/* -----------------------------------------------------------------------------
   2. The shell
   -------------------------------------------------------------------------- */

/* A container, for section 11's narrow-window rules. `.c360-de-split` cannot query its own width,
   so the query has to sit on whatever holds it - and there are two such things, because the split
   is drawn both by this shell and by the line editors INSIDE a sales or purchase card. The second
   host is `.c360-ro-contents`, immediately below. Both carry the same container name so section 11
   is written once.

   Miss one and nothing reports it: an `@container` naming no ancestor container simply never
   matches, which looks exactly like a window that is wide enough. */
.c360-de {
    container-type: inline-size;
    container-name: c360de;

    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: var(--cim360-surface, var(--cim360-card));
}

/* The line editor's wrapper - Cim360ReadOnlyRegion's CssClass, which had no rule of its own until
   this. It is the `.c360-de-split` host inside a record card, where the split is a panel in a tab
   and is nowhere near the width of the browser. */
.c360-ro-contents {
    container-type: inline-size;
    container-name: c360de;

    min-width: 0;
}

/* ---- the stripe.

   Grey and fixed. A document being keyed has one state and it is "not created
   yet"; the card's stripe takes its colour from a real status this screen has
   none of, and borrowing one would imply the document exists. */

.c360-de-stripe {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 0 0 auto;
    padding: 0.4375rem 0.875rem;
    background: #64748b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.c360-de-stripe-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--cim360-card);
    flex: 0 0 auto;
}

.c360-de-stripe-label {
    letter-spacing: .02em;
}

/* ---- rail beside stack */

.c360-de-split {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
}

.c360-de-rail {
    flex: 0 0 11rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.625rem 0.5rem;
    border-right: 1px solid var(--cim360-border);
    background: var(--cim360-primary-zebra);
    overflow-y: auto;
}

.c360-de-railr {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: none;
    color: var(--cim360-text);
    font-size: 0.7813rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.c360-de-railr > i {
    font-size: 0.875rem;
    color: var(--cim360-text-muted);
    flex: 0 0 auto;
}

.c360-de-railr > span {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The open tab is already filled with the card colour. Tinting it on hover as well put the primary
   ink (#1d75bb) on the primary tint: 3.81:1 against the 4.5 the 7.7pt label needs (1.4.3). */
.c360-de-railr:hover:not(:disabled):not(.active) {
    background: var(--cim360-primary-tint);
}

.c360-de-railr.active {
    border-color: var(--cim360-primary-field-border, var(--cim360-border-strong));
    background: var(--cim360-card);
    color: var(--cim360-primary);
    font-weight: 800;
}

.c360-de-railr.active > i {
    color: var(--cim360-primary);
}

/* Disabled until the document is started. Kept legible rather than faded to
   nothing: it is a list of what the document WILL have, and the title on each
   says why it cannot be opened yet. */
.c360-de-railr:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.c360-de-railr-n {
    flex: 0 0 auto;
    min-width: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 62.4375rem;
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse, var(--cim360-card));
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
}

/* A tab with something required still empty behind it (DEV-480). The danger family's three tokens
   together, per the theming rules, so every theme reaches it. Compounded with .active so an
   attention tab that is also the open one keeps saying so. */
.c360-de-railr.needs-attention,
.c360-de-railr.needs-attention.active {
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
    box-shadow: inset 0.1875rem 0 0 var(--cim360-danger-border);
}

.c360-de-railr-att {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    margin-left: auto;
    padding: 0 0.375rem;
    border: 1px solid var(--cim360-danger-border);
    border-radius: 62.4375rem;
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
    font-size: 0.75rem;
    font-weight: 800;
}

/* The scroller of last resort. The band and the action bar never shrink, so once they alone are
   taller than the stack - a narrow window stacks the band's fields into three or four rows - the
   body had already gone to zero and the rest overflowed with nowhere to go: the line bar painted
   under the blue footer, outside the card, and stayed clickable there (R16). With the body's floor
   below, the stack scrolls instead; while everything fits there is nothing to scroll and nothing
   changes. */
.c360-de-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
}

/* ---- the pinned band.

   Never scrolls. The fields in it decide what the tabs below even mean, so
   scrolling them away is what the design's own "is-pinned" is for. The one
   exception is a window too short to hold it and the body's floor together,
   where .c360-de-stack scrolls it rather than letting the page overflow. */

.c360-de-band {
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--cim360-border);
    background: var(--cim360-card);
}

.c360-de-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11.875rem, 1fr));
    gap: 0.625rem 0.875rem;
}

/* Two columns exactly, for the Intrastat pair and the line editor. */
.c360-de-grid.is-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* The top padding is --c360-sticky-inset so a docked table header can pull itself up by it - see
   `.c360-ct thead th` in css/cards/cim360-card.css. Every override below sets both.

   A floor, not min-height: 0. At zero the body was the only thing that yielded, so a short window
   showed the band and no lines at all. 9.375rem is the record card's floor for the same reason
   (cim360-card.css, "STOP FITTING, START SCROLLING") - a header and a few rows. */
.c360-de-body {
    --c360-sticky-inset: 0.875rem;
    flex: 1 1 auto;
    min-height: 9.375rem;
    overflow: auto;
    padding: var(--c360-sticky-inset) 1rem;
}

/* Sticky so Add line and the totals stay in reach while the stack is scrolled, and above the
   body's docked table header (z-index 2) which would otherwise paint over it. Inert while the
   stack fits, because there is then nothing to stick against. */
.c360-de-actionbar {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid var(--cim360-border);
    background: var(--cim360-card);
}

/* The footer band is Cim360RecordCardFooter now - the same blue band the card uses -
   so .c360-de-foot and its two children are gone rather than left matching nothing.
   Its styling lives in css/cards/cim360-card.css as .c360-rcf-*.

   The stripe chip and stripe button rules went the same way: the type pill, the
   quotation expiry and the "read a document" affordance are all on the header band
   now, as .c360-rch-chip. */


/* -----------------------------------------------------------------------------
   3. Fields - NOT HERE. See the form-controls note at the top of this file.

   .c360-ef-* and .c360-de-in were a second form system: a 30px input with its own
   label, beside the 36px .c360-dlg-input and Cim360DialogField every settings
   dialog uses. Both screens are on the shared one now, so the only rule left in
   this section is the hidden file input - which is not a form control, it is a
   file dialog with no visible part.
   -------------------------------------------------------------------------- */

.c360-de-hiddenfile {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}


/* -----------------------------------------------------------------------------
   4. Notes, panels, the start gate
   -------------------------------------------------------------------------- */

.c360-de-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--cim360-info-border);
    border-radius: 0.5rem;
    background: var(--cim360-info-bg);
    color: var(--cim360-info-fg);
    font-size: 0.75rem;
    line-height: 1.45;
}

.c360-de-note > i {
    flex: 0 0 auto;
    margin-top: 1px;
}

.c360-de-note.warn {
    border-color: var(--cim360-warning-border);
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
}

.c360-de-note.bad {
    border-color: var(--cim360-danger-border);
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
}

.c360-de-panel {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ─── Files chosen before the document exists ───
   The New screen holds attachments in memory until Create, so this list is of things that have NOT
   been uploaded. It is deliberately plainer than the card's attachment list: there is no download,
   no archive and no type, because none of those exist yet - only a name, a size and a way to take
   it back off. */

.c360-de-filelist {
    list-style: none;
    margin: 0.375rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.c360-de-fileitem {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    font-size: 0.8125rem;
}

.c360-de-fileitem i {
    color: var(--cim360-text-muted);
}

/* The name takes the room and truncates; the size never does, because a truncated size is a
   different number. */
.c360-de-fileitem .nm {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cim360-text);
}

.c360-de-fileitem .sz {
    flex: 0 0 auto;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
}

/* The file's type, between its name and its size. DEV-750. */
.c360-de-fileitem .ty {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
}

.c360-de-fileremove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    padding: 0;
    border: 0;
    border-radius: 0.3125rem;
    background: transparent;
    color: var(--cim360-text-muted);
    cursor: pointer;
}

.c360-de-fileremove:hover {
    background: color-mix(in srgb, var(--cim360-danger) 12%, transparent);
    color: var(--cim360-danger);
}

.c360-de-fileremove:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
}

.c360-de-subhead {
    margin: 1rem 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-primary);
}

.c360-de-subhead:first-child {
    margin-top: 0;
}

.c360-de-empty {
    padding: 0.875rem;
    border: 1px dashed var(--cim360-border);
    border-radius: 0.5rem;
    color: var(--cim360-text-muted);
    font-size: 0.7813rem;
    text-align: center;
}

.c360-de-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-de-kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0;
    font-size: 0.7813rem;
}

.c360-de-kv dt {
    color: var(--cim360-text-muted);
}

.c360-de-kv dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.c360-de-chk,
.c360-af-chk,
.c360-dip-chk {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.7813rem;
    cursor: pointer;
}

.c360-de-chk input,
.c360-af-chk input,
.c360-dip-chk input {
    margin-top: 2px;
    flex: 0 0 auto;
}

.c360-de-addr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19.375rem, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
}

/* ---- the party segment.

   Both halves are disabled today: an existing customer is the only thing a
   quotation can be raised against, because Customer models no prospect. The
   segment is still rendered, and the prospect side carries the reason - a
   missing control is a feature nobody knows was considered. */

.c360-de-seg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr));
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.c360-de-seg > button {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    background: var(--cim360-card);
    text-align: left;
    cursor: not-allowed;
}

.c360-de-seg > button > i {
    font-size: 1rem;
    color: var(--cim360-text-muted);
    flex: 0 0 auto;
    margin-top: 1px;
}

.c360-de-seg > button.on {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-tint);
}

.c360-de-seg > button.on > i {
    color: var(--cim360-primary);
}

.c360-de-seg > button:disabled:not(.on) {
    opacity: .58;
}

.c360-de-seg .t {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.c360-de-seg .t b {
    font-size: 0.7813rem;
}

.c360-de-seg .t em {
    font-style: normal;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--cim360-text-muted);
}

/* ---- the start gate */

.c360-de-gate {
    display: grid;
    justify-items: center;
    gap: 0.625rem;
    max-width: 52ch;
    margin: 1.625rem auto;
    padding: 1.5rem;
    border: 1px dashed var(--cim360-border);
    border-radius: 0.75rem;
    background: var(--cim360-card);
    text-align: center;
}

.c360-de-gate > i {
    font-size: 1.625rem;
    color: var(--cim360-primary);
}

.c360-de-gate strong {
    font-size: 0.9063rem;
}

.c360-de-gate p {
    margin: 0;
    font-size: 0.7813rem;
    line-height: 1.5;
    color: var(--cim360-text-muted);
}

.c360-de-gate-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.c360-de-gate-steps li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
}

.c360-de-gate-steps li.is-done {
    border-color: var(--cim360-success-border);
    background: var(--cim360-success-bg);
    color: var(--cim360-success-fg);
}

/* ---- loading */

.c360-de-state {
    display: grid;
    justify-items: center;
    gap: 0.625rem;
    padding: 2.5rem 1rem;
    color: var(--cim360-text-muted);
    font-size: 0.7813rem;
}

.c360-de-spinner,
.c360-sp-spin {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--cim360-border);
    border-top-color: var(--cim360-primary);
    border-radius: 50%;
    animation: c360-de-spin .7s linear infinite;
}

.c360-sp-spin {
    width: 0.8125rem;
    height: 0.8125rem;
    border-width: 2px;
    display: inline-block;
    vertical-align: -2px;
}

@keyframes c360-de-spin {
    to { transform: rotate(360deg); }
}

/* Somebody who has asked for less motion still needs to know it is working, so
   the spinner becomes a pulse rather than disappearing. */
@media (prefers-reduced-motion: reduce) {
    .c360-de-spinner,
    .c360-sp-spin,
    .c360-dip-spin {
        animation: none;
        opacity: .6;
    }
}

/* -----------------------------------------------------------------------------
   5. The draft line table - NOT HERE ANY MORE.

   It was .c360-dlt-*: a second table with its own header colour, its own zebra
   and its own selection ring, sitting in the same product as the card's .c360-ct.
   That is why the New document screen's line grid looked nothing like the card's,
   and why its selected row had a box around every cell while the card's had a bar
   down the left.

   Cim360DocumentLineTable now renders .c360-ct, so it gets the design's solid
   primary header, its zebra and its selection for free. The four column widths
   and the three draft-only states - a discount line reading down, an incomplete
   line, and the marker on a line a reader suggested - live beside .c360-ct in
   css/cards/cim360-card.css, because that is where the table they modify is.
   -------------------------------------------------------------------------- */


/* -----------------------------------------------------------------------------
   6. The line action bar and the totals
   -------------------------------------------------------------------------- */

.c360-dlb {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.875rem;
}

.c360-dlb-acts {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.c360-dlb-btn {
}


.c360-dlb-btn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
}

.c360-dlb-btn.is-primary {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse, var(--cim360-card));
}

.c360-dlb-btn.is-primary:hover:not(:disabled) {
    background: var(--cim360-primary-surface-hover);
    color: var(--cim360-text-inverse, var(--cim360-card));
}

/* Disabled rather than hidden, so the set does not reflow as rows are picked -
   and every one carries its reason in a title. */
.c360-dlb-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.c360-dlb-totals {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-left: auto;
}

.c360-dlb-t {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0.1875rem 0.6875rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card);
    text-align: right;
    cursor: default;
}

.c360-dlb-t em {
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
}

.c360-dlb-t b {
    font-size: 0.8438rem;
    font-variant-numeric: tabular-nums;
}

.c360-dlb-t.is-grand {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-tint);
}

.c360-dlb-t.is-grand b {
    color: var(--cim360-primary);
}

/* Tax, which is not calculated. Dashed, so it reads as "no figure here" rather
   than as a figure of zero - see DocumentEntryTotals' remarks. */
.c360-dlb-t.is-unknown {
    border-style: dashed;
}

.c360-dlb-t.is-unknown b {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
}

/* ---- the breakdown, on hover and on keyboard focus.

   :focus-within as well as :hover, or the panel is unreachable without a
   pointer. */

.c360-dlb-pop {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.375rem);
    z-index: 20;
    display: none;
    min-width: 16.25rem;
    padding: 0.5rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5625rem;
    background: var(--cim360-card);
    box-shadow: 0 0.75rem 1.875rem rgba(15, 23, 42, .16);
    text-align: left;
}

.c360-dlb-t:hover .c360-dlb-pop,
.c360-dlb-t:focus-within .c360-dlb-pop {
    display: block;
}

.c360-dlb-pop-h,
.c360-dlb-pop-r {
    display: grid;
    grid-template-columns: 1fr 2.875rem 5.75rem;
    gap: 0.375rem;
    padding: 0.1875rem 0.25rem;
    font-size: 0.75rem;
}

.c360-dlb-pop-h {
    border-bottom: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-caption);
}

.c360-dlb-pop-h span:not(:first-child),
.c360-dlb-pop-r span:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.c360-dlb-pop-r.is-none {
    color: var(--cim360-text-muted);
    font-style: italic;
}


/* -----------------------------------------------------------------------------
   7. The address form
   -------------------------------------------------------------------------- */

.c360-af {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.6875rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    background: var(--cim360-card);
}

.c360-af.is-readonly {
    background: var(--cim360-surface-2);
}

.c360-af-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.4375rem;
    font-size: 0.7813rem;
    font-weight: 800;
    color: var(--cim360-primary);
}

/* The note WRAPS, never clips. It is an instruction - "add the contact name here" - and it was cut
   to one line about 26 characters wide, leaving the sentence readable only as a hover tooltip that
   keyboard and touch users cannot reach (WCAG 2.2 3.3.2). It sits at the right of the heading while
   it fits, and drops beneath the title onto its own line when it does not. DEV-869. */
.c360-af-note {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-left: auto;
    min-width: 0;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
    white-space: normal;
    overflow-wrap: anywhere;
}

/* After the note, the box's buttons sit beside it rather than both claiming the right edge. DEV-495. */
.c360-af-note + .c360-addr-acts { margin-left: 0.5rem; }

.c360-af-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.375rem, 1fr));
    gap: 0.5rem 0.625rem;
}

.c360-af-f {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    min-width: 0;
}

.c360-af-f.is-wide {
    grid-column: 1 / -1;
}

.c360-af-fl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-text-muted);
}

.c360-af-in {
    width: 100%;
    min-width: 0;
    height: 1.75rem;
    padding: 0 0.5rem;
    border: 1px solid var(--cim360-border-strong, var(--cim360-border));
    border-radius: 0.375rem;
    background: var(--cim360-primary-field-bg, var(--cim360-card));
    color: var(--cim360-text);
    font-size: 0.75rem;
    font-family: inherit;
}

.c360-af-in:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: -1px;
}

.c360-af-ro {
    display: flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0 2px;
    font-size: 0.75rem;
    color: var(--cim360-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-af-flags {
    display: flex;
    gap: 0.375rem;
}


/* -----------------------------------------------------------------------------
   8. The search picker
   -------------------------------------------------------------------------- */

.c360-sp {
    position: relative;
}

/* THE PRODUCT'S DIALOG CONTROL SIZE - 36px, 6px radius, 13px - not a size of its own.

   This button was 30px / 7px / 12.5px, which made it a SIXTH control size in a product that
   had settled on two: 38/8/13.5 tinted on a page form, and 36/6/13 on white in a dialog. Both
   of those are written down, in cim360-form-grid.css and cim360-dialog.css respectively, and
   the second of those files opens by naming the exact mistake this was - "it was a fifth
   control size (32px, 5px radius, 12.5px) in a product that had already settled on 36/6/13".

   It showed wherever a picker stood beside anything else: on a sales line the Line no box is a
   .c360-dlg-input at 36px and the Item lookup beside it was six pixels shorter, and the same
   gap appeared on every nominal and tax code field in the product, because both of those are
   this component in a thin wrapper. Reported 2026-09-18.

   The page-form size is applied where it belongs, by cim360-form-grid.css, which already lists
   every other control that has to grow to 38px on a settings page. A picker therefore matches
   its neighbours in both contexts rather than matching neither.

   Padding is 12px at the text end so the label lines up with a text input's first character,
   and 10px at the chevron end, which already carries its own gap. */
.c360-sp-btn {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    width: 100%;
    height: 2.25rem;
    padding: 0 0.625rem 0 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-size: 0.8125rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.c360-sp-btn > span:first-of-type {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-sp-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.c360-sp-btn.is-open {
    border-color: var(--cim360-primary);
}

.c360-sp-btn:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: -1px;
}

.c360-sp-ph {
    color: var(--cim360-text-muted);
}

/* Shrinkable and truncated, like the label: a long secondary ("Accruals (Goods Received Not
   Invoiced)") otherwise keeps its full width and runs over the chevron and out of the button. The
   label shrinks last because its basis is shorter, so the code stays readable and the name gives. */
.c360-sp-sec {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-sp-pop {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    min-width: 16.25rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5625rem;
    background: var(--cim360-card);
    box-shadow: 0 0.875rem 2.125rem rgba(15, 23, 42, .18);
    overflow: hidden;
}


/* Positioned from JS, in viewport coordinates - resources/js/cim360-anchor.js.

   FIXED, not absolute, and that is the whole point: an absolutely-positioned panel is
   clipped by every scrolling ancestor, and on the line editor the nearest one is the tab
   body - a band about 180px tall. The tax code picker in the Financial tab dropped its
   list straight off the bottom of the screen.

   top/left/width/max-height are all written by the script. The values here are what a
   browser that could not load it falls back to: auto puts the panel at its static
   position, under the button, which is exactly where it used to be. */
.c360-sp-pop.is-anchored {
    position: fixed;
    top: auto;
    left: auto;
    right: auto;

    /* The panel is given a height budget rather than a fixed height, so it fills what is
       available and the list inside it takes the scroll. Without the flex column the list's
       own 260px would overrun the budget and be cut off by the rounded-corner clip. */
    display: flex;
    flex-direction: column;
}

.c360-sp-pop.is-anchored .c360-sp-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* Neither of these may shrink, or a short budget eats the search box before the list. */
.c360-sp-pop.is-anchored .c360-sp-search,
.c360-sp-pop.is-anchored .c360-sp-pager {
    flex: 0 0 auto;
}

.c360-sp-search {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.4375rem 0.5625rem;
    border-bottom: 1px solid var(--cim360-border);
}

.c360-sp-search > i {
    color: var(--cim360-text-muted);
}

.c360-sp-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: none;
    color: var(--cim360-text);
    font-size: 0.7813rem;
    font-family: inherit;
}

.c360-sp-search input:focus {
    outline: none;
}

.c360-sp-list {
    max-height: 16.25rem;
    overflow-y: auto;
}

.c360-sp-opt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.375rem 0.625rem;
    border: none;
    background: none;
    color: var(--cim360-text);
    font-size: 0.7813rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.c360-sp-opt:hover {
    background: var(--cim360-primary-tint);
}

/* The option the arrow keys are on. An outline as well as the tint, so it is not carried by colour alone
   (WCAG 1.4.1) and still shows where the tint is the same as a chosen option's. */
.c360-sp-opt.is-active {
    background: var(--cim360-primary-tint);
    outline: 2px solid var(--cim360-primary);
    outline-offset: -2px;
}

.c360-sp-opt.is-sel {
    background: var(--cim360-primary-soft, var(--cim360-primary-tint));
    font-weight: 700;
}

.c360-sp-opt-l {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-sp-opt-s {
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-sp-state {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0.625rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* A search that FAILED, said as a failure. A picker that shows "no matches"
   because the call threw is indistinguishable from a company with no
   customers - DEV-297. */
.c360-sp-state.is-bad {
    color: var(--cim360-danger-fg);
    background: var(--cim360-danger-bg);
}

.c360-sp-state-detail {
    margin-top: 2px;
    font-size: 0.75rem;
    opacity: .85;
}

/* The pager. It replaced a "showing 25 of 312" note that was honest about the list
   being truncated and left the other 287 unreachable - which is worst exactly where
   somebody is browsing because they do not know the code. */
.c360-sp-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding: 0.375rem 0.5rem;
    border-top: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);
}

.c360-sp-pgbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.625rem;
    height: 1.625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    cursor: pointer;
    font-size: 0.75rem;
}

.c360-sp-pgbtn:hover:not([aria-disabled="true"]) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

/* Unavailable at the ends rather than hidden, so the pager keeps its shape and the
   range text does not shift sideways between pages. aria-disabled, not disabled: a
   disabled arrow loses focus and the picker closes - see Cim360SearchPicker.razor. */
.c360-sp-pgbtn[aria-disabled="true"] {
    opacity: .4;
    cursor: not-allowed;
}

.c360-sp-pgcount {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* -----------------------------------------------------------------------------
   9. The document import panel
   -------------------------------------------------------------------------- */

/* absolute + percentages, for the reason set out at .c360-lw-scrim: this panel also
   opens from inside a layout window, so `fixed` already meant "the window" - and the
   `92vh` it used to carry measured the VIEWPORT, which is 160px taller than the box
   the panel is actually in. It had not been seen yet only because 720px usually won
   the min(); on a short screen it would have been clipped the same way. */
.c360-dip-scrim {
    position: absolute;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, .48);
}

/* The panel is its own container. Its width is `min(560px, 100%)`, or 1080px reviewing - a number
   this file already knows and the viewport does not - so anything laid out inside it has to ask
   the panel. See the review grid below. */
.c360-dip {
    /* Positioned so it stacks above .c360-dlg-backdrop, which is absolutely placed behind it. */
    position: relative;
    z-index: 1;

    container-type: inline-size;
    container-name: c360dip;

    display: flex;
    flex-direction: column;
    width: min(35rem, 100%);
    max-height: min(45rem, 100%);
    border-radius: 0.875rem;
    background: var(--cim360-card);
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .3);
    overflow: hidden;
}

/* The review state needs two panels side by side, which 560px cannot hold. */
.c360-dip.is-wide {
    width: min(67.5rem, 100%);
}

.c360-dip-h {
    display: flex;
    align-items: center;
    gap: 0.6875rem;
    flex: 0 0 auto;
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--cim360-border);
}

.c360-dip-h-ic {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5625rem;
    background: var(--cim360-primary-tint);
    color: var(--cim360-primary);
    font-size: 1rem;
    flex: 0 0 auto;
}

.c360-dip-h-t {
    min-width: 0;
    flex: 1 1 auto;
}

.c360-dip-h-k {
    font-size: 0.8438rem;
    font-weight: 800;
}

.c360-dip-h-f {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-dip-h-sz {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.c360-dip-x {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.4375rem;
    background: var(--cim360-card);
    color: var(--cim360-text-muted);
    cursor: pointer;
}

.c360-dip-x:hover {
    color: var(--cim360-text);
    border-color: var(--cim360-border);
}

.c360-dip-b {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 1rem;
}

/* ---- reading */

.c360-dip-wait {
    display: grid;
    justify-items: center;
    gap: 0.625rem;
    text-align: center;
}

.c360-dip-spin {
    display: grid;
    place-items: center;
    width: 2.875rem;
    height: 2.875rem;
    border-radius: 50%;
    background: var(--cim360-primary-tint);
    color: var(--cim360-primary);
    font-size: 1.25rem;
    animation: c360-dip-pulse 1.4s ease-in-out infinite;
}

@keyframes c360-dip-pulse {
    50% { transform: scale(1.08); opacity: .75; }
}

.c360-dip-wait-t {
    font-size: 0.875rem;
    font-weight: 800;
}

.c360-dip-wait-s {
    max-width: 44ch;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--cim360-text-muted);
}

/* Indeterminate, not a percentage. A reader that has not answered cannot say how
   far through it is, and a bar that crawls to 90% and waits is a lie. */
.c360-dip-prog {
    width: min(18.75rem, 100%);
    height: 0.3125rem;
    border-radius: 62.4375rem;
    background: var(--cim360-border);
    overflow: hidden;
}

.c360-dip-prog > i {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: 62.4375rem;
    background: var(--cim360-primary-surface);
    animation: c360-dip-slide 1.2s ease-in-out infinite;
}

@keyframes c360-dip-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

@media (prefers-reduced-motion: reduce) {
    .c360-dip-prog > i {
        animation: none;
        width: 100%;
        opacity: .5;
    }
}

/* ---- failure */

.c360-dip-err {
    display: grid;
    justify-items: center;
    gap: 0.625rem;
    text-align: center;
}

.c360-dip-err-ic {
    display: grid;
    place-items: center;
    width: 2.875rem;
    height: 2.875rem;
    border-radius: 50%;
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
    font-size: 1.25rem;
}

/* "Not switched on" is not the same news as "your file is broken". An
   information icon, not a triangle - a triangle sends somebody looking for a
   problem with their document. */
.c360-dip-err-ic.is-info {
    background: var(--cim360-info-bg);
    color: var(--cim360-info-fg);
}

.c360-dip-err-t {
    font-size: 0.9063rem;
    font-weight: 800;
}

.c360-dip-err-b {
    max-width: 52ch;
    font-size: 0.7813rem;
    line-height: 1.55;
    color: var(--cim360-text-muted);
}

.c360-dip-err-a {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* ---- review */

.c360-dip-sum {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 1px;
    flex: 0 0 auto;
    background: var(--cim360-border);
}

.c360-dip-s {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 0.5625rem 0.375rem;
    background: var(--cim360-surface-2);
}

.c360-dip-s .n {
    font-size: 1.125rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.c360-dip-s .k {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--cim360-text-muted);
    text-align: center;
}

.c360-dip-s.is-warn {
    background: var(--cim360-warning-bg);
}

.c360-dip-s.is-warn .n,
.c360-dip-s.is-warn .k {
    color: var(--cim360-warning-fg);
}

.c360-dip-rev {
    display: grid;
    grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

/* The panel, not the viewport. Reviewing, the panel is 1080px at most and 560px otherwise, so on
   any browser narrower than 900px this collapsed a grid that was already only 560px wide - and on
   a wide browser with a 560px panel it never collapsed at all. Both wrong, in opposite
   directions, from one rule. */
@container c360dip (max-width: 900px) {
    .c360-dip-rev {
        grid-template-columns: minmax(0, 1fr);
    }
}

.c360-dip-p {
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    overflow: hidden;
}

.c360-dip-p-h {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.5rem 0.6875rem;
    border-bottom: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--cim360-primary);
}

.c360-dip-p-h .r {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
}

.c360-dip-p-b {
    padding: 0.625rem 0.6875rem;
}

.c360-dip-f {
    display: grid;
    grid-template-columns: 6.625rem minmax(0, 1fr);
    gap: 0.375rem 0.625rem;
    padding: 0.3125rem 0;
    border-bottom: 1px solid var(--cim360-border-soft, var(--cim360-border));
    font-size: 0.75rem;
}

.c360-dip-f:last-of-type {
    border-bottom: none;
}

.c360-dip-f .l {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-text-muted);
    padding-top: 2px;
}

.c360-dip-f .v {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    flex-wrap: wrap;
    min-width: 0;
}

.c360-dip-f .v.is-col {
    flex-direction: column;
    align-items: stretch;
}

.c360-dip-f .nm {
    font-weight: 700;
}

.c360-dip-f .ac,
.c360-dip-f .code {
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-dip-flag {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--cim360-warning-border);
    border-radius: 0.4375rem;
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
    font-size: 0.75rem;
    line-height: 1.4;
}

.c360-dip-note {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--cim360-text-muted);
}

.c360-dip-conf {
    flex: 0 0 auto;
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.c360-dip-conf.is-high {
    background: var(--cim360-success-bg);
    color: var(--cim360-success-fg);
}

.c360-dip-conf.is-med {
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
}

.c360-dip-conf.is-low {
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
}

.c360-dip-t {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
}

.c360-dip-t thead th {
    padding: 0.3125rem 0.4375rem;
    border-bottom: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
    text-align: left;
    white-space: nowrap;
}

.c360-dip-t tbody td {
    padding: 0.3125rem 0.4375rem;
    border-bottom: 1px solid var(--cim360-border-soft, var(--cim360-border));
    vertical-align: top;
}

.c360-dip-t-chk { width: 1.875rem; }
.c360-dip-t-item { width: 11.875rem; }
.c360-dip-t-conf { width: 4.875rem; }

.c360-dip-t-n {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* What the document said, beside what it resolved to. Without it a clerk is
   approving a resolution they cannot check. */
.c360-dip-t-raw {
    max-width: 32ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cim360-text-muted);
}

/* The matched item code, in the preview table. The grid's own typeface with tabular figures -
   the monospace face that was here made the column read as a different table from its row. The
   summary fields above the table (.c360-dip-f .code) are not grid cells and keep theirs. */
.c360-dip-t-item .code {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.c360-dip-t-nomatch {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--cim360-danger-fg);
}

.c360-dip-t tr.is-off {
    opacity: .45;
}

.c360-dip-t tr.is-unmatched .c360-dip-t-raw {
    color: var(--cim360-text);
}

.c360-dip-t .uom {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-dip-var {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-warning-fg);
}

.c360-dip-chk {
    margin-top: 0.625rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-surface-2);
    font-size: 0.75rem;
    line-height: 1.45;
}

.c360-dip-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding: 0.625rem 0.875rem;
    border-top: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);
}

.c360-dip-foot-l {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--cim360-text-muted);
}

.c360-dip-foot-l .warn,
.c360-dip-foot-l .is-warn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--cim360-warning-fg);
    font-weight: 700;
}


/* -----------------------------------------------------------------------------
   10. The line editor modal
   -------------------------------------------------------------------------- */

/* ---- ABSOLUTE, and measured against the window, not the viewport -----------
 *
 * This editor is opened from inside a layout window, and `.cim-window` carries
 * `transform: translateY(12px)` with `animation: ... forwards` - so the transform
 * PERSISTS, and a transformed element is the containing block for every
 * `position: fixed` descendant. `fixed` here never meant "the viewport"; it meant
 * "the order window", silently, and had done all along.
 *
 * On its own that was survivable, because the card used to be smaller than the
 * window. What broke it was sizing: `100vw` and `vh` still measure the VIEWPORT
 * even inside a transformed ancestor, so the card was laid out ~1440x760 inside a
 * box the size of the window - viewport less 160px - and `.cim-window`'s
 * `overflow: hidden` then cut the blue header off the top and the blue footer off
 * the bottom, leaving the body looking stuck inside the order window.
 *
 * Both halves of the fix are deliberate: `absolute`, which says out loud what was
 * already happening, and percentages, which measure the box it is actually in. The
 * card centres on the window and can never exceed it - and on a wide screen it
 * comes out LARGER than the design's 1480px, because the window is itself the
 * viewport less 160px.
 *
 * If this ever has to cover the whole application rather than one window, it must
 * be RENDERED outside `.cim-window`: no positioning value escapes a transformed
 * ancestor. R-031 checks the pairing that broke it.
 * -------------------------------------------------------------------------- */

.c360-lw-scrim {
    position: absolute;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, .42);
}

.c360-lw {
    position: absolute;
    z-index: 1101;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;

    /* Wide, because the rail takes 176px and the tiling puts two panel columns on the
       rest, each holding two fields across. The design's tiled layout is 1480 wide -
       .sop-lw.is-alt - and its own comment says the fixed height had to go because
       line types differ too much in depth. Same here: the height is a floor and a
       ceiling, and .c360-lw-body scrolls between them.

       Percentages of the WINDOW, per the note above. The min-height is capped by the
       same expression as the max, so on a short screen it asks for less than the
       window has rather than overflowing it and losing the chrome again. */
    width: min(90rem, calc(100% - 1.5rem));
    min-height: min(47.5rem, calc(100% - 1.5rem));
    max-height: calc(100% - 1.5rem);
    border-radius: 0.875rem;
    background: var(--cim360-card);
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .3);
    overflow: hidden;
}

/* ---- the header ---------------------------------------------------------- */

/* No padding-right reservation any more: the close button is a flex item at the end
   of the head row rather than an absolutely positioned overlay, so the row makes room
   for it by itself. */
.c360-lw-h {
    flex: 0 0 auto;
    padding: 0.8125rem 1rem 0.875rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
}

.c360-lw-hrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

/* The shared dialog close button is drawn for .c360-dlg-head, which centres its own
   children. Here it sits in a row whose other items are two lines tall, so it needs
   pinning to the top rather than floating at the vertical centre. */
.c360-lw-hrow > .c360-dlg-head-close {
    align-self: flex-start;
    margin-left: auto;
}

/* The icon tile, carrying the line type's glyph. A translucent dark tint rather than a
   colour of its own: the glyph is what identifies the type, and a per-type hue on
   the header would be a second encoding of the same fact. */
.c360-lw-hic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6875rem;
    background: rgba(0, 0, 0, .135);
    font-size: 1.1875rem;
    color: var(--cim360-headerband-fg);
}

/* Takes the width the icon tile and the close button leave, so the top line (the shared path) spans it and its
   flag sits at the right-hand end, as on a card. Without it the column shrank to its text and the flag hung off
   the end of the words. */
.c360-lw-hmain {
    flex: 1 1 auto;
    min-width: 0;
}

/* The window's top line - "Sales quotation line · Line 3" and its Viewing / Adding / Amending flag - has no
   rule here. It is the shared path (Cim360CardPath), styled in cim360-card.css with every card's, and its flag
   is the shared flag. */

.c360-lw-title {
    display: flex;
    align-items: baseline;
    gap: 0.4375rem;
    margin-top: 0.1875rem;
    min-width: 0;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
}

.c360-lw-title .code {
    color: var(--cim360-headerband-fg);
    white-space: nowrap;
}

/* The description is secondary to the code and can be long, so it takes the
   remaining width and truncates rather than pushing the close button. */
.c360-lw-titledesc {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    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. */
}

/* ---- the rail's two additions -------------------------------------------- */

/* The rail's own heading. The shell's rail needs none - its buttons are tabs and
   a tab strip explains itself - but this one is a field, and a column of six
   buttons with no label does not say it is choosing the line type. */
.c360-de-raillbl {
    padding: 2px 0.625rem 0.4375rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-caption);
}

/* ---- the body ------------------------------------------------------------ */

.c360-lw-body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    --c360-sticky-inset: 1rem;
    padding: var(--c360-sticky-inset) 1rem;
}

/* A tiled body has its own ground behind the panels, and the panels carry the
   padding - so the body only supplies the gutter. */
.c360-lw-body.is-tiled {
    --c360-sticky-inset: 0.75rem;
    padding: var(--c360-sticky-inset) 0.875rem;
    background: var(--cim360-surface-2);
}


/* -----------------------------------------------------------------------------
   10a. Tiled line panels

   c360-lp- = line panel. The design's .sla- set, which draws a stock line as five
   titled panels in two columns rather than a list of fields.

   Shared, not sales-only: purchasing's line editor tiles the same panels, and the
   other four sales line types reuse the tiling with different content in it.
   -------------------------------------------------------------------------- */

.c360-lp-tile {
    display: flex;
    gap: 0.625rem;
    align-items: stretch;
}

.c360-lp-col {
    flex: 1 1 0;
    min-width: 0;

    /* min-content, not zero. A column whose min-height is zero lets its panels
       compress below their own content and cut the last field off - the same trap
       the panel's no-clip rule addresses from the other end. */
    min-height: min-content;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* The group box, matching Cim360FormSection - which is what a group box looks like in this
   product: a solid brand-blue band, the caption and its icon in white, and a bordered body
   under it carrying no top border of its own.

   THE NUMBERS COME FROM Cim360FormSection.razor.css and are mirrored here rather than
   reused, because that is a SCOPED stylesheet: a .razor.css is rewritten with its own
   component's attribute and cannot reach markup Cim360LinePanel writes. Its body is also a
   twelve-column grid, which is right for a settings form and wrong for these bands. If that
   sheet ever moves to a global one, the two should converge on it.

   White on --cim360-primary is 4.9:1, which clears AA for the caption at this size - and is
   the pairing every settings page already ships. */
.c360-lp {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 0.3125rem;
    background: var(--cim360-card);
}

/* One panel per column takes the leftover height, or the column stops short of the card's
   bottom edge and the tiling reads as unfinished. */
.c360-lp.is-fill {
    flex: 1 1 auto;
}

.c360-lp-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0 .75rem 0 1rem;
    border-radius: 0.3125rem 0.3125rem 0 0;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
}

.c360-lp-h-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-size: .875rem;
    font-weight: 600;
    color: var(--cim360-headerband-fg);
}

/* The icon is part of the caption rather than a second thing beside it, so it takes the
   caption's colour and sits one size above its text. */
.c360-lp-h-title > i {
    flex: 0 0 auto;
    font-size: 0.9375rem;
    color: var(--cim360-headerband-fg);
}

/* The note on the right - a category, a count, where a value came from. Held back from the
   caption without dropping out of contrast: .82 white on this blue is still above 4.5:1. */
.c360-lp-h .r {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 500;
    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. */
}

.c360-lp-b {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--cim360-border);
    border-top: none;
    border-radius: 0 0 0.3125rem 0.3125rem;
    background: var(--cim360-card);
}

/* Row grids inside a panel. align-items: end so a field with a hint under it keeps
   its control aligned with the one beside it instead of riding up. */
.c360-lp-row {
    display: grid;
    gap: 0.5rem;
    align-items: end;
}

.c360-lp-row.is-two {
    grid-template-columns: 1fr 1fr;
}

/* The rate is a fixed narrow box - it holds at most "20" and a percent sign, and
   half the panel's width for two characters reads as a mistake. */
.c360-lp-row.is-tax {
    grid-template-columns: 1fr 6rem;
}

/* ---- the denser field, for a panel rather than a dialog ------------------ */

/* The dialog label is 11px uppercase with wide tracking, which is right for a
   settings dialog with eight fields and too loud for a panel with twenty. Same
   component, same 36px .c360-dlg-input - only the label changes. */
.c360-dlg-field.is-dense > label {
    font-size: 0.7813rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cim360-caption, var(--cim360-text-muted));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 0.375rem;
}

/* A field that should take the leftover height in its panel - the price-break
   table, so the totals under it sit on the panel's bottom edge. */
.c360-dlg-field.is-grow {
    flex: 1 1 auto;
    min-height: 0;
}

.c360-dlg-field.is-grow > .c360-lp-brk {
    flex: 1 1 auto;
}

/* Where a value came from, on the label. It answers "why can I not type here"
   before somebody clicks the box to find out. */
.c360-dlg-src {
    padding: 1px 0.375rem;
    border-radius: 0.25rem;
    background: var(--cim360-primary-tint);
    font-size: 0.75rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

/* A code reads as a code - the item, the line number, the tax code. Same
   treatment the line table and the card header give one. */
.c360-dlg-input.is-code {
    font-family: inherit;
    font-weight: 700;
}

textarea.c360-dlg-input.is-area {
    height: auto;
    min-height: 3.5rem;
    padding: 0.5rem 0.6875rem;
    line-height: 1.45;
    resize: vertical;
}

/* A free-text or comment line IS its text, so the box takes the panel. Paired with
   the field's is-grow, which gives it the leftover height in the column. */
textarea.c360-dlg-input.is-area.is-tall {
    flex: 1 1 auto;
    min-height: 10rem;
}

/* The single-column tiling, for a comment line - one panel, full width, because
   there is nothing else on the line to put beside it. */
.c360-lp-col.is-full {
    flex: 1 1 100%;
}

.c360-dlg-input.is-bad {
    border-color: var(--cim360-danger);
    box-shadow: 0 0 0 0.1875rem rgba(192, 57, 43, .1);
}

/* ---- the item panel's top row -------------------------------------------- */

.c360-lp-itemtop {
    display: flex;
    gap: 0.625rem;
    align-items: stretch;
}

.c360-lp-itemmain {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Fixed size whether or not the item has a picture, so the fields beside it do not
   reflow as items are picked. */
.c360-lp-thumb {
    flex: 0 0 6.25rem;
    align-self: flex-end;
    height: 6.25rem;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--cim360-border);
    border-radius: 0.4375rem;
    background: repeating-linear-gradient(135deg,
        var(--cim360-surface-2) 0 0.4375rem,
        var(--cim360-border-subtle) 0.4375rem 0.875rem);
    color: var(--cim360-text-muted);
}

/* Laid over the tile, not in its flow: on the item band the tile has no height of its own
   (aspect-ratio, height: auto), so an in-flow picture's natural size resized the tile - and
   the row - the moment it loaded. */
.c360-lp-thumb {
    position: relative;
}

.c360-lp-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--cim360-card);
}

.c360-lp-thumb > span {
    padding: 2px 0.4375rem;
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--cim360-headerband-fg) 82%, transparent);
    font-family: inherit;
    font-size: 0.75rem;
    letter-spacing: .04em;
}

/* ---- the segmented switches ---------------------------------------------- */

/* Two of these: which field the item box searches, and which discount column is in
   force. Both choose between two mutually exclusive things, which is why neither is
   a pair of fields somebody could fill in both of. */
.c360-lp-seg,
.c360-lp-basis {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-primary-zebra);
}

.c360-lp-seg {
    margin-left: auto;
}

/* Under the picker rather than on the label, which is where the item field puts it: it
   chooses what the box ABOVE searches, and read top to bottom that is the order the two
   happen in. margin-left: auto is what pushed it to the right-hand end of a label and has
   to go, or it floats away from the field it belongs to. */
.c360-lp-seg.is-under {
    margin-left: 0;
    align-self: flex-start;

    /* Clear of the box above it. A Cim360DialogField stacks its children with no gap, so the
       switch sat against the picker's bottom edge and the two read as one two-storey control -
       which is the opposite of what it is: a choice ABOUT the box, made after it. */
    margin-top: 0.4375rem;
}

.c360-lp-basis {
    align-self: flex-start;
}

.c360-lp-seg button,
.c360-lp-basis button {
    height: 1.375rem;
    padding: 0 0.625rem;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

/* min-width, never width. The right-hand button carries the currency's symbol, and a
   fixed 40px box broke the moment that was three characters instead of one - "GBP"
   wrapped and dropped the P onto a second line inside a 26px button. Padding plus a
   floor keeps the two buttons even for a one-character symbol and lets either grow. */
.c360-lp-basis button {
    min-width: 2.5rem;
    height: 1.625rem;
    padding: 0 0.625rem;
    white-space: nowrap;
    font-size: 0.7813rem;
    font-weight: 700;
}

.c360-lp-seg button.on,
.c360-lp-basis button.on {
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse, var(--cim360-card));
    box-shadow: 0 1px 2px rgba(15, 23, 42, .14);
}

.c360-lp-seg button:not(.on):not(:disabled):hover,
.c360-lp-basis button:not(.on):not(:disabled):hover {
    color: var(--cim360-primary);
}

/* A read-only line disables the switch. The chosen basis stays at full strength because it still
   says which one the line uses; the other fades and refuses the pointer, as .c360-de-seg does. DEV-554. */
.c360-lp-seg button:disabled,
.c360-lp-basis button:disabled {
    cursor: not-allowed;
}

.c360-lp-seg button:disabled:not(.on),
.c360-lp-basis button:disabled:not(.on) {
    opacity: .45;
}

/* ---- the prefixed number box --------------------------------------------- */

/* An input GROUP, not an input with an absolutely positioned overlay and a guessed
   padding-left. The prefix is a real flex item, so the box makes room for whatever it
   holds - a one-character symbol or a three-letter code - instead of the text sliding
   under a 42px reservation that was right for exactly one of those. */
.c360-lp-cur {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.c360-lp-cur .sym {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 0.5rem;
    border: 1px solid var(--cim360-border);
    border-right: 0;
    border-radius: 0.375rem 0 0 0.375rem;
    background: var(--cim360-surface-2);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--cim360-text-muted);
    pointer-events: none;
}

.c360-lp-cur .c360-dlg-input {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0 0.375rem 0.375rem 0;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* A percent sign goes on the right, where a reader expects it - so the group's order
   reverses and the two borders swap sides with it. */
.c360-lp-cur.is-pc {
    flex-direction: row-reverse;
}

.c360-lp-cur.is-pc .sym {
    border-right: 1px solid var(--cim360-border);
    border-left: 0;
    border-radius: 0 0.375rem 0.375rem 0;
    font-size: 0.8125rem;
}

.c360-lp-cur.is-pc .c360-dlg-input {
    border-radius: 0.375rem 0 0 0.375rem;
}

/* ---- the quantity block -------------------------------------------------- */

/* The line's headline figure, and it leads the band - the design draws it at more than
   twice the height of an ordinary field because it is the one number somebody types on
   nearly every line.

   Targets .c360-numbox, NOT .c360-dlg-input: the quantity is Cim360NumberWithUnit, which
   renders its own box and a .c360-numbox-input inside it. The rules here named the dialog
   input class and therefore matched nothing at all, which is why the figure came out the
   same size as every other field. */
.c360-lp-qbig {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
}

.c360-lp-qbig .qin {
    flex: 1 1 12.5rem;
    max-width: 18.75rem;
    height: 3.25rem;
}

.c360-lp-qbig .qin .c360-numbox-input {
    font-size: 1.625rem;
    font-weight: 800;
    text-align: right;
    font-variant-numeric: tabular-nums;

    /* More room than the shared box's 10px. At 26px the digits are nearly twice the height
       of an ordinary field's, so the same gap reads as half of one and the figure looks
       jammed against the unit beside it. */
    padding-right: 1rem;
}

/* Centred in the box, like the affix on every other number control. It was pinned to the
   bottom to sit on the big figure's baseline, and at 52px tall that reads as a unit that
   has slipped rather than one aligned to anything. */
.c360-lp-qbig .qin .c360-numbox-affix {
    font-size: 0.75rem;
}

.c360-lp-qbig .conv {
    margin-left: auto;
    text-align: right;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--cim360-text-muted);
}

.c360-lp-qbig .conv b {
    display: block;
    font-size: 0.8125rem;
    color: var(--cim360-text);
    font-variant-numeric: tabular-nums;
}

/* Three stacked segments, not three bars: they are parts of one quantity, and
   side-by-side bars would invite adding them up. */
.c360-lp-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.625rem, 1fr));
    gap: 0.4375rem;
}

.c360-lp-legend .g {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.c360-lp-legend .g .k {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-primary);
}

.c360-lp-legend .g .k .d {
    flex: 0 0 auto;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 2px;
}


.c360-lp-legend .g .n {
    font-size: 1.1875rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--cim360-text);
    font-variant-numeric: tabular-nums;
}

/* Outstanding is what is still owed, which is the figure somebody chases. */
.c360-lp-legend .g.is-out .n {
    color: var(--cim360-warning-fg);
}

/* ---- the price-break table ----------------------------------------------- */

.c360-lp-brk {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cim360-border);
    border-radius: 0.4375rem;
    overflow: hidden;
}

.c360-lp-brk .hd,
.c360-lp-brk .rw {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.7813rem;
}

/* THE TOKENS, not a copy of the numbers. This panel is a grid of spans imitating the table the
   custom fields tab beside it is drawn with, so it cannot inherit a `th` rule - it has to restate
   the geometry, and the previous comment here said so and added "restated, so it can drift".

   It drifted the same day the table moved: 2026-09-23 took the shared header to 40px and the rows
   to a 7px/44px pair, and a hardcoded 14px/10px here would have left two tables on one card at
   different heights again - which is the exact fault this block was written to fix. Reading the
   tokens costs nothing and cannot fall behind. */
.c360-lp-brk .hd {
    min-height: var(--c360-head-h, 2.5rem);
    display: flex;
    align-items: center;
    padding: 0 var(--c360-row-pad-x, 1rem);
    /* Explicit rather than inherited. The shared th resolves to `left`; a grid item with no rule
       resolves to `start`. They paint the same in this product and would stop doing so the day
       anything renders right-to-left, which is exactly the kind of difference that is invisible
       until it is not. */
    text-align: left;
}

/* The rows read the same tokens. They used to be deliberately tighter than the header - 10px
   against 14px - because four rows at the header's padding pushed the totals block below the fold
   in a tab body a third the height of the custom fields grid. The shared row is 7px now, so the
   tighter-than-the-header exception has nothing left to buy: it IS tighter than the header, by
   the same amount everywhere. */
.c360-lp-brk .rw {
    min-height: var(--c360-row-h, 2.75rem);
    display: flex;
    align-items: center;
    padding: var(--c360-row-pad-y, 0.4375rem) var(--c360-row-pad-x, 1rem);
}

/* The SAME header treatment as every other in-card table - Cim360InCardTable, which is what the
   custom fields tab two tabs along is drawn with. It read as a different object: 12.5px bold body
   text on the blue zebra, against the product's 11px uppercase muted band. The values below are
   `.c360-grid-table thead th` in css/forms/cim360-dialog.css, restated here rather than shared
   because this panel is a grid of spans and not a <table> - a header <th> rule cannot reach it.

   Restated, so it can drift. The alternative is rebuilding the panel on Cim360InCardTable, which
   is the right answer the day this list needs sorting, a column picker or an actions cell. It
   needs none of the three: three columns, a handful of rows, read-only. */
.c360-lp-brk .hd {
    border-bottom: 1px solid var(--cim360-border);
    background: color-mix(in srgb, var(--cim360-primary) 4%, var(--cim360-card));
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
}

/* A row, not a button. These were <button>s that re-priced the line on a click; the tab reports
   what the customer has agreed and sets nothing, so there is no pointer, no hover and nothing to
   focus. See SalesOrderLineEditor's note where ApplyBreak used to be. */
.c360-lp-brk .rw {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--cim360-border-subtle);
    background: transparent;
    color: var(--cim360-text);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    text-align: left;
    cursor: default;
}

.c360-lp-brk .rw:first-of-type {
    border-top: 0;
}

.c360-lp-brk .rw.is-none {
    color: var(--cim360-text-muted);
    font-style: italic;
}

/* Which break the line's quantity has actually reached. The one thing this tab is read FOR, so it
   stays marked even though nothing here is clickable. The text is the brand colour pulled towards
   the strong text colour, because the plain brand colour on its own tint is under 4.5:1 in both
   themes (WCAG 1.4.3) and the row is 11px text, which is not "large". */
.c360-lp-brk .rw.on {
    background: var(--cim360-primary-tint);
    font-weight: 800;
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

/* EXCEPT on a purchase line, where a break row prices the line on a click - the purchase story and
   design both ask for it, and it clears the typed-cost mark so the quantity re-prices from there.
   A real <button>, so it is focusable and announced; the sales rows above stay plain. DEV-755. */
.c360-lp-brk .rw.is-pick {
    cursor: pointer;
}

.c360-lp-brk .rw.is-pick:hover {
    background: color-mix(in srgb, var(--cim360-primary) 6%, var(--cim360-card));
}

.c360-lp-brk .rw.is-pick:focus-visible {
    outline: 2px solid var(--cim360-focus-ring, var(--cim360-primary));
    outline-offset: -2px;
}

/* A purchase line's comments - who, when, then the note. DEV-755. */
.c360-lp-cmts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.c360-lp-cmt {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cim360-border-subtle);
    border-radius: 0.4375rem;
    font-size: 0.8125rem;
}

.c360-lp-cmt .by {
    display: block;
    margin-bottom: 0.1875rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-lp-cmt p {
    margin: 0;
    white-space: pre-wrap;
}

.c360-lp-cmtadd {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.c360-lp-cmtadd textarea {
    flex: 1;
}

/* Only the price column is right-aligned. The middle column carried the effective-from date and
   now carries the break's note, which is prose and reads wrong ranged right. */
.c360-lp-brk .hd span:nth-child(3),
.c360-lp-brk .rw span:nth-child(3) {
    text-align: right;
}

/* ---- the totals block ---------------------------------------------------- */

/* margin-top: auto pins it to the panel's bottom edge, so it sits in the same
   place whether or not the warnings above it are showing. */
.c360-lp-tot {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--cim360-border);
}

.c360-lp-tot .t {
    display: flex;
    justify-content: space-between;
    gap: 0.625rem;
    font-size: 0.8125rem;
}

.c360-lp-tot .t .k {
    font-weight: 600;
    color: var(--cim360-caption, var(--cim360-text-muted));
}

.c360-lp-tot .t .v {
    font-weight: 700;
    color: var(--cim360-text);
    font-variant-numeric: tabular-nums;
}

.c360-lp-tot .t .v.is-neg {
    color: var(--cim360-warning-fg);
}

.c360-lp-tot .t.is-grand {
    margin-top: 0.25rem;
    padding-top: 0.375rem;
    border-top: 2px solid var(--cim360-primary);
}

.c360-lp-tot .t.is-grand .k {
    font-weight: 800;
    color: var(--cim360-text);
}

.c360-lp-tot .t.is-grand .v {
    font-size: 1.1875rem;
    font-weight: 800;
    color: var(--cim360-primary);
}

/* ---- the bands: a read-out, and a warning -------------------------------- */

.c360-lp-note {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    padding: 0.4375rem 0.5625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.4375rem;
    background: var(--cim360-surface-2);
}

.c360-lp-note > i {
    flex: 0 0 auto;
    font-size: 0.875rem;
    color: var(--cim360-text-muted);
}

.c360-lp-note .b {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.c360-lp-note .b .d {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--cim360-text);
}

.c360-lp-note .b .w {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-lp-note.is-ok {
    border-color: var(--cim360-primary-field-border, var(--cim360-border-strong));
    background: var(--cim360-primary-tint);
}

.c360-lp-note.is-ok > i {
    color: var(--cim360-primary);
}

.c360-lp-note.is-short {
    border-color: var(--cim360-warning-border);
    background: var(--cim360-warning-bg);
}

.c360-lp-note.is-short > i {
    color: var(--cim360-warning-fg);
}

.c360-lp-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.4375rem;
    padding: 0.375rem 0.5625rem;
    border: 1px solid var(--cim360-warning-border);
    border-radius: 0.375rem;
    background: var(--cim360-warning-bg);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-warning-fg);
}

.c360-lp-warn > i {
    flex: 0 0 auto;
    margin-top: 1px;
}

/* A validation failure, not an advisory - it blocks Save, so it must not look like
   the two warnings above it that do not. */
.c360-lp-warn.is-bad {
    border-color: var(--cim360-danger);
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
}

.c360-lp-chk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7813rem;
    color: var(--cim360-text);
    cursor: pointer;
}

.c360-lp-chk input {
    flex: 0 0 auto;
    width: 0.875rem;
    height: 0.875rem;
    accent-color: var(--cim360-primary);
    cursor: pointer;
}

/* ---- the footer ---------------------------------------------------------- */

/* Blue, and the card's own footer treatment - this band carries Save, and the
   product's Save band is primary with white buttons on it. It used to be a grey
   strip with .c360-dlb-btn on it, which is a third footer look in a product that
   has two. */
.c360-lw-foot {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
    padding: 0.6875rem 1rem;
    background: var(--cim360-headerband-bg);
    border-top: 1px solid var(--cim360-primary-dark);
}

/* The line total, on the band beside Save rather than at the foot of the
   scrolling form. It is the figure somebody checks before pressing the button, so
   it must not be able to scroll away from it. */
.c360-lw-tot {
    display: flex;
    align-items: baseline;
    gap: 0.5625rem;
    min-width: 0;
    color: var(--cim360-headerband-fg);
}

.c360-lw-tot .l {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    /* On the totals bar's dark ground, so white rather than --cim360-caption. */
    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. */
    white-space: nowrap;
}

.c360-lw-tot .v {
    font-size: 1.1875rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.c360-lw-tot .sub {
    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. */
    white-space: nowrap;
}

.c360-lw-msg {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    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. */
}

.c360-lw-msg > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-lw-foot .acts {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex: 0 0 auto;
}


/* -----------------------------------------------------------------------------
   11. Narrow windows

   The rail becomes a row and the band a single column. A layout window can be
   dragged narrow, and the alternative is the band's fields shrinking until a
   date input clips its own text.

   THE CONTAINER, NOT THE VIEWPORT. This section always said it was about a window
   being dragged narrow and it measured the browser, so the one case it describes
   - a narrow window on a wide screen - was the one it could not see, while a
   maximised shell on a small laptop got the stacked layout it had no need of.
   The container is declared on `.c360-de` and on `.c360-ro-contents`; see those.
   -------------------------------------------------------------------------- */

@container c360de (max-width: 720px) {
    .c360-de-split {
        flex-direction: column;
    }

    .c360-de-rail {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--cim360-border);
    }

    .c360-de-railr {
        width: auto;
        white-space: nowrap;
    }

    .c360-de-grid,
    .c360-de-grid.is-two {
        grid-template-columns: minmax(0, 1fr);
    }

    .c360-ef.is-wide {
        grid-column: span 1;
    }

    .c360-dlb-totals {
        margin-left: 0;
        width: 100%;
    }

    .c360-dlb-t {
        flex: 1 1 0;
    }

    /* The line editor's footer wraps rather than squeezing: the total, the reason
       Save is disabled and the buttons are three things that all have to stay
       readable, and the message is the one that can take a second row. */
    .c360-lw-foot {
        flex-wrap: wrap;
        gap: 0.5rem 0.875rem;
    }

    .c360-lw-foot .acts {
        margin-left: auto;
    }

    /* The rail is horizontal here, per .c360-de-rail above, so its heading would
       sit in the scroll strip taking width from the buttons. The nav's aria-label
       still names it. */
    .c360-de-raillbl {
        display: none;
    }

    .c360-lw-title {
        font-size: 1.0625rem;
    }

    /* The description is the first thing to go - the code identifies the line and
       the description is repeated in the form's own field two inches below. */
    .c360-lw-titledesc {
        display: none;
    }

    /* The two panel columns become one. Side by side at this width each panel would
       be ~330px, and a two-field row inside one of those clips a date input - which
       is the same reason the field band below stacks. */
    .c360-lp-tile {
        flex-direction: column;
    }

    .c360-lp-row.is-two,
    .c360-lp-row.is-tax {
        grid-template-columns: minmax(0, 1fr);
    }

    /* The thumbnail goes rather than shrinking: the fields it sits beside need the
       width more than the picture does, and the item code names the item. */
    .c360-lp-thumb {
        display: none;
    }

    /* Nothing fills a leftover height once the columns are stacked - "fill" was
       about squaring two columns off against each other. */
    .c360-lp.is-fill {
        flex: 0 0 auto;
    }
}

/* A short window, where the tiling is what runs out of room rather than the width.
   The design carries the same breakpoint at 780px for the same reason. */
@media (max-height: 800px) {
    .c360-lw-body.is-tiled {
        --c360-sticky-inset: 0.5rem;
        padding: var(--c360-sticky-inset) 0.75rem;
    }

    .c360-lp-tile,
    .c360-lp-col {
        gap: 0.5rem;
    }

    .c360-lp-b {
        padding: 0.4375rem 0.625rem;
        gap: 0.375rem;
    }

    /* The band loses height before the caption loses size - 44px is generous on a short
       window and the words still have to be readable. */
    .c360-lp-h {
        min-height: 2.25rem;
        padding: 0 .625rem 0 .75rem;
    }

    .c360-lp-thumb {
        flex-basis: 4.875rem;
        height: 4.875rem;
    }

    .c360-lp-qbig .qin {
        height: 2.625rem;
    }

    .c360-lp-qbig .qin .c360-numbox-input {
        font-size: 1.25rem;
    }

    .c360-lp-legend .g .n {
        font-size: 1rem;
    }

    /* THE ROWS COMPRESS; THE HEADER DOES NOT. The header used to be in here too, and that is what
       made this panel and the custom fields grid beside it disagree on a short screen while
       agreeing on a tall one - a 1366x768 laptop sat inside this block and a 1920x1080 desktop did
       not, so the same card looked consistent to one person and not to another.

       The header's job is to match every other in-card table header in the product, and those are
       drawn by a shared rule this sheet cannot compress without reaching every table in the
       application. So it is left alone and the rows take the saving instead - which is where the
       height actually is, since there is one header and any number of rows. */
    .c360-lp-brk .rw {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
    }

    .c360-lp-tot .t {
        font-size: 0.7813rem;
    }

    .c360-lp-tot .t.is-grand .v {
        font-size: 1rem;
    }
}

/* -----------------------------------------------------------------------------
   A SHORT window - the document entry screens
   -----------------------------------------------------------------------------
   Raising a sales or purchase document, and the line window inside it. The bodies
   yield on their own - flex: 1 1 auto, overflow: auto, and the entry shell's body
   down to a floor past which its stack scrolls (section 2) - so this is the chrome
   around them giving back the height it was holding: the stripe, the band above
   the lines, the body padding and the line window's footer.

   The tiers match cim360-card.css, cim360-dialog.css and Cim360KpiStrip so every
   surface in Sales and Purchasing compresses at the same three moments. The 800px
   tier already in this file is a different thing and stays: it is about the TILING
   running out of room, not about the shell's chrome, and it was measured against
   the design's own 780px breakpoint. */
@media (max-height: 900px) {
    .c360-de-band {
        padding: 0.5rem 1rem;
    }

    .c360-de-stripe {
        padding: 0.3125rem 0.875rem;
    }

    .c360-de-body {
        --c360-sticky-inset: 0.625rem;
        padding: var(--c360-sticky-inset) 0.875rem;
    }

    .c360-lw-body {
        --c360-sticky-inset: 0.75rem;
        padding: var(--c360-sticky-inset) 0.75rem;
    }

    .c360-lw-foot {
        padding: 0.5rem 0.875rem;
    }
}

@media (max-height: 740px) {
    .c360-de-band {
        padding: 0.375rem 0.875rem;
    }

    .c360-de-stripe {
        padding: 0.1875rem 0.875rem;
    }

    .c360-de-body {
        --c360-sticky-inset: 0.5rem;
        padding: var(--c360-sticky-inset) 0.75rem;
    }

    .c360-lw-body {
        --c360-sticky-inset: 0.625rem;
        padding: var(--c360-sticky-inset) 0.625rem;
    }

    .c360-lw-foot {
        padding: 0.375rem 0.75rem;
    }
}

@media (max-height: 620px) {
    .c360-de-band {
        padding: 0.25rem 0.875rem;
    }

    .c360-de-stripe {
        padding: 2px 0.875rem;
    }

    .c360-de-body {
        --c360-sticky-inset: 0.375rem;
        padding: var(--c360-sticky-inset) 0.75rem;
    }

    .c360-lw-body {
        --c360-sticky-inset: 0.5rem;
        padding: var(--c360-sticky-inset) 0.5rem;
    }

    .c360-lw-foot {
        padding: 0.25rem 0.75rem;
    }
}

/* A full-width band above the two columns.

   The item panel is what the line IS - its code, description, warehouse and unit - and the two
   columns below it are detail about that. Sitting it in the left column made it one of five equal
   panels and put the description in a half-width box while the space beside it held a price break
   table. The design bands it across the top instead.

   Same flex model as .c360-lp-tile, turned ninety degrees, so a stack composes with a tile inside
   it and neither needs to know about the other. Shared with purchasing's editor, which tiles the
   same panels. */
.c360-lp-stack {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex: 1 1 0;
    min-width: 0;
}

/* -----------------------------------------------------------------------------
   10b. Three bands, not two columns

   The design's own words, above its full-width panel rules: "Item, Quantity &
   pricing, then the tab control: three bands, each using the whole width, so
   nothing is squeezed into a half column."

   Two columns put the description in a half-width box with a price-break table
   beside it, and left Planning and Financial - two panels consulted per line
   rather than keyed on every one - taking half the card between them. The bands
   give the line's identity and its value the full width, and everything
   consulted rather than keyed goes behind a tab.

   Shared, not sales-only: purchasing's editor draws the same three bands.
   -------------------------------------------------------------------------- */

/* ---- the item band -------------------------------------------------------- */

/* A grid rather than the panel's usual column, so the picture can span both rows
   on the right while the fields and the description stack down the left. */
.c360-lp.is-item > .c360-lp-b {
    display: grid;
    gap: 0.5625rem 0.625rem;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: start;
}

/* Everything that is not the field row or the picture falls into the second row
   of the first column - the description, and anything a line type adds. */
.c360-lp.is-item > .c360-lp-b > * {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.c360-lp.is-item > .c360-lp-b > .c360-lp-igrid {
    grid-column: 1;
    grid-row: 1;
}

/* Square, and as tall as the fields beside it - it is the one thing on the band
   with no natural height of its own. */
.c360-lp.is-item > .c360-lp-b > .c360-lp-thumb {
    grid-column: 2;
    grid-row: 1 / span 2;
    flex: none;
    align-self: stretch;
    width: auto;
    height: auto;
    min-height: 6rem;
    aspect-ratio: 1 / 1;
}

/* The identity fields read across the band: a narrow line number, the picker
   taking the slack, then the shorter fields at their own widths. */
.c360-lp-igrid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5625rem 0.75rem;
    align-items: flex-start;
}

.c360-lp-igrid > * {
    flex: 1 1 9.375rem;
    min-width: 0;
}

/* A line number is three digits and will never be anything else. */
.c360-lp-igrid > *:first-child {
    flex: 0 0 5.125rem;
}

/* Unit of measure closes a sales row: a short value, so a short field. */
.c360-lp-igrid > *:last-child {
    flex: 0 1 7rem;
}

/* NAMED rather than positional, because the branches do not agree on what sits where:
   purchasing's row ends with the warehouse, sales' ends with the unit, and a nth-child
   rule written for one silently sizes the wrong field on the other.

   The item is what the whole band is about and it holds a code, a description and a
   chevron - so it takes the slack, and takes it three times faster than anything else in
   the row. */
.c360-lp-igrid > .is-lead {
    flex: 3 1 21.25rem;
}

/* The warehouse holds one short name and was taking as much room as the item beside it.
   It gives that room up first as the row narrows. Declared after :last-child so it also
   wins on purchasing's row, where the warehouse IS the last field. */
.c360-lp-igrid > .is-short {
    flex: 0 1 10.5rem;
}


/* One field's label wraps to two lines - the item's carries the lookup switch -
   and without a floor under all of them the controls beneath sit at two heights. */
.c360-lp-igrid > .c360-dlg-field.is-dense > label {
    min-height: 1.625rem;
    align-items: flex-start;
}


/* Free text has no picture and its wording IS the line, so the band turns ninety
   degrees: the two short fields stack down a narrow left column and the text takes
   the whole of the rest. The design does the same. */
.c360-lp.is-item.is-ft > .c360-lp-b {
    grid-template-columns: 11.625rem minmax(0, 1fr);
}

.c360-lp.is-item.is-ft > .c360-lp-b > .c360-lp-igrid {
    grid-column: 1;
    grid-row: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    align-content: start;
}

.c360-lp.is-item.is-ft > .c360-lp-b > .c360-lp-igrid > * {
    flex: 0 0 auto;
}

.c360-lp.is-item.is-ft > .c360-lp-b > .c360-dlg-field {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: stretch;
    min-height: 0;
}
/* ---- the quantity and pricing band ---------------------------------------- */

/* The band's body is a size container, so the grid below can ask how wide IT is rather than
   how wide the window is. inline-size only: the height still comes from the content, which is
   what a band of fields needs. */
.c360-lp.is-qp > .c360-lp-b {
    container-type: inline-size;
    container-name: qpband;
}

/* Quantity beside its pricing fields, with the movement figures and the money
   as a second row under each. */
.c360-lp-qpgrid {
    display: grid;
    gap: 0.625rem 0.75rem;
    align-items: start;
    grid-template-columns: minmax(14.375rem, 1fr) minmax(16.875rem, 1.05fr);
}

.c360-lp-qpqty,
.c360-lp-qpprice {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.c360-lp-qpqty {
    grid-column: 1;
    grid-row: 1;
}

.c360-lp-qpprice {
    grid-column: 2;
    grid-row: 1;
}

/* Unit price on the left, the discount basis and its figure together on the right, so
   the toggle sits against the amount it applies to.

   FLEX, not a three-column grid with fixed track widths. Those tracks were sized for
   English: "Discount basis" and "Discount value" are among the longest labels here, and a
   language that makes either longer had nowhere to put it - the label folded onto a second
   line, or the field dropped to a row of its own, at whatever width the track said.

   EVERY ITEM DECLARES A FLEX-BASIS, and that is the fix for a real defect rather than
   tidiness. With `flex: 0 1 auto` a field asks for its MAX-CONTENT width, and the max-content
   width of one of these is not a number this design chose - it is whatever a DevExpress text
   input asks for, which is its default character size, around 200px. Three of those plus the
   gaps came to more than the column had on a 1440-wide screen, so the row wrapped with room
   to spare and the basis toggle was left at the far end of the first line. A basis is a
   width the design decides; max-content is a width the control vendor decides.

   AND NO `margin-right: auto` ON THE PRICE. That was what put the pair against the right
   edge, and an auto margin cannot tell that the row has wrapped - so the moment it did, the
   gap it opens appeared BETWEEN two fields on the same line instead of before the pair. The
   price grows into the spare room instead, which cannot strand anything. */
.c360-lp-qpfields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5625rem 0.75rem;
}

.c360-lp-qpfields > .c360-dlg-field {
    flex: 1 1 9.375rem;
    min-width: 8rem;
}


/* RIGHT-ALIGNED, like the quantity above them. Money and a percentage are figures to be
   compared down a column, and the decimal points have to line up to be compared at all - which
   is also why .c360-numbox-input already sets tabular figures. The big quantity box has been
   right-aligned since the design; the unit price and the discount beside it were not, so the
   one band held three numbers and two conventions.

   The affix is unaffected: the currency and the % stay docked at the box's edge, and the digits
   now run up to them instead of away from them. */
/* THREE CLASSES, matching .c360-lp-qbig .qin .c360-numbox-input above, and that is the whole
   reason `.c360-numbox` is in the middle of this selector. Written with two it lost: the padding
   it has to beat is a shorthand on `.c360-numbox .c360-numbox-input`, and a DevExpress editor
   brings its own rules for the same input on top of that. The quantity box has always carried
   three and has always worked; this one carried two and silently did nothing, which is why the
   figures still sat against the currency after they were right-aligned. */
.c360-lp-qpfields .c360-numbox .c360-numbox-input {
    text-align: right;

    /* 16px, the same gap the quantity box keeps between its figure and its unit. The shared box's
       10px is a LEFT-aligned box's leading padding doing double duty at the other end, and against
       a docked currency a right-aligned figure sits almost on top of it. */
    padding-right: 1rem;
}

/* The pair, as one item. Where it folds is decided here rather than by whichever field
   happened not to fit. */
.c360-lp-qpdisc {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5625rem 0.75rem;
    flex: 1 1 16.25rem;
    min-width: 12.5rem;
}

.c360-lp-qpdisc > .c360-dlg-field {
    flex: 1 1 8.125rem;
    min-width: 7rem;
}

/* The toggle takes what its two buttons and its label need and no more, so the room in the
   pair goes to the figure rather than to whitespace beside a 40px control. */
.c360-lp-qpdisc > .c360-dlg-field.is-basis {
    flex: 0 0 auto;
    min-width: 0;
}

/* A line with no unit price - a narrative purchase line - has only the discount pair, and it
   keeps the right-hand side rather than stretching across the gap the price left. */
.c360-lp-qpfields.is-noprice {
    justify-content: flex-end;
}

.c360-lp-qpfields.is-noprice > .c360-lp-qpdisc {
    flex: 0 1 auto;
}

/* Movement figures and money, boxed alike, under their own columns. Auto columns
   rather than a count, because purchasing shows three of the four - nothing is
   allocated against a purchase order. */
.c360-lp-qpgrid > .c360-lp-legend {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    align-items: stretch;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border: 0;
}

/* Centred, each card with its own progress bar under its label - the ticket's movement cards,
   DEV-481. */
.c360-lp-qpgrid > .c360-lp-legend .g {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.1875rem;
    padding: 0.5rem 0.5625rem;
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    border-radius: 0.4375rem;
}

/* In each card the FIGURE leads and its label sits under it, which is the design's own
   arrangement and the reason the cards can be narrow: a label on top holds the card to the
   width of the longest word in it, and "Outstanding" then decides how wide four cards are.
   Under the figure it is free to wrap inside the card instead.

   order, not a reordered markup: the label still comes first in the DOM, so a screen reader
   reads "Outstanding, 12" rather than a number with no name in front of it. */
.c360-lp-qpgrid > .c360-lp-legend .g .n {
    order: -1;
    font-size: 1.25rem;
    line-height: 1;
}

.c360-lp-qpgrid > .c360-lp-legend .g .k {
    display: block;
    font-size: 0.75rem;
    letter-spacing: .02em;
    line-height: 1.25;
    color: var(--cim360-text-muted);
    white-space: normal;
    overflow-wrap: anywhere;
}

.c360-lp-qpgrid > .c360-lp-legend .g .k .d {
    display: inline-block;
    width: 0.375rem;
    height: 0.375rem;
    margin-right: 0.3125rem;
    vertical-align: middle;
}

/* Each movement's own progress against the line's quantity. The track is drawn with an outline
   so an empty bar - nothing allocated yet - still reads as a bar rather than as nothing. */
.c360-lp-legend .g .p {
    display: block;
    align-self: stretch;
    height: 0.3125rem;
    margin-top: 0.25rem;
    border-radius: 62.4375rem;
    background: var(--cim360-surface);
    box-shadow: inset 0 0 0 1px var(--cim360-border-strong, var(--cim360-border));
    overflow: hidden;
}

.c360-lp-legend .g .p > i {
    display: block;
    height: 100%;
}

/* Boxed to match the figures beside it, so the two read as one row rather than
   as a total that happens to sit low. */
.c360-lp-qpgrid > .c360-lp-tot {
    grid-column: 2;
    grid-row: 2;
    align-self: stretch;
    margin-top: 0;
    padding: 0.5625rem 0.6875rem;
    border-top: 0;
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    border-radius: 0.4375rem;
}

/* THE BAND'S OWN WIDTH, not the window's. A @media query asks the viewport, and the viewport
   is not what decides whether two columns fit here: this band sits inside a line editor,
   which sits inside an application window, which is the viewport less its chrome - so the
   band is several hundred pixels narrower than the number a media query is testing, and by a
   different amount on every screen. `max-width: 760px` therefore fired when the band was
   already down to about 500, and never fired for a band that had genuinely run out of room
   while the window was wide.

   A container query asks the element. `.c360-lp-qpgrid` is declared a container above and
   this reads that container, so the band folds to one column exactly when IT is too narrow,
   whatever the screen is doing.

   Container queries need Chrome/Edge 105, Firefox 110 or Safari 16 - all 2022-2023. A browser
   older than that ignores this block and keeps the two-column grid, which is the behaviour it
   has today. */
@container qpband (max-width: 620px) {
    .c360-lp-qpgrid {
        grid-template-columns: minmax(0, 1fr);
    }

    .c360-lp-qpqty,
    .c360-lp-qpprice,
    .c360-lp-qpgrid > .c360-lp-legend,
    .c360-lp-qpgrid > .c360-lp-tot {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ---- the tab control ------------------------------------------------------ */

/* The tab control wears the group box's chrome, because it IS one - a band with a caption
   in it, except the caption is a row of them. Same blue, same white, same 5px radius and
   the same bordered body with no top border of its own, so the three bands read as three
   of the same thing rather than two group boxes and a widget. */
.c360-lp-tabs {
    flex: 1 1 auto;
    min-height: 11.25rem;
    display: flex;
    flex-direction: column;
    border-radius: 0.3125rem;
    background: var(--cim360-card);
}

.c360-lp-tabstrip {
    flex: 0 0 auto;
    display: flex;
    gap: 2px;
    min-height: 2.75rem;
    padding: 0 0.375rem;
    border-radius: 0.3125rem 0.3125rem 0 0;
    background: var(--cim360-headerband-bg);
    overflow-x: auto;
}

/* EVERY tab is full white, and the selected one is marked by weight, an underline and a
   lighter ground rather than by the others being dimmed. Holding the unselected ones back
   with opacity is the obvious way to do it and the wrong one: white at .7 over this blue
   lands around 3.4:1, under the 4.5:1 a tab label has to clear. Full white is 4.9:1.

   A DIV, not a button - see Cim360LineTabs.razor, which explains why. So the three things a
   button brought are declared here: the pointer, no text selection (a double-click on a
   button selects nothing; on a div it selects the label), and a focus ring, because the
   platform's own default ring is dark and this band is dark blue. */
.c360-lp-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0 0.875rem;
    border: 0;
    border-bottom: 0.1875rem solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7813rem;
    font-weight: 600;
    color: var(--cim360-headerband-fg);
    white-space: nowrap;
    user-select: none;
    transition: background-color .12s;
}

.c360-lp-tab:focus-visible {
    outline: 2px solid var(--cim360-headerband-fg);
    outline-offset: -0.1875rem;
}

.c360-lp-tab:hover {
    background: rgba(0, 0, 0, .09);
}

.c360-lp-tab.is-on {
    font-weight: 800;
    background: rgba(0, 0, 0, .12);
    border-bottom-color: var(--cim360-headerband-fg);
}

.c360-lp-tab > i {
    font-size: 0.8125rem;
}

/* A figure on the tab, for a tab whose interest is how many. Reversed out - white ground,
   brand text - so it reads as a value rather than as another word in the label. */
.c360-lp-tab .n {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 1px 0.375rem;
    border-radius: 62.4375rem;
    background: var(--cim360-card);
    color: var(--cim360-primary);
    font-variant-numeric: tabular-nums;
}

/* The gap above the first row is 8px, not 12px, and every tab gets the same one.

   It is the ONLY thing between the strip and a tab's first control, which is what makes it worth
   being mean with: a line editor is a modal on a card, the tab body is the last band to get height,
   and four pixels back at the top is four more pixels of rows. The sides keep 14px because they are
   not competing with anything.

   Consistency was the reported half. Planning, Financial and Price breaks put their fields straight
   into this padding; Custom fields drew a framed grid with a margin of its own on top, so its table
   started about 20px down while the others started at 12px, and it looked misaligned because it
   was. That is fixed at the source - the shared grid carries no outer margin and the three dialogs
   draw it frameless - so this rule is now the single answer for all four. */
/* A scroller of its own, inside .c360-lw-body, so it declares its own --c360-sticky-inset:
   otherwise a line's custom fields header would inherit the line window's larger inset and be
   pulled up past this box's top and clipped. */
.c360-lp-tabbody {
    --c360-sticky-inset: 0.5rem;
    flex: 1 1 auto;
    min-height: 0;
    padding: var(--c360-sticky-inset) 0.875rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-top: none;
    border-radius: 0 0 0.3125rem 0.3125rem;
    background: var(--cim360-card);
    overflow: auto;
}

/* The tab's own field grid - as many columns as fit, because a tab body is as
   wide as the card and a two-column form in it leaves half the band empty. */
.c360-lp-tabgrid {
    display: grid;
    gap: 0.5625rem 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(10.625rem, 1fr));
}

/* A tab that stacks something under its fields - Planning's stock band. */
.c360-lp-tabstack {
    display: flex;
    flex-direction: column;
    gap: 0.5625rem;
}

/* The same three tiers the rest of the card uses: a short window loses padding
   before it loses content. The strip follows the group box band, so the two keep
   the same height as each other at every tier. */
@media (max-height: 700px) {
    .c360-lp-tabs {
        min-height: 9.375rem;
    }

    .c360-lp-tabstrip {
        min-height: 2.375rem;
    }

    .c360-lp-tab {
        padding: 0 0.75rem;
    }

    /* The top is already 8px at full height, so a short window only gives back the sides and the
       bottom. Restating 8px here rather than dropping the rule, because this block is read as the
       whole padding at this tier and a partial one would leave the next reader deriving it. */
    .c360-lp-tabbody {
        --c360-sticky-inset: 0.5rem;
        padding: var(--c360-sticky-inset) 0.625rem 0.625rem;
    }
}

@media (max-height: 620px) {
    .c360-lp-tabs {
        min-height: 8rem;
    }

    .c360-lp-tabstrip {
        min-height: 2.125rem;
    }

    .c360-lp-tab {
        padding: 0 0.6875rem;
    }

    .c360-lp-tabbody {
        --c360-sticky-inset: 0.375rem;
        padding: var(--c360-sticky-inset) 0.5625rem;
    }
}
