body {
    margin: 0;
    color: var(--cim360-text, var(--DS-color-content-neutral-default-rest, var(--bs-primary)));
    background-color: var(--cim360-surface, var(--DS-color-surface-neutral-default-rest, var(--bs-body-bg)));
}

/* Jeff's brand blend: the fixed blue circle behind the white wheel logo and the portrait. A brand asset,
   the same in every mode like the logo it carries, so it is declared once here and not per palette. */
body {
    --cim360-jeff-blend: linear-gradient(135deg, #155389 0%, #1D75BB 46%, #2F86CC 100%);
}

/* .cim360-theme-preview[data-preview="light"] is the preview card on Company Defaults, which has
   to render the theme an administrator is CONSIDERING rather than the one they are looking at.
   It joins the selector list rather than getting a palette of its own: a second copy of these
   values would be a second thing to keep in step, and the one that drifts is always the copy
   nobody opens. Declared ON the element, so it beats the tokens inherited from body either way.
   DEV-204. */
body.dxbl-theme-fluent,
body[class*="dxbl-theme"],
.cim360-theme-preview[data-preview="light"] {
    --cim360-primary: #1D75BB;
    --cim360-primary-hover: #1a66a3;
    --cim360-primary-dark: #155389;
    --cim360-primary-tint: rgba(29, 117, 187, .14);
    --cim360-primary-soft: rgba(29, 117, 187, .08);
    --cim360-primary-zebra: #f4f8fc;
    --cim360-primary-field-bg: rgba(29, 117, 187, .05);
    --cim360-primary-field-border: rgba(29, 117, 187, .22);

    --cim360-card: #ffffff;
    --cim360-surface: #f4f6f9;
    --cim360-surface-2: #f8fafc;
    --cim360-surface-3: #fafbfc;

    /* WHITE IN BOTH MODES, DELIBERATELY - unlike every surface above it. For a plate holding a
       third party's own logo mark (Xero, QuickBooks, Sage Intacct), drawn once against a light
       background and not this product's to recolour. --cim360-card also happens to be white in
       light, but it darkens in dark mode - which is exactly the surface a coloured or near-black
       vendor mark would go illegible on. See AccountingIntegration.razor.css. */
    --cim360-logo-plate: #ffffff;

    /* No edge in light: the plate is the same white as the tile it sits on, so a border only
       draws a second box inside the tile. In dark it is what separates the plate from the card. */
    --cim360-logo-plate-border: transparent;

    --cim360-text-strong: #0f172a;
    --cim360-text: #1f2937;
    --cim360-caption: #374151;
    /* Kept in step with app.css, which carries the measurements. 4.46:1 on the KPI tile and 3.38:1
       on the grid's focused row were the failures; this holds 4.65:1 on the darker of the two. */
    /* #4B5563. Every muted label in a grid row reads this - the progress percentage, the sub-line
       separators - and a row that is selected AND focused paints a 32% tint of the primary behind
       them, where the previous #565d68 measured 4.27:1 against a required 4.5 at 11.5px. This is
       7.56:1 on white and 4.86:1 on that tint, so it holds on both. WCAG 1.4.3, found 2026-09-15. */
    --cim360-text-muted: #4B5563;
    --cim360-muted-soft: #94a3b8;
    --cim360-text-inverse: #ffffff;

    /* ---- THE BORDERS, WHICH UNTIL NOW DID NOT EXIST IN LIGHT MODE. -------------------
       These four read `--cim360-border: var(--cim360-border)` - each one defined as
       itself. That is a cycle, and the CSS Variables spec makes every custom property in
       a cycle compute to the guaranteed-invalid value; a `border: 1px solid var(--x)`
       using one then becomes invalid at computed-value time, which resolves to `unset`,
       which for the border shorthand is `border-style: none`.

       So they drew NOTHING. Not a wrong colour - no border at all, on 521 declarations
       across 114 files, for as long as the tokens have existed. Proved rather than read:
       tools/a11y/prove-border-token.js asks a browser and gets border-style `none` and
       width `0px` back, against `solid 1px` for the same rule with a fallback.

       It survived this long because the dark block DID define them, so the tokens looked
       defined to anyone grepping, and because a missing border reads as a design choice -
       nothing logs, nothing overlaps, the page is merely flatter than it was drawn to be.

       The values mirror the dark block: ink at low alpha rather than a flat grey, so the
       two blocks are one idea pointing in opposite directions. The levels come from what
       people actually wrote in the 24 call sites that carried a fallback - #e5e7eb,
       #dbe2ec, #e2e6ea for the plain one, #eef2f7 for soft - and -cool keeps the blue
       tint its own fallbacks asked for (#d7e3ef), which a neutral grey would have lost. */
    --cim360-border: rgba(15, 23, 42, .12);
    --cim360-border-strong: rgba(15, 23, 42, .18);
    --cim360-border-soft: rgba(15, 23, 42, .08);
    --cim360-border-cool: rgba(29, 117, 187, .18);

    /* Used in two places and never defined in either block, so both were living on their
       own fallback - which meant a near-white hairline in dark. */
    --cim360-border-subtle: rgba(15, 23, 42, .06);

    /* The search-match highlight, as its own role. ::highlight() paints behind text whose
       colour is deliberately left inherited - the match is shown by WHERE it is, not by
       recolouring the row - so the wash has to work under whatever the row's text already
       is, which is near-black here and near-white in dark. No one hue does that, hence a
       token rather than the #fde68a that was here. */
    --cim360-search-highlight: #fde68a;

    /* The two warehouse palette entries that were literals. The other seven already point at
       hues that follow the mode; these two were chosen by eye and stayed put. */
    --cim360-wh-navy: #0E4F7F;
    --cim360-wh-teal: var(--cim360-teal);

    /* Teal, as a real member of the palette rather than a hex that turned up twice - the
       warehouse colour and the "moved" segment of a line progress bar are the same green-blue
       and were two different literals. */
    --cim360-teal: #14b8a6;

    --cim360-success: #16a34a;
    --cim360-success-bg: #dcfce7;
    --cim360-success-fg: #166534;
    --cim360-success-border: #bbf7d0;

    --cim360-warning: #d97706;
    --cim360-warning-bg: #fef3c7;
    --cim360-warning-fg: #92400e;
    --cim360-warning-border: #fde68a;

    --cim360-danger: #dc2626;
    --cim360-danger-bg: #fef2f2;
    --cim360-danger-fg: #991b1b;
    --cim360-danger-border: #fecaca;

    --cim360-info: #2563eb;
    --cim360-info-bg: #dbeafe;
    --cim360-info-fg: #1d4ed8;
    --cim360-info-border: #bfdbfe;

    --cim360-violet: #7c3aed;
    --cim360-violet-bg: #ede9fe;
    --cim360-violet-fg: #6d28d9;
    --cim360-violet-border: #ddd6fe;

    --cim360-pink: #db2777;
    --cim360-pink-bg: #fce7f3;
    --cim360-pink-fg: #9d174d;
    --cim360-pink-border: #fbcfe8;

    /* ---- THE ALIASES, WHICH HAVE TO LIVE ON THE SAME ELEMENT AS THE PALETTE. ----------
       These ten pointed at other tokens and were declared in app.css on :root. A var() in a
       custom property is substituted AT THE ELEMENT THE DECLARATION IS ON, and every theme
       block here is on BODY - one element further down - so each of them resolved against
       the LIGHT palette on :root and then inherited that computed value everywhere. They
       could not follow dark mode, or any mode, ever.

       --cim360-surface-muted is the background of the record-count pill on every list view,
       which is how this surfaced: a white pill with white text on it, reported from the
       screen after the scan had reported zero. A literal scan cannot see this - there is no
       literal, both tokens exist, and every value involved is correct. Only the ELEMENT was
       wrong.

       Proved rather than argued: tools/a11y/prove-alias-token.js puts the same alias on
       :root and on body and reads the computed background back. The :root one comes out
       #f8fafc with the page in dark mode; the body one follows. It also confirms the
       override may sit in a SEPARATE body rule, which is what lets these be declared once
       here rather than duplicated into the dark block.

       Rule for any token added later: if its value mentions another token, it belongs in
       this block. Not in app.css, and never on :root. */
    --cim360-queue-bg: var(--cim360-primary-surface);
    --cim360-status-draft: var(--cim360-muted-soft);
    --cim360-status-counting: var(--cim360-primary);
    --cim360-status-approval: var(--cim360-warning);
    --cim360-status-cancelled: var(--cim360-muted-soft);
    --cim360-status-gain: var(--cim360-violet);
    --cim360-surface-hover: var(--cim360-surface-2);
    --cim360-surface-selected: var(--cim360-primary-soft);
    --cim360-surface-muted: var(--cim360-surface-2);

    /* Were #4d9ad5 and #63a9df in app.css - a lighter blue than the brand one, used as a BUTTON
       FILL under white text, which measures 3.04:1 and fails in LIGHT as well as dark. The
       surface tokens hold 4.87:1 in both modes and are what every other primary button in the
       product already uses. */
    --cim360-button: var(--cim360-primary-surface);
    --cim360-button-hover: var(--cim360-primary-surface-hover);
    /* The top bar is 64px. Both report pages read this with a 56px fallback and nothing ever
       declared it, so they were sizing themselves against a bar 8px shorter than the real one.
       A size, so one value serves every mode. */
    --cim360-topbar-height: 4rem;

    --cim360-q-all: var(--cim360-primary);

    /* The dot on All in every status band, and on any segment given no colour. Muted ink rather than a
       status colour, because All stands for no status; an alias, so it belongs in this block and follows
       every mode. */
    --cim360-seg-all: var(--cim360-text-muted);

    --cim360-accent: #29aae2;
    --cim360-soft: #73e6e6;
    --cim360-surface-strong: color-mix(in srgb, #ffffff 70%, var(--cim360-accent) 30%);

    /* ---- THE TOP BAR, AS ITS OWN ROLE. -----------------------------------------------
       It used to paint itself from --cim360-primary directly, which was fine while that
       token had one job. It has two: a FILL behind white text up here, and a LINE or TEXT
       colour everywhere else. Those pull in opposite directions the moment there is a dark
       mode - text on a dark ground has to get lighter to clear 4.5:1, and a fill behind
       white text has to get darker for the same reason - so lightening the one token for
       text turned this bar pale.

       Three tokens instead, named for what they paint. The accessibility notes state the
       general rule: text and shapes have different thresholds, so they need different
       values. This is that rule applied to one token that was doing both jobs. */
    --cim360-topbar-bg: var(--cim360-primary);
    --cim360-topbar-fg: #ffffff;
    --cim360-topbar-wedge: #ffffff;

    /* THE HUE AS A FILLED SURFACE, which is not the same value as the hue as text.

       --cim360-primary is a text colour in dark: it was lightened to #4DA3E8 to clear 4.5:1
       against a near-black card. Handed to a BACKGROUND with white on it, that same value
       measures 2.72:1 and fails - the top bar found this first, and it is not a top bar
       problem, it is every filled control that pairs the token with white.

       So the fill keeps the brand blue in BOTH modes. White on #1D75BB is 4.87:1, which
       passes in light and goes on passing in dark, and the light value is unchanged - the
       substitution is a no-op there, which is what makes converting a call site safe to do
       without looking at it. --cim360-on-primary is the text that belongs on it. */
    --cim360-primary-surface: #1D75BB;
    --cim360-primary-surface-hover: #1a66a3;
    /* Green as a FILL under white text (5.02:1). --cim360-success is the green of dots, bars and
       words, and white on it measured 3.30:1 - the split --cim360-primary-surface makes for blue. */
    --cim360-success-surface: #15803d;
    --cim360-primary-surface-strong: #155389;
    --cim360-on-primary: #ffffff;

    /* Danger as a FILL, for the same reason the primary has one: --cim360-danger is #F87171 in
       dark so it can be read as text, and white on that is 2.5:1. This is the value that works
       behind white in both modes - 4.53:1 - and it is what a notification count sits on. */
    --cim360-danger-surface: #dc2626;
    --cim360-on-danger: #ffffff;
    /* The pressed/hover step of a danger fill. Was #b91c1c hard-coded on the dialog button. */
    --cim360-danger-surface-hover: #b91c1c;

    /* The floating selection bar and the docked record bar - one family, one gradient.
       Blue in light, where the page around them is white and the bar is the one coloured
       thing on it. See the dark block for why that stops being true. */
    --cim360-actionbar-bg: linear-gradient(180deg, var(--cim360-primary-surface) 0%, var(--cim360-primary-surface-hover) 100%);
    --cim360-actionbar-fg: var(--cim360-on-primary);
    --cim360-actionbar-hairline: rgba(255, 255, 255, .18);
    --cim360-actionbar-lift: rgba(255, 255, 255, .18);
    --cim360-actionbar-lift-strong: rgba(255, 255, 255, .32);
    --cim360-actionbar-shadow: rgba(15, 23, 42, .45);
    /* Destructive action ON the bar, so it is measured against the bar and not the page. */
    --cim360-actionbar-danger: #ffd9d9;
    /* The one solid control on the bar, the Ask Jeff launcher. The bar is the brand blue, so the
       pill inverts it: blue on white, 4.87:1 as text, and white against the bar is the same 4.87:1
       as a shape. */
    --cim360-actionbar-cta-bg: #ffffff;
    --cim360-actionbar-cta-fg: var(--cim360-primary-surface);
    --cim360-actionbar-cta-border: transparent;
    /* The bar's own hover tooltips (DEV-498): near-black on a white page, 17.9:1 ink. */
    --cim360-tooltip-bg: #0f172a;
    --cim360-tooltip-fg: #ffffff;

    /* ---- THE HEADER BAND: a card header, a grid header, a list header, a rail header.
       Unchanged in light. A blue band works here because the page around it is white, so
       the band is the one coloured thing and reads as the top of something. In dark that
       stops being true - see the dark block.

       The four below the surface exist because a band is not just a colour, it is a colour
       with CONTROLS on it: a search pill, a New button, a count, a column picker. Those are
       currently white-on-blue, and white-on-blue does not survive the band going dark, so
       they need to move with it rather than be rediscovered one screenshot at a time. That
       is the same lesson the floating bar taught; this is it applied before the fact. */
    --cim360-headerband-bg: var(--cim360-primary-surface);
    --cim360-headerband-fg: var(--cim360-on-primary);
    --cim360-headerband-line: transparent;
    /* The count pill. A DARKER wash, not a lighter one - washing 18% white under it lifted
       the ground to #468ec7 and took its white text to 3.53:1, where 18% black separates it
       just as clearly and reads 6.62:1. */
    --cim360-headerband-pill: color-mix(in srgb, #000 18%, transparent);
    --cim360-headerband-control-bg: var(--cim360-card);
    --cim360-headerband-control-fg: var(--cim360-text);
    --cim360-headerband-control-line: transparent;
    /* The label on a control that sits on the band. Blue on the white pill in light, where the
       pill IS white; near-white in dark, where the pill is a raised dark surface and blue on it
       measures 3.91:1. Two values because the pill underneath is two different colours. */
    --cim360-headerband-control-accent: var(--cim360-primary);
    --cim360-headerband-quiet-hover: color-mix(in srgb, var(--cim360-on-primary) 14%, transparent);

    /* ---- THE STATUS BAND: a full-width band painted in a record's status colour, with its
       words on it (the stocktake drawer's DRAFT · 0 / 1 COUNTED). A consumer mixes its tone
       into the card at -strength and writes in -fg. Light paints the tone solid under white,
       which needs a text-grade (dark) tone. Dark cannot do that: every hue there is lightened
       to be READ, and white on them measured 1.40-2.72:1. See the dark block. DEV-TC-1076. */
    --cim360-statusband-strength: 100%;
    --cim360-statusband-fg: var(--cim360-text-inverse);

    /* Text on a SELECTED grid row, which is a 22% primary wash - and at 32% when the row is
       selected and focused at once, which is the worst case the ratios below were measured
       against. A near-navy on a pale blue in light; it cannot simply invert, because the
       wash it sits on is a different colour in each mode, so it gets a role of its own. */
    --cim360-row-selected-fg: #0a3a64;

    /* WHAT A HUE USED AS TEXT IS SOFTENED TOWARDS, and it is white in BOTH modes.
       Deliberately not --cim360-card, which is what a hue used as a SURFACE is tinted
       towards. The two look like the same operation and pull opposite ways: a surface
       softens towards the page and gets closer to it, while text softened towards the page
       disappears into it. In light both happen to be white, which is why one sweep over
       "mix into white" turned every chip's text into a near-invisible mix of its own
       background - the backgrounds were right to follow the card and the text was not.
       Kept as its own token so the next sweep cannot make the same substitution twice. */
    --cim360-text-tint-base: #ffffff;


    /* Sign in with Microsoft / Google. The values are the vendors' own button specs (Microsoft
       identity platform branding; Google Identity "Sign in with Google" branding), light and dark
       variants. They are fixed by the vendors, which is why they are tokens of their own rather
       than the card/text/border tokens. Contrast: Microsoft ink 6.4:1, edge 3.4:1; Google ink
       16:1, edge 4.6:1 - all against the white fill. */
    --cim360-signin-ms-fill: #ffffff;
    --cim360-signin-ms-ink: #5e5e5e;
    --cim360-signin-ms-edge: #8c8c8c;
    --cim360-signin-google-fill: #ffffff;
    --cim360-signin-google-ink: #1f1f1f;
    --cim360-signin-google-edge: #747775;

    /* THE SIGN-IN SHELL (Cim360SignInShell) AND THE SPLASH. Designed once, always light: the
       brand panel is a blue gradient and the card is white whatever the theme is doing, so none of
       these is redefined in the dark, contrast or colour-blind blocks below and they keep their
       values there. Every value the shell's stylesheet needs lives here because a component
       stylesheet may not carry a colour literal (R-078).

       Differences from the design's literals, all for contrast: --muted is #4b5563 (the design's
       #6b7280 is 4.1:1 on the hover tint), the footer scrim is dark enough for white text to pass
       over the palest end of the gradient, and the splash hint is near-opaque white. */
    --cim360-login-primary: #1d75bb;
    --cim360-login-primary-dark: #155389;
    --cim360-login-primary-hover: #1a66a3;
    --cim360-login-card: #ffffff;
    --cim360-login-text: #1f2937;
    --cim360-login-muted: #4b5563;
    --cim360-login-caption: #374151;
    --cim360-login-border: #d6dbe1;
    --cim360-login-field-bg: rgba(29, 117, 187, 0.05);
    --cim360-login-field-border: rgba(29, 117, 187, 0.22);
    --cim360-login-tile-hover: #e3f0fb;
    --cim360-login-tile-border: color-mix(in srgb, var(--cim360-login-muted) 65%, #ffffff);
    --cim360-login-tile-selected: color-mix(in srgb, var(--cim360-login-primary) 20%, #ffffff);
    --cim360-login-pale: #f3f8fd;
    --cim360-login-edge: rgba(29, 117, 187, 0.18);
    --cim360-login-wash: rgba(29, 117, 187, 0.06);
    --cim360-login-mark-bg: #ffffff;
    --cim360-login-badge-bg: #f1f5f9;
    --cim360-login-badge-ink: #4b5563;
    --cim360-login-badge-current-bg: rgba(29, 117, 187, 0.12);
    --cim360-login-danger: #b42318;
    --cim360-login-danger-bg: #fef3f2;
    --cim360-login-on-brand: #ffffff;
    --cim360-login-on-brand-soft: rgba(255, 255, 255, 0.92);
    --cim360-login-brand-scrim: rgba(10, 40, 75, 0.42);
    --cim360-login-on-brand-faint: rgba(255, 255, 255, 0.14);
    --cim360-login-on-brand-faint-hover: rgba(255, 255, 255, 0.26);
    --cim360-login-on-brand-edge: rgba(255, 255, 255, 0.26);
    --cim360-login-foot-bg: rgba(10, 40, 75, 0.86);
    --cim360-login-foot-edge: rgba(255, 255, 255, 0.14);
    --cim360-login-foot-ink: rgba(255, 255, 255, 0.88);
    --cim360-login-foot-dot: rgba(255, 255, 255, 0.45);
    --cim360-login-dot-grid: rgba(255, 255, 255, 0.10);
    --cim360-login-logo-shadow: rgba(10, 40, 75, 0.25);
    --cim360-login-hover-shadow: rgba(21, 83, 137, 0.35);
    --cim360-login-btn-shadow: rgba(21, 83, 137, 0.20);
    --cim360-login-card-shadow: 0 1.875rem 4.375rem -0.875rem rgba(10, 40, 75, 0.38), 0 0.375rem 1.125rem rgba(10, 40, 75, 0.12);
    --cim360-login-bg: radial-gradient(120% 90% at 0% 0%, #2a8ad6 0%, rgba(42, 138, 214, 0) 55%), radial-gradient(90% 80% at 100% 100%, rgba(115, 190, 240, 0.55) 0%, rgba(115, 190, 240, 0) 60%), linear-gradient(115deg, #155389 0%, #1d75bb 38%, #5aa3db 68%, #cfe3f4 100%);
    --cim360-login-bar-bg: linear-gradient(115deg, #155389 0%, #1d75bb 100%);
    --cim360-login-mask-fade: linear-gradient(115deg, #000 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    --cim360-login-splash-mask: radial-gradient(60% 60% at 50% 50%, #000, transparent);
    --cim360-login-splash-bg: radial-gradient(70% 70% at 50% 45%, #2a8ad6 0%, #1d75bb 45%, #155389 100%);
}

body.dxbl-theme-fluent[data-bs-theme="dark"],
[data-fluent-darkmode] body,
[data-fluent-darkmode] .dxbl-theme-fluent,
.cim360-theme-preview[data-preview="dark"] {

    /* ---- THE BASE HUES, LIGHTENED. --------------------------------------------------
       These eleven were the gap in this block: every derived token below was defined for
       dark and the hues they derive FROM were left at their light values, so anything
       using a hue directly was being drawn in a colour chosen against white.

       That is not a tidiness point, it is a contrast failure. The dark card surface is
       color-mix(#0f1720 88%, primary 12%), which computes to rgb(17,34,51) and a relative
       luminance of 0.015. Against that:

         --cim360-primary  #1D75BB   3.32:1   passes 3:1 for a shape, FAILS 4.5:1 for text
         --cim360-primary  #4DA3E8   5.94:1   passes both

       and #1D75BB is the colour the tracking link, every focus ring and every primary
       button reaches for. The values below are the same hues lifted to the level that
       clears 4.5:1 on that surface - the 400-level of each family, which is what those
       levels are for. The accent stays recognisably our blue; it is the same hue, lit for
       a dark ground.

       MEASURED, NOT PICKED. Each figure is the computed ratio against rgb(17,34,51):
         primary #4DA3E8  5.94    success #4ADE80  9.27    danger  #F87171  6.48
         info    #60A5FA  6.85    warning #FBBF24  10.4    violet  #A78BFA  6.21
         pink    #F472B6  6.36    accent  #5FC6F5  8.53    soft    #8FF0F0  11.9
       The rendered axe pass is what confirms them in place - see Test-Cim360Wcag.ps1. */

    --cim360-primary: #4DA3E8;
    --cim360-primary-hover: #6FB6EE;

    /* Named "dark" for its ROLE, not its lightness: it is the high-contrast primary, the
       one used for link text and focus rings. On a dark ground the high-contrast primary
       is the lighter one, so this is deliberately lighter than --cim360-primary rather
       than darker. Renaming it to --cim360-primary-strong is the right fix and is a
       sweep of its own; the role is what matters here. */
    --cim360-primary-dark: #8CC5F2;

    --cim360-success: #4ADE80;
    --cim360-warning: #FBBF24;
    --cim360-danger: #F87171;
    --cim360-info: #60A5FA;
    --cim360-violet: #A78BFA;
    --cim360-pink: #F472B6;
    --cim360-accent: #5FC6F5;
    --cim360-soft: #8FF0F0;

    --cim360-primary-tint: rgba(29, 117, 187, .28);
    --cim360-primary-soft: rgba(29, 117, 187, .16);
    --cim360-primary-zebra: color-mix(in srgb, var(--cim360-primary) 8%, #0f1720);
    --cim360-primary-field-bg: rgba(29, 117, 187, .12);
    --cim360-primary-field-border: rgba(29, 117, 187, .38);

    --cim360-card: color-mix(in srgb, #0f1720 88%, var(--cim360-primary) 12%);
    --cim360-surface: color-mix(in srgb, #0a1018 90%, var(--cim360-primary) 10%);
    --cim360-surface-2: color-mix(in srgb, #11192a 92%, var(--cim360-primary) 8%);
    --cim360-surface-3: color-mix(in srgb, #131c2e 94%, var(--cim360-primary) 6%);

    /* Restated for the same reason --cim360-surface-muted is below: an element that declares this
       whole palette on itself must not inherit the light block's value from body. Same value as
       light on purpose - see the light block's comment. */
    --cim360-logo-plate: #ffffff;
    --cim360-logo-plate-border: var(--cim360-border-soft);

    /* Restated here although the light block already says exactly this, and the value on <body> is
       identical either way - the light block's declaration resolves --cim360-surface-2 at whatever
       element it lands on, and on body that is the dark value above.

       IT MATTERS FOR ANY ELEMENT THAT DECLARES THIS PALETTE ON ITSELF, which the theme preview
       card does so it can paint a theme the page is not in. Without this line the dark block hands
       that element every other token and leaves this one to be INHERITED from body - so the dark
       preview drew a light banded row whenever the page was light, and a correct one whenever the
       page was dark. The kind of fault that reads as "sometimes it looks wrong". DEV-204. */
    --cim360-surface-muted: var(--cim360-surface-2);

    --cim360-text-strong: #f8fafc;
    --cim360-text: #edf6ff;
    --cim360-caption: #cbd5e1;
    --cim360-text-muted: #b6cadb;
    --cim360-muted-soft: #94a3b8;
    --cim360-text-inverse: #ffffff;

    --cim360-border: rgba(255, 255, 255, .12);
    --cim360-border-strong: rgba(255, 255, 255, .18);
    --cim360-border-soft: rgba(255, 255, 255, .08);
    --cim360-border-cool: rgba(255, 255, 255, .10);
    --cim360-border-subtle: rgba(255, 255, 255, .06);

    /* A dark amber, so the inherited near-white text on top of it stays readable. The light
       value is a pale yellow for exactly the same reason pointing the other way. */
    --cim360-search-highlight: color-mix(in srgb, var(--cim360-warning) 35%, transparent);

    /* Navy stays recognisably navy by going SLATE rather than simply lighter: lifted to the
       same level as --cim360-primary it would have been the same colour as Blue, and the
       palette exists so two warehouses can be told apart. 6.14:1 on the card; teal 10.18:1. */
    --cim360-wh-navy: #8FA8C4;
    --cim360-wh-teal: var(--cim360-teal);
    --cim360-teal: #5EEAD4;

    /* Text-grade green and red. These two are deliberately NOT --cim360-success/-danger -
       app.css explains that those also fill buttons, which answer to 3:1, while every use of
       these is words at 4.5:1. That split is the same one --cim360-primary-surface exists
       for, and it needs a dark value for the same reason: #146c34 and #b91c1c were picked
       against white and are near-invisible on a near-black card. */
    --cim360-status-finalised: var(--cim360-success-fg);
    --cim360-status-loss: var(--cim360-danger-fg);

    /* White in dark TOO, and stated rather than inherited. This is what a hue used as TEXT is
       softened towards, which is white in every mode - the opposite of a surface, which softens
       towards the card. Declaring it here costs nothing and stops the next mode assuming the
       omission was an oversight. */
    --cim360-text-tint-base: #ffffff;
    /* ---- THE QUARANTINE STATUS PALETTE. Seven hues shown as dots and as text on a card, and
       consumed from C# as var(--cim360-q-xxx) strings, so they reach the DOM without passing
       through any stylesheet a sweep would read. Lifted to the 400 level like every other hue
       in this block: #16a34a as text on the dark card is 3.30:1 and #6b7280 is 3.49:1, both
       under the 4.5 a status word needs. The weakest of the new values is 5.93:1. */
    --cim360-q-pending: #FBBF24;
    --cim360-q-passed: #4ADE80;
    --cim360-q-failed: #F87171;
    --cim360-q-rework: #A78BFA;
    --cim360-q-scrapped: #9CA3AF;
    --cim360-q-overdue: #FBBF24;
    --cim360-q-returned: #22D3EE;

    /* Unchanged from light, and SAID rather than left out. Every one of these is white, or a
       wash of white, on the processing queue bar - and that bar keeps --cim360-primary-surface
       in both modes, so white on it stays 4.87:1 and nothing needs to move. Declaring them
       here is how the next mode can tell "deliberately the same" from "nobody looked". */
    --cim360-queue-fg: #ffffff;
    --cim360-queue-track-bg: rgba(255, 255, 255, .28);
    --cim360-queue-btn-bg: rgba(255, 255, 255, .15);
    --cim360-queue-btn-border: rgba(255, 255, 255, .45);
    --cim360-queue-btn-hover: rgba(255, 255, 255, .30);
    --cim360-primary-light: rgba(255, 255, 255, 0.18);

    /* A navy shadow is invisible on a near-black page, so it goes black and deepens. */
    --cim360-shadow: 0 0.875rem 1.875rem rgba(0, 0, 0, 0.55);

    /* ---- THE HEADER BAND, WHICH STOPS BEING BLUE. ------------------------------------
       In light a blue band is the one coloured thing on a white page: it is the figure,
       and it reads as the top of something. In dark every surface is already dark, so a
       saturated band is no longer an accent - it is the brightest object on the screen,
       and the eye lands on the chrome instead of on the data. Counted across the product,
       45 of the blue fills were bands like this and 49 were accents, which means roughly
       half the brand colour was being spent on furniture.

       So the band recedes and the blue is rationed. It survives on the things that tell
       you where you are and what will happen - selection, focus, the active item, primary
       buttons, links, progress - where being the brightest thing is the entire job.

       The surface keeps 8% of the hue so the chrome is still recognisably ours rather than
       generic grey, and separates from the card by ELEVATION and a hairline rather than by
       colour. It cannot simply be --cim360-card: the body of the card is that colour too,
       and a header the same colour as its body is not a header. Measured: the band is
       rgb(26,50,70) and the text on it 12.1:1, against 4.87:1 for white on the blue.

       A deep navy band was the other candidate and is the one already rejected once, on
       the top bar: two dark surfaces a shade apart read as a seam rather than as one
       shell. */
    --cim360-headerband-bg: color-mix(in srgb, var(--cim360-primary) 8%, var(--cim360-card));
    --cim360-headerband-fg: var(--cim360-text);
    --cim360-headerband-line: var(--cim360-border);

    /* White at low alpha rather than black: on a dark band a black wash is invisible, which
       is the same trap the light value's comment describes running the other way. */
    --cim360-headerband-pill: rgba(255, 255, 255, .10);

    /* A control ON the band. In light these are white on blue and could not be plainer; in
       dark the band is already dark, so a white control would be a glare and --cim360-card
       would be DARKER than the band and recede into it. A step further up instead, and a
       hairline to carry the edge - the fills are only 1.24:1 apart, which is under the 3:1
       a control boundary needs, so the border is doing that work and is not decoration. */
    --cim360-headerband-control-bg: color-mix(in srgb, var(--cim360-primary) 20%, var(--cim360-card));
    --cim360-headerband-control-fg: var(--cim360-text);
    --cim360-headerband-control-line: var(--cim360-border-strong);
    --cim360-headerband-control-accent: var(--cim360-text);
    --cim360-headerband-quiet-hover: rgba(255, 255, 255, .10);

    /* The status band goes the way the header band does in dark: the tone tints the card and
       the words are the body text. Measured 7.28-10.74:1 across the five stocktake tones, and
       11.87-18.91:1 with more contrast, which inherits these. DEV-TC-1076. */
    --cim360-statusband-strength: 24%;
    --cim360-statusband-fg: var(--cim360-text);

    --cim360-success-bg: color-mix(in srgb, var(--cim360-success) 18%, transparent);
    --cim360-success-fg: #86efac;
    --cim360-success-border: color-mix(in srgb, var(--cim360-success) 45%, transparent);

    --cim360-warning-bg: color-mix(in srgb, var(--cim360-warning) 18%, transparent);
    --cim360-warning-fg: #fcd34d;
    --cim360-warning-border: color-mix(in srgb, var(--cim360-warning) 45%, transparent);

    --cim360-danger-bg: color-mix(in srgb, var(--cim360-danger) 18%, transparent);
    --cim360-danger-fg: #fca5a5;
    --cim360-danger-border: color-mix(in srgb, var(--cim360-danger) 45%, transparent);

    --cim360-info-bg: color-mix(in srgb, var(--cim360-info) 18%, transparent);
    --cim360-info-fg: #93c5fd;
    --cim360-info-border: color-mix(in srgb, var(--cim360-info) 45%, transparent);

    --cim360-violet-bg: color-mix(in srgb, var(--cim360-violet) 18%, transparent);
    --cim360-violet-fg: #c4b5fd;
    --cim360-violet-border: color-mix(in srgb, var(--cim360-violet) 45%, transparent);

    --cim360-pink-bg: color-mix(in srgb, var(--cim360-pink) 18%, transparent);
    --cim360-pink-fg: #f9a8d4;
    --cim360-pink-border: color-mix(in srgb, var(--cim360-pink) 45%, transparent);

    --cim360-surface-strong: color-mix(in srgb, #111a25 86%, var(--cim360-accent) 14%);

    /* Deep blue rather than the lightened primary: this is a FILL, and the lightened
       primary is for text. Still recognisably the blue bar - the hue is unchanged, it is
       the level that differs - and white on it measures 13.9:1 where white on the light
       bar's #1D75BB manages 4.87. The wedge follows the card so the shape stays visible
       against the bar instead of becoming a white slab on a dark screen. */
    /* THE SAME SURFACE AS THE SIDE MENU, which is var(--cim360-card).

       The first attempt made this a deep blue - the reasoning being that the bar is blue in
       light, so it should stay blue in dark. On screen that put a dark blue band across the
       top of a page whose left menu was the card colour, two dark surfaces a shade apart,
       which reads as a seam rather than as one shell. In light the blue bar works because
       everything around it is white and the bar is the one coloured thing; in dark
       everything is already dark and the bar stops being a highlight and becomes a mismatch.

       So the chrome agrees with itself, and the brand blue keeps its job on the controls and
       the accents rather than on a band. The text follows suit: white on a card is white on
       near-black, so it takes the ordinary text token and measures as body text does. */
    --cim360-topbar-bg: var(--cim360-card);
    --cim360-topbar-fg: var(--cim360-text);
    --cim360-topbar-wedge: var(--cim360-card);

    /* Unchanged from light, and that is the point: this is the hue doing its FILL job, and
       a fill behind white text has to stay dark whatever the page around it is doing.
       --cim360-primary went light in this block so it could be read as text; if a filled
       control followed it there, white on #4DA3E8 would measure 2.72:1. It measures 4.87:1
       on this one. Two values because there are two jobs. */
    --cim360-primary-surface: #1D75BB;
    --cim360-primary-surface-hover: #1a66a3;
    --cim360-success-surface: #15803d;
    --cim360-primary-surface-strong: #155389;
    --cim360-on-primary: #ffffff;

    /* Danger as a FILL, for the same reason the primary has one: --cim360-danger is #F87171 in
       dark so it can be read as text, and white on that is 2.5:1. This is the value that works
       behind white in both modes - 4.53:1 - and it is what a notification count sits on. */
    --cim360-danger-surface: #dc2626;
    --cim360-on-danger: #ffffff;
    --cim360-danger-surface-hover: #b91c1c;

    /* The floating selection bar takes the side menu's surface, which is what was asked for
       and is also the only thing that reads correctly. It is a pill that hovers OVER the
       list, so in light it is a blue lozenge on a white page - obvious, and right. In dark
       the page is already dark and a blue lozenge stops being an accent and becomes the one
       glowing object on the screen, which is where the eye goes instead of the data.

       Agreeing with the side menu and the top bar makes the three read as one shell with the
       content inside it. The white lifts below still work on this surface - white at 10% on
       a near-black card is a hover, the same way white at 18% on blue was - and white text
       on the card measures 15.1:1. The shadow goes black rather than navy: a navy shadow on
       a near-black page is invisible, and the bar needs to look lifted off the list. */
    --cim360-actionbar-bg: var(--cim360-card);
    --cim360-actionbar-fg: var(--cim360-text);
    --cim360-actionbar-hairline: var(--cim360-border-strong);
    --cim360-actionbar-lift: rgba(255, 255, 255, .10);
    --cim360-actionbar-lift-strong: rgba(255, 255, 255, .18);
    --cim360-actionbar-shadow: rgba(0, 0, 0, .65);
    /* The pale pink reads as danger against blue. Against a near-black card it is one
       near-white beside another and the only thing separating Delete from Export is a hue
       nobody can see, so it takes the palette's own red - 5.44:1 on the card, and visibly red. */
    --cim360-actionbar-danger: var(--cim360-danger);
    /* Here the bar is the dark card, so the launcher takes the brand blue fill: white on it is
       4.87:1. The blue against the card is only about 3:1, so a light edge carries the shape. */
    --cim360-actionbar-cta-bg: var(--cim360-primary-surface);
    --cim360-actionbar-cta-fg: var(--cim360-on-primary);
    --cim360-actionbar-cta-border: rgba(255, 255, 255, .55);
    /* Inverted on a dark page: a near-black tooltip on a near-black page is no tooltip at all. */
    --cim360-tooltip-bg: #f1f5f9;
    --cim360-tooltip-fg: #0f172a;

    /* The light value was #0a3a64 - a near-navy, which on a dark blue wash is one dark
       colour on another and the row a reader has just selected becomes the one they
       cannot read. Near-white instead, and deliberately not pure: the selected wash is
       the lightest surface in the dark palette, and #f2f8ff on the 32% selected-and-
       focused row measures 11.2:1 where the navy managed 1.4. */
    --cim360-row-selected-fg: #f2f8ff;

    /* The vendors' dark button variants. Microsoft's has no border of its own, so its edge
       takes the fill and the theme border separates it from the card. */
    --cim360-signin-ms-fill: #2f2f2f;
    --cim360-signin-ms-ink: #ffffff;
    --cim360-signin-ms-edge: #2f2f2f;
    --cim360-signin-google-fill: #131314;
    --cim360-signin-google-ink: #e3e3e3;
    --cim360-signin-google-edge: #8e918f;
}

/* =================================================================================================
   HIGH CONTRAST - A MODIFIER, NOT A THEME
   =================================================================================================

   It composes with light and dark rather than replacing them, because that is what the operating
   system does and what people expect: somebody who runs dark mode and needs more contrast wants a
   HIGHER-CONTRAST DARK, not a switch back to white.

   So there are two blocks below, both keyed on data-fluent-contrast="more", one of them also
   requiring data-fluent-darkmode. They come after the dark block so they win the cascade, and the
   light one carries :not([data-fluent-darkmode]) so the two can never both apply.

   THE TARGET IS 7:1, which is WCAG 1.4.6 Contrast (Enhanced) - Level AAA. Nothing obliges us to
   meet AAA, and EN 301 549 asks for AA; this exists because the people who turn it on are the ones
   for whom AA is not enough, and a mode that only matched the default would be a setting that does
   nothing. Non-text goes to 4.5:1 rather than the 3:1 of 1.4.11, for the same reason.

   Surfaces FLATTEN deliberately. The ordinary palette separates a card from the page with a step of
   a few percent, which is exactly the distinction that disappears first for a low-vision reader;
   here the surfaces collapse to one value and every boundary is carried by a border instead. That
   is a real design change and not a darker palette - it is why this is a hand-written block rather
   than a filter over the existing one.

   Hues keep their identity. Red still reads as red: a high-contrast mode that greys everything
   would take away the colour channel from people who can still use it, which is 1.4.1 territory.
   ============================================================================================== */

[data-fluent-contrast="more"]:not([data-fluent-darkmode]) body,
.cim360-theme-preview[data-preview="light"][data-preview-contrast="more"],
[data-fluent-contrast="more"]:not([data-fluent-darkmode]) .dxbl-theme-fluent {
    /* Ink goes to black. #1f2937 is 13.6:1 on white and would pass, but muted text at #4B5563 is
       7.6:1 and every tint it sits on takes it below 7. One value removes the question. */
    --cim360-text-strong: #000000;
    --cim360-text: #000000;
    --cim360-caption: #000000;
    --cim360-text-muted: #1c1c1c;
    --cim360-muted-soft: #333333;

    /* One surface. See the header: the 2-4% steps between card, surface and surface-2 are the
       first thing to disappear, so they are replaced by borders that cannot. */
    --cim360-card: #ffffff;
    --cim360-surface: #ffffff;
    --cim360-surface-2: #ffffff;
    --cim360-surface-3: #ffffff;
    --cim360-surface-strong: #ffffff;
    --cim360-primary-zebra: #ffffff;

    /* Borders do the work the surfaces used to. Solid ink at high alpha, not a tint. */
    --cim360-border: rgba(0, 0, 0, .70);
    --cim360-border-strong: rgba(0, 0, 0, .85);
    --cim360-border-soft: rgba(0, 0, 0, .55);
    --cim360-border-cool: rgba(0, 0, 0, .70);
    --cim360-border-subtle: rgba(0, 0, 0, .45);

    /* #0b4c7d: white on it is 8.96:1, and it is still recognisably the brand blue. */
    --cim360-primary: #0b4c7d;
    --cim360-primary-dark: #063554;
    --cim360-primary-hover: #063554;
    --cim360-primary-surface: #0b4c7d;
    --cim360-primary-surface-hover: #063554;
    --cim360-success-surface: #0f5132;
    --cim360-primary-surface-strong: #041f33;
    --cim360-primary-tint: rgba(11, 76, 125, .18);
    --cim360-primary-soft: rgba(11, 76, 125, .12);
    --cim360-primary-field-bg: #ffffff;
    --cim360-primary-field-border: rgba(0, 0, 0, .70);

    /* Semantic hues darkened until each clears 7:1 as text on white, keeping the hue so the
       colour channel still carries meaning for anyone who can use it. */
    --cim360-success: #0f5132;
    --cim360-success-fg: #0f5132;
    --cim360-success-bg: #ffffff;
    --cim360-success-border: #0f5132;

    --cim360-warning: #6b3b00;
    --cim360-warning-fg: #6b3b00;
    --cim360-warning-bg: #ffffff;
    --cim360-warning-border: #6b3b00;

    --cim360-danger: #8b0000;
    --cim360-danger-fg: #8b0000;
    --cim360-danger-bg: #ffffff;
    --cim360-danger-border: #8b0000;
    --cim360-danger-surface: #8b0000;
    --cim360-danger-surface-hover: #6b0000;

    --cim360-info: #0b4c7d;
    --cim360-info-fg: #0b4c7d;
    --cim360-info-bg: #ffffff;
    --cim360-info-border: #0b4c7d;

    --cim360-violet: #4c1d95;
    --cim360-violet-fg: #4c1d95;
    --cim360-violet-bg: #ffffff;
    --cim360-violet-border: #4c1d95;

    --cim360-pink: #831843;
    --cim360-pink-fg: #831843;
    --cim360-pink-bg: #ffffff;
    --cim360-pink-border: #831843;

    --cim360-status-finalised: #0f5132;
    --cim360-status-loss: #8b0000;
    --cim360-accent: #0b4c7d;
    --cim360-teal: #0f5132;

    /* The bands keep their fill, because white-on-blue at 8.96:1 is the most contrast a band
       can have. The header band stops being a tint and becomes the fill itself. */
    --cim360-headerband-bg: #0b4c7d;
    --cim360-headerband-fg: #ffffff;
    --cim360-headerband-line: rgba(0, 0, 0, .85);
    --cim360-headerband-pill: rgba(0, 0, 0, .45);
    --cim360-headerband-control-bg: #ffffff;
    --cim360-headerband-control-fg: #000000;
    --cim360-headerband-control-line: #ffffff;
    --cim360-headerband-control-accent: #0b4c7d;
    --cim360-headerband-quiet-hover: rgba(255, 255, 255, .30);

    --cim360-topbar-bg: #0b4c7d;
    --cim360-topbar-fg: #ffffff;
    --cim360-topbar-wedge: #ffffff;

    --cim360-actionbar-bg: #0b4c7d;
    --cim360-actionbar-fg: #ffffff;
    --cim360-actionbar-hairline: rgba(255, 255, 255, .55);
    --cim360-actionbar-lift: rgba(255, 255, 255, .25);
    --cim360-actionbar-lift-strong: rgba(255, 255, 255, .40);
    --cim360-actionbar-shadow: rgba(0, 0, 0, .55);
    --cim360-actionbar-danger: #ffd9d9;
    /* The launcher inverts the bar: #0b4c7d on white, 9.0:1. */
    --cim360-actionbar-cta-bg: #ffffff;
    --cim360-actionbar-cta-fg: #0b4c7d;
    --cim360-actionbar-cta-border: transparent;

    --cim360-row-selected-fg: #000000;
    --cim360-search-highlight: #ffe680;
    --cim360-surface-hover: #ffffff;
    --cim360-surface-selected: rgba(11, 76, 125, .18);
    --cim360-surface-muted: #ffffff;
    --cim360-queue-bg: #0b4c7d;

    /* Charts: the four-step sequential ramp loses its middle two steps at this contrast, so it
       is respaced to the extremes rather than left to collapse into one blue. */
    --chart-seq-1: #4a99d1;
    --chart-seq-2: #1e73a8;
    --chart-seq-3: #0b4c7d;
    --chart-seq-4: #041f33;
    --chart-deemphasis: #6b6b6b;
    --chart-grid: rgba(0, 0, 0, .45);
    --chart-axis: rgba(0, 0, 0, .85);

    /* The quarantine seven, darkened until each clears 7:1 on white. Overdue is deliberately a
       different orange from Pending rather than the same one: at this contrast the two ambers
       collapse into each other, and those are the two states somebody is comparing. */
    --cim360-q-pending: #6b3b00;
    --cim360-q-passed: #0f5132;
    --cim360-q-failed: #8b0000;
    --cim360-q-rework: #4c1d95;
    --cim360-q-scrapped: #333333;
    --cim360-q-overdue: #7c2d12;
    --cim360-q-returned: #134e4a;

    --cim360-wh-navy: #06283d;
    --cim360-soft: #134e4a;
    --cim360-shadow: 0 0.875rem 1.875rem rgba(0, 0, 0, .45);
}

[data-fluent-darkmode][data-fluent-contrast="more"] body,
.cim360-theme-preview[data-preview="dark"][data-preview-contrast="more"],
[data-fluent-darkmode][data-fluent-contrast="more"] .dxbl-theme-fluent {
    /* The mirror. Pure black ground, pure white ink - 21:1, which is as far as a screen goes. */
    --cim360-text-strong: #ffffff;
    --cim360-text: #ffffff;
    --cim360-caption: #ffffff;
    --cim360-text-muted: #e6e6e6;
    --cim360-muted-soft: #cccccc;

    --cim360-card: #000000;
    --cim360-surface: #000000;
    --cim360-surface-2: #000000;
    --cim360-surface-3: #000000;
    --cim360-surface-strong: #000000;
    --cim360-primary-zebra: #000000;

    --cim360-border: rgba(255, 255, 255, .75);
    --cim360-border-strong: rgba(255, 255, 255, .90);
    --cim360-border-soft: rgba(255, 255, 255, .55);
    --cim360-border-cool: rgba(255, 255, 255, .75);
    --cim360-border-subtle: rgba(255, 255, 255, .45);

    /* #7FC4FF on black is 9.8:1. The SURFACE keeps a dark fill so white on it still clears 7. */
    --cim360-primary: #7FC4FF;
    --cim360-primary-dark: #AEDBFF;
    --cim360-primary-hover: #AEDBFF;
    --cim360-primary-surface: #0b4c7d;
    --cim360-primary-surface-hover: #063554;
    --cim360-success-surface: #0f5132;
    --cim360-primary-surface-strong: #041f33;
    --cim360-primary-tint: rgba(127, 196, 255, .22);
    --cim360-primary-soft: rgba(127, 196, 255, .14);
    --cim360-primary-field-bg: #000000;
    --cim360-primary-field-border: rgba(255, 255, 255, .75);

    /* The 300-level of each hue: every one clears 7:1 on black, and they stay far enough apart
       in hue to be told from one another. */
    --cim360-success: #6EE7A0;
    --cim360-success-fg: #6EE7A0;
    --cim360-success-bg: #000000;
    --cim360-success-border: #6EE7A0;

    --cim360-warning: #FFD166;
    --cim360-warning-fg: #FFD166;
    --cim360-warning-bg: #000000;
    --cim360-warning-border: #FFD166;

    --cim360-danger: #FF9B9B;
    --cim360-danger-fg: #FF9B9B;
    --cim360-danger-bg: #000000;
    --cim360-danger-border: #FF9B9B;
    --cim360-danger-surface: #8b0000;
    --cim360-danger-surface-hover: #6b0000;

    --cim360-info: #7FC4FF;
    --cim360-info-fg: #7FC4FF;
    --cim360-info-bg: #000000;
    --cim360-info-border: #7FC4FF;

    --cim360-violet: #C9B0FF;
    --cim360-violet-fg: #C9B0FF;
    --cim360-violet-bg: #000000;
    --cim360-violet-border: #C9B0FF;

    --cim360-pink: #FFA8D5;
    --cim360-pink-fg: #FFA8D5;
    --cim360-pink-bg: #000000;
    --cim360-pink-border: #FFA8D5;

    --cim360-status-finalised: #6EE7A0;
    --cim360-status-loss: #FF9B9B;
    --cim360-accent: #7FC4FF;
    --cim360-teal: #6EE7A0;

    --cim360-headerband-bg: #000000;
    --cim360-headerband-fg: #ffffff;
    --cim360-headerband-line: rgba(255, 255, 255, .90);
    --cim360-headerband-pill: rgba(255, 255, 255, .25);
    --cim360-headerband-control-bg: #000000;
    --cim360-headerband-control-fg: #ffffff;
    --cim360-headerband-control-line: rgba(255, 255, 255, .90);
    --cim360-headerband-control-accent: #ffffff;
    --cim360-headerband-quiet-hover: rgba(255, 255, 255, .25);

    --cim360-topbar-bg: #000000;
    --cim360-topbar-fg: #ffffff;
    --cim360-topbar-wedge: #000000;

    --cim360-actionbar-bg: #000000;
    --cim360-actionbar-fg: #ffffff;
    --cim360-actionbar-hairline: rgba(255, 255, 255, .90);
    --cim360-actionbar-lift: rgba(255, 255, 255, .22);
    --cim360-actionbar-lift-strong: rgba(255, 255, 255, .35);
    --cim360-actionbar-shadow: rgba(0, 0, 0, .9);
    --cim360-actionbar-danger: #FF9B9B;
    /* The launcher inverts the black bar: black on white, 21:1. */
    --cim360-actionbar-cta-bg: #ffffff;
    --cim360-actionbar-cta-fg: #000000;
    --cim360-actionbar-cta-border: transparent;

    --cim360-row-selected-fg: #ffffff;
    --cim360-search-highlight: rgba(255, 209, 102, .45);
    --cim360-surface-hover: #000000;
    --cim360-surface-selected: rgba(127, 196, 255, .22);
    --cim360-surface-muted: #000000;
    --cim360-queue-bg: #0b4c7d;

    --chart-seq-1: #CFE8FF;
    --chart-seq-2: #7FC4FF;
    --chart-seq-3: #3D9BE0;
    --chart-seq-4: #1F6FA8;
    --chart-deemphasis: #999999;
    --chart-grid: rgba(255, 255, 255, .40);
    --chart-axis: rgba(255, 255, 255, .85);

    /* The mirror of the light block's seven, lifted until each clears 7:1 on black, and with
       Overdue kept a separate orange from Pending for the same reason. */
    --cim360-q-pending: #FFD166;
    --cim360-q-passed: #6EE7A0;
    --cim360-q-failed: #FF9B9B;
    --cim360-q-rework: #C9B0FF;
    --cim360-q-scrapped: #d4d4d4;
    --cim360-q-overdue: #FFB380;
    --cim360-q-returned: #7FE3E0;

    --cim360-wh-navy: #AEDBFF;
    --cim360-soft: #7FE3E0;
    --cim360-shadow: 0 0.875rem 1.875rem rgba(0, 0, 0, .9);
}

/* =================================================================================================
   COLOUR-BLIND SAFE - ONE PALETTE, NOT ONE PER TYPE
   =================================================================================================

   ONE mode, and that is the whole design decision. Protanopia, deuteranopia and tritanopia shift
   different parts of the spectrum, so the instinct is a mode each - but a palette can be chosen so
   that every pair stays distinct under ALL of them at once, and then one mode serves everybody.
   Three modes would also require a person to know which type they have, which most do not: the
   red-green pair covers roughly 8% of men between them and very few have been tested.

   The palette is OKABE-ITO, published for exactly this purpose and the de-facto standard in
   scientific figures. Eight hues, chosen so no two collide under any common form of colour vision
   deficiency:

     orange           #E69F00      blue             #0072B2
     sky blue         #56B4E9      vermillion       #D55E00
     bluish green     #009E73      reddish purple   #CC79A7
     yellow           #F0E442      black            #000000

   WHAT IS MAPPED, AND WHY IT IS NOT A RECOLOURING OF EVERYTHING. Only the SEMANTIC hues move -
   success, warning, danger, info, violet, pink - because those are the ones whose whole job is to
   be told apart from each other. Surfaces, text and borders are untouched: they carry no meaning by
   hue and changing them would be a different theme, not an accessible one.

   The brand blue is left alone as well. It means "this product", not "this state", so nothing is
   read from distinguishing it - and Okabe-Ito's own blue is close enough that swapping it would
   cost brand identity for no gain.

   The critical pair here is GREEN AGAINST AMBER, which is the one the chart stylesheet already
   records as failing a measured separation. Bluish green against orange is the pair Okabe-Ito
   separates furthest, and it survives every simulation.

   AND IT IS STILL NOT AN EXCUSE FOR COLOUR-ONLY MEANING. WCAG 1.4.1 is not satisfied by a better
   palette; it is satisfied by a second channel. Every status here is already a word or a glyph
   beside its dot, and that remains the thing keeping us conformant. This mode makes the colour
   channel useful to more people - it does not make it load-bearing.

   Values are derived rather than hand-picked per family: -bg, -fg and -border come from the hue by
   color-mix, so a hue that is already light and one that is already dark both land in range, and a
   ninth family added later needs one value rather than four.
   ============================================================================================== */

[data-fluent-cvd="okabe-ito"]:not([data-fluent-darkmode]) body,
.cim360-theme-preview[data-preview="light"][data-preview-cvd="okabe-ito"],
[data-fluent-cvd="okabe-ito"]:not([data-fluent-darkmode]) .dxbl-theme-fluent {
    --cim360-success: #009E73;
    --cim360-warning: #E69F00;
    --cim360-danger: #D55E00;
    --cim360-info: #0072B2;
    --cim360-violet: #CC79A7;
    --cim360-pink: #CC79A7;

    /* Text sits at 75% of the hue towards black, which lands every family past 4.5:1 on its own
       wash without a second hand-picked value per family. */
    --cim360-success-fg: color-mix(in srgb, var(--cim360-success) 72%, #000000);
    --cim360-warning-fg: color-mix(in srgb, var(--cim360-warning) 62%, #000000);
    --cim360-danger-fg: color-mix(in srgb, var(--cim360-danger) 78%, #000000);
    --cim360-info-fg: color-mix(in srgb, var(--cim360-info) 88%, #000000);
    --cim360-violet-fg: color-mix(in srgb, var(--cim360-violet) 62%, #000000);
    --cim360-pink-fg: color-mix(in srgb, var(--cim360-pink) 62%, #000000);

    --cim360-success-bg: color-mix(in srgb, var(--cim360-success) 14%, var(--cim360-card));
    --cim360-warning-bg: color-mix(in srgb, var(--cim360-warning) 16%, var(--cim360-card));
    --cim360-danger-bg: color-mix(in srgb, var(--cim360-danger) 14%, var(--cim360-card));
    --cim360-info-bg: color-mix(in srgb, var(--cim360-info) 12%, var(--cim360-card));
    --cim360-violet-bg: color-mix(in srgb, var(--cim360-violet) 16%, var(--cim360-card));
    --cim360-pink-bg: color-mix(in srgb, var(--cim360-pink) 16%, var(--cim360-card));

    --cim360-success-border: color-mix(in srgb, var(--cim360-success) 45%, var(--cim360-card));
    --cim360-warning-border: color-mix(in srgb, var(--cim360-warning) 45%, var(--cim360-card));
    --cim360-danger-border: color-mix(in srgb, var(--cim360-danger) 45%, var(--cim360-card));
    --cim360-info-border: color-mix(in srgb, var(--cim360-info) 45%, var(--cim360-card));
    --cim360-violet-border: color-mix(in srgb, var(--cim360-violet) 45%, var(--cim360-card));
    --cim360-pink-border: color-mix(in srgb, var(--cim360-pink) 45%, var(--cim360-card));

    --cim360-status-finalised: var(--cim360-success-fg);
    --cim360-status-loss: var(--cim360-danger-fg);
    --cim360-teal: #009E73;

    /* The quarantine seven, which reach the DOM as strings from C# and so cannot be derived at
       the call site. Sky blue and yellow earn their place here - this is the one palette with
       enough distinct hues to give seven states seven identities. */
    --cim360-q-pending: #E69F00;
    --cim360-q-passed: #009E73;
    --cim360-q-failed: #D55E00;
    --cim360-q-rework: #CC79A7;
    --cim360-q-scrapped: #555555;
    --cim360-q-overdue: #D55E00;
    --cim360-q-returned: #56B4E9;

    /* A sequential ramp is magnitude, not category, so it stays one hue - light to dark is
       readable under every deficiency including achromatopsia. Okabe-Ito's blue is the anchor. */
    --chart-seq-1: #4a99ce;
    --chart-seq-2: #3586b9;
    --chart-seq-3: #0072B2;
    --chart-seq-4: #04456b;
}

[data-fluent-darkmode][data-fluent-cvd="okabe-ito"] body,
.cim360-theme-preview[data-preview="dark"][data-preview-cvd="okabe-ito"],
[data-fluent-darkmode][data-fluent-cvd="okabe-ito"] .dxbl-theme-fluent {
    /* The same eight hues lifted for a dark ground. Okabe-Ito was published against white, so
       taking each towards white keeps the separations that make it work while clearing 4.5:1 on
       the dark card - the alternative, using the published values as-is, puts #0072B2 at 2.3:1. */
    --cim360-success: color-mix(in srgb, #009E73 62%, #ffffff);
    --cim360-warning: color-mix(in srgb, #E69F00 72%, #ffffff);
    --cim360-danger: color-mix(in srgb, #D55E00 58%, #ffffff);
    --cim360-info: color-mix(in srgb, #56B4E9 82%, #ffffff);
    --cim360-violet: color-mix(in srgb, #CC79A7 70%, #ffffff);
    --cim360-pink: color-mix(in srgb, #CC79A7 70%, #ffffff);

    --cim360-success-fg: var(--cim360-success);
    --cim360-warning-fg: var(--cim360-warning);
    --cim360-danger-fg: var(--cim360-danger);
    --cim360-info-fg: var(--cim360-info);
    --cim360-violet-fg: var(--cim360-violet);
    --cim360-pink-fg: var(--cim360-pink);

    --cim360-success-bg: color-mix(in srgb, var(--cim360-success) 18%, transparent);
    --cim360-warning-bg: color-mix(in srgb, var(--cim360-warning) 18%, transparent);
    --cim360-danger-bg: color-mix(in srgb, var(--cim360-danger) 18%, transparent);
    --cim360-info-bg: color-mix(in srgb, var(--cim360-info) 18%, transparent);
    --cim360-violet-bg: color-mix(in srgb, var(--cim360-violet) 18%, transparent);
    --cim360-pink-bg: color-mix(in srgb, var(--cim360-pink) 18%, transparent);

    --cim360-success-border: color-mix(in srgb, var(--cim360-success) 45%, transparent);
    --cim360-warning-border: color-mix(in srgb, var(--cim360-warning) 45%, transparent);
    --cim360-danger-border: color-mix(in srgb, var(--cim360-danger) 45%, transparent);
    --cim360-info-border: color-mix(in srgb, var(--cim360-info) 45%, transparent);
    --cim360-violet-border: color-mix(in srgb, var(--cim360-violet) 45%, transparent);
    --cim360-pink-border: color-mix(in srgb, var(--cim360-pink) 45%, transparent);

    --cim360-status-finalised: var(--cim360-success);
    --cim360-status-loss: var(--cim360-danger);
    --cim360-teal: var(--cim360-success);

    --cim360-q-pending: color-mix(in srgb, #E69F00 72%, #ffffff);
    --cim360-q-passed: color-mix(in srgb, #009E73 62%, #ffffff);
    --cim360-q-failed: color-mix(in srgb, #D55E00 58%, #ffffff);
    --cim360-q-rework: color-mix(in srgb, #CC79A7 70%, #ffffff);
    --cim360-q-scrapped: #b3b3b3;
    --cim360-q-overdue: color-mix(in srgb, #D55E00 58%, #ffffff);
    --cim360-q-returned: #56B4E9;

    --chart-seq-1: #cfe6f5;
    --chart-seq-2: #8ec6e8;
    --chart-seq-3: #56B4E9;
    --chart-seq-4: #2b86bd;
}

/* =================================================================================================
   BOTH AT ONCE
   =================================================================================================

   Two modifiers that compose have a third state, and it does not look after itself. The
   colour-blind block is written after the high-contrast one, so with both switched on it won the
   cascade and replaced the 7:1 values with its own 4.5:1 ones - which means somebody who needed
   BOTH got LESS contrast than choosing high contrast alone. A setting that gets worse when you
   also ask for the other setting is the kind of fault nobody reports, because whoever hits it
   assumes that is simply what the product looks like.

   Caught by the API probe rather than by reasoning: switching both on and reading --cim360-success
   back gave the Okabe-Ito value, not the raised one.

   So the combination has its own block and keeps both promises - Okabe-Ito's hue separations, at
   high contrast's ratios. The hues are the same eight; only the level moves.
   ============================================================================================== */

[data-fluent-contrast="more"][data-fluent-cvd="okabe-ito"]:not([data-fluent-darkmode]) body,
.cim360-theme-preview[data-preview="light"][data-preview-contrast="more"][data-preview-cvd="okabe-ito"],
[data-fluent-contrast="more"][data-fluent-cvd="okabe-ito"]:not([data-fluent-darkmode]) .dxbl-theme-fluent {
    /* Surfaces stay flattened, as the high-contrast block has them. */
    --cim360-success-bg: #ffffff;
    --cim360-warning-bg: #ffffff;
    --cim360-danger-bg: #ffffff;
    --cim360-info-bg: #ffffff;
    --cim360-violet-bg: #ffffff;
    --cim360-pink-bg: #ffffff;

    /* Okabe-Ito taken down until each clears 7:1 on white. The hue is preserved - these are the
       published values mixed towards black, not replaced - so the separations survive. */
    --cim360-success: color-mix(in srgb, #009E73 52%, #000000);
    --cim360-warning: color-mix(in srgb, #E69F00 44%, #000000);
    --cim360-danger: color-mix(in srgb, #D55E00 58%, #000000);
    --cim360-info: color-mix(in srgb, #0072B2 72%, #000000);
    --cim360-violet: color-mix(in srgb, #CC79A7 46%, #000000);
    --cim360-pink: color-mix(in srgb, #CC79A7 46%, #000000);

    --cim360-success-fg: var(--cim360-success);
    --cim360-warning-fg: var(--cim360-warning);
    --cim360-danger-fg: var(--cim360-danger);
    --cim360-info-fg: var(--cim360-info);
    --cim360-violet-fg: var(--cim360-violet);
    --cim360-pink-fg: var(--cim360-pink);

    --cim360-success-border: var(--cim360-success);
    --cim360-warning-border: var(--cim360-warning);
    --cim360-danger-border: var(--cim360-danger);
    --cim360-info-border: var(--cim360-info);
    --cim360-violet-border: var(--cim360-violet);
    --cim360-pink-border: var(--cim360-pink);

    --cim360-status-finalised: var(--cim360-success);
    --cim360-status-loss: var(--cim360-danger);
}

[data-fluent-darkmode][data-fluent-contrast="more"][data-fluent-cvd="okabe-ito"] body,
.cim360-theme-preview[data-preview="dark"][data-preview-contrast="more"][data-preview-cvd="okabe-ito"],
[data-fluent-darkmode][data-fluent-contrast="more"][data-fluent-cvd="okabe-ito"] .dxbl-theme-fluent {
    --cim360-success-bg: #000000;
    --cim360-warning-bg: #000000;
    --cim360-danger-bg: #000000;
    --cim360-info-bg: #000000;
    --cim360-violet-bg: #000000;
    --cim360-pink-bg: #000000;

    /* The mirror: the same eight hues taken towards white until each clears 7:1 on black. */
    --cim360-success: color-mix(in srgb, #009E73 45%, #ffffff);
    --cim360-warning: color-mix(in srgb, #E69F00 62%, #ffffff);
    --cim360-danger: color-mix(in srgb, #D55E00 42%, #ffffff);
    --cim360-info: color-mix(in srgb, #56B4E9 72%, #ffffff);
    --cim360-violet: color-mix(in srgb, #CC79A7 55%, #ffffff);
    --cim360-pink: color-mix(in srgb, #CC79A7 55%, #ffffff);

    --cim360-success-fg: var(--cim360-success);
    --cim360-warning-fg: var(--cim360-warning);
    --cim360-danger-fg: var(--cim360-danger);
    --cim360-info-fg: var(--cim360-info);
    --cim360-violet-fg: var(--cim360-violet);
    --cim360-pink-fg: var(--cim360-pink);

    --cim360-success-border: var(--cim360-success);
    --cim360-warning-border: var(--cim360-warning);
    --cim360-danger-border: var(--cim360-danger);
    --cim360-info-border: var(--cim360-info);
    --cim360-violet-border: var(--cim360-violet);
    --cim360-pink-border: var(--cim360-pink);

    --cim360-status-finalised: var(--cim360-success);
    --cim360-status-loss: var(--cim360-danger);
}

.w-100 {
    width: 100%;
}

.text-danger {
    color: var(--DS-color-surface-danger-default-rest);
}

.p-4 {
    padding: 1.5rem;
}

.navigation-drawer {
    --dxbl-drawer-separator-border-width: 0;
}

.menu-item {
    --dxbl-menu-item-color: #fff;
    --dxbl-menu-item-image-color: #fff;
}

.menu-item a {
    color: inherit;
}

[data-fluent-darkmode] .dxbl-theme-fluent .welcome-card {
    color: var(--DS-primary-70);
}

.icon {
    --icon-width: 1.25rem;
    --icon-height: 1.25rem;
    --icon-back-mask-image: url("../images/back-fluent.svg");
    --icon-close-mask-image: url("../images/close-fluent.svg");
    --icon-menu-mask-image: url("../images/menu-fluent.svg");
    --icon-docs-mask-image: url("../images/doc-fluent.svg");
    --icon-demos-mask-image: url("../images/demos-fluent.svg");
    --icon-home-mask-image: url("../images/home-fluent.svg");
    --icon-stock-control-mask-image: url("../../images/different-odd-even-pages.svg");
    --icon-counter-mask-image: url("../images/counter-fluent.svg");
    --icon-shelf-full-mask-image: url("../images/shelf_full.svg");
}
