/* ===========================================================================
   SGI Design System — canonical tokens, 0.3.1
   ---------------------------------------------------------------------------
   GENERATED FILE. Do not edit.

   Source of truth: design-system/foundation/. Regenerate with `npm run
   build` in design-system/, and `npm run check` fails if this file and the
   source disagree. Import, never transcribe: a consumer that copies a value
   out of this file has taken the estate's documented failure mode and put it
   in a new repository.

   Every declaration below carries a status in the source — a decision a
   human selected among alternatives, or a derived value required to
   implement one. FOUNDATION.md says which is which and why. Nothing here may
   be changed by editing this file.
   =========================================================================== */

/* Every value that varies with nothing. Declared once, so contrast across the
   whole system is verified once rather than once per brand, register and
   audience. */
:root {
  /* color.surface */
  --sgi-color-surface-canvas: #eef0f2;
  --sgi-color-surface-sunken: #f4f5f7;
  --sgi-color-surface-panel: #ffffff;
  --sgi-color-surface-paper: #ffffff;

  /* color.ink */
  --sgi-color-ink-primary: #15181c;
  --sgi-color-ink-secondary: #4d525a;
  --sgi-color-ink-tertiary: #5c626b;
  --sgi-color-ink-inverse: #ffffff;

  /* color.border */
  --sgi-color-border-hairline: #dcdee2;
  --sgi-color-border-bar: #dfe3e8;
  --sgi-color-border-control: #7e838b;

  /* color.frame */
  --sgi-color-frame-base: #17202c;
  --sgi-color-frame-raised: #1a283a;
  --sgi-color-frame-recessed: #121e2e;
  --sgi-color-frame-edge: #2c3d54;
  --sgi-color-frame-band: #162435;
  --sgi-color-frame-hover: #232b37;
  --sgi-color-frame-current: #14353d;
  --sgi-color-frame-ink-primary: #e8eaed;
  --sgi-color-frame-ink-secondary: #c4c9d4;
  --sgi-color-frame-ink-tertiary: #9aa0a9;

  /* color.scope */
  --sgi-color-scope-base: #0d131c;
  --sgi-color-scope-edge: #39424f;
  --sgi-color-scope-ink-primary: #f2f5f8;
  --sgi-color-scope-ink-secondary: #9fadbd;

  /* color.status */
  --sgi-color-status-ok-ink: #177040;
  --sgi-color-status-ok-container: #e3f3e9;
  --sgi-color-status-ok-edge: #9fd2b4;
  --sgi-color-status-ok-on-frame: #7fdaa8;
  --sgi-color-status-info-ink: #1b5b8f;
  --sgi-color-status-info-container: #e4eef7;
  --sgi-color-status-info-edge: #a4c6e2;
  --sgi-color-status-info-on-frame: #a5cff2;
  --sgi-color-status-warn-ink: #8a5a00;
  --sgi-color-status-warn-container: #fbf0da;
  --sgi-color-status-warn-edge: #e2c283;
  --sgi-color-status-warn-on-frame: #efc57f;
  --sgi-color-status-danger-ink: #ad2020;
  --sgi-color-status-danger-container: #fbe6e6;
  --sgi-color-status-danger-edge: #e4a3a3;
  --sgi-color-status-danger-on-frame: #f8b6b6;
  --sgi-color-status-danger-solid: var(--sgi-color-status-danger-ink);
  --sgi-color-status-neutral-ink: #4d525a;
  --sgi-color-status-neutral-container: #eef0f3;
  --sgi-color-status-neutral-edge: #c8ccd2;
  --sgi-color-status-neutral-on-frame: var(--sgi-color-frame-ink-secondary);
  --sgi-color-status-tint-danger: #fdf1f1;
  --sgi-color-status-tint-warn: #fdf8ee;

  /* color.action */
  --sgi-color-action-primary-staff-ink: #656a70;
  --sgi-color-action-primary-staff-fill: #5f6268;
  --sgi-color-action-primary-staff-wash: #eaeff6;
  --sgi-color-action-primary-platform-ink: #2362b8;
  --sgi-color-action-primary-platform-fill: #2362b8;
  --sgi-color-action-primary-platform-wash: #edf2f9;

  /* color.accent */
  --sgi-color-accent-teal: var(--sgi-color-identity-mark-on-frame);
  --sgi-color-accent-teal-on-light: #0b6e68;
  --sgi-color-accent-blue: var(--sgi-color-action-primary-platform-fill);

  /* color.identity */
  --sgi-color-identity-mark-on-frame: #00beb1;

  /* color.focus */
  --sgi-color-focus-ring: var(--sgi-color-accent-teal-on-light);
  --sgi-color-focus-contrast: #ffffff;

  /* type.family */
  --sgi-type-family-interface: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", "Liberation Sans", Arial, sans-serif;
  --sgi-type-family-code: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* type.size */
  --sgi-type-size-annotation: 0.75rem;
  --sgi-type-size-dense: 0.8125rem;
  --sgi-type-size-body: 0.9375rem;
  --sgi-type-size-title: 1rem;
  --sgi-type-size-subhead: 1.1875rem;
  --sgi-type-size-heading: 1.5rem;
  --sgi-type-size-page-title: 1.9375rem;
  --sgi-type-size-promo: 2.5rem;
  --sgi-type-size-promo-large: 3.25rem;

  /* type.lineHeight */
  --sgi-type-line-height-tight: 1.25;
  --sgi-type-line-height-interface: 1.45;
  --sgi-type-line-height-reading: 1.62;

  /* type.weight */
  --sgi-type-weight-body: 400;
  --sgi-type-weight-strong: 600;
  --sgi-type-weight-structural: 700;

  /* type.measure */
  --sgi-type-measure-reading: 68ch;

  /* space.step */
  --sgi-space-step-hair: 2px;
  --sgi-space-step-tight: 4px;
  --sgi-space-step-snug: 8px;
  --sgi-space-step-base: 12px;
  --sgi-space-step-loose: 16px;
  --sgi-space-step-wide: 24px;
  --sgi-space-step-wider: 32px;
  --sgi-space-step-widest: 48px;

  /* space.gutter */
  --sgi-space-gutter: 24px;

  /* density.panelPadding */
  --sgi-density-panel-padding: 16px;

  /* density.panelHeader */
  --sgi-density-panel-header: 36px;

  /* density.rowPaddingBlock */
  --sgi-density-row-padding-block: 8px;

  /* density.rowPaddingInline */
  --sgi-density-row-padding-inline: 10px;

  /* density.controlHeight */
  --sgi-density-control-height: 32px;

  /* density.sectionGap */
  --sgi-density-section-gap: 16px;

  /* shape.radius */
  --sgi-shape-radius-panel: 6px;
  --sgi-shape-radius-control: 4px;
  --sgi-shape-radius-circle: 999px;

  /* shape.borderWidth */
  --sgi-shape-border-width-hairline: 1px;

  /* shape.focusRing */
  --sgi-shape-focus-ring-width: 2px;
  --sgi-shape-focus-ring-offset: 2px;

  /* shape.elevation */
  --sgi-shape-elevation-float: 0 12px 28px -10px rgba(12, 22, 33, 0.42), 0 2px 6px -2px rgba(12, 22, 33, 0.2);
}

