@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;700&family=JetBrains+Mono:wght@400..700&display=swap');

/*!
 * Flux 2.3.0 — Kaptio design system
 * Tokens, fonts and base rules
 *
 * The one-line import. Loads Lexend 300/700 and JetBrains Mono Variable, defines every token, and applies the base rules Flux 1.x could only document.
 *
 * Canonical: https://flux.kaptio.com
 * Agent contract: https://flux.kaptio.com/llms.txt
 * Generated from src/tokens/. Do not edit by hand.
 */
@layer flux.primitive, flux.semantic, flux.component, flux.base;

/* ======================================================================
   TIER 1 — PRIMITIVES. Raw values, no meaning. Flux 1.x compatible.
   ====================================================================== */
@layer flux.primitive {
  :root {
    /* Teal — Kaptio Seagreen (primary) */
    --flux-primary-900: #021E24;
    --flux-primary-800: #032E36;
    --flux-primary-700: #034050;
    --flux-primary-600: #034955;
    --flux-primary-500: #056271;
    --flux-primary-400: #056F82;
    --flux-primary-300: #69A9B4;
    --flux-primary-200: #B4D4DA;
    --flux-primary-100: #E6F1F2;
    --flux-primary-50: #EFF5F5;

    /* Yellow — Bumble-Me (CTA only) */
    --flux-yellow-900: #3A2C10;
    --flux-yellow-800: #956000;
    --flux-yellow-600: #DC8E00;
    --flux-yellow-400: #FFBC42;
    --flux-yellow-300: #FFD78E;
    --flux-yellow-200: #FFEBC6;
    --flux-yellow-100: #FFF8EC;

    /* Pink — Fandango ("the dot", Edge) */
    --flux-pink-600: #AF0072;
    --flux-pink-400: #DE37A4;
    --flux-pink-300: #EB87C8;
    --flux-pink-200: #F5C3E4;
    --flux-pink-100: #FCEBF6;

    /* Orange — Puffin Beak */
    --flux-orange-900: #3D1D19;
    --flux-orange-800: #9C1500;
    --flux-orange-600: #CF1B00;
    --flux-orange-400: #FF6F59;
    --flux-orange-300: #FFA99B;
    --flux-orange-200: #FFD4CD;
    --flux-orange-100: #FFF1EE;

    /* Green — Poison Green */
    --flux-green-900: #16301A;
    --flux-green-850: #0C3403;
    --flux-green-800: #0E5600;
    --flux-green-600: #197C04;
    --flux-green-400: #2BA711;
    --flux-green-300: #80CA70;
    --flux-green-200: #BFE5B8;
    --flux-green-100: #EAF6E7;

    /* Blue */
    --flux-blue-800: #17458F;
    --flux-blue-600: #2F67CF;
    --flux-blue-400: #015BFF;
    --flux-blue-300: #8EB6FF;
    --flux-blue-200: #C6DAFF;
    --flux-blue-100: #ECF5FF;

    /* Purple */
    --flux-purple-600: #5A47D6;
    --flux-purple-400: #6149FF;
    --flux-purple-300: #ADA0FF;
    --flux-purple-200: #D5CFFF;
    --flux-purple-100: #F1EFFF;

    /* Neutrals (Flux 1.x — retained verbatim) */
    --flux-black: #212121;
    --flux-grey-700: #374151;
    --flux-grey-500: #646B78;
    --flux-grey-300: #6B6B6B;
    --flux-grey-200: #C3C3C3;
    --flux-grey-100: #EBEBEB;
    --flux-grey-50: #F5F5F5;
    --flux-white: #FFFFFF;

    /* Neutrals (2.0 ramp — powers the dark theme) */
    --flux-canvas: #F9FAF8;
    --flux-neutral-50: #F4F7F7;
    --flux-neutral-100: #E8EDEE;
    --flux-neutral-200: #D3DADC;
    --flux-neutral-300: #B2BCBF;
    --flux-neutral-400: #8C989C;
    --flux-neutral-500: #6B777B;
    --flux-neutral-600: #4E585C;
    --flux-neutral-700: #363F42;
    --flux-neutral-800: #242B2E;
    --flux-neutral-900: #171D1F;
    --flux-neutral-950: #0E1315;

    /* Status hues */
    --flux-success: #0A7954;
    --flux-error: #C1121F;
    --flux-warning: #945F06;
    --flux-info: #056F82;

    /* Product & platform-layer accents (graphic only) */
    --flux-product-core: #056F82;
    --flux-product-pex: #F18525;
    --flux-product-edge: #DE37A4;
    --flux-product-agents: #8B5CF6;
    --flux-product-quest: #4F46E5;
    --flux-product-voyage: #056F82;
    --flux-product-circle: #047857;
    --flux-layer-core: #056F82;
    --flux-layer-pex: #F18525;
    --flux-layer-edge: #DE37A4;
    --flux-layer-agents: #8B5CF6;
    --flux-quest-accent: #4F46E5;
    --flux-voyage-accent: #056F82;
    --flux-circle-accent: #047857;
    --flux-edge-accent: #DE37A4;
    --flux-agents-accent: #8B5CF6;

    /* Typography */
    --flux-font-sans: 'Lexend', system-ui, -apple-system, sans-serif;
    --flux-font-mono: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    --flux-weight-light: 300;
    --flux-weight-bold: 700;
    --flux-weight-mono-regular: 400;
    --flux-weight-mono-medium: 500;
    --flux-weight-mono-bold: 700;
    --flux-text-xs: 0.75rem;
    --flux-text-sm: 0.875rem;
    --flux-text-base: 1rem;
    --flux-text-lg: 1.125rem;
    --flux-text-xl: 1.25rem;
    --flux-text-2xl: 1.5rem;
    --flux-text-3xl: 1.875rem;
    --flux-text-4xl: 2.25rem;
    --flux-text-5xl: 3rem;
    --flux-text-6xl: 3.75rem;
    --flux-display-sm: 4.5rem;
    --flux-display-md: 6rem;
    --flux-display-lg: 8rem;
    --flux-display-xl: 10.5rem;
    --flux-prototype-font-display: 'Google Sans Flex', 'Manrope', system-ui, -apple-system, sans-serif;
    --flux-prototype-font-ui: 'Manrope', system-ui, -apple-system, sans-serif;
    --flux-prototype-weight-regular: 400;
    --flux-prototype-weight-medium: 500;
    --flux-prototype-weight-semibold: 600;
    --flux-prototype-weight-bold: 700;
    --flux-prototype-text-label: 0.8125rem;
    --flux-prototype-text-kpi: 3.5rem;
    --flux-leading-display: 1;
    --flux-leading-tight: 1.15;
    --flux-leading-snug: 1.3;
    --flux-leading-normal: 1.55;
    --flux-leading-relaxed: 1.7;
    --flux-tracking-tighter: -0.05em;
    --flux-tracking-tight: -0.02em;
    --flux-tracking-normal: 0;
    --flux-tracking-wide: 0.05em;
    --flux-tracking-widest: 0.12em;

    /* Spacing — 4px grid */
    --flux-space-0: 0;
    --flux-space-px: 1px;
    --flux-space-1: 0.25rem;
    --flux-space-2: 0.5rem;
    --flux-space-3: 0.75rem;
    --flux-space-4: 1rem;
    --flux-space-5: 1.25rem;
    --flux-space-6: 1.5rem;
    --flux-space-8: 2rem;
    --flux-space-10: 2.5rem;
    --flux-space-12: 3rem;
    --flux-space-16: 4rem;
    --flux-space-20: 5rem;
    --flux-space-24: 6rem;
    --flux-space-32: 8rem;

    /* Radius */
    --flux-radius-none: 0;
    --flux-radius-xs: 0.125rem;
    --flux-radius-sm: 0.25rem;
    --flux-radius-md: 0.5rem;
    --flux-radius-lg: 0.75rem;
    --flux-radius-xl: 1rem;
    --flux-radius-2xl: 1.5rem;
    --flux-radius-full: 9999px;

    /* Layout */
    --flux-measure-prose: 38rem;
    --flux-measure-content: 62rem;
    --flux-measure-wide: 78rem;
    --flux-gutter: clamp(1.25rem, 4vw, 3rem);
    --flux-seam-gap: 4.5rem;
    --flux-hairline: 1px;

    /* Motion */
    --flux-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --flux-ease-productive: cubic-bezier(0.2, 0, 0.38, 0.9);
    --flux-ease-expressive: cubic-bezier(0.4, 0.14, 0.3, 1);
    --flux-ease-entrance: cubic-bezier(0, 0, 0.38, 0.9);
    --flux-ease-exit: cubic-bezier(0.2, 0, 1, 0.9);
    --flux-duration-fast: 150ms;
    --flux-duration-normal: 200ms;
    --flux-duration-slow: 300ms;
    --flux-duration-deliberate: 480ms;
  }
}

