/*
 * Instrument: NCode's design tokens, NCode Brand 0.12.0.
 *
 * Generated by build.mjs from src/tokens.source.json: do not edit it. "npm run build" writes it, and
 * "npm run check" fails when it is not what the source gives.
 *
 * Every custom property starts with --nc-. The semantic tokens are the public contract: the color roles
 * (--nc-color-*), the type roles (--nc-type-*), elevation, the two font families, the measures and the two
 * tenant inputs. The color ramps and the steps of the type scale are private primitives, which may change in any
 * release (docs/decisions/1002).
 *
 * A theme is nothing but the root's color-scheme: it follows prefers-color-scheme until data-theme pins it.
 * A tenant replaces two values: --nc-brand (BrandingConfig.primaryColor) and --nc-brand-secondary
 * (BrandingConfig.secondaryColor). Everything their colors touch is derived from them below, in CSS. The
 * derivations are calibrated on the logo kit: NCode Blue yields exactly NCode Navy for screens and exactly NCode
 * Blue Light for the dark theme. tokens/derive.mjs derives the same colors in JavaScript and also guarantees their
 * contrast for any input, which CSS cannot.
 */

:root {
  color-scheme: light dark;

  /* ---- primitives: color. Private: read a semantic color instead (docs/decisions/1002) */

  /* Blue: the logo kit's hue, 225 degrees in HSL. 300, 600 and 900 are the kit's exact colors; the other steps bend the hue the way those three do. */
  --nc-blue-50: #F2F5FF;
  --nc-blue-100: #E4EBFF;
  --nc-blue-200: #C3D2FF;
  --nc-blue-300: #809FFF; /* NCode Blue Light */
  --nc-blue-400: #557EFA;
  --nc-blue-500: #2757E8;
  --nc-blue-600: #0033CC; /* NCode Blue */
  --nc-blue-700: #032AA7;
  --nc-blue-800: #08257F;
  --nc-blue-900: #0A1F5C; /* NCode Navy */
  --nc-blue-950: #071339;

  /* Stone: the neutral. A trace of warm olive (OKLCH hue 106), so the case has no opinion about a tenant's color. */
  --nc-stone-0: #FFFFFF;
  --nc-stone-50: #F7F7F4;
  --nc-stone-100: #F0F0ED;
  --nc-stone-200: #E9E9E4;
  --nc-stone-300: #D9D9D4;
  --nc-stone-400: #BEBEB8;
  --nc-stone-450: #93938C;
  --nc-stone-500: #797972;
  --nc-stone-600: #5E5E58;
  --nc-stone-700: #4B4B45;
  --nc-stone-800: #343430;
  --nc-stone-850: #282824;
  --nc-stone-900: #1E1E1B;
  --nc-stone-925: #171714;
  --nc-stone-950: #11110F;
  --nc-stone-975: #0A0A08;

  /* Green: success. */
  --nc-green-50: #ECFAEF;
  --nc-green-100: #D3F5DB;
  --nc-green-300: #7ADE95;
  --nc-green-500: #20A04E;
  --nc-green-600: #11813C;
  --nc-green-700: #126630;
  --nc-green-800: #0D4A22;
  --nc-green-900: #083518;
  --nc-green-950: #092210;

  /* Amber: the one supporting hue. Warning, hazard tape, and a sensitive value on a screen. */
  --nc-amber-50: #FFF6E1;
  --nc-amber-100: #FFECB8;
  --nc-amber-300: #FAC13B;
  --nc-amber-400: #F4AD1D;
  --nc-amber-500: #DC8900;
  --nc-amber-600: #B96A00;
  --nc-amber-700: #8F4D05;
  --nc-amber-800: #623606;
  --nc-amber-900: #442504;
  --nc-amber-950: #2A1907;

  /* Red: danger. */
  --nc-red-50: #FFF2F0;
  --nc-red-100: #FFE2DF;
  --nc-red-300: #FF958D;
  --nc-red-500: #DE3C37;
  --nc-red-600: #C01F1C;
  --nc-red-700: #9C1B18;
  --nc-red-800: #711612;
  --nc-red-900: #4D1612;
  --nc-red-950: #31100D;

  /* ---- type. The families are public; the widths, weights, sizes, leadings and trackings are private primitives */
  --nc-font-sans: "Instrument Sans Variable", "Instrument Sans", system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif; /* names, headings and reading */
  --nc-font-mono: "Martian Mono Variable", "Martian Mono", ui-monospace, "Cascadia Mono", "SF Mono", "Menlo", "Consolas", monospace; /* every value the system reports, and code */

  /* Width is part of the voice: labels are engraved narrow, headings a little condensed, text at full width. */
  --nc-width-label: 82%;
  --nc-width-display: 86%;
  --nc-width-text: 100%;
  --nc-width-code: 75%; /* Martian Mono at 75% has a 0.6em advance, the usual width of a code face */
  --nc-width-readout: 100%; /* a short value on a screen is set wide, like a display */

  --nc-weight-regular: 400;
  --nc-weight-medium: 500;
  --nc-weight-semibold: 600;
  --nc-weight-bold: 700;

  --nc-text-2xs: 0.6875rem; /* 11px: engraved labels */
  --nc-text-xs: 0.75rem; /* 12px */
  --nc-text-sm: 0.8125rem; /* 13px: dense interface, code, field labels */
  --nc-text-md: 0.875rem; /* 14px: interface */
  --nc-text-base: 1rem; /* 16px */
  --nc-text-reading: 1.0625rem; /* 17px: long-form documentation */
  --nc-text-lg: 1.1875rem; /* 19px */
  --nc-text-xl: 1.375rem; /* 22px: lead */
  --nc-text-2xl: 1.75rem; /* 28px */
  --nc-text-3xl: 2.25rem; /* 36px */
  --nc-text-4xl: 2.75rem; /* 44px */
  --nc-text-5xl: 3.5rem; /* 56px */
  --nc-text-6xl: 4.75rem; /* 76px */

  --nc-leading-flat: 1;
  --nc-leading-tight: 1.08;
  --nc-leading-snug: 1.3;
  --nc-leading-normal: 1.5;
  --nc-leading-reading: 1.7;

  --nc-tracking-label: 0.08em;
  --nc-tracking-display: -0.022em;
  --nc-tracking-heading: -0.012em;
  --nc-tracking-normal: 0;

  /* ---- space, shape, size, motion */
  --nc-space-0: 0;
  --nc-space-1: 0.125rem; /* 2px */
  --nc-space-2: 0.25rem; /* 4px */
  --nc-space-3: 0.5rem; /* 8px */
  --nc-space-4: 0.75rem; /* 12px */
  --nc-space-5: 1rem; /* 16px */
  --nc-space-6: 1.5rem; /* 24px */
  --nc-space-7: 2rem; /* 32px */
  --nc-space-8: 3rem; /* 48px */
  --nc-space-9: 4rem; /* 64px */
  --nc-space-10: 6rem; /* 96px */

  --nc-radius-cell: 2px; /* memory cells, check boxes */
  --nc-radius-plate: 4px; /* label plates, tags, keycaps */
  --nc-radius-control: 6px; /* keys and wells */
  --nc-radius-panel: 10px; /* plates, screens */
  --nc-radius-module: 14px; /* the outermost modules: dialogs, cards */
  --nc-radius-round: 999px; /* lamps */

  --nc-border-hair: 1px;
  --nc-border-bold: 2px;
  --nc-travel: 2px; /* how far a key stands above its plate, and how far it moves when pressed */
  --nc-focus-width: 2px;
  --nc-focus-gap: 2px;
  --nc-control-sm: 1.75rem; /* 28px */
  --nc-control-md: 2.25rem; /* 36px */
  --nc-control-lg: 2.75rem; /* 44px: every control on a phone */
  --nc-measure: 41rem; /* the reading column of long-form documentation: about 70 characters at the reading size */
  --nc-bleed: 1.25rem; /* how far a listing or a table starts before the reading column, so its content lines up with the text */

  /* Media queries cannot read custom properties, so base.css repeats these numbers; they are exported for a Material UI theme's breakpoints. */
  --nc-breakpoint-phone: 40rem; /* at 640px and below tables become lists, dialogs become sheets and navigation moves into a sheet */
  --nc-breakpoint-tablet: 68rem; /* at 1088px and below the console's navigation moves into a sheet */
  --nc-breakpoint-desk: 80rem; /* at 1280px and below documentation drops its page index */

  --nc-dur-press: 70ms; /* a key going down */
  --nc-dur-quick: 120ms; /* hover, a change of color */
  --nc-dur-move: 200ms; /* a switch sliding */
  --nc-dur-enter: 280ms; /* a dialog arriving */
  --nc-ease-out: cubic-bezier(0.2, 0, 0, 1);
  --nc-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --nc-ease-tick: steps(1, end); /* a readout changes in one step; it never glides */

  /* ---- the brace: the width of each stretching brace, as build.mjs draws it in brace/ */
  --nc-brace-sm: 10px; /* a lifetime in a code listing */
  --nc-brace-md: 17px; /* a card, the memory panel */
  --nc-brace-lg: 23px; /* the frame of a console workspace */

  /* ---- type roles: a font shorthand each, with its width and tracking beside it as --nc-type-<role>-stretch and -tracking, and its case as -case where it sets one */
  --nc-type-headline: var(--nc-weight-semibold) var(--nc-text-6xl)/var(--nc-leading-flat) var(--nc-font-sans); /* the one headline of a landing page */
  --nc-type-headline-stretch: var(--nc-width-display);
  --nc-type-headline-tracking: -0.028em;
  --nc-type-title: var(--nc-weight-semibold) var(--nc-text-4xl)/var(--nc-leading-tight) var(--nc-font-sans); /* the title of a page */
  --nc-type-title-stretch: var(--nc-width-display);
  --nc-type-title-tracking: var(--nc-tracking-display);
  --nc-type-title-long: var(--nc-weight-semibold) var(--nc-text-4xl)/var(--nc-leading-tight) var(--nc-font-sans); /* the title of a long-form page */
  --nc-type-title-long-stretch: var(--nc-width-display);
  --nc-type-title-long-tracking: var(--nc-tracking-display);
  --nc-type-heading: var(--nc-weight-semibold) var(--nc-text-2xl)/1.18 var(--nc-font-sans); /* a section */
  --nc-type-heading-stretch: var(--nc-width-display);
  --nc-type-heading-tracking: var(--nc-tracking-heading);
  --nc-type-heading-long: var(--nc-weight-semibold) var(--nc-text-2xl)/1.18 var(--nc-font-sans); /* a section of a long-form page */
  --nc-type-heading-long-stretch: var(--nc-width-display);
  --nc-type-heading-long-tracking: var(--nc-tracking-heading);
  --nc-type-subheading: var(--nc-weight-semibold) var(--nc-text-xl)/var(--nc-leading-snug) var(--nc-font-sans); /* a group within a section, the title of a dialog */
  --nc-type-subheading-stretch: var(--nc-width-display);
  --nc-type-subheading-tracking: var(--nc-tracking-heading);
  --nc-type-minor: var(--nc-weight-semibold) var(--nc-text-base)/var(--nc-leading-snug) var(--nc-font-sans); /* the smallest heading */
  --nc-type-minor-stretch: var(--nc-width-text);
  --nc-type-minor-tracking: var(--nc-tracking-normal);
  --nc-type-lead: var(--nc-weight-regular) var(--nc-text-xl)/1.5 var(--nc-font-sans); /* the first paragraph of a long-form page */
  --nc-type-lead-stretch: var(--nc-width-text);
  --nc-type-lead-tracking: var(--nc-tracking-normal);
  --nc-type-body: var(--nc-weight-regular) var(--nc-text-base)/var(--nc-leading-normal) var(--nc-font-sans); /* running text outside long-form pages */
  --nc-type-body-stretch: var(--nc-width-text);
  --nc-type-body-tracking: var(--nc-tracking-normal);
  --nc-type-reading: var(--nc-weight-regular) var(--nc-text-reading)/var(--nc-leading-reading) var(--nc-font-sans); /* long-form documentation, on the measure */
  --nc-type-reading-stretch: var(--nc-width-text);
  --nc-type-reading-tracking: var(--nc-tracking-normal);
  --nc-type-ui: var(--nc-weight-regular) var(--nc-text-md)/var(--nc-leading-normal) var(--nc-font-sans); /* the interface */
  --nc-type-ui-stretch: var(--nc-width-text);
  --nc-type-ui-tracking: var(--nc-tracking-normal);
  --nc-type-field: var(--nc-weight-semibold) var(--nc-text-sm)/var(--nc-leading-snug) var(--nc-font-sans); /* the label of a field: sentence case, because a form is read, not scanned */
  --nc-type-field-stretch: var(--nc-width-text);
  --nc-type-field-tracking: var(--nc-tracking-normal);
  --nc-type-label: var(--nc-weight-semibold) var(--nc-text-2xs)/1.2 var(--nc-font-sans); /* uppercase: engraved: the name of a fixed part. Column heads, group heads, tags, the boundary's kind */
  --nc-type-label-stretch: var(--nc-width-label);
  --nc-type-label-tracking: var(--nc-tracking-label);
  --nc-type-label-case: uppercase;
  --nc-type-value: var(--nc-weight-medium) var(--nc-text-sm)/1.4 var(--nc-font-mono); /* displayed: anything read off the system */
  --nc-type-value-stretch: var(--nc-width-code);
  --nc-type-value-tracking: -0.01em;
  --nc-type-code: var(--nc-weight-regular) var(--nc-text-sm)/1.7 var(--nc-font-mono); /* a listing */
  --nc-type-code-stretch: var(--nc-width-code);
  --nc-type-code-tracking: var(--nc-tracking-normal);
  --nc-type-readout: var(--nc-weight-medium) var(--nc-text-xs)/var(--nc-leading-flat) var(--nc-font-mono); /* a short value on a screen */
  --nc-type-readout-stretch: var(--nc-width-readout);
  --nc-type-readout-tracking: var(--nc-tracking-normal);

  /* ---- the tenant's two inputs */
  --nc-brand: var(--nc-blue-600); /* primaryColor: what you press. Keys, links, focus, selection. */
  --nc-brand-secondary: var(--nc-brand); /* secondaryColor: what you are shown. Screens and the tenant's scope braces. It follows the primary until a tenant sets it. */

  /* ---- elevation */
  /* Depth is drawn with hard edges: a lip below means raised, a shade above means recessed. Blur appears only under overlays. */
  --nc-elevation-recessed: inset 0 var(--nc-travel) 0 var(--nc-color-shade);
  --nc-elevation-flush: inset 0 1px 0 var(--nc-color-glint), 0 1px 0 var(--nc-color-lip);
  --nc-elevation-raised: inset 0 1px 0 var(--nc-color-glint), 0 var(--nc-travel) 0 var(--nc-color-lip);
  --nc-elevation-floating: 0 1px 0 var(--nc-color-lip), 0 10px 24px -8px var(--nc-color-shadow);
  --nc-elevation-overlay: inset 0 1px 0 var(--nc-color-glint), 0 var(--nc-travel) 0 var(--nc-color-lip), 0 28px 64px -16px var(--nc-color-shadow);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* On paper every page takes the light theme, whatever data-theme or the system says. */
@media print {
  :root, :root[data-theme] { color-scheme: light; }
}

/* Inside a nested brand scope the secondary follows that scope's own primary, until the scope sets one. */
[data-brand-scope] { --nc-brand-secondary: var(--nc-brand); }

/*
 * Semantic colors. Each is written once: as light-dark(<light>, <dark>) where the themes differ, as one value where
 * they do not.
 */
@supports (color: light-dark(#000, #fff)) and (color: oklch(from #000 l c h)) and (color: lch(from #000 l c h)) and (color: color-mix(in oklab, #000, #fff)) {
  :root {
    /* The case and its parts. */
    --nc-color-page: light-dark(var(--nc-stone-200), var(--nc-stone-975)); /* the case */
    --nc-color-page-sunken: light-dark(var(--nc-stone-300), #050504); /* a recess cut into the case */
    --nc-color-surface: light-dark(var(--nc-stone-50), var(--nc-stone-925)); /* a plate */
    --nc-color-surface-raised: light-dark(var(--nc-stone-0), var(--nc-stone-850)); /* the brightest sheet: a dialog, a menu, a page of documentation */
    --nc-color-surface-sunken: light-dark(var(--nc-stone-100), var(--nc-stone-950)); /* a recess cut into a plate: a table head, a footer */
    --nc-color-well: light-dark(var(--nc-stone-0), var(--nc-stone-975)); /* a field */

    /* A neutral key. */
    --nc-color-control: light-dark(var(--nc-stone-0), var(--nc-stone-850)); /* its face */
    --nc-color-control-hover: light-dark(var(--nc-stone-100), var(--nc-stone-800));
    --nc-color-control-pressed: light-dark(var(--nc-stone-300), var(--nc-stone-950));
    --nc-color-ghost-hover: light-dark(rgb(23 23 20 / 0.08), rgb(240 240 237 / 0.1)); /* the face a ghost key gains under the pointer: the text color, thinned */
    --nc-color-ghost-pressed: light-dark(rgb(23 23 20 / 0.15), rgb(240 240 237 / 0.18));

    /* Lines. */
    --nc-color-border: light-dark(var(--nc-stone-300), var(--nc-stone-800)); /* a hairline between parts: decoration, it carries no meaning alone */
    --nc-color-border-strong: var(--nc-stone-500); /* the edge of a control: 3 to 1 against every surface in both themes */
    --nc-color-lamp-unlit: light-dark(var(--nc-stone-400), var(--nc-stone-700)); /* an unlit lamp in a selector: decoration, the word and the latched key carry the state */

    /* Type. */
    --nc-color-text: light-dark(var(--nc-stone-925), var(--nc-stone-100));
    --nc-color-text-secondary: light-dark(var(--nc-stone-700), var(--nc-stone-400));
    --nc-color-text-muted: light-dark(var(--nc-stone-600), var(--nc-stone-450)); /* engraved labels, placeholders */
    --nc-color-text-disabled: light-dark(var(--nc-stone-500), var(--nc-stone-600));
    --nc-color-code-tint: light-dark(rgb(23 23 20 / 0.06), rgb(240 240 237 / 0.08)); /* the tint behind inline code: the text color, thinned, so it shows on every surface */

    /* Status. -mark is the lamp, icon or line (3 to 1 on every surface); -text is running text (4.5 to 1). */
    --nc-color-success: light-dark(var(--nc-green-600), var(--nc-green-300));
    --nc-color-on-success: light-dark(var(--nc-stone-0), var(--nc-green-950));
    --nc-color-success-mark: light-dark(var(--nc-green-600), var(--nc-green-300));
    --nc-color-success-text: light-dark(var(--nc-green-700), var(--nc-green-300));
    --nc-color-success-subtle: light-dark(var(--nc-green-50), var(--nc-green-950));
    --nc-color-success-border: light-dark(var(--nc-green-300), var(--nc-green-800));

    --nc-color-warning: var(--nc-amber-400);
    --nc-color-on-warning: var(--nc-stone-925);
    --nc-color-warning-mark: light-dark(var(--nc-amber-600), var(--nc-amber-300));
    --nc-color-warning-text: light-dark(var(--nc-amber-700), var(--nc-amber-300));
    --nc-color-warning-subtle: light-dark(var(--nc-amber-50), var(--nc-amber-950));
    --nc-color-warning-border: light-dark(var(--nc-amber-300), var(--nc-amber-800));

    --nc-color-danger: light-dark(var(--nc-red-600), var(--nc-red-300));
    --nc-color-on-danger: light-dark(var(--nc-stone-0), var(--nc-red-950));
    --nc-color-danger-mark: light-dark(var(--nc-red-600), var(--nc-red-300));
    --nc-color-danger-text: light-dark(var(--nc-red-700), var(--nc-red-300));
    --nc-color-danger-subtle: light-dark(var(--nc-red-50), var(--nc-red-950));
    --nc-color-danger-border: light-dark(var(--nc-red-300), var(--nc-red-800));
    --nc-color-danger-hover: light-dark(var(--nc-red-700), color-mix(in oklab, var(--nc-red-300), #FFFFFF 22%));
    --nc-color-danger-lip: light-dark(var(--nc-red-800), var(--nc-red-700));

    --nc-color-info: light-dark(var(--nc-blue-600), var(--nc-blue-300));
    --nc-color-on-info: light-dark(var(--nc-stone-0), var(--nc-blue-950));
    --nc-color-info-mark: light-dark(var(--nc-blue-600), var(--nc-blue-300));
    --nc-color-info-text: light-dark(var(--nc-blue-700), var(--nc-blue-300));
    --nc-color-info-subtle: light-dark(var(--nc-blue-50), var(--nc-blue-950));
    --nc-color-info-border: light-dark(var(--nc-blue-200), var(--nc-blue-800));

    /* Hazard tape: the same in both themes, as tape is. */
    --nc-color-hazard: var(--nc-amber-400);
    --nc-color-on-hazard: var(--nc-stone-925);

    /* NCode's own marks: blue, or light blue on dark. Under a tenant's color they go one color (the text color), as the logo kit allows; they never take the tenant's hue. */
    --nc-color-logo: light-dark(var(--nc-blue-600), var(--nc-blue-300));

    /* Depth is drawn with hard edges, never with blur: a lip below means raised, a shade above means recessed. */
    --nc-color-lip: light-dark(var(--nc-stone-400), #000000); /* the side of a raised part */
    --nc-color-shade: light-dark(rgb(23 23 20 / 0.08), rgb(0 0 0 / 0.55)); /* the shadow inside a recess */
    --nc-color-screen-shade: rgb(0 0 0 / 0.3); /* the shadow inside a screen's top edge, the same in both themes */
    --nc-color-glint: light-dark(var(--nc-stone-0), rgb(255 255 255 / 0.06)); /* light on a top edge */
    --nc-color-shadow: light-dark(rgb(23 23 20 / 0.2), rgb(0 0 0 / 0.7)); /* the only soft shadow, under overlays */
    --nc-color-scrim: light-dark(rgb(23 23 20 / 0.5), rgb(0 0 0 / 0.68));
  }

  /*
   * Everything a tenant's colors touch. It is declared for the root and again for any element marked
   * data-brand-scope, so one part of a page (a branding preview, say) can run under other inputs.
   */
  :root,
  [data-brand-scope] {
    /* Primary, derived from --nc-brand: what you press. */
    --nc-color-primary: light-dark(var(--nc-brand), oklch(from var(--nc-brand) 0.7206 min(c, 0.1444) calc(h + 5.3))); /* NCode Blue becomes exactly NCode Blue Light in the dark theme */
    --nc-color-on-primary: light-dark(lch(from var(--nc-brand) clamp(0, (49.4 - l) * 9999, 100) 0 0), oklch(from var(--nc-brand) 0.205 min(c * 0.32, 0.076) calc(h + 2.4))); /* white, or black when the tenant's color is lighter than CIE lightness 49.4, near where the label with the higher contrast changes. A color at the flip itself can fall short in CSS; tokens/derive.mjs chooses by measured contrast */
    --nc-color-primary-shade: light-dark(lch(from var(--nc-brand) clamp(0, (l - 49.4) * 9999, 100) 0 0), #FFFFFF); /* what a primary key's face moves toward when it is touched: away from its label, so the label gains contrast */
    --nc-color-primary-hover: light-dark(color-mix(in oklab, var(--nc-color-primary), var(--nc-color-primary-shade) 13%), color-mix(in oklab, var(--nc-color-primary), var(--nc-color-primary-shade) 22%));
    --nc-color-primary-pressed: light-dark(color-mix(in oklab, var(--nc-color-primary), var(--nc-color-primary-shade) 22%), color-mix(in oklab, var(--nc-color-primary), #000000 10%));
    --nc-color-primary-edge: light-dark(oklch(from var(--nc-color-primary) min(l * 0.78, 0.55) calc(c * 0.78) h), color-mix(in oklab, var(--nc-color-primary), #000000 10%)); /* the outline of a primary key: darker than its face, and never lighter than OKLCH lightness 0.55, so it reaches 3 to 1 against a light plate whatever the tenant's color */
    --nc-color-primary-lip: light-dark(color-mix(in oklab, var(--nc-color-primary), #000000 40%), color-mix(in oklab, var(--nc-color-primary), #000000 48%));
    --nc-color-primary-text: light-dark(oklch(from var(--nc-brand) min(l, 0.48) c h), var(--nc-color-primary)); /* the brand as text, line or lamp: at most OKLCH lightness 0.48 in the light theme, 4.5 to 1 on every surface for all but the brightest greens, which tokens/derive.mjs darkens further */
    --nc-color-primary-subtle: light-dark(color-mix(in oklab, var(--nc-stone-0), var(--nc-color-primary) 8%), color-mix(in oklab, var(--nc-stone-925), var(--nc-color-primary) 16%)); /* the wash behind a selected option */
    --nc-color-primary-subtle-border: light-dark(color-mix(in oklab, var(--nc-stone-0), var(--nc-color-primary) 30%), color-mix(in oklab, var(--nc-stone-925), var(--nc-color-primary) 42%));
    --nc-color-focus: var(--nc-color-primary-text); /* the focus ring */

    /* The screen, derived from --nc-brand-secondary: what you are shown. A screen is the same in both themes: a deep field of the hue with lit values on it. NCode Blue yields exactly NCode Navy and NCode Blue Light. */
    --nc-color-screen: oklch(from var(--nc-brand-secondary) 0.2697 calc(c * 0.478) calc(h + 1.2));
    --nc-color-screen-raised: oklch(from var(--nc-brand-secondary) 0.335 calc(c * 0.62) calc(h + 0.8)); /* a lit row, a memory cell */
    --nc-color-screen-border: oklch(from var(--nc-brand-secondary) 0.4 calc(c * 0.6) h);
    --nc-color-screen-lit: oklch(from var(--nc-brand-secondary) 0.7206 min(c, 0.1444) calc(h + 5.3)); /* keywords, lit labels, the lit boundary plate, braces on a screen */
    --nc-color-on-screen: var(--nc-stone-0);
    --nc-color-on-screen-secondary: oklch(from var(--nc-brand-secondary) 0.868 min(c * 0.3, 0.071) calc(h + 6.9));
    --nc-color-on-screen-muted: oklch(from var(--nc-brand-secondary) 0.74 min(c * 0.24, 0.058) calc(h + 4));
    --nc-color-screen-hot: var(--nc-amber-300); /* a literal, a sensitive value */

    /* The ink of a scope brace on the case, one per kind of security boundary. */
    --nc-color-scope-tenant: light-dark(oklch(from var(--nc-brand-secondary) min(l, 0.48) c h), var(--nc-color-screen-lit)); /* a tenant's braces take the tenant's secondary color */
    --nc-color-scope-team: var(--nc-color-text); /* a team's braces are plain ink */
    --nc-color-scope-platform: var(--nc-color-hazard); /* the platform's braces are hazard tape: this color striped with on-hazard */
  }
}

/*
 * The same colors for a browser without light-dark(), relative colors or color-mix(): the values above,
 * computed by the build for NCode's own brand. Such a browser cannot derive a tenant's colors, so a host that
 * must support it sets the derived tokens itself, from tokens/derive.mjs.
 */
@supports not ((color: light-dark(#000, #fff)) and (color: oklch(from #000 l c h)) and (color: lch(from #000 l c h)) and (color: color-mix(in oklab, #000, #fff))) {
  :root {
    /* The case and its parts. */
    --nc-color-page: #E9E9E4;
    --nc-color-page-sunken: #D9D9D4;
    --nc-color-surface: #F7F7F4;
    --nc-color-surface-raised: #FFFFFF;
    --nc-color-surface-sunken: #F0F0ED;
    --nc-color-well: #FFFFFF;

    /* A neutral key. */
    --nc-color-control: #FFFFFF;
    --nc-color-control-hover: #F0F0ED;
    --nc-color-control-pressed: #D9D9D4;
    --nc-color-ghost-hover: rgb(23 23 20 / 0.08);
    --nc-color-ghost-pressed: rgb(23 23 20 / 0.15);

    /* Lines. */
    --nc-color-border: #D9D9D4;
    --nc-color-border-strong: #797972;
    --nc-color-lamp-unlit: #BEBEB8;

    /* Type. */
    --nc-color-text: #171714;
    --nc-color-text-secondary: #4B4B45;
    --nc-color-text-muted: #5E5E58;
    --nc-color-text-disabled: #797972;
    --nc-color-code-tint: rgb(23 23 20 / 0.06);

    /* Status. -mark is the lamp, icon or line (3 to 1 on every surface); -text is running text (4.5 to 1). */
    --nc-color-success: #11813C;
    --nc-color-on-success: #FFFFFF;
    --nc-color-success-mark: #11813C;
    --nc-color-success-text: #126630;
    --nc-color-success-subtle: #ECFAEF;
    --nc-color-success-border: #7ADE95;

    --nc-color-warning: #F4AD1D;
    --nc-color-on-warning: #171714;
    --nc-color-warning-mark: #B96A00;
    --nc-color-warning-text: #8F4D05;
    --nc-color-warning-subtle: #FFF6E1;
    --nc-color-warning-border: #FAC13B;

    --nc-color-danger: #C01F1C;
    --nc-color-on-danger: #FFFFFF;
    --nc-color-danger-mark: #C01F1C;
    --nc-color-danger-text: #9C1B18;
    --nc-color-danger-subtle: #FFF2F0;
    --nc-color-danger-border: #FF958D;
    --nc-color-danger-hover: #9C1B18;
    --nc-color-danger-lip: #711612;

    --nc-color-info: #0033CC;
    --nc-color-on-info: #FFFFFF;
    --nc-color-info-mark: #0033CC;
    --nc-color-info-text: #032AA7;
    --nc-color-info-subtle: #F2F5FF;
    --nc-color-info-border: #C3D2FF;

    /* Hazard tape: the same in both themes, as tape is. */
    --nc-color-hazard: #F4AD1D;
    --nc-color-on-hazard: #171714;

    /* NCode's own marks: blue, or light blue on dark. Under a tenant's color they go one color (the text color), as the logo kit allows; they never take the tenant's hue. */
    --nc-color-logo: #0033CC;

    /* Depth is drawn with hard edges, never with blur: a lip below means raised, a shade above means recessed. */
    --nc-color-lip: #BEBEB8;
    --nc-color-shade: rgb(23 23 20 / 0.08);
    --nc-color-screen-shade: rgb(0 0 0 / 0.3);
    --nc-color-glint: #FFFFFF;
    --nc-color-shadow: rgb(23 23 20 / 0.2);
    --nc-color-scrim: rgb(23 23 20 / 0.5);

    /* Primary, derived from --nc-brand: what you press. */
    --nc-color-primary: #0033CC;
    --nc-color-on-primary: #FFFFFF;
    --nc-color-primary-shade: #000000;
    --nc-color-primary-hover: #0029A9;
    --nc-color-primary-pressed: #002292;
    --nc-color-primary-edge: #002292;
    --nc-color-primary-lip: #001465;
    --nc-color-primary-text: #0033CC;
    --nc-color-primary-subtle: #E9F0FD;
    --nc-color-primary-subtle-border: #AFC7F5;
    --nc-color-focus: #0033CC;

    /* The screen, derived from --nc-brand-secondary: what you are shown. A screen is the same in both themes: a deep field of the hue with lit values on it. NCode Blue yields exactly NCode Navy and NCode Blue Light. */
    --nc-color-screen: #0A1F5C;
    --nc-color-screen-raised: #0E2C80;
    --nc-color-screen-border: #1E4192;
    --nc-color-screen-lit: #809FFF;
    --nc-color-on-screen: #FFFFFF;
    --nc-color-on-screen-secondary: #C2D2FF;
    --nc-color-on-screen-muted: #9BAACF;
    --nc-color-screen-hot: #FAC13B;

    /* The ink of a scope brace on the case, one per kind of security boundary. */
    --nc-color-scope-tenant: #0033CC;
    --nc-color-scope-team: #171714;
    --nc-color-scope-platform: #F4AD1D;
  }

  @media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      /* The case and its parts. */
      --nc-color-page: #0A0A08;
      --nc-color-page-sunken: #050504;
      --nc-color-surface: #171714;
      --nc-color-surface-raised: #282824;
      --nc-color-surface-sunken: #11110F;
      --nc-color-well: #0A0A08;

      /* A neutral key. */
      --nc-color-control: #282824;
      --nc-color-control-hover: #343430;
      --nc-color-control-pressed: #11110F;
      --nc-color-ghost-hover: rgb(240 240 237 / 0.1);
      --nc-color-ghost-pressed: rgb(240 240 237 / 0.18);

      /* Lines. */
      --nc-color-border: #343430;
      --nc-color-lamp-unlit: #4B4B45;

      /* Type. */
      --nc-color-text: #F0F0ED;
      --nc-color-text-secondary: #BEBEB8;
      --nc-color-text-muted: #93938C;
      --nc-color-text-disabled: #5E5E58;
      --nc-color-code-tint: rgb(240 240 237 / 0.08);

      /* Status. -mark is the lamp, icon or line (3 to 1 on every surface); -text is running text (4.5 to 1). */
      --nc-color-success: #7ADE95;
      --nc-color-on-success: #092210;
      --nc-color-success-mark: #7ADE95;
      --nc-color-success-text: #7ADE95;
      --nc-color-success-subtle: #092210;
      --nc-color-success-border: #0D4A22;

      --nc-color-warning-mark: #FAC13B;
      --nc-color-warning-text: #FAC13B;
      --nc-color-warning-subtle: #2A1907;
      --nc-color-warning-border: #623606;

      --nc-color-danger: #FF958D;
      --nc-color-on-danger: #31100D;
      --nc-color-danger-mark: #FF958D;
      --nc-color-danger-text: #FF958D;
      --nc-color-danger-subtle: #31100D;
      --nc-color-danger-border: #711612;
      --nc-color-danger-hover: #FFADA6;
      --nc-color-danger-lip: #9C1B18;

      --nc-color-info: #809FFF;
      --nc-color-on-info: #071339;
      --nc-color-info-mark: #809FFF;
      --nc-color-info-text: #809FFF;
      --nc-color-info-subtle: #071339;
      --nc-color-info-border: #08257F;

      /* Hazard tape: the same in both themes, as tape is. */

      /* NCode's own marks: blue, or light blue on dark. Under a tenant's color they go one color (the text color), as the logo kit allows; they never take the tenant's hue. */
      --nc-color-logo: #809FFF;

      /* Depth is drawn with hard edges, never with blur: a lip below means raised, a shade above means recessed. */
      --nc-color-lip: #000000;
      --nc-color-shade: rgb(0 0 0 / 0.55);
      --nc-color-glint: rgb(255 255 255 / 0.06);
      --nc-color-shadow: rgb(0 0 0 / 0.7);
      --nc-color-scrim: rgb(0 0 0 / 0.68);

      /* Primary, derived from --nc-brand: what you press. */
      --nc-color-primary: #809FFF;
      --nc-color-on-primary: #071339;
      --nc-color-primary-shade: #FFFFFF;
      --nc-color-primary-hover: #9BB5FF;
      --nc-color-primary-pressed: #6E8ADE;
      --nc-color-primary-edge: #6E8ADE;
      --nc-color-primary-lip: #313E69;
      --nc-color-primary-text: #809FFF;
      --nc-color-primary-subtle: #262A34;
      --nc-color-primary-subtle-border: #404C6D;
      --nc-color-focus: #809FFF;

      /* The screen, derived from --nc-brand-secondary: what you are shown. A screen is the same in both themes: a deep field of the hue with lit values on it. NCode Blue yields exactly NCode Navy and NCode Blue Light. */

      /* The ink of a scope brace on the case, one per kind of security boundary. */
      --nc-color-scope-tenant: #809FFF;
      --nc-color-scope-team: #F0F0ED;
    }
  }

  @media screen {
    :root[data-theme="dark"] {
      /* The case and its parts. */
      --nc-color-page: #0A0A08;
      --nc-color-page-sunken: #050504;
      --nc-color-surface: #171714;
      --nc-color-surface-raised: #282824;
      --nc-color-surface-sunken: #11110F;
      --nc-color-well: #0A0A08;

      /* A neutral key. */
      --nc-color-control: #282824;
      --nc-color-control-hover: #343430;
      --nc-color-control-pressed: #11110F;
      --nc-color-ghost-hover: rgb(240 240 237 / 0.1);
      --nc-color-ghost-pressed: rgb(240 240 237 / 0.18);

      /* Lines. */
      --nc-color-border: #343430;
      --nc-color-lamp-unlit: #4B4B45;

      /* Type. */
      --nc-color-text: #F0F0ED;
      --nc-color-text-secondary: #BEBEB8;
      --nc-color-text-muted: #93938C;
      --nc-color-text-disabled: #5E5E58;
      --nc-color-code-tint: rgb(240 240 237 / 0.08);

      /* Status. -mark is the lamp, icon or line (3 to 1 on every surface); -text is running text (4.5 to 1). */
      --nc-color-success: #7ADE95;
      --nc-color-on-success: #092210;
      --nc-color-success-mark: #7ADE95;
      --nc-color-success-text: #7ADE95;
      --nc-color-success-subtle: #092210;
      --nc-color-success-border: #0D4A22;

      --nc-color-warning-mark: #FAC13B;
      --nc-color-warning-text: #FAC13B;
      --nc-color-warning-subtle: #2A1907;
      --nc-color-warning-border: #623606;

      --nc-color-danger: #FF958D;
      --nc-color-on-danger: #31100D;
      --nc-color-danger-mark: #FF958D;
      --nc-color-danger-text: #FF958D;
      --nc-color-danger-subtle: #31100D;
      --nc-color-danger-border: #711612;
      --nc-color-danger-hover: #FFADA6;
      --nc-color-danger-lip: #9C1B18;

      --nc-color-info: #809FFF;
      --nc-color-on-info: #071339;
      --nc-color-info-mark: #809FFF;
      --nc-color-info-text: #809FFF;
      --nc-color-info-subtle: #071339;
      --nc-color-info-border: #08257F;

      /* Hazard tape: the same in both themes, as tape is. */

      /* NCode's own marks: blue, or light blue on dark. Under a tenant's color they go one color (the text color), as the logo kit allows; they never take the tenant's hue. */
      --nc-color-logo: #809FFF;

      /* Depth is drawn with hard edges, never with blur: a lip below means raised, a shade above means recessed. */
      --nc-color-lip: #000000;
      --nc-color-shade: rgb(0 0 0 / 0.55);
      --nc-color-glint: rgb(255 255 255 / 0.06);
      --nc-color-shadow: rgb(0 0 0 / 0.7);
      --nc-color-scrim: rgb(0 0 0 / 0.68);

      /* Primary, derived from --nc-brand: what you press. */
      --nc-color-primary: #809FFF;
      --nc-color-on-primary: #071339;
      --nc-color-primary-shade: #FFFFFF;
      --nc-color-primary-hover: #9BB5FF;
      --nc-color-primary-pressed: #6E8ADE;
      --nc-color-primary-edge: #6E8ADE;
      --nc-color-primary-lip: #313E69;
      --nc-color-primary-text: #809FFF;
      --nc-color-primary-subtle: #262A34;
      --nc-color-primary-subtle-border: #404C6D;
      --nc-color-focus: #809FFF;

      /* The screen, derived from --nc-brand-secondary: what you are shown. A screen is the same in both themes: a deep field of the hue with lit values on it. NCode Blue yields exactly NCode Navy and NCode Blue Light. */

      /* The ink of a scope brace on the case, one per kind of security boundary. */
      --nc-color-scope-tenant: #809FFF;
      --nc-color-scope-team: #F0F0ED;
    }
  }
}

/* Under a tenant's color NCode's marks go one color, as the logo kit allows: they never take the tenant's hue. */
:root[data-brand="tenant"] { --nc-color-logo: var(--nc-color-text); }