/* Values that vary with a declared dimension. Only these vary at all; every
   other token above is invariant, which is checked rather than asserted.

   Each block below is a complete state rather than a delta: it declares
   every token that varies with the dimension, at its value for that
   dimension value or at its base value. That is what makes a dimension
   declared on a nested surface resolve to a coherent state instead of
   inheriting half of an ancestor's — including the default value, which
   needs a block precisely so that declaring it inside a non-default ancestor
   resets rather than doing nothing.
*/
/* density: compact */
[data-sgi-density='compact'] {
  --sgi-type-size-body: 0.875rem;
  --sgi-density-panel-padding: 12px;
  --sgi-density-panel-header: 30px;
  --sgi-density-row-padding-block: 5px;
  --sgi-density-row-padding-inline: 8px;
  --sgi-density-control-height: 28px;
  --sgi-density-section-gap: 12px;
}

/* density: default — the base state, restated so it resets inside another */
[data-sgi-density='default'] {
  --sgi-type-size-body: 0.9375rem; /* base */
  --sgi-density-panel-padding: 16px; /* base */
  --sgi-density-panel-header: 36px; /* base */
  --sgi-density-row-padding-block: 8px; /* base */
  --sgi-density-row-padding-inline: 10px; /* base */
  --sgi-density-control-height: 32px; /* base */
  --sgi-density-section-gap: 16px; /* base */
}

/* density: open */
[data-sgi-density='open'] {
  --sgi-type-size-body: 0.9375rem; /* base */
  --sgi-density-panel-padding: 32px;
  --sgi-density-panel-header: 48px;
  --sgi-density-row-padding-block: 12px;
  --sgi-density-row-padding-inline: 14px;
  --sgi-density-control-height: 40px;
  --sgi-density-section-gap: 32px;
}

/* Bindings. A role resolves to a different token, or a rule takes a different
   value, as a declared dimension changes. This is the whole of the approved
   mode-sensitivity: register governs enclosure, content governs the ground,
   and audience governs where colour is allowed to mean "do this". They are
   three properties rather than one because the approved rules turn on all
   three — a companion overlay is frameless like a public page and staff-facing
   like a worklist. */

