/* Global shell variables shared by isolated component CSS */
:root {
    --panel-top: 5rem;
    --panel-left: max(1rem, env(safe-area-inset-left));
    --panel-right: max(1rem, env(safe-area-inset-right));
    --panel-bottom-gap: 5.25rem;

    /* ---- THE VERTICAL RHYTHM ------------------------------------------------------------------
       Added 2026-09-23, after a side-by-side against the interactive design showed our screens
       fitting noticeably less at the same 100% zoom. The type was never the problem - this product
       already runs at 11-13px, which is the same as the design. What differs is the space AROUND
       everything: control heights, the gaps between fields, and panel padding.

       Before this there was not a single sizing token in the product - 2,937 hardcoded px values
       across the shared sheets and one --cim360-topbar-height. So there was nowhere to make a
       change like this from, and every previous attempt at density had to be a hand edit per rule.

       These are deliberately FEW. One token per thing that actually repeats, not a scale nobody can
       hold in their head, and each names what it is for rather than a t-shirt size - `--cim360-
       control-h` says where it belongs, `--space-3` does not.

       WHAT THEY REPLACED, so the reduction is on the record and can be argued with:
         control height   38px -> 32px   the text box / dropdown pair on a card
         field gap        16px -> 10px   between stacked fields in a panel
         panel padding    20px -> 14px   a summary or form panel's own inset
       A stock item card's summary band was 330px of a 579px body - 57% of the card - which is what
       pushed the stock grid off the bottom of the screen at the window size somebody actually had
       open. */

    /* A text box, dropdown or button sitting in a form row. DevExpress editors are sized by their
       own theme and do not read this; where one sits beside a native control, the native one is
       matched to IT rather than the other way round. */
    --cim360-control-h: 2rem;

    /* Between two stacked fields. The horizontal gap between columns stays wider - a column break
       reads at a glance and a row break does not, so they are not the same distance. */
    --cim360-field-gap-y: 0.625rem;
    --cim360-field-gap-x: 1.5rem;

    /* A panel's own inset: a summary band, a form section, the body of a card tab. */
    --cim360-panel-pad-y: 0.875rem;
    --cim360-panel-pad-x: 1.25rem;

    /* A REGISTER'S ROW, wherever one is drawn: the lines on a document card, a settings grid, the
       price-break panel that imitates one out of spans. These are the LIST VIEW'S numbers at its
       default density (`css/lists/cim360-list.css`, `.grid-viewport.density-cosy`), so the same
       record reads the same height on a list and on a card.

       Here rather than on `.c360-grid-table` because one of the consumers is not a table and
       cannot inherit from one; a density or a tighter variant re-declares them on its own element,
       which beats this for everything inside it without having to out-specify anything.

       `--c360-row-h` is a MINIMUM the content sits inside, not padding it adds to. That is what
       stops a row holding a 28px chip standing 7px taller than the row above it. */
    --c360-row-pad-y: 0.4375rem;
    --c360-row-pad-x: 1rem;
    --c360-row-h: 2.75rem;
    --c360-head-h: 2.5rem;
}

* {
    box-sizing: border-box;
}

/* The whole UI scales with the window, because every size in our stylesheets is in rem - by the
   SMALLER of its width and its height, between 80% and 100%.
     width:  100% at 1920px wide, down to 80% at 1536px      (0.8333vw)
     height: 100% at 1200px tall, down to 80% at 960px       (1.3333vh)
   It followed the width alone, and that got it backwards: a window gets no taller for being wider,
   but everything in it grew 25%, so a full-width new order showed 4 of its 8 custom fields and a
   half-width one showed all 8 (measured at 945px tall, 2026-09-25). The fixed blocks above a
   scrolling body - title, status stripe, header fields - are what took the height. A maximised
   browser on a 1080-high screen is about 945px, so it now draws at 80%, which is the density
   browser zoom at 80% gave - without zoom, which DevExpress cannot position its drop-downs under.
   Relative to the browser's own default, so a reader who has raised it keeps that.
   Below 1024px wide the small-screen layouts take over and are drawn at full size.
   R-093 keeps new px sizes out; hairlines of 1-2px stay px. */
html {
    font-size: clamp(0.8rem, min(0.8333vw, 1.3333vh), 1rem);
}

@media (max-width: 1023.98px) {
    html { font-size: 1rem; }
}
/* Paper is not a window: the vw above would size a printout from the page width. */
@media print {
    html { font-size: 1rem; }
}

html, body {
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    margin: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--cim360-surface);
    color: var(--cim360-text);
}

body {
    transition: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.button-link {
    text-decoration: unset;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
}

.title.title-secondary {
    padding-top: 0.313rem;
    padding-bottom: 0;
    color: var(--cim360-text-muted);
}

.title-header-text {
    font-size: 2.5rem;
    line-height: 3rem;
    font-weight: 700;
    letter-spacing: 0rem;
    padding: 0.3125rem 0;
}

.title-content-text {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 2.5rem;
    letter-spacing: 0rem;
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.block-content {
    width: 31.25rem;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 100%;
}

.icon {
    width: var(--icon-width);
    height: var(--icon-height);
    background-color: currentcolor;
    mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-image: var(--icon-mask-image, none);
    mask-image: var(--icon-mask-image, none);
}

/* The rich text editor's ribbon draws its split buttons (font colour, highlight) as two halves of
   23.5px and 20px wide, under WCAG 2.5.8's 24px - axe measured them on the BOM card's Details tab.
   Here rather than per screen, because every DxHtmlEditor carries the same ribbon. A combo's own
   drop-down arrow is left as DevExpress draws it: it sits inside its editor and passes on spacing.
   max() with 24px, because 1.5rem alone scales down with the window above and drew 20px at 1600. */
.dxbl-html-editor .dxbl-ribbon .dxbl-btn:not(.dxbl-edit-btn-dropdown) {
    min-width: max(1.5rem, 24px);
}

/* The split's first half tucks under the second by a negative margin meant to merge two borders.
   The ribbon's buttons have none, so it merged nothing and only left the first half 23.2px clear. */
.dxbl-html-editor .dxbl-ribbon .dxbl-btn-split > .dxbl-btn-first {
    margin-right: 0;
}