/* ======================================================================
   TIER 2 — SEMANTIC. Reference these. Theme-aware: light / dark / deep.
   ====================================================================== */
@layer flux.semantic {
  :root,
  [data-flux-theme="light"] {
    /* Text */
    --flux-text-primary: var(--flux-black);
    --flux-text-secondary: var(--flux-grey-700);
    --flux-text-subtle: var(--flux-grey-500);
    --flux-text-placeholder: var(--flux-grey-300);
    --flux-text-disabled: var(--flux-grey-200);
    --flux-text-on-color: var(--flux-white);
    --flux-text-on-cta: var(--flux-black);
    --flux-text-inverse: var(--flux-white);
    --flux-text-link: var(--flux-primary-400);
    --flux-text-link-hover: var(--flux-primary-600);
    --flux-text-brand: var(--flux-primary-600);
    --flux-text-error: var(--flux-error);
    --flux-text-success: var(--flux-success);
    --flux-text-warning: var(--flux-warning);
    --flux-text-info: var(--flux-info);

    /* Layer — elevation */
    --flux-layer-00: var(--flux-canvas);
    --flux-layer-01: var(--flux-white);
    --flux-layer-02: var(--flux-neutral-50);
    --flux-layer-03: var(--flux-neutral-100);
    --flux-layer-hover-01: var(--flux-neutral-50);
    --flux-layer-hover-02: var(--flux-neutral-100);
    --flux-layer-hover-03: var(--flux-neutral-200);

    /* Surface */
    --flux-surface-page: var(--flux-canvas);
    --flux-surface: var(--flux-white);
    --flux-surface-alt: var(--flux-grey-50);
    --flux-surface-raised: var(--flux-white);
    --flux-surface-overlay: var(--flux-white);
    --flux-surface-sunken: var(--flux-neutral-50);
    --flux-surface-hover: var(--flux-neutral-50);
    --flux-surface-active: var(--flux-neutral-100);
    --flux-surface-selected: var(--flux-primary-50);
    --flux-surface-disabled: var(--flux-grey-50);
    --flux-surface-inverse: var(--flux-primary-800);
    --flux-surface-brand: var(--flux-primary-600);
    --flux-surface-brand-hover: var(--flux-primary-500);
    --flux-surface-brand-active: var(--flux-primary-700);
    --flux-surface-brand-subtle: var(--flux-primary-100);
    --flux-surface-cta: var(--flux-yellow-400);
    --flux-surface-cta-hover: var(--flux-yellow-300);
    --flux-surface-success-subtle: var(--flux-green-100);
    --flux-surface-warning-subtle: var(--flux-yellow-100);
    --flux-surface-error-subtle: var(--flux-orange-100);
    --flux-surface-info-subtle: var(--flux-primary-100);
    --flux-surface-backdrop: rgba(3, 46, 54, 0.5);

    /* Border */
    --flux-border-subtle: var(--flux-grey-100);
    --flux-border-default: var(--flux-grey-200);
    --flux-border-strong: var(--flux-grey-300);
    --flux-border-interactive: var(--flux-primary-400);
    --flux-border-brand: var(--flux-primary-600);
    --flux-border-focus: var(--flux-primary-400);
    --flux-border-error: var(--flux-error);
    --flux-border-disabled: var(--flux-grey-100);
    --flux-border-inverse: var(--flux-primary-700);

    /* Icon */
    --flux-icon-primary: var(--flux-black);
    --flux-icon-secondary: var(--flux-grey-500);
    --flux-icon-subtle: var(--flux-grey-300);
    --flux-icon-on-color: var(--flux-white);
    --flux-icon-brand: var(--flux-primary-400);
    --flux-icon-disabled: var(--flux-grey-200);

    /* Chart */
    --flux-chart-1: var(--flux-primary-400);
    --flux-chart-2: var(--flux-purple-600);
    --flux-chart-3: var(--flux-pink-600);
    --flux-chart-4: var(--flux-yellow-800);
    --flux-chart-muted: var(--flux-neutral-500);
    --flux-chart-sequential-1: var(--flux-primary-100);
    --flux-chart-sequential-2: var(--flux-primary-200);
    --flux-chart-sequential-3: var(--flux-primary-300);
    --flux-chart-sequential-4: var(--flux-primary-500);
    --flux-chart-sequential-5: var(--flux-primary-800);
    --flux-chart-sequential-text-1: var(--flux-black);
    --flux-chart-sequential-text-2: var(--flux-black);
    --flux-chart-sequential-text-3: var(--flux-black);
    --flux-chart-sequential-text-4: var(--flux-white);
    --flux-chart-sequential-text-5: var(--flux-white);

    /* Focus */
    --flux-focus-ring: var(--flux-primary-400);
    --flux-focus-ring-inset: var(--flux-white);
    --flux-focus-ring-width: 2px;
    --flux-focus-ring-offset: 2px;

    /* Elevation shadow */
    --flux-shadow-sm: 0 1px 2px 0 rgba(3, 46, 54, 0.05);
    --flux-shadow-md: 0 4px 6px -1px rgba(3, 46, 54, 0.07), 0 2px 4px -2px rgba(3, 46, 54, 0.05);
    --flux-shadow-lg: 0 10px 15px -3px rgba(3, 46, 54, 0.08), 0 4px 6px -4px rgba(3, 46, 54, 0.04);
    --flux-shadow-xl: 0 20px 25px -5px rgba(3, 46, 54, 0.08), 0 8px 10px -6px rgba(3, 46, 54, 0.04);

    /* Flux 1.x semantic aliases */
    --flux-background: var(--flux-canvas);
    --flux-heading: var(--flux-primary-800);
  }

  [data-flux-theme="dark"] {
    /* Text */
    --flux-text-primary: var(--flux-neutral-50);
    --flux-text-secondary: var(--flux-neutral-100);
    --flux-text-subtle: var(--flux-neutral-200);
    --flux-text-placeholder: var(--flux-neutral-300);
    --flux-text-disabled: var(--flux-neutral-600);
    --flux-text-on-color: var(--flux-white);
    --flux-text-on-cta: var(--flux-black);
    --flux-text-inverse: var(--flux-black);
    --flux-text-link: var(--flux-primary-200);
    --flux-text-link-hover: var(--flux-primary-100);
    --flux-text-brand: var(--flux-primary-200);
    --flux-text-error: var(--flux-orange-300);
    --flux-text-success: var(--flux-green-300);
    --flux-text-warning: var(--flux-yellow-300);
    --flux-text-info: var(--flux-primary-200);

    /* Layer — elevation */
    --flux-layer-00: var(--flux-neutral-950);
    --flux-layer-01: var(--flux-neutral-900);
    --flux-layer-02: var(--flux-neutral-800);
    --flux-layer-03: var(--flux-neutral-700);
    --flux-layer-hover-01: var(--flux-neutral-800);
    --flux-layer-hover-02: var(--flux-neutral-700);
    --flux-layer-hover-03: var(--flux-neutral-600);

    /* Surface */
    --flux-surface-page: var(--flux-neutral-950);
    --flux-surface: var(--flux-neutral-900);
    --flux-surface-alt: var(--flux-neutral-800);
    --flux-surface-raised: var(--flux-neutral-800);
    --flux-surface-overlay: var(--flux-neutral-800);
    --flux-surface-sunken: var(--flux-neutral-950);
    --flux-surface-hover: var(--flux-neutral-800);
    --flux-surface-active: var(--flux-neutral-700);
    --flux-surface-selected: var(--flux-primary-800);
    --flux-surface-disabled: var(--flux-neutral-800);
    --flux-surface-inverse: var(--flux-neutral-50);
    --flux-surface-brand: var(--flux-primary-400);
    --flux-surface-brand-hover: color-mix(in srgb, var(--flux-primary-400) 85%, #FFFFFF);
    --flux-surface-brand-active: color-mix(in srgb, var(--flux-primary-400) 70%, #FFFFFF);
    --flux-surface-brand-subtle: var(--flux-primary-900);
    --flux-surface-cta: var(--flux-yellow-400);
    --flux-surface-cta-hover: var(--flux-yellow-300);
    --flux-surface-success-subtle: var(--flux-green-900);
    --flux-surface-warning-subtle: var(--flux-yellow-900);
    --flux-surface-error-subtle: var(--flux-orange-900);
    --flux-surface-info-subtle: var(--flux-primary-800);
    --flux-surface-backdrop: rgba(0, 0, 0, 0.65);

    /* Border */
    --flux-border-subtle: var(--flux-neutral-800);
    --flux-border-default: var(--flux-neutral-700);
    --flux-border-strong: var(--flux-neutral-400);
    --flux-border-interactive: var(--flux-primary-300);
    --flux-border-brand: var(--flux-primary-300);
    --flux-border-focus: var(--flux-primary-300);
    --flux-border-error: var(--flux-orange-300);
    --flux-border-disabled: var(--flux-neutral-800);
    --flux-border-inverse: var(--flux-neutral-100);

    /* Icon */
    --flux-icon-primary: var(--flux-neutral-50);
    --flux-icon-secondary: var(--flux-neutral-200);
    --flux-icon-subtle: var(--flux-neutral-400);
    --flux-icon-on-color: var(--flux-white);
    --flux-icon-brand: var(--flux-primary-300);
    --flux-icon-disabled: var(--flux-neutral-600);

    /* Chart */
    --flux-chart-1: var(--flux-primary-300);
    --flux-chart-2: var(--flux-purple-300);
    --flux-chart-3: var(--flux-pink-300);
    --flux-chart-4: var(--flux-yellow-400);
    --flux-chart-muted: var(--flux-neutral-400);
    --flux-chart-sequential-1: var(--flux-primary-800);
    --flux-chart-sequential-2: var(--flux-primary-600);
    --flux-chart-sequential-3: var(--flux-primary-400);
    --flux-chart-sequential-4: var(--flux-primary-300);
    --flux-chart-sequential-5: var(--flux-primary-100);
    --flux-chart-sequential-text-1: var(--flux-white);
    --flux-chart-sequential-text-2: var(--flux-white);
    --flux-chart-sequential-text-3: var(--flux-white);
    --flux-chart-sequential-text-4: var(--flux-primary-900);
    --flux-chart-sequential-text-5: var(--flux-primary-900);

    /* Focus */
    --flux-focus-ring: var(--flux-primary-300);
    --flux-focus-ring-inset: var(--flux-neutral-950);
    --flux-focus-ring-width: 2px;
    --flux-focus-ring-offset: 2px;

    /* Elevation shadow */
    --flux-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --flux-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --flux-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --flux-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 8px 10px -6px rgba(0, 0, 0, 0.4);

    /* Flux 1.x semantic aliases */
    --flux-background: var(--flux-neutral-950);
    --flux-heading: var(--flux-neutral-50);
  }

  [data-flux-theme="deep"] {
    /* Text */
    --flux-text-primary: var(--flux-white);
    --flux-text-secondary: var(--flux-primary-100);
    --flux-text-subtle: var(--flux-primary-200);
    --flux-text-placeholder: var(--flux-primary-200);
    --flux-text-disabled: var(--flux-primary-600);
    --flux-text-on-color: var(--flux-white);
    --flux-text-on-cta: var(--flux-black);
    --flux-text-inverse: var(--flux-black);
    --flux-text-link: var(--flux-primary-200);
    --flux-text-link-hover: var(--flux-white);
    --flux-text-brand: var(--flux-primary-200);
    --flux-text-error: var(--flux-orange-300);
    --flux-text-success: var(--flux-green-300);
    --flux-text-warning: var(--flux-yellow-300);
    --flux-text-info: var(--flux-primary-200);

    /* Layer — elevation */
    --flux-layer-00: var(--flux-primary-800);
    --flux-layer-01: var(--flux-primary-700);
    --flux-layer-02: var(--flux-primary-600);
    --flux-layer-03: var(--flux-primary-600);
    --flux-layer-hover-01: var(--flux-primary-600);
    --flux-layer-hover-02: var(--flux-primary-500);
    --flux-layer-hover-03: var(--flux-primary-500);

    /* Surface */
    --flux-surface-page: var(--flux-primary-800);
    --flux-surface: var(--flux-primary-700);
    --flux-surface-alt: var(--flux-primary-600);
    --flux-surface-raised: var(--flux-primary-700);
    --flux-surface-overlay: var(--flux-primary-700);
    --flux-surface-sunken: var(--flux-primary-900);
    --flux-surface-hover: var(--flux-primary-700);
    --flux-surface-active: var(--flux-primary-600);
    --flux-surface-selected: var(--flux-primary-600);
    --flux-surface-disabled: var(--flux-primary-700);
    --flux-surface-inverse: var(--flux-white);
    --flux-surface-brand: var(--flux-primary-400);
    --flux-surface-brand-hover: color-mix(in srgb, var(--flux-primary-400) 85%, #FFFFFF);
    --flux-surface-brand-active: color-mix(in srgb, var(--flux-primary-400) 70%, #FFFFFF);
    --flux-surface-brand-subtle: var(--flux-primary-700);
    --flux-surface-cta: var(--flux-yellow-400);
    --flux-surface-cta-hover: var(--flux-yellow-300);
    --flux-surface-success-subtle: var(--flux-green-900);
    --flux-surface-warning-subtle: var(--flux-yellow-900);
    --flux-surface-error-subtle: var(--flux-orange-900);
    --flux-surface-info-subtle: var(--flux-primary-500);
    --flux-surface-backdrop: rgba(2, 30, 36, 0.7);

    /* Border */
    --flux-border-subtle: var(--flux-primary-700);
    --flux-border-default: var(--flux-primary-600);
    --flux-border-strong: var(--flux-primary-300);
    --flux-border-interactive: var(--flux-primary-300);
    --flux-border-brand: var(--flux-primary-300);
    --flux-border-focus: var(--flux-primary-300);
    --flux-border-error: var(--flux-orange-300);
    --flux-border-disabled: var(--flux-primary-700);
    --flux-border-inverse: var(--flux-white);

    /* Icon */
    --flux-icon-primary: var(--flux-white);
    --flux-icon-secondary: var(--flux-primary-200);
    --flux-icon-subtle: var(--flux-primary-300);
    --flux-icon-on-color: var(--flux-white);
    --flux-icon-brand: var(--flux-primary-200);
    --flux-icon-disabled: var(--flux-primary-600);

    /* Chart */
    --flux-chart-1: var(--flux-primary-200);
    --flux-chart-2: var(--flux-purple-300);
    --flux-chart-3: var(--flux-pink-300);
    --flux-chart-4: var(--flux-yellow-400);
    --flux-chart-muted: var(--flux-neutral-400);
    --flux-chart-sequential-1: var(--flux-primary-900);
    --flux-chart-sequential-2: var(--flux-primary-500);
    --flux-chart-sequential-3: var(--flux-primary-300);
    --flux-chart-sequential-4: var(--flux-primary-200);
    --flux-chart-sequential-5: var(--flux-primary-50);
    --flux-chart-sequential-text-1: var(--flux-white);
    --flux-chart-sequential-text-2: var(--flux-white);
    --flux-chart-sequential-text-3: var(--flux-primary-900);
    --flux-chart-sequential-text-4: var(--flux-primary-900);
    --flux-chart-sequential-text-5: var(--flux-primary-900);

    /* Focus */
    --flux-focus-ring: var(--flux-primary-300);
    --flux-focus-ring-inset: var(--flux-primary-800);
    --flux-focus-ring-width: 2px;
    --flux-focus-ring-offset: 2px;

    /* Elevation shadow */
    --flux-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
    --flux-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
    --flux-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
    --flux-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.35);

    /* Flux 1.x semantic aliases */
    --flux-background: var(--flux-primary-800);
    --flux-heading: var(--flux-white);
  }
}

/* ======================================================================
   TIER 3 — COMPONENT. Per-component geometry and role bindings.
   ====================================================================== */
@layer flux.component {
  :root {
    /* Touch target */
    --flux-touch-target: 2.75rem;

    /* Button */
    --flux-button-radius: var(--flux-radius-sm);
    --flux-button-font-weight: var(--flux-weight-bold);
    --flux-button-gap: var(--flux-space-2);
    --flux-button-chevron-size: var(--flux-space-4);
    --flux-button-height-sm: 1.875rem;
    --flux-button-height-md: 2.25rem;
    --flux-button-height-lg: 2.75rem;
    --flux-button-padding-x-sm: var(--flux-space-3);
    --flux-button-padding-x-md: var(--flux-space-4);
    --flux-button-padding-x-lg: var(--flux-space-6);
    --flux-button-font-size-sm: var(--flux-text-sm);
    --flux-button-font-size-md: var(--flux-text-sm);
    --flux-button-font-size-lg: var(--flux-text-base);

    /* Field — input, textarea, select, date picker */
    --flux-field-height: 2.25rem;
    --flux-field-radius: var(--flux-radius-sm);
    --flux-field-padding-x: var(--flux-space-3);
    --flux-field-font-size: var(--flux-text-sm);
    --flux-field-bg: var(--flux-surface);
    --flux-field-text: var(--flux-text-primary);
    --flux-field-placeholder: var(--flux-text-placeholder);
    --flux-field-border: var(--flux-border-strong);
    --flux-field-border-hover: var(--flux-border-interactive);
    --flux-field-border-focus: var(--flux-border-focus);
    --flux-field-border-error: var(--flux-border-error);
    --flux-field-label-gap: var(--flux-space-1);
    --flux-field-info-size: var(--flux-space-6);
    --flux-field-info-icon-size: var(--flux-space-4);
    --flux-field-info-icon: var(--flux-icon-secondary);
    --flux-field-info-icon-hover: var(--flux-icon-brand);
    --flux-field-info-max-width: 18rem;
    --flux-field-info-padding-x: var(--flux-space-3);
    --flux-field-info-padding-y: var(--flux-space-2);
    --flux-field-info-bg: var(--flux-layer-01);
    --flux-field-info-text: var(--flux-text-secondary);
    --flux-field-info-border: var(--flux-border-subtle);
    --flux-field-info-shadow: var(--flux-shadow-md);
    --flux-textarea-min-height: 6.25rem;
    --flux-select-chevron-size: var(--flux-space-4);
    --flux-select-panel-max-height: 12.5rem;
    --flux-multiselect-panel-max-height: 12.5rem;
    --flux-datepicker-trigger-icon-size: var(--flux-space-4);
    --flux-datepicker-panel-width: 18rem;
    --flux-datepicker-panel-padding: var(--flux-space-4);
    --flux-datepicker-panel-bg: var(--flux-surface-overlay);
    --flux-datepicker-panel-border: var(--flux-border-subtle);
    --flux-datepicker-nav-size: var(--flux-space-8);
    --flux-datepicker-day-size: var(--flux-space-8);
    --flux-datepicker-grid-gap: var(--flux-space-1);
    --flux-datepicker-day-text: var(--flux-text-primary);
    --flux-datepicker-weekday-text: var(--flux-text-subtle);
    --flux-datepicker-selected-bg: var(--flux-surface-brand);
    --flux-datepicker-selected-text: var(--flux-text-on-color);
    --flux-datepicker-range-bg: var(--flux-surface-selected);
    --flux-datepicker-today-border: var(--flux-border-interactive);

    /* Control — checkbox, radio, switch */
    --flux-control-size: 1.125rem;
    --flux-control-label-gap: var(--flux-space-2);
    --flux-control-checked-bg: var(--flux-surface-brand);
    --flux-control-unchecked-border: var(--flux-border-strong);
    --flux-control-check: var(--flux-icon-on-color);
    --flux-switch-track-width: 2.75rem;
    --flux-switch-track-height: 1.5rem;
    --flux-switch-thumb-inset: var(--flux-space-1);
    --flux-switch-thumb: var(--flux-icon-secondary);
    --flux-control-radio-dot: var(--flux-space-2);
    --flux-choice-group-gap: var(--flux-space-3);
    --flux-choice-group-inline-gap: var(--flux-space-6);

    /* Slider — a value or a range on a track */
    --flux-slider-thumb-size: var(--flux-space-5);
    --flux-slider-thumb-border-width: 0.125rem;
    --flux-slider-thumb-bg: var(--flux-surface);
    --flux-slider-thumb-bg-hover: var(--flux-surface-brand-subtle);
    --flux-slider-thumb-border: var(--flux-icon-brand);
    --flux-slider-track-height: var(--flux-space-1);
    --flux-slider-track: var(--flux-layer-03);
    --flux-slider-fill: var(--flux-icon-brand);
    --flux-slider-value: var(--flux-text-primary);
    --flux-slider-scale: var(--flux-text-secondary);
    --flux-slider-scale-gap: var(--flux-space-1);

    /* Search — field with icon, clear and result count */
    --flux-search-icon: var(--flux-icon-secondary);
    --flux-search-icon-size: var(--flux-space-4);
    --flux-search-clear-size: var(--flux-space-6);
    --flux-search-count: var(--flux-text-secondary);

    /* Accordion — collapsible page sections */
    --flux-accordion-divider: var(--flux-border-subtle);
    --flux-accordion-padding-y: var(--flux-space-4);
    --flux-accordion-panel-padding: var(--flux-space-5);
    --flux-accordion-title-size: var(--flux-text-base);
    --flux-accordion-title-hover: var(--flux-text-brand);
    --flux-accordion-icon: var(--flux-icon-secondary);
    --flux-accordion-meta: var(--flux-text-secondary);

    /* Toast — transient confirmation */
    --flux-toast-width: 24rem;
    --flux-toast-bg: var(--flux-surface-raised);
    --flux-toast-border: var(--flux-border-subtle);
    --flux-toast-shadow: var(--flux-shadow-lg);
    --flux-toast-padding: var(--flux-space-4);
    --flux-toast-gap: var(--flux-space-3);
    --flux-toast-offset: var(--flux-space-6);
    --flux-toast-icon: var(--flux-icon-brand);
    --flux-toast-icon-success: var(--flux-text-success);
    --flux-toast-icon-size: var(--flux-space-5);
    --flux-toast-duration: 6s;

    /* Reorder — drag and keyboard reordering */
    --flux-reorder-divider: var(--flux-border-subtle);
    --flux-reorder-padding-y: var(--flux-space-3);
    --flux-reorder-gap: var(--flux-space-3);
    --flux-reorder-handle-size: var(--flux-space-8);
    --flux-reorder-handle-icon: var(--flux-icon-secondary);
    --flux-reorder-lifted-bg: var(--flux-surface-raised);
    --flux-reorder-lifted-shadow: var(--flux-shadow-md);

    /* Editable cell — values edited in place */
    --flux-editable-padding-x: var(--flux-space-2);
    --flux-editable-radius: var(--flux-radius-sm);
    --flux-editable-border-hover: var(--flux-border-strong);
    --flux-editable-saving-text: var(--flux-text-secondary);

    /* Popover — small floating panel */
    --flux-popover-width: 20rem;
    --flux-popover-padding: var(--flux-space-4);
    --flux-popover-gap: var(--flux-space-3);
    --flux-popover-bg: var(--flux-surface-raised);
    --flux-popover-border: var(--flux-border-subtle);
    --flux-popover-shadow: var(--flux-shadow-md);
    --flux-popover-radius: var(--flux-radius-sm);

    /* Card */
    --flux-card-radius: var(--flux-radius-sm);
    --flux-card-padding: var(--flux-space-5);
    --flux-card-bg: var(--flux-layer-01);
    --flux-card-border: var(--flux-border-subtle);
    --flux-card-border-hover: var(--flux-border-interactive);
    --flux-card-shadow-hover: var(--flux-shadow-md);

    /* Metric — headline figures on one surface */
    --flux-metric-min-width: 14rem;
    --flux-metric-padding: var(--flux-card-padding);
    --flux-metric-gap-x: var(--flux-space-8);
    --flux-metric-gap-y: var(--flux-space-6);
    --flux-metric-part-gap: var(--flux-space-1);
    --flux-metric-radius: var(--flux-radius-sm);
    --flux-metric-bg: var(--flux-layer-01);
    --flux-metric-border: var(--flux-border-subtle);
    --flux-metric-label-color: var(--flux-text-secondary);
    --flux-metric-label-size: var(--flux-text-sm);
    --flux-metric-value-color: var(--flux-text-brand);
    --flux-metric-value-size: var(--flux-text-4xl);
    --flux-metric-value-tracking: var(--flux-tracking-tighter);
    --flux-metric-change-size: var(--flux-text-sm);
    --flux-metric-change-neutral: var(--flux-text-secondary);
    --flux-metric-change-positive: var(--flux-text-success);
    --flux-metric-change-negative: var(--flux-text-error);
    --flux-metric-icon-size: var(--flux-space-4);

    /* Timeline and itinerary */
    --flux-timeline-rail: var(--flux-border-default);
    --flux-timeline-rail-width: var(--flux-hairline);
    --flux-timeline-marker-size: var(--flux-space-3);
    --flux-timeline-marker-current-size: var(--flux-space-4);
    --flux-timeline-marker-radius: var(--flux-radius-sm);
    --flux-timeline-marker-done: var(--flux-icon-brand);
    --flux-timeline-marker-upcoming: var(--flux-border-strong);
    --flux-timeline-marker-bg: var(--flux-layer-01);
    --flux-timeline-item-gap: var(--flux-space-5);
    --flux-timeline-column-gap: var(--flux-space-4);
    --flux-timeline-time-width: 3.5rem;
    --flux-timeline-title-min-width: 12rem;
    --flux-timeline-font-size: var(--flux-text-sm);
    --flux-timeline-time-color: var(--flux-text-secondary);
    --flux-timeline-time-current: var(--flux-text-brand);
    --flux-timeline-title-color: var(--flux-text-primary);
    --flux-timeline-body-color: var(--flux-text-secondary);
    --flux-itinerary-when-width: 9rem;
    --flux-itinerary-body-min-width: 20rem;
    --flux-itinerary-day-padding: var(--flux-space-6);
    --flux-itinerary-column-gap: var(--flux-space-6);
    --flux-itinerary-divider: var(--flux-border-subtle);
    --flux-itinerary-number-color: var(--flux-text-primary);
    --flux-itinerary-date-color: var(--flux-text-secondary);
    --flux-itinerary-title-size: var(--flux-text-lg);

    /* Spinner — loading indicator */
    --flux-spinner-size: var(--flux-space-8);
    --flux-spinner-size-sm: var(--flux-space-4);
    --flux-spinner-size-lg: var(--flux-space-16);
    --flux-spinner-head: var(--flux-icon-brand);
    --flux-spinner-accent: var(--flux-product-edge);
    --flux-spinner-duration: 1.1s;
    --flux-spinner-ease: var(--flux-ease-expressive);
    --flux-spinner-gap: var(--flux-space-3);
    --flux-spinner-label: var(--flux-text-secondary);

    /* Empty state — nothing to show, and the one way forward */
    --flux-empty-padding: var(--flux-space-12);
    --flux-empty-gap: var(--flux-space-3);
    --flux-empty-icon-size: var(--flux-space-8);
    --flux-empty-icon: var(--flux-icon-secondary);
    --flux-empty-title-size: var(--flux-text-lg);
    --flux-empty-body: var(--flux-text-secondary);
    --flux-empty-measure: var(--flux-measure-prose);

    /* Breadcrumbs — the path back up a hierarchy */
    --flux-breadcrumbs-gap: var(--flux-space-2);
    --flux-breadcrumbs-link: var(--flux-text-secondary);
    --flux-breadcrumbs-link-hover: var(--flux-text-brand);
    --flux-breadcrumbs-current: var(--flux-text-primary);
    --flux-breadcrumbs-separator: var(--flux-icon-secondary);
    --flux-breadcrumbs-separator-size: var(--flux-space-3);

    /* Pagination — moving through pages of results */
    --flux-pagination-gap: var(--flux-space-1);
    --flux-pagination-item-size: var(--flux-button-height-sm);
    --flux-pagination-item-text: var(--flux-text-primary);
    --flux-pagination-item-hover: var(--flux-surface-hover);
    --flux-pagination-current-bg: var(--flux-surface-selected);
    --flux-pagination-current-text: var(--flux-text-brand);
    --flux-pagination-range: var(--flux-text-secondary);

    /* Segmented control — joined, mutually exclusive options */
    --flux-segmented-height: var(--flux-field-height);
    --flux-segmented-height-sm: var(--flux-button-height-sm);
    --flux-segmented-padding-x: var(--flux-space-4);
    --flux-segmented-bg: var(--flux-field-bg);
    --flux-segmented-border: var(--flux-border-strong);
    --flux-segmented-text: var(--flux-text-secondary);
    --flux-segmented-text-hover: var(--flux-text-primary);
    --flux-segmented-selected-bg: var(--flux-surface-selected);
    --flux-segmented-selected-text: var(--flux-text-brand);

    /* Stepper — the steps of a wizard */
    --flux-stepper-marker-size: var(--flux-space-6);
    --flux-stepper-gap: var(--flux-space-3);
    --flux-stepper-connector: var(--flux-border-default);
    --flux-stepper-connector-complete: var(--flux-icon-brand);
    --flux-stepper-marker-border: var(--flux-border-strong);
    --flux-stepper-marker-text: var(--flux-text-secondary);
    --flux-stepper-marker-current-bg: var(--flux-surface-brand);
    --flux-stepper-marker-current-text: var(--flux-text-on-color);
    --flux-stepper-marker-complete: var(--flux-icon-brand);
    --flux-stepper-marker-error: var(--flux-text-error);
    --flux-stepper-label: var(--flux-text-secondary);
    --flux-stepper-label-current: var(--flux-text-primary);

    /* Keyboard shortcut — key caps */
    --flux-kbd-bg: var(--flux-layer-02);
    --flux-kbd-border: var(--flux-border-default);
    --flux-kbd-text: var(--flux-text-secondary);
    --flux-kbd-padding-x: var(--flux-space-1);
    --flux-kbd-gap: var(--flux-space-1);

    /* Command palette — search over commands and records */
    --flux-command-width: 40rem;
    --flux-command-list-height: 24rem;
    --flux-command-offset: var(--flux-space-24);
    --flux-command-bg: var(--flux-surface-overlay);
    --flux-command-shadow: var(--flux-shadow-xl);
    --flux-command-backdrop: var(--flux-surface-backdrop);
    --flux-command-divider: var(--flux-border-subtle);
    --flux-command-padding: var(--flux-space-2);
    --flux-command-input-height: var(--flux-space-12);
    --flux-command-option-padding-x: var(--flux-space-3);
    --flux-command-option-padding-y: var(--flux-space-2);
    --flux-command-option-active: var(--flux-surface-selected);
    --flux-command-option-icon: var(--flux-icon-secondary);
    --flux-command-group-label: var(--flux-text-subtle);

    /* Calendar view — a month of departures */
    --flux-calendar-bg: var(--flux-layer-01);
    --flux-calendar-border: var(--flux-border-subtle);
    --flux-calendar-day-min-height: var(--flux-space-24);
    --flux-calendar-day-padding: var(--flux-space-2);
    --flux-calendar-outside-bg: var(--flux-layer-02);
    --flux-calendar-date: var(--flux-text-secondary);
    --flux-calendar-today-bg: var(--flux-surface-brand);
    --flux-calendar-today-text: var(--flux-text-on-color);
    --flux-calendar-event-bg: var(--flux-layer-02);
    --flux-calendar-event-hover: var(--flux-layer-hover-02);
    --flux-calendar-event-attention: var(--flux-surface-warning-subtle);
    --flux-calendar-min-width: 48rem;

    /* Board — columns of cards that move between stages */
    --flux-board-column-width: 18rem;
    --flux-board-gap: var(--flux-space-4);
    --flux-board-column-bg: var(--flux-layer-02);
    --flux-board-column-padding: var(--flux-space-3);
    --flux-board-card-bg: var(--flux-layer-01);
    --flux-board-card-border: var(--flux-border-subtle);
    --flux-board-card-padding: var(--flux-space-3);
    --flux-board-card-gap: var(--flux-space-2);
    --flux-board-lifted-shadow: var(--flux-shadow-md);
    --flux-board-drop-border: var(--flux-border-interactive);

    /* Walkthrough and storyboard — an explanation in order */
    --flux-walkthrough-gap: var(--flux-space-12);
    --flux-walkthrough-marker-size: var(--flux-space-8);
    --flux-walkthrough-marker-bg: var(--flux-surface-brand);
    --flux-walkthrough-marker-text: var(--flux-text-on-color);
    --flux-walkthrough-media-bg: var(--flux-layer-02);
    --flux-walkthrough-media-padding: var(--flux-space-5);
    --flux-storyboard-frame-width: 16rem;
    --flux-storyboard-gap: var(--flux-space-6);
    --flux-storyboard-screen-bg: var(--flux-layer-02);
    --flux-storyboard-screen-border: var(--flux-border-subtle);
    --flux-storyboard-screen-padding: var(--flux-space-4);
    --flux-storyboard-number: var(--flux-text-brand);

    /* Map — markers, routes and popups over a map library */
    --flux-map-height: 28rem;
    --flux-map-ground: var(--flux-layer-02);
    --flux-map-border: var(--flux-border-subtle);
    --flux-map-route: var(--flux-chart-1);
    --flux-map-route-planned: var(--flux-chart-muted);
    --flux-map-route-width: 3;
    --flux-map-route-dash: 6 5;
    --flux-map-marker-size: var(--flux-space-8);
    --flux-map-marker-bg: var(--flux-surface-brand);
    --flux-map-marker-text: var(--flux-text-on-color);
    --flux-map-marker-ring: var(--flux-layer-01);
    --flux-map-marker-selected-bg: var(--flux-layer-01);
    --flux-map-marker-selected-text: var(--flux-text-brand);
    --flux-map-marker-selected-border: var(--flux-border-brand);
    --flux-map-popup-width: 16rem;
    --flux-map-popup-bg: var(--flux-surface-overlay);
    --flux-map-popup-shadow: var(--flux-shadow-md);
    --flux-map-popup-padding: var(--flux-space-3);

    /* Flow diagram — nodes, edges and minimap */
    --flux-flow-unit: var(--flux-space-4);
    --flux-flow-height: 30rem;
    --flux-flow-bg: var(--flux-layer-01);
    --flux-flow-border: var(--flux-border-subtle);
    --flux-flow-grid: var(--flux-border-default);
    --flux-flow-node-bg: var(--flux-layer-01);
    --flux-flow-node-border: var(--flux-border-strong);
    --flux-flow-node-padding: var(--flux-space-3);
    --flux-flow-node-selected-bg: var(--flux-surface-selected);
    --flux-flow-node-selected-border: var(--flux-border-interactive);
    --flux-flow-node-type: var(--flux-text-subtle);
    --flux-flow-edge: var(--flux-border-strong);
    --flux-flow-edge-active: var(--flux-icon-brand);
    --flux-flow-edge-width: 1.5;
    --flux-flow-label-bg: var(--flux-layer-01);
    --flux-flow-minimap-width: 10rem;
    --flux-flow-minimap-bg: var(--flux-layer-02);
    --flux-flow-minimap-node: var(--flux-border-strong);
    --flux-flow-minimap-viewport: var(--flux-border-interactive);

    /* Chart — plot, axis, legend and series marks */
    --flux-chart-gap: var(--flux-space-4);
    --flux-chart-plot-height: 16rem;
    --flux-chart-scale-width: var(--flux-space-10);
    --flux-chart-headroom: var(--flux-space-6);
    --flux-chart-column-gap: var(--flux-space-1);
    --flux-chart-bar-width: var(--flux-space-6);
    --flux-chart-row-bar-height: var(--flux-space-3);
    --flux-chart-grid: var(--flux-border-subtle);
    --flux-chart-axis: var(--flux-border-strong);
    --flux-chart-label: var(--flux-text-secondary);
    --flux-chart-track: var(--flux-layer-03);
    --flux-chart-legend-gap: var(--flux-space-4);
    --flux-chart-swatch-size: var(--flux-space-3);
    --flux-chart-line-width: 2;
    --flux-chart-line-dash: 4 3;
    --flux-chart-donut-size: 12rem;
    --flux-chart-donut-stroke: 5;
    --flux-chart-area-opacity: 0.16;
    --flux-chart-stack-gap: var(--flux-space-px);
    --flux-chart-guide: var(--flux-border-strong);
    --flux-chart-readout-gap: var(--flux-space-2);
    --flux-chart-readout-padding-x: var(--flux-space-3);
    --flux-chart-readout-padding-y: var(--flux-space-2);
    --flux-chart-readout-bg: var(--flux-surface-overlay);
    --flux-chart-readout-border: var(--flux-border-subtle);
    --flux-chart-readout-shadow: var(--flux-shadow-md);

    /* Heatmap — a matrix of values on a sequential scale */
    --flux-heatmap-cell-height: var(--flux-space-10);
    --flux-heatmap-cell-min-width: var(--flux-space-16);
    --flux-heatmap-cell-gap: var(--flux-space-px);
    --flux-heatmap-cell-padding-x: var(--flux-space-2);
    --flux-heatmap-header: var(--flux-text-secondary);
    --flux-heatmap-row-header: var(--flux-text-primary);
    --flux-heatmap-empty-text: var(--flux-text-secondary);
    --flux-heatmap-hover-ring: var(--flux-border-strong);
    --flux-heatmap-key-swatch: var(--flux-space-6);

    /* Split view — a list beside the selected record */
    --flux-split-list-width: 22rem;
    --flux-split-height: 36rem;
    --flux-split-bg: var(--flux-layer-01);
    --flux-split-border: var(--flux-border-subtle);
    --flux-split-item-padding-y: var(--flux-space-3);
    --flux-split-item-padding-x: var(--flux-space-4);
    --flux-split-item-hover: var(--flux-layer-hover-01);
    --flux-split-item-selected: var(--flux-surface-selected);
    --flux-split-item-pointer-size: var(--flux-space-3);
    --flux-split-item-meta: var(--flux-text-secondary);
    --flux-split-detail-padding: var(--flux-space-6);

    /* File upload — dropzone and file list */
    --flux-upload-padding: var(--flux-space-8);
    --flux-upload-gap: var(--flux-space-3);
    --flux-upload-bg: var(--flux-layer-01);
    --flux-upload-bg-active: var(--flux-surface-brand-subtle);
    --flux-upload-border: var(--flux-border-strong);
    --flux-upload-border-active: var(--flux-border-brand);
    --flux-upload-icon: var(--flux-icon-secondary);
    --flux-upload-icon-size: var(--flux-space-8);
    --flux-upload-text: var(--flux-text-secondary);
    --flux-upload-item-padding-y: var(--flux-space-3);
    --flux-upload-item-padding-x: var(--flux-space-4);
    --flux-upload-item-gap: var(--flux-space-3);
    --flux-upload-item-divider: var(--flux-border-subtle);
    --flux-upload-meta: var(--flux-text-secondary);
    --flux-upload-success: var(--flux-text-success);

    /* Assistant panel — messages, prompt and sources */
    --flux-assistant-width: 26rem;
    --flux-assistant-height: 40rem;
    --flux-assistant-bg: var(--flux-layer-01);
    --flux-assistant-border: var(--flux-border-subtle);
    --flux-assistant-padding: var(--flux-space-5);
    --flux-assistant-gap: var(--flux-space-5);
    --flux-assistant-user-bg: var(--flux-layer-02);
    --flux-assistant-tail-size: var(--flux-space-3);
    --flux-assistant-mark: var(--flux-product-agents);
    --flux-assistant-mark-size: var(--flux-space-6);
    --flux-assistant-meta: var(--flux-text-secondary);
    --flux-assistant-source-bg: var(--flux-layer-02);
    --flux-assistant-source-hover: var(--flux-layer-hover-02);

    /* Rich text editor — toolbar, content area and prose styles */
    --flux-editor-bg: var(--flux-field-bg);
    --flux-editor-border: var(--flux-field-border);
    --flux-editor-border-hover: var(--flux-field-border-hover);
    --flux-editor-toolbar-bg: var(--flux-layer-02);
    --flux-editor-toolbar-padding: var(--flux-space-1);
    --flux-editor-tool-size: var(--flux-button-height-sm);
    --flux-editor-tool-icon: var(--flux-icon-secondary);
    --flux-editor-tool-hover: var(--flux-layer-hover-02);
    --flux-editor-tool-pressed-bg: var(--flux-surface-selected);
    --flux-editor-tool-pressed-icon: var(--flux-icon-brand);
    --flux-editor-content-padding: var(--flux-space-4);
    --flux-editor-min-height: var(--flux-space-32);
    --flux-prose-text: var(--flux-text-primary);
    --flux-prose-gap: var(--flux-space-4);
    --flux-prose-heading-2: var(--flux-text-xl);
    --flux-prose-heading-3: var(--flux-text-lg);
    --flux-prose-quote-border: var(--flux-border-strong);
    --flux-prose-quote-text: var(--flux-text-secondary);
    --flux-prose-link: var(--flux-text-link);

    /* Progress and meter — segmented bars */
    --flux-progress-segment-height: var(--flux-space-3);
    --flux-progress-segment-height-sm: var(--flux-space-2);
    --flux-progress-segment-gap: var(--flux-space-1);
    --flux-progress-segment-radius: var(--flux-radius-sm);
    --flux-progress-segment-empty: var(--flux-layer-03);
    --flux-progress-fill: var(--flux-icon-brand);
    --flux-progress-fill-warning: var(--flux-text-warning);
    --flux-progress-fill-error: var(--flux-text-error);
    --flux-progress-header-gap: var(--flux-space-2);
    --flux-progress-label: var(--flux-text-primary);
    --flux-progress-value: var(--flux-text-secondary);

    /* Skeleton — placeholder shapes for content whose layout is known */
    --flux-skeleton-bg: var(--flux-layer-03);
    --flux-skeleton-radius: var(--flux-radius-sm);
    --flux-skeleton-block-size: var(--flux-space-32);
    --flux-skeleton-avatar-size: var(--flux-avatar-size-md);
    --flux-skeleton-duration: 1.6s;
    --flux-skeleton-ease: var(--flux-ease-expressive);
    --flux-skeleton-dim: 0.5;

    /* App shell — rail, top bar and main column */
    --flux-shell-rail-width: 15rem;
    --flux-shell-rail-collapsed-width: var(--flux-space-16);
    --flux-shell-topbar-height: var(--flux-space-16);
    --flux-shell-search-width: 24rem;
    --flux-shell-contained-height: 36rem;
    --flux-shell-rail-bg: var(--flux-layer-01);
    --flux-shell-topbar-bg: var(--flux-layer-01);
    --flux-shell-main-bg: var(--flux-surface-page);
    --flux-shell-divider: var(--flux-border-subtle);
    --flux-shell-padding: var(--flux-space-3);
    --flux-shell-content-padding: var(--flux-space-8);
    --flux-shell-section-gap: var(--flux-space-6);
    --flux-shell-section-label: var(--flux-text-subtle);
    --flux-shell-item-height: var(--flux-space-10);
    --flux-shell-item-gap: var(--flux-space-3);
    --flux-shell-item-padding-x: var(--flux-space-3);
    --flux-shell-item-radius: var(--flux-radius-sm);
    --flux-shell-item-text: var(--flux-text-secondary);
    --flux-shell-item-hover: var(--flux-layer-hover-01);
    --flux-shell-item-hover-text: var(--flux-text-primary);
    --flux-shell-item-current-bg: var(--flux-surface-selected);
    --flux-shell-item-current-text: var(--flux-text-brand);
    --flux-shell-item-icon: var(--flux-icon-secondary);
    --flux-shell-item-current-icon: var(--flux-icon-brand);
    --flux-shell-icon-size: var(--flux-space-4);
    --flux-shell-mark: var(--flux-product-core);
    --flux-shell-mark-size: var(--flux-space-8);
    --flux-shell-sheet-shadow: var(--flux-shadow-lg);
    --flux-shell-backdrop: var(--flux-surface-backdrop);

    /* Badge */
    --flux-badge-radius: var(--flux-radius-full);
    --flux-badge-height: 1.25rem;
    --flux-badge-padding-x: 0.625rem;
    --flux-badge-font-size: var(--flux-text-xs);
    --flux-badge-font-weight: var(--flux-weight-bold);

    /* Table */
    --flux-table-cell-padding-y: var(--flux-space-3);
    --flux-table-cell-padding-x: var(--flux-space-4);
    --flux-table-divider: var(--flux-border-subtle);
    --flux-table-header-text: var(--flux-text-subtle);
    --flux-table-header-font-size: var(--flux-text-xs);
    --flux-table-row-hover: var(--flux-layer-hover-01);
    --flux-table-font-size: var(--flux-text-sm);
    --flux-table-row-height: var(--flux-space-12);
    --flux-table-row-height-compact: var(--flux-space-10);
    --flux-table-cell-padding-y-compact: var(--flux-space-2);
    --flux-table-header-bg: var(--flux-layer-01);
    --flux-table-cell-bg: var(--flux-layer-01);
    --flux-table-row-selected: var(--flux-surface-selected);
    --flux-table-detail-bg: var(--flux-layer-02);
    --flux-table-control-width: var(--flux-space-10);
    --flux-table-icon-button-size: var(--flux-button-height-sm);
    --flux-table-icon: var(--flux-icon-secondary);
    --flux-table-icon-hover: var(--flux-icon-primary);
    --flux-table-icon-hover-bg: var(--flux-layer-03);
    --flux-table-sort-icon-active: var(--flux-icon-brand);
    --flux-table-sticky-max-height: 30rem;
    --flux-table-toolbar-gap: var(--flux-space-4);

    /* Filter chips and the more-filters panel */
    --flux-chip-height: var(--flux-button-height-sm);
    --flux-chip-padding-x: var(--flux-space-3);
    --flux-chip-padding-end: var(--flux-space-2);
    --flux-chip-gap: var(--flux-space-1);
    --flux-chip-radius: var(--flux-radius-sm);
    --flux-chip-bg: var(--flux-surface-selected);
    --flux-chip-text: var(--flux-text-primary);
    --flux-chip-font-size: var(--flux-text-sm);
    --flux-chip-border: var(--flux-border-subtle);
    --flux-chip-border-hover: var(--flux-border-interactive);
    --flux-chip-icon: var(--flux-icon-secondary);
    --flux-chip-icon-size: var(--flux-space-4);
    --flux-filter-panel-width: var(--flux-datepicker-panel-width);
    --flux-filter-panel-padding: var(--flux-space-4);
    --flux-filter-panel-gap: var(--flux-space-4);

    /* Menu — row actions and column options */
    --flux-menu-bg: var(--flux-surface-overlay);
    --flux-menu-border: var(--flux-border-subtle);
    --flux-menu-shadow: var(--flux-shadow-md);
    --flux-menu-radius: var(--flux-radius-sm);
    --flux-menu-padding: var(--flux-space-1);
    --flux-menu-min-width: 12rem;
    --flux-menu-item-padding-x: var(--flux-space-3);
    --flux-menu-item-padding-y: var(--flux-space-2);
    --flux-menu-item-hover: var(--flux-layer-hover-01);
    --flux-menu-item-font-size: var(--flux-text-sm);
    --flux-menu-offset: var(--flux-space-1);
    --flux-menu-separator: var(--flux-border-subtle);
    --flux-menu-item-danger: var(--flux-text-error);

    /* Drawer — a record or a task over the page, from its end edge */
    --flux-drawer-width: 32rem;
    --flux-drawer-width-lg: 48rem;
    --flux-drawer-bg: var(--flux-surface-overlay);
    --flux-drawer-shadow: var(--flux-shadow-xl);
    --flux-drawer-backdrop: var(--flux-surface-backdrop);
    --flux-drawer-divider: var(--flux-border-subtle);
    --flux-drawer-padding: var(--flux-space-5);
    --flux-drawer-duration: var(--flux-duration-normal);

    /* Modal */
    --flux-modal-radius: var(--flux-radius-sm);
    --flux-modal-bg: var(--flux-surface-overlay);
    --flux-modal-shadow: var(--flux-shadow-xl);
    --flux-modal-backdrop: var(--flux-surface-backdrop);
    --flux-modal-width-sm: 24rem;
    --flux-modal-width-md: 32rem;
    --flux-modal-width-lg: 48rem;
    --flux-modal-padding: var(--flux-space-5);

    /* Note */
    --flux-note-radius: var(--flux-radius-sm);
    --flux-note-padding: var(--flux-space-4);
    --flux-note-gap: var(--flux-space-3);

    /* Description list — labelled values for one object */
    --flux-dl-gap-x: var(--flux-space-8);
    --flux-dl-gap-y: var(--flux-space-4);
    --flux-dl-term-gap: var(--flux-space-1);
    --flux-dl-term-color: var(--flux-text-secondary);
    --flux-dl-term-size: var(--flux-text-sm);
    --flux-dl-detail-color: var(--flux-text-primary);
    --flux-dl-detail-size: var(--flux-text-base);

    /* Tabs */
    --flux-tab-height: 2.5rem;
    --flux-tab-padding-x: var(--flux-space-4);
    --flux-tab-font-size: var(--flux-text-sm);
    --flux-tab-indicator-width: 2px;
    --flux-tab-indicator: var(--flux-border-interactive);
    --flux-tab-text: var(--flux-text-subtle);
    --flux-tab-text-active: var(--flux-text-brand);

    /* Avatar */
    --flux-avatar-radius: var(--flux-radius-full);
    --flux-avatar-size-sm: 2rem;
    --flux-avatar-size-md: 2.5rem;
    --flux-avatar-size-lg: 3.5rem;
    --flux-avatar-bg: var(--flux-surface-brand-subtle);
    --flux-avatar-text: var(--flux-text-brand);

    /* Tooltip */
    --flux-tooltip-bg: var(--flux-surface-inverse);
    --flux-tooltip-text: var(--flux-text-inverse);
    --flux-tooltip-radius: var(--flux-radius-sm);
    --flux-tooltip-font-size: var(--flux-text-xs);
    --flux-tooltip-padding-x: var(--flux-space-3);
    --flux-tooltip-padding-y: var(--flux-space-2);
    --flux-tooltip-max-width: 16rem;
    --flux-tooltip-offset: var(--flux-space-1);

    /* Slide — deck geometry */
    --flux-slide-width: 80rem;
    --flux-slide-height: 45rem;
    --flux-slide-pad-x: var(--flux-space-16);
    --flux-slide-pad-y: var(--flux-space-12);
    --flux-slide-gap: var(--flux-space-10);
    --flux-slide-measure: 44rem;
    --flux-slide-measure-display: var(--flux-measure-content);
    --flux-slide-accent: var(--flux-product-core);
    --flux-slide-ground-forest: var(--flux-green-850);
    --flux-slide-ground-forest-layer: var(--flux-green-900);
    --flux-slide-mark-opacity: 0.12;
    --flux-slide-plot-height: 18rem;
    --flux-slide-donut-size: 20rem;
    --flux-slide-closing-image-opacity: 0.8;
    --flux-slide-donut-stroke: 5;

    /* Flow — outcome patterns (Flux 1.x, retained) */
    --flux-flow-header-height: 3.5rem;
    --flux-flow-header-bg: var(--flux-surface);
    --flux-flow-header-border: var(--flux-border-subtle);
    --flux-flow-entry-duration: var(--flux-duration-deliberate);
    --flux-flow-return-countdown: 8s;
  }
}

/* Touch screens: controls grow to the touch target. Mouse layouts are unchanged. */
@media (pointer: coarse) {
  @layer flux.component {
    :root {
      --flux-button-height-sm: var(--flux-touch-target);
      --flux-button-height-md: var(--flux-touch-target);
      --flux-field-height: var(--flux-touch-target);
      --flux-tab-height: var(--flux-touch-target);
    }
  }
}

/* ======================================================================
   BASE — the rules a preset cannot enforce from tokens alone.
   ====================================================================== */
@layer flux.base {
  html {
    /* Fluid root. Every rem in Flux scales from 16px to 19px, not from a fixed 16px. */
    font-size: clamp(16px, 0.875rem + 0.4vw, 19px);
    font-family: var(--flux-font-sans);
    font-weight: var(--flux-weight-light);
    color: var(--flux-text-primary);
    background-color: var(--flux-surface-page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* Lexend ships two weights in Flux. Anything between collapses to one of them. */
  b, strong, h1, h2, h3, h4, h5, h6, th {
    font-weight: var(--flux-weight-bold);
  }

  code, kbd, samp, pre {
    font-family: var(--flux-font-mono);
    font-weight: var(--flux-weight-mono-regular);
  }

  /* Focus is Flux teal everywhere, never a browser or Tailwind default. */
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: var(--flux-focus-ring-width) solid var(--flux-focus-ring);
    outline-offset: var(--flux-focus-ring-offset);
  }

  ::selection {
    background-color: var(--flux-surface-brand-subtle);
    color: var(--flux-text-primary);
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer flux.base {
    *, *::before, *::after {
      animation-duration: 1ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 1ms !important;
      scroll-behavior: auto !important;
    }
  }
}