/* The fallback each role takes on a surface that declares nothing, which in
   this estate is the commonest surface there is. Each dimension's default and
   the reason for it are in foundation/meta.json, and each is the conservative
   half. A binding that applies only under some other dimension's non-default
   value contributes nothing here, and a role composed from more than one
   dimension takes its fallback from the composition below, where the default
   of every dimension it reads is one of the enumerated cases. */
:root {
  /* color.ground, where content defaults to prose */
  --sgi-color-ground: var(--sgi-color-surface-paper);
  /* brand.reach, where audience defaults to staff */
  --sgi-brand-reach: none;
  /* layout.enclosure, where register defaults to bare */
  --sgi-layout-enclosure: unavailable;
  /* layout.panel, where content defaults to prose */
  --sgi-layout-panel: dissolved;
  /* color.action.primary: composed from audience and brand, below */
}

/* color.ground — by content */
[data-sgi-content='prose'] { --sgi-color-ground: var(--sgi-color-surface-paper); }
[data-sgi-content='objects'] { --sgi-color-ground: var(--sgi-color-surface-canvas); }

/* brand.reach — by audience */
[data-sgi-audience='staff'] { --sgi-brand-reach: none; }
[data-sgi-audience='patient'] { --sgi-brand-reach: accent; }

/* layout.enclosure — by register */
[data-sgi-register='framed'] { --sgi-layout-enclosure: earned; }
[data-sgi-register='contained'] { --sgi-layout-enclosure: structural; }
[data-sgi-register='bare'] { --sgi-layout-enclosure: unavailable; }

/* layout.panel — by content */
[data-sgi-content='prose'] { --sgi-layout-panel: dissolved; }
[data-sgi-content='objects'] { --sgi-layout-panel: available; }

/* The surface's dimension state, for the composed roles below.

   Each dimension value declares its own toggle empty and every sibling
   value's guaranteed-invalid, so a case gated on a conjunction of them
   resolves only where all of them hold. They are custom properties rather
   than selectors for one reason: a custom property inherits, so a dimension
   declared on any ancestor reaches here and the nearest declaration of each
   dimension wins independently of the others. That is what a compound
   selector cannot do, and it is what the dimension model has always claimed.

   They are generated machinery in the canonical prefix, not canonical names.
   A consumer neither declares nor reads one; it declares data-sgi-* and
   reads a role. Note for anyone processing this file: the empty values are
   load-bearing, and a minifier that drops an empty custom-property
   declaration breaks every case gated on it.
*/
/* audience, defaulting to staff */
:root {
  --sgi-when-audience-staff: ;
  --sgi-when-audience-patient: initial;
}
[data-sgi-audience='staff'] {
  --sgi-when-audience-staff: ;
  --sgi-when-audience-patient: initial;
}
[data-sgi-audience='patient'] {
  --sgi-when-audience-staff: initial;
  --sgi-when-audience-patient: ;
}

/* brand, defaulting to platform */
:root {
  --sgi-when-brand-platform: ;
  --sgi-when-brand-practice: initial;
}
[data-sgi-brand='platform'] {
  --sgi-when-brand-platform: ;
  --sgi-when-brand-practice: initial;
}
[data-sgi-brand='practice'] {
  --sgi-when-brand-platform: initial;
  --sgi-when-brand-practice: ;
}

