/* Strix token layer 4b/7 — dark theme.
 * Generated by scripts/build-tokens.mjs from scripts/tokens/upstream-snapshot.css.
 * Do not edit by hand — change the generator or the snapshot. `pnpm tokens:check` gates this.
 *
 * The vendored snapshot was taken from ui-registry PR #117 and not main, because
 * main's dark block is a stale half-light theme in which 129 tokens are literally
 * #ffffff. The CORRECTIONS block below is registry-authored and MUST survive any
 * future edit to the snapshot. See scripts/tokens/README.md.
 */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* semantic color — surface */
  --color-surface-accent-extra-soft: var(--palette-secondary-800);
  --color-surface-accent-extra-strong: var(--palette-primary-800);
  --color-surface-accent-medium: var(--palette-secondary-600);
  --color-surface-accent-semi-extra-soft: var(--palette-primary-065);
  --color-surface-accent-soft: var(--palette-primary-200);
  --color-surface-accent-strong: var(--palette-primary-500);
  --color-surface-accent-ultra-soft: var(--palette-primary-060);
  --color-surface-alpha-black-200: var(--palette-alpha-black-alpha-200);
  --color-surface-alpha-blue-080: var(--palette-alpha-blue-alpha-300);
  --color-surface-alpha-blue-200: var(--palette-alpha-neutral-alpha-200);
  --color-surface-alpha-page-bg-l0-l1: var(--palette-white-100);
  --color-surface-alpha-white-100: var(--palette-alpha-black-alpha-050);
  --color-surface-alpha-white-200: var(--palette-alpha-black-alpha-200);
  --color-surface-alpha-white-300: var(--palette-alpha-black-alpha-200);
  --color-surface-alpha-white-400: var(--palette-alpha-black-alpha-300);
  --color-surface-base: var(--palette-secondary-890);
  --color-surface-disabled: var(--palette-alpha-white-alpha-080);
  --color-surface-error: var(--palette-alpha-red-alpha-200);
  --color-surface-error-disabled: var(--palette-hex-a5b0c4-a10);
  --color-surface-error-focused: var(--palette-hex-b10f23-a10);
  --color-surface-error-hover: var(--palette-hex-b10f23-a10);
  --color-surface-error-pressed: var(--palette-hex-b10f23-a5);
  --color-surface-error-soft: var(--palette-hex-b10f23-a10);
  --color-surface-hover: var(--palette-secondary-800);
  --color-surface-inactive: var(--palette-hex-a5b0c4-a30);
  --color-surface-inactive-disabled: var(--palette-hex-a5b0c4-a10);
  --color-surface-inactive-focused: var(--palette-hex-a5b0c4-a10);
  --color-surface-inactive-hover: var(--palette-hex-a5b0c4-a10);
  --color-surface-inactive-pressed: var(--palette-hex-a5b0c4-a5);
  --color-surface-info: var(--palette-alpha-blue-alpha-200);
  --color-surface-inverse: var(--palette-secondary-800);
  --color-surface-neutral-medium: var(--palette-secondary-500);
  --color-surface-neutral-neutral: var(--palette-secondary-700);
  --color-surface-neutral-neutral-disabled: var(--palette-hex-a5b0c4-a10);
  --color-surface-neutral-neutral-focused: var(--palette-hex-2d3954);
  --color-surface-neutral-neutral-hover: var(--palette-hex-2d3954);
  --color-surface-neutral-neutral-pressed: var(--palette-secondary-800);
  --color-surface-neutral-semi-medium: var(--palette-secondary-800);
  --color-surface-neutral-semi-medium-strong: var(--palette-secondary-850);
  --color-surface-neutral-semi-strong: var(--palette-secondary-500);
  --color-surface-neutral-soft: var(--palette-hex-2d3954);
  --color-surface-neutral-strong: var(--palette-secondary-700);
  --color-surface-pressed: var(--palette-secondary-850);
  --color-surface-primary: var(--palette-alpha-white-alpha-080);
  --color-surface-secondary: var(--palette-secondary-800);
  --color-surface-selection-layer-soft: var(--palette-alpha-black-alpha-200);
  --color-surface-selection-layer-strong: var(--palette-alpha-white-alpha-200);
  --color-surface-skeleton: var(--palette-secondary-850);
  --color-surface-success: var(--palette-alpha-mint-alpha-200);
  --color-surface-success-disabled: var(--palette-hex-a5b0c4-a10);
  --color-surface-success-focus: var(--palette-hex-6addb2-a10);
  --color-surface-success-hover: var(--palette-hex-6addb2-a10);
  --color-surface-success-medium: var(--palette-accent-mint-300);
  --color-surface-success-pressed: var(--palette-hex-6addb2-a5);
  --color-surface-success-semi-strong: var(--palette-accent-mint-400);
  --color-surface-success-soft: var(--palette-alpha-mint-alpha-200);
  --color-surface-tertiary: var(--palette-hex-2d3954);
  --color-surface-variant: var(--palette-secondary-800);
  --color-surface-warning: var(--palette-alpha-sun-alpha-200);
  --color-surface-warning-disabled: var(--palette-hex-a5b0c4-a10);
  --color-surface-warning-focused: var(--palette-hex-ff7a00-a10);
  --color-surface-warning-hover: var(--palette-hex-ff7a00-a10);
  --color-surface-warning-pressed: var(--palette-hex-ff7a00-a5);
  --color-surface-warning-soft: var(--palette-hex-ff7a00-a10);

  /* semantic color — text */
  --color-text-accent: var(--palette-primary-400);
  --color-text-accent-focused: var(--palette-primary-300);
  --color-text-accent-hover: var(--palette-primary-300);
  --color-text-accent-pressed: var(--palette-primary-300);
  --color-text-accent-selected: var(--palette-primary-200);
  --color-text-accent-soft: var(--palette-primary-200);
  --color-text-accent-strong: var(--palette-primary-200);
  --color-text-badge: var(--palette-secondary-800);
  --color-text-badge-success: var(--palette-accent-mint-800);
  --color-text-button-loading: var(--palette-secondary-400);
  --color-text-button-primary: var(--palette-secondary-900);
  --color-text-button-primary-disabled: var(--palette-alpha-white-alpha-200);
  --color-text-button-secondary: var(--palette-primary-400);
  --color-text-button-secondary-disabled: var(--palette-alpha-white-alpha-200);
  --color-text-button-secondary-disabled-on-surface: var(--palette-alpha-white-alpha-200);
  --color-text-button-secondary-focused: var(--palette-primary-200);
  --color-text-button-secondary-focused-on-surface: var(--palette-primary-200);
  --color-text-button-secondary-hover: var(--palette-primary-100);
  --color-text-button-secondary-hover-on-surface: var(--palette-primary-100);
  --color-text-button-secondary-on-surface: var(--palette-white-100);
  --color-text-button-secondary-pressed: var(--palette-primary-300);
  --color-text-button-secondary-pressed-on-surface: var(--palette-primary-300);
  --color-text-button-tertiary: var(--palette-primary-300);
  --color-text-button-tertiary-disabled: var(--palette-neutrals-800);
  --color-text-button-tertiary-focused: var(--palette-primary-200);
  --color-text-button-tertiary-hover: var(--palette-primary-100);
  --color-text-button-tertiary-pressed: var(--palette-primary-300);
  --color-text-destructive: var(--palette-tertiary-500);
  --color-text-destructive-disabled: var(--palette-alpha-white-alpha-200);
  --color-text-destructive-focused: var(--palette-tertiary-400);
  --color-text-destructive-hover: var(--palette-tertiary-400);
  --color-text-destructive-pressed: var(--palette-tertiary-200);
  --color-text-disabled: var(--palette-alpha-white-alpha-200);
  --color-text-disabled-on-surface: var(--palette-neutrals-600);
  --color-text-error: var(--palette-tertiary-400);
  --color-text-error-disabled: var(--palette-secondary-600);
  --color-text-error-focused: var(--palette-tertiary-300);
  --color-text-error-hover: var(--palette-tertiary-300);
  --color-text-error-pressed: var(--palette-tertiary-200);
  --color-text-inactive: var(--palette-secondary-300);
  --color-text-inactive-disabled: var(--palette-secondary-600);
  --color-text-inactive-focused: var(--palette-secondary-300);
  --color-text-inactive-hover: var(--palette-secondary-300);
  --color-text-inactive-pressed: var(--palette-white-100);
  --color-text-input-default: var(--palette-secondary-400);
  --color-text-inverse: var(--palette-white-100);
  --color-text-on-error: var(--palette-tertiary-400);
  --color-text-on-error-subtle: var(--palette-tertiary-900);
  --color-text-primary: var(--palette-white-100);
  --color-text-quaternary: var(--palette-secondary-400);
  --color-text-secondary: var(--palette-secondary-300);
  --color-text-success: var(--palette-accent-mint-500);
  --color-text-success-strong: var(--palette-accent-mint-800);
  --color-text-tertiary: var(--palette-secondary-400);
  --color-text-warning-disabled: var(--palette-secondary-600);

  /* semantic color — border */
  --color-border-accent: var(--palette-primary-300);
  --color-border-accent-soft: var(--palette-primary-500);
  --color-border-button-button-secondary: var(--palette-primary-400);
  --color-border-button-button-secondary-disabled: var(--palette-neutrals-800);
  --color-border-button-button-secondary-disabled-on-surface: var(--palette-alpha-white-alpha-200);
  --color-border-button-button-secondary-focused: var(--palette-primary-300);
  --color-border-button-button-secondary-focused-on-surface: var(--palette-primary-200);
  --color-border-button-button-secondary-hover: var(--palette-primary-300);
  --color-border-button-button-secondary-hover-on-surface: var(--palette-primary-200);
  --color-border-button-button-secondary-on-surface: var(--palette-primary-100);
  --color-border-button-button-secondary-pressed: var(--palette-primary-200);
  --color-border-button-button-secondary-pressed-on-surface: var(--palette-primary-300);
  --color-border-button-button-tertiary: var(--palette-primary-050);
  --color-border-button-button-tertiary-focused: var(--palette-primary-200);
  --color-border-button-button-tertiary-pressed: var(--palette-primary-900);
  --color-border-button-secondary-loading: var(--palette-secondary-500);
  --color-border-card-card-primary: var(--palette-secondary-600);
  --color-border-card-card-primary-disabled: var(--palette-neutrals-700);
  --color-border-card-card-primary-focused: var(--palette-primary-800);
  --color-border-card-card-primary-hover: var(--palette-primary-800);
  --color-border-card-card-primary-pressed: var(--palette-primary-900);
  --color-border-destructive: var(--palette-tertiary-700);
  --color-border-destructive-disabled: var(--palette-neutrals-800);
  --color-border-destructive-focused: var(--palette-tertiary-800);
  --color-border-destructive-hover: var(--palette-tertiary-800);
  --color-border-destructive-pressed: var(--palette-tertiary-900);
  --color-border-disabled: var(--palette-neutrals-700);
  --color-border-disabled-on-surface: var(--palette-neutrals-500);
  --color-border-divider-on-surface: var(--palette-hex-2d3954);
  --color-border-error: var(--palette-tertiary-400);
  --color-border-error-disabled: var(--palette-secondary-600);
  --color-border-error-focused: var(--palette-tertiary-600);
  --color-border-error-hover: var(--palette-tertiary-600);
  --color-border-error-pressed: var(--palette-tertiary-700);
  --color-border-error-soft: var(--palette-tertiary-500);
  --color-border-focus: var(--palette-primary-500);
  --color-border-hover: var(--palette-primary-500);
  --color-border-inactive: var(--palette-neutrals-600);
  --color-border-inactive-disabled: var(--palette-secondary-600);
  --color-border-inactive-focused: var(--palette-neutrals-600);
  --color-border-inactive-hover: var(--palette-neutrals-600);
  --color-border-inactive-pressed: var(--palette-neutrals-700);
  --color-border-inverse: var(--palette-neutrals-900);
  --color-border-neutral-extra-soft: var(--palette-secondary-800);
  --color-border-neutral-medium: var(--palette-secondary-600);
  --color-border-neutral-neutral: var(--palette-secondary-400);
  --color-border-neutral-neutral-disabled: var(--palette-secondary-600);
  --color-border-neutral-neutral-focused: var(--palette-secondary-700);
  --color-border-neutral-neutral-hover: var(--palette-secondary-700);
  --color-border-neutral-neutral-pressed: var(--palette-secondary-800);
  --color-border-neutral-semi-strong: var(--palette-secondary-400);
  --color-border-neutral-soft: var(--palette-secondary-700);
  --color-border-neutral-strong: var(--palette-secondary-700);
  --color-border-pressed: var(--palette-primary-300);
  --color-border-skeleton: var(--palette-neutrals-700);
  --color-border-success: var(--palette-accent-mint-400);
  --color-border-success-disabled: var(--palette-secondary-600);
  --color-border-success-focus: var(--palette-accent-mint-700);
  --color-border-success-hover: var(--palette-accent-mint-700);
  --color-border-success-medium: var(--palette-accent-mint-300);
  --color-border-success-pressed: var(--palette-accent-mint-700);
  --color-border-tab-active: var(--palette-primary-050);
  --color-border-tertiary: var(--palette-neutrals-600);
  --color-border-warning: var(--palette-accent-sun-400);
  --color-border-warning-disabled: var(--palette-secondary-600);
  --color-border-warning-focused: var(--palette-accent-sun-700);
  --color-border-warning-hover: var(--palette-accent-sun-700);
  --color-border-warning-pressed: var(--palette-accent-sun-700);
  --color-border-warning-semi-medium: var(--palette-accent-sun-500);

  /* semantic color — icon */
  --color-icon-accent: var(--palette-primary-300);
  --color-icon-accent-extra-soft: var(--palette-primary-060);
  --color-icon-accent-focused: var(--palette-primary-400);
  --color-icon-accent-hover: var(--palette-primary-500);
  --color-icon-accent-muted: var(--palette-neutrals-800);
  --color-icon-accent-pressed: var(--palette-primary-500);
  --color-icon-accent-selected: var(--palette-primary-200);
  --color-icon-accent-soft: var(--palette-primary-060);
  --color-icon-accent-subtle: var(--palette-primary-500);
  --color-icon-badge: var(--palette-secondary-300);
  --color-icon-badge-success: var(--palette-accent-mint-400);
  --color-icon-destructive: var(--palette-tertiary-500);
  --color-icon-destructive-disabled: var(--palette-secondary-600);
  --color-icon-destructive-focused: var(--palette-tertiary-600);
  --color-icon-destructive-hover: var(--palette-tertiary-600);
  --color-icon-destructive-pressed: var(--palette-tertiary-700);
  --color-icon-disabled: var(--palette-neutrals-600);
  --color-icon-error: var(--palette-tertiary-500);
  --color-icon-error-disabled: var(--palette-secondary-600);
  --color-icon-error-focused: var(--palette-tertiary-600);
  --color-icon-error-hover: var(--palette-tertiary-600);
  --color-icon-error-pressed: var(--palette-tertiary-700);
  --color-icon-inactive: var(--palette-secondary-300);
  --color-icon-inactive-disabled: var(--palette-secondary-600);
  --color-icon-inactive-focused: var(--palette-secondary-300);
  --color-icon-inactive-hover: var(--palette-secondary-300);
  --color-icon-inactive-pressed: var(--palette-white-100);
  --color-icon-inverse: var(--palette-white-100);
  --color-icon-loading: var(--palette-secondary-500);
  --color-icon-on-surface: var(--palette-alpha-white-alpha-400);
  --color-icon-primary: var(--palette-white-100);
  --color-icon-primary-button: var(--palette-secondary-900);
  --color-icon-primary-button-disabled: var(--palette-secondary-700);
  --color-icon-secondary: var(--palette-secondary-300);
  --color-icon-skeleton: var(--palette-neutrals-500);
  --color-icon-success: var(--palette-accent-mint-500);
  --color-icon-success-soft: var(--palette-accent-mint-600);
  --color-icon-tertiary: var(--palette-secondary-600);
  --color-icon-warning: var(--palette-accent-sun-500);
  --color-icon-warning-disabled: var(--palette-secondary-600);

  /* semantic color — button background */
  --color-bg-button-destructive: var(--palette-hex-9a1c2b);
  --color-bg-button-destructive-disabled: var(--palette-alpha-white-alpha-050);
  --color-bg-button-destructive-focused: var(--palette-tertiary-800);
  --color-bg-button-destructive-hover: var(--palette-tertiary-800);
  --color-bg-button-destructive-pressed: var(--palette-tertiary-900);
  --color-bg-button-inverse: var(--palette-alpha-white-alpha-000);
  --color-bg-button-primary: var(--palette-primary-700);
  --color-bg-button-primary-disabled: var(--palette-alpha-white-alpha-050);
  --color-bg-button-primary-focused: var(--palette-primary-800);
  --color-bg-button-primary-hover: var(--palette-primary-800);
  --color-bg-button-primary-loading: var(--palette-neutrals-900);
  --color-bg-button-primary-pressed: var(--palette-primary-900);
  --color-bg-button-secondary: var(--palette-alpha-black-alpha-200);

  /* semantic color — elevation */
  --color-elevation-elevation-040: var(--palette-hex-000d25-a4);
  --color-elevation-elevation-080: var(--palette-secondary-800);
  --color-elevation-elevation-100: var(--palette-alpha-black-alpha-100);

  /* gradients */
  --gradients-blue-balance: linear-gradient(334deg, #7facfa -7.23%, #bed6ff 38.7%, #c9f2e0 83.76%);
  --gradients-skeleton-loader: linear-gradient(
    270deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 40%,
    rgba(255, 255, 255, 0.2) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  --gradients-white-surface-fade-right: linear-gradient(90deg, #0f172a 82.34%, rgba(0, 13, 37, 0) 92.81%);
}

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

/* =========================================================================
 * maker-ds dark-theme CORRECTIONS — registry-authored, NOT auto-generated.
 *
 * The [data-theme="dark"] block above is a verbatim concatenation of
 * one-console ds-tokens' Figma-synced dark theme (see the Token Sync
 * Workflow in docs/specs/2026-05-20-maker-ds-port-design.md). A handful of
 * its dark values are genuine upstream defects: they fail WCAG AA against
 * the surface/background they are paired with in ds-react's own components.
 * This block overrides ONLY those specific tokens with contrast-verified
 * derived values.
 *
 * Rules:
 *  - Scoped to [data-theme="dark"] only; the light theme is never touched.
 *  - Same selector + later source order than the generated block => wins.
 *  - Each override documents the upstream (broken) value, the paired bg,
 *    the measured contrast, and the corrected value's contrast.
 *  - MUST be preserved when re-concatenating upstream tokens.
 *  - Every entry is reported upstream (maker-ds / ds-react) as a real defect.
 * ========================================================================= */
:root,
[data-theme="dark"] {
  /* Primary button label. Upstream dark: #000d25 on --color-bg-button-primary
   * #1866ee = 3.84:1 (FAIL for 14px normal). Light value is #ffffff and the
   * sibling --color-text-button-primary-on-surface is #ffffff; white on
   * #1866ee = 5.05:1 (PASS), and white on --color-bg-button-destructive-primary
   * #9a1c2b also passes. Fixes button-v2 primary + destructive-primary. */
  --color-text-button-primary: #ffffff;

  /* Soft accent surfaces. Upstream left these three as LIGHT-theme values in
   * the dark theme (white / light-blue text over them fails: #ffffff on
   * #bed6ff = 1.4:1, on #dae4f6/#ecf1fa similar), while the sibling
   * --color-surface-accent-extra-soft is correctly dark (#232e47). Corrected
   * to a subtle dark-navy ladder between the base surface (#0f172a) and
   * -extra-soft (#232e47), ordered by softness. All hold #ffffff (>= 12:1) and
   * #bed6ff (>= 8:1). Aesthetic pending upstream/design review. */
  --color-surface-accent-ultra-soft: #151d31; /* upstream dark: #ecf1fa */
  --color-surface-accent-soft: #1b243a; /* upstream dark: #bed6ff */
  --color-surface-accent-semi-extra-soft: #212c45; /* upstream dark: #dae4f6 */

  /* Success surface. Upstream dark = rgba(106,221,178,0.2), which composites
   * over the base to ~#395a67; text-success #6addb2 on it = 4.44:1 (just under
   * AA), and it drives the alert-message success banner + success status badges.
   * Corrected to a solid deep green (matches the existing --color-text-badge-
   * success / --color-text-success-strong #183d2f family); text-success #6addb2
   * on #183d2f = ~6.7:1. */
  --color-surface-success: #183d2f;

  /* Badge `new` decorative background. accent-lavender-200 is a badge-only
   * primitive (grep-verified) left light (#f5e9fe) in dark; text-accent-strong
   * #bed6ff over it = 1.26:1. Corrected to the upstream decorative dark purple
   * (--color-decorative-surface-purple #653874); #bed6ff on #653874 = ~5:1. */
  --color-accent-lavender-200: #653874;
}

/* =========================================================================
 * Figma design-authority re-points — dark theme only.
 *
 * Source: scripts/figma/bindings/*.json, our committed capture of get_variable_defs
 * against the Demo components library. Generated from FIGMA_DARK_OVERRIDES in
 * scripts/build-tokens.mjs — do not hand-edit.
 *
 * Rules:
 *  - Dark only. The Figma library is authored dark-surface exclusively, so it is
 *    authoritative here and silent for light; light stays maker-ds-derived.
 *  - Same selector, later source order than CORRECTIONS => wins where they overlap.
 *  - Values are var() into palette.css, never raw hex (spec 6.3).
 *  - Each row names the atom and variant it was captured from.
 *
 * Captured but NOT applied yet, and why:
 *  - .button-main Secondary/Hover + Pressed fills: Figma fills the outlined button on
 *    hover (brand-white) and pressed (gray-100). Strix has no
 *    --color-bg-button-secondary-hover or -pressed role to point at, and minting them
 *    needs a LIGHT value too — a dark-only role resolves to undefined in light and is
 *    silently skipped by the contrast helper. maker-ds has no equivalent to inherit, and
 *    Figma is dark-only, so the light values would have to be invented. Needs a design
 *    decision, not a re-point.
 *  - .button-main Secondary/Default + Hover inks: Figma draws the resting outline
 *    white-on-transparent and inverts to ink-on-white on hover. Strix inks it with the
 *    accent blue. Re-pointing the existing roles would work in dark but they are the same
 *    roles the light theme uses, where white-on-white is invisible. Blocked on the same
 *    light-value decision as the fills.
 *  - .button-main Link: Figma gives it a 1px bottom border, a white resting ink and its
 *    own 14/20 ramp; Strix uses `underline` on hover with the accent inks. Reconciling
 *    means choosing between border-bottom and text-decoration, and a white resting link
 *    has no light-theme value.
 *
 * DECLINED on accessibility grounds — an a11y floor is a constraint, not a preference,
 * and is the one exception to "where they disagree, Figma wins":

 * ========================================================================= */
:root,
[data-theme="dark"] {
  --color-bg-button-primary-hover: var(--palette-blue-700); /* figma .button-main Primary/Hover */
  --color-bg-button-primary-pressed: var(--palette-blue-850); /* figma .button-main Primary/Pressed */
  --color-bg-button-primary-disabled: var(--palette-gray-700); /* figma .button-main Primary/Disable */
  --color-text-button-primary-disabled: var(--palette-gray-300); /* figma .button-main Primary/Disable */
  --color-border-button-button-secondary-disabled: var(--palette-gray-700); /* figma .button-main Secondary/Disable */
  --color-text-button-secondary-disabled: var(--palette-gray-300); /* figma .button-main Secondary+Link/Disable */
  --color-surface-base: var(--palette-brand-ink); /* figma color/brand/ink — the page every screen is drawn on */
  --color-border-tab-active: var(--palette-blue-200); /* figma .tab-item active rule */
  --color-bg-button-outline-hover: var(
    --palette-brand-white
  ); /* figma .button-main Secondary/Hover fill, light inverted */
  --color-bg-button-outline-pressed: var(
    --palette-gray-100
  ); /* figma .button-main Secondary/Pressed fill, light inverted */
  --color-border-button-outline: var(
    --palette-brand-white
  ); /* figma .button-main Secondary/Default border, light inverted */
  --color-border-button-outline-pressed: var(
    --palette-gray-100
  ); /* figma .button-main Secondary/Pressed border, light inverted */
  --color-text-button-outline: var(
    --palette-brand-white
  ); /* figma .button-main Secondary/Default ink, light inverted */
  --color-text-button-outline-hover: var(
    --palette-brand-ink
  ); /* figma .button-main Secondary/Hover ink, light inverted */
  --color-text-button-link-pressed: var(--palette-blue-500); /* figma .button-main Link/Pressed ink, light inverted */
  --color-text-button-outline-pressed: var(
    --palette-brand-ink
  ); /* figma .button-main Secondary/Pressed ink, light inverted */
  --color-surface-badge-error: var(--palette-alpha-accesible-red-alpha-200); /* figma .badge fill */
  --color-text-muted-figma: var(--palette-gray-400); /* figma color/gray/gray-400 — the muted ink seven atoms share */
  --color-surface-field: var(--palette-gray-800); /* figma .input-text fill, shared by every field atom */
  --color-border-field-figma: var(--palette-gray-700); /* figma .input-text boundary, 1.40:1 (conflict) */
  --color-border-field-focus: var(--palette-blue-200); /* figma .input-dropdown open border, derived */
  --color-border-field-error: var(--palette-brand-accesible-red-dark-theme); /* figma .input-text Error border */
  --color-text-field-description: var(--palette-gray-300); /* figma .input-text FieldDescription ink */
  --color-text-field-alert: var(--palette-brand-accesible-red-dark-theme); /* figma .input-text [Alert] ink */
  --color-surface-field-disabled: var(--palette-gray-850); /* figma .input-dropdown Disabled fill */
  --color-icon-field-info: var(--palette-gray-300); /* figma .input-dropdown tooltip glyph */
  --color-border-otp-cell: var(--palette-gray-300); /* figma .input-otp resting cell border */
  --color-border-otp-cell-filled: var(--palette-brand-white); /* figma .input-otp Filled cell border */
  --color-surface-tooltip: var(--palette-brand-white); /* figma .label bubble surface, inverted */
  --color-text-on-tooltip: var(--palette-brand-ink); /* figma .label bubble ink */
  --color-text-on-tooltip-muted: var(--palette-gray-700); /* figma-derived: the secondary line .label does not draw */
  --color-border-tab: var(--palette-gray-700); /* figma .tab-item resting rule, 1.95:1 (conflict) */
  --color-border-tab-hover: var(--palette-brand-white); /* figma .tab-item hover rule */
  --color-text-subtle-figma: var(--palette-gray-300); /* figma color/gray/gray-300 — the ink fifteen atoms share */
  --color-border-tile: var(--palette-gray-700); /* figma .button-selectable resting border, 1.95:1 (conflict) */
  --color-border-tile-selected: var(--palette-brand-accesible-red-dark-theme); /* figma tile Selected border */
  --color-surface-tile-hover: var(--palette-alpha-twilio-red-alpha-200); /* figma tile hover tint (conflict) */
  --color-border-chat-input: var(--palette-brand-white); /* figma .cellphone-input-text resting border */
  --color-icon-section: var(--palette-brand-twilio-red); /* figma Section Header icon */
  --color-icon-brand: var(--palette-brand-twilio-red); /* Twilio brand red icon */
  --color-text-brand: var(--palette-brand-twilio-red); /* Twilio brand red text */
  --color-icon-twilio-red: var(--palette-brand-twilio-red); /* Twilio brand red icon alias */
  --color-text-twilio-red: var(--palette-brand-twilio-red); /* Twilio brand red text alias */
  --color-surface-bubble-user: var(--palette-gray-50); /* figma Cellphone-messages user bubble */
  --color-surface-chat-visitor: var(--palette-gray-50); /* figma Cellphone-messages user bubble (visitor) */
  --color-text-on-bubble-user: var(--palette-brand-ink); /* figma Cellphone-messages user bubble ink */
  --color-text-on-chat-visitor: var(--palette-brand-ink); /* figma Cellphone-messages user bubble ink (visitor) */
  --color-surface-bubble-agent: var(--palette-gray-800); /* figma Cellphone-messages agent bubble surface */
  --color-text-on-bubble-agent: var(--palette-brand-white); /* figma Cellphone-messages agent bubble ink */
  --color-text-section-title: var(--palette-gray-100); /* figma Section Header title */
  --color-border-tile-group-disabled: var(--palette-gray-800); /* figma Use-case-selection disabled container */
  --color-text-tile-group-disabled: var(--palette-gray-700); /* figma Use-case-selection disabled title */
  --color-surface-card-inverted: var(--palette-brand-white); /* figma Scenario-card fill */
  --color-text-on-card-inverted: var(--palette-brand-ink); /* figma Scenario-card title */
  --color-text-on-card-inverted-muted: var(--palette-gray-700); /* figma Scenario-card description */
  --color-icon-on-card-inverted: var(--palette-brand-ink); /* figma Scenario-card resting arrow glyph */
  --color-surface-card-arrow-active: var(
    --palette-brand-accesible-red-dark-theme
  ); /* figma Scenario-card arrow hover */
  --color-border-phone-active: var(--palette-blue-700); /* figma Phone-container Default */
  --color-border-phone-ended: var(--palette-gray-700); /* figma Phone-container End */
  --color-surface-chat-error: var(--palette-red-600); /* figma .system-messages fill */
  --color-border-chat-error: var(--palette-red-850); /* figma .system-messages left rule */
  --color-icon-loading-figma: var(--palette-brand-twilio-red); /* figma Phone-loading-text arc */
  --color-surface-chat-banner: var(--palette-brand-white); /* figma .system-messages light fill */
  --color-text-on-chat-banner: var(--palette-brand-ink); /* figma .system-messages ink */
  --color-border-chat-info: var(--palette-blue-400); /* figma .system-messages informative rule */
  --color-border-chat-response: var(--palette-blue-600); /* figma .system-messages response rule */
  --color-surface-chat-success: var(--palette-blue-100); /* figma .system-messages call-ended fill */
  --color-border-chat-success: var(--palette-blue-400); /* figma .system-messages call-ended rule */
  --color-icon-chat-info: var(--palette-blue-400); /* figma .system-messages informative glyph */
  --color-icon-chat-response: var(--palette-blue-600); /* figma .system-messages response glyph */
  --color-surface-identity-chip: var(--palette-gray-850); /* figma ChannelAvatar/EmailMessage chip */
  --color-surface-avatar-pill: var(--palette-brand-ink); /* figma ChannelAvatar Company pill */
  --color-icon-waveform-agent: var(--palette-brand-accesible-red-dark-theme); /* figma .agent-waiting bars */
  --color-icon-waveform-transferred: var(--palette-blue-700); /* figma .transfer-agent-animation post-handoff bars */
  --color-border-transfer-rule: var(--palette-red-850); /* figma .transfer-agent-animation gradient rule ends */
  --color-surface-panel: var(--palette-gray-850); /* figma Panel-configurations fill */
  --color-border-panel: var(--palette-gray-700); /* figma Panel-configurations border */
  --color-surface-call-decline: var(--palette-red-600); /* figma Half-phonecall Type=Calling decline fill */
  --color-surface-call-declined: var(--palette-red-700); /* figma Half-phonecall Type=Declined settled fill */
  --color-surface-call-accept: var(--palette-blue-500); /* figma Half-phonecall Type=Calling accept fill */
  --color-icon-on-call-action: var(--palette-brand-white); /* figma Half-phonecall call action glyph */
  --color-surface-call-end: var(
    --palette-brand-accesible-red-dark-theme
  ); /* figma .cellphone-button end + Full-phonecall End fill */
  --color-surface-call-end-hover: var(--palette-red-600); /* figma .cellphone-button end/Hover fill */
  --color-surface-identity-disc: var(--palette-brand-white); /* figma Icon 22:3119 */
  --color-border-phone-voice: var(--palette-gray-700); /* figma Full-phonecall-screen frame border */
  --color-surface-transcript-header: var(--palette-gray-800); /* figma Transcript header fill */
  --color-border-transcript-header: var(--palette-gray-700); /* figma Transcript header rule, 1.40:1 (conflict) */
  --color-text-transcript-agent: var(--palette-red-400); /* figma Text agent prefix, 4.48:1 (conflict) */
  --color-surface-scrollbar-thumb: var(--palette-gray-700); /* figma Transcript scrollbar thumb 22:27958 */
  --color-border-notification-success: var(--palette-status-green); /* figma .demo-notifications Success border */
  --color-border-notification-warning: var(--palette-status-amber); /* figma .demo-notifications Alert border */
  --color-border-notification-error: var(
    --palette-brand-accesible-red-dark-theme
  ); /* figma .demo-notifications Error border */
  --color-text-notification-success: var(--palette-status-green); /* figma .demo-notifications Success title ink */
  --color-text-notification-warning: var(--palette-status-amber); /* figma .demo-notifications Alert title ink */
  --color-text-notification-error: var(
    --palette-brand-accesible-red-dark-theme
  ); /* figma .demo-notifications Error title ink, 4.57:1 */
  --color-icon-notification-success: var(--palette-status-green); /* figma .demo-notifications Success glyph */
  --color-icon-notification-warning: var(--palette-status-amber); /* figma .demo-notifications Alert glyph */
  --color-icon-notification-error: var(--palette-brand-twilio-red); /* figma .demo-notifications Error glyph, 3.82:1 */
}

/* =========================================================================
 * Accessibility corrections — dark theme only.
 *
 * Roles where a value THIS system chose does not meet a WCAG floor on the surface it
 * actually appears on. Generated from A11Y_DARK_CORRECTIONS in
 * scripts/build-tokens.mjs — do not hand-edit.
 *
 * Emitted last, so it outranks both upstream CORRECTIONS and the Figma re-points: an
 * accessibility floor is a constraint rather than a preference, and is the one stated
 * exception to "where they disagree, Figma wins".
 * ========================================================================= */
:root,
[data-theme="dark"] {
  --color-border-control: var(
    --palette-secondary-500
  ); /* Q-J: secondary-600 is 2.83:1 on a field fill (#232e47), under 1.4.11 3:1. secondary-500 is 4.20:1 */
}