/* color.action.primary — composed from audience and brand.

   Every combination of audience and brand is enumerated as its own case, so
   exactly one is live on any surface and the role takes it. Exhaustive
   rather than layered, because a layered chain would let a live case whose
   target is a reserved slot fall through to a lower one and hand the surface
   a value nobody chose — the failure this whole layer exists to stop. The
   last var() has no fallback for the same reason: where the live case is
   unbound, the role is invalid and the surface fails in view.
*/
:root,
[data-sgi-audience='staff'],
[data-sgi-audience='patient'],
[data-sgi-brand='platform'],
[data-sgi-brand='practice'] {
  /* audience staff, brand platform → color.action.primary.staff */
  --sgi-case-audience-staff-brand-platform-color-action-primary-fill: var(--sgi-when-audience-staff) var(--sgi-when-brand-platform) var(--sgi-color-action-primary-staff-fill);
  --sgi-case-audience-staff-brand-platform-color-action-primary-ink: var(--sgi-when-audience-staff) var(--sgi-when-brand-platform) var(--sgi-color-action-primary-staff-ink);
  --sgi-case-audience-staff-brand-platform-color-action-primary-wash: var(--sgi-when-audience-staff) var(--sgi-when-brand-platform) var(--sgi-color-action-primary-staff-wash);
  /* audience staff, brand practice → color.action.primary.staff */
  --sgi-case-audience-staff-brand-practice-color-action-primary-fill: var(--sgi-when-audience-staff) var(--sgi-when-brand-practice) var(--sgi-color-action-primary-staff-fill);
  --sgi-case-audience-staff-brand-practice-color-action-primary-ink: var(--sgi-when-audience-staff) var(--sgi-when-brand-practice) var(--sgi-color-action-primary-staff-ink);
  --sgi-case-audience-staff-brand-practice-color-action-primary-wash: var(--sgi-when-audience-staff) var(--sgi-when-brand-practice) var(--sgi-color-action-primary-staff-wash);
  /* audience patient, brand platform → color.action.primary.platform */
  --sgi-case-audience-patient-brand-platform-color-action-primary-fill: var(--sgi-when-audience-patient) var(--sgi-when-brand-platform) var(--sgi-color-action-primary-platform-fill);
  --sgi-case-audience-patient-brand-platform-color-action-primary-ink: var(--sgi-when-audience-patient) var(--sgi-when-brand-platform) var(--sgi-color-action-primary-platform-ink);
  --sgi-case-audience-patient-brand-platform-color-action-primary-wash: var(--sgi-when-audience-patient) var(--sgi-when-brand-platform) var(--sgi-color-action-primary-platform-wash);
  /* audience patient, brand practice → color.brand.practice.accent, a reserved slot waiting on OQ-BRAND-VALUES */
  --sgi-case-audience-patient-brand-practice-color-action-primary-fill: var(--sgi-when-audience-patient) var(--sgi-when-brand-practice) var(--sgi-color-brand-practice-accent-fill);
  --sgi-case-audience-patient-brand-practice-color-action-primary-ink: var(--sgi-when-audience-patient) var(--sgi-when-brand-practice) var(--sgi-color-brand-practice-accent-ink);
  --sgi-case-audience-patient-brand-practice-color-action-primary-wash: var(--sgi-when-audience-patient) var(--sgi-when-brand-practice) var(--sgi-color-brand-practice-accent-wash);

  --sgi-color-action-primary-fill: var(--sgi-case-audience-staff-brand-platform-color-action-primary-fill, var(--sgi-case-audience-staff-brand-practice-color-action-primary-fill, var(--sgi-case-audience-patient-brand-platform-color-action-primary-fill, var(--sgi-case-audience-patient-brand-practice-color-action-primary-fill))));
  --sgi-color-action-primary-ink: var(--sgi-case-audience-staff-brand-platform-color-action-primary-ink, var(--sgi-case-audience-staff-brand-practice-color-action-primary-ink, var(--sgi-case-audience-patient-brand-platform-color-action-primary-ink, var(--sgi-case-audience-patient-brand-practice-color-action-primary-ink))));
  --sgi-color-action-primary-wash: var(--sgi-case-audience-staff-brand-platform-color-action-primary-wash, var(--sgi-case-audience-staff-brand-practice-color-action-primary-wash, var(--sgi-case-audience-patient-brand-platform-color-action-primary-wash, var(--sgi-case-audience-patient-brand-practice-color-action-primary-wash))));
}

/* ===========================================================================
   RESERVED SLOTS — named canonical roles with no canonical value
   ---------------------------------------------------------------------------
   These are not omissions and they are not to be filled in by a consumer
   that needs a number. Each is a role the approved decisions require, whose
   value depends on a question a human has declined to answer, listed here
   with the contract the eventual value must satisfy. Nothing below is
   declared, so a stylesheet that references one fails visibly instead of
   falling back silently — which is exactly how two products in this estate
   ended up with a palette nobody chose.

     --sgi-color-brand-practice-accent-ink
       A practice's own colour as an ink, on that practice's patient-facing
       surface.
       bound by: the consuming product
       waiting on: OQ-BRAND-VALUES — What each practice's accent actually is
       must satisfy: CT-AA-TEXT, CT-BRAND-BINDING

     --sgi-color-brand-practice-accent-fill
       A practice's own colour as a fill, on that practice's patient-facing
       surface. Composed with the action rule, this is what owns the practice's
       primary call to action.
       bound by: the consuming product
       waiting on: OQ-BRAND-VALUES — What each practice's accent actually is
       must satisfy: CT-AA-TEXT, CT-BRAND-BINDING

     --sgi-color-brand-practice-accent-wash
       A practice's own colour as a wash, on that practice's patient-facing
       surface.
       bound by: the consuming product
       waiting on: OQ-BRAND-VALUES — What each practice's accent actually is
       must satisfy: CT-WASH-GROUND, CT-BRAND-BINDING

   =========================================================================== */
