/* AV DS 4 token consumption boundary. Product aliases are intentionally kept
   here so components and layouts never redefine design-system primitives. */
@layer avds.tokens {
  html[data-design-system="avds4"][data-av-theme="institutional"],
  html[data-design-system="avds4"]:not([data-av-theme]) {
    --av-color-background: #f6f9fc;
    --av-color-foreground: #020617;
    --av-color-surface: #ffffff;
    --av-color-card: var(--av-color-surface);
    --av-color-muted: #f1f5f9;
    --av-color-muted-foreground: #334155;
    --av-color-border: #e2e8f0;
    --av-color-primary: #1d4ed8;
    --av-color-primary-foreground: #ffffff;
    --av-color-blue-500: #3b82f6;
    --av-color-blue-600: #2563eb;
    --av-color-blue-700: #1d4ed8;
    --av-color-white: #ffffff;
    --av-color-success: #15803d;
    --av-color-green-100: #dcfce7;
    --av-color-green-700: #15803d;
    --av-color-red-600: #dc2626;
    --av-color-amber-700: #b45309;
    --av-spacing-1: 4px;
    --av-spacing-2: 8px;
    --av-spacing-3: 12px;
    --av-spacing-4: 16px;
    --av-spacing-5: 20px;
    --av-spacing-6: 24px;
    --av-spacing-8: 32px;
    --av-spacing-10: 40px;
    --av-spacing-12: 48px;
    --av-radius-sm: 4px;
    --av-radius-md: 8px;
    --av-radius-lg: 12px;
    --av-radius-xl: 16px;
    --av-radius-full: 999px;
    --av-duration-instant: 80ms;
    --av-duration-fast: 120ms;
    --av-duration-base: 180ms;
    --av-easing-standard: cubic-bezier(.2, 0, 0, 1);
    --av-opacity-disabled: .48;
    --av-shadow-xs: 0 1px 1px 0 rgb(15 23 42 / .08);
    --av-shadow-sm: 0 1px 2px 0 rgb(15 23 42 / .12);
    --av-shadow-md: 0 8px 16px -4px rgb(15 23 42 / .16);
    --av-shadow-lg: 0 16px 32px -12px rgb(15 23 42 / .18);
    --av-size-control-sm: 32px;
    --av-size-control-md: 40px;
    --av-size-control-lg: 48px;
    --av-z-base: 0;
    --av-z-raised: 10;
    --av-z-sticky: 20;
    --av-z-overlay: 100;
    --av-z-skip-link: 1000;
    --av-breakpoint-compact: 320px;
    --av-breakpoint-mobile: 390px;
    --av-breakpoint-tablet: 768px;
    --av-breakpoint-tablet-wide: 820px;
    --av-breakpoint-desktop: 1024px;
    --av-breakpoint-wide: 1440px;
    --av-breakpoint-ultrawide: 1920px;
    --av-container-reading: 72ch;
    --av-container-content: 1240px;
    --av-grid-gutter-compact: 16px;
    --av-grid-gutter-default: 32px;
    --av-text-body-font-family: var(--sans);
    --av-text-body-font-size: 16px;
    --av-text-body-font-weight: 400;
    --av-text-body-line-height: 24px;
    --av-text-body-letter-spacing: 0;
    --av-text-body: var(--av-text-body-font-weight) var(--av-text-body-font-size)/var(--av-text-body-line-height) var(--av-text-body-font-family);
    --av-text-heading-font-family: Georgia, "Times New Roman", serif;
    --av-text-heading-font-size: 32px;
    --av-text-heading-font-weight: 600;
    --av-text-heading-line-height: 40px;
    --av-text-heading-letter-spacing: 0;
    --av-text-heading: var(--av-text-heading-font-weight) var(--av-text-heading-font-size)/var(--av-text-heading-line-height) var(--av-text-heading-font-family);
    --av-text-heading-sm: 600 22px/28px Georgia, "Times New Roman", serif;
    --av-text-code-font-family: var(--mono);
    --av-text-code: 400 13px/20px var(--mono);

    --avds-color-slate-50: #f8fafc;
    --avds-color-slate-100: #f1f5f9;
    --avds-color-slate-200: #e2e8f0;
    --avds-color-slate-300: #cbd5e1;
    --avds-color-slate-400: #94a3b8;
    --avds-color-slate-500: #64748b;
    --avds-color-slate-700: #334155;
    --avds-color-slate-900: #0f172a;
    --avds-color-slate-950: #020617;
    --avds-color-cyan-500: #06b6d4;
    --avds-color-teal-500: #14b8a6;
    --avds-color-amber-100: #fef3c7;
    --avds-color-amber-700: #b45309;
    --avds-color-green-100: #dcfce7;
    --avds-color-green-700: #15803d;
    --avds-color-red-100: #fee2e2;
    --avds-color-red-600: #dc2626;
    --avds-space-1: var(--av-spacing-1);
    --avds-space-2: var(--av-spacing-2);
    --avds-space-3: var(--av-spacing-3);
    --avds-space-4: var(--av-spacing-4);
    --avds-space-5: var(--av-spacing-5);
    --avds-space-6: var(--av-spacing-6);
    --avds-space-8: var(--av-spacing-8);
    --avds-space-10: var(--av-spacing-10);
    --avds-space-12: var(--av-spacing-12);
    --avds-radius-sm: var(--av-radius-sm);
    --avds-radius-md: var(--av-radius-md);
    --avds-radius-lg: var(--av-radius-lg);
    --avds-radius-xl: var(--av-radius-xl);
    --avds-duration-instant: var(--av-duration-instant);
    --avds-duration-fast: var(--av-duration-fast);
    --avds-duration-base: var(--av-duration-base);
    --avds-easing-standard: var(--av-easing-standard);
    --avds-focus-ring: 0 0 0 3px rgb(6 182 212 / .34);
    --avds-surface: #f9fbfb;
    --avds-surface-subtle: #edf3f4;
    --avds-surface-inverse: #07131d;
    --avds-text: #07131d;
    --avds-text-muted: #596c78;
    --avds-border: #d3e0e4;
    --avds-accent: #2196c9;
    --avds-accent-strong: #075f76;
    --avds-accent-subtle: #dff2f6;

    --ink: var(--avds-surface-inverse);
    --paper: var(--avds-surface-subtle);
    --surface: var(--avds-surface);
    --line: var(--avds-border);
    --muted: var(--avds-text-muted);
  }

  html[data-design-system="avds4"][data-av-theme="golden-paper"] {
    --av-color-background: #fff8e7;
    --av-color-foreground: #020617;
    --av-color-surface: #fffdf5;
    --av-color-card: var(--av-color-surface);
    --av-color-muted: #fef3c7;
    --av-color-muted-foreground: #334155;
    --av-color-border: #e2e8f0;
    --av-color-primary: #92400e;
    --av-color-primary-foreground: #ffffff;
    --avds-surface: #fffdf5;
    --avds-surface-subtle: #fff8e7;
    --avds-text: #020617;
    --avds-text-muted: #5f5644;
    --avds-border: #e7d8b7;
    --avds-accent: #92400e;
    --avds-accent-strong: #78350f;
    --avds-accent-subtle: #fef3c7;
    --avds-focus-ring: 0 0 0 3px rgb(180 83 9 / .28);
  }

  /* The product keeps one semantic token contract while allowing each AV DS
     surface to choose a legible presentation. Theme names are public API and
     are intentionally explicit so screenshots and route ledgers can refer to
     them without relying on browser color-scheme heuristics. */
  html[data-design-system="avds4"][data-av-theme="editorial"] {
    --av-color-background: #fbfaf7;
    --av-color-foreground: #241f1b;
    --av-color-surface: #fffefa;
    --av-color-card: #fffefa;
    --av-color-muted: #f1ece5;
    --av-color-muted-foreground: #554b43;
    --av-color-border: #ded4ca;
    --av-color-primary: #8b4513;
    --av-color-primary-foreground: #fffefa;
    --avds-surface: #fffefa;
    --avds-surface-subtle: #f1ece5;
    --avds-surface-inverse: #241f1b;
    --avds-text: #241f1b;
    --avds-text-muted: #665a50;
    --avds-border: #ded4ca;
    --avds-accent: #b05b2a;
    --avds-accent-strong: #7a3910;
    --avds-accent-subtle: #f6e8dc;
    --avds-focus-ring: 0 0 0 3px rgb(176 91 42 / .28);
  }

  html[data-design-system="avds4"][data-av-theme="data-analytics"] {
    --av-color-background: #eef7fb;
    --av-color-foreground: #082337;
    --av-color-surface: #ffffff;
    --av-color-card: #ffffff;
    --av-color-muted: #dceff7;
    --av-color-muted-foreground: #31556b;
    --av-color-border: #c5dfe9;
    --av-color-primary: #006d9c;
    --av-color-primary-foreground: #ffffff;
    --avds-surface: #ffffff;
    --avds-surface-subtle: #eef7fb;
    --avds-surface-inverse: #082337;
    --avds-text: #082337;
    --avds-text-muted: #486a7c;
    --avds-border: #c5dfe9;
    --avds-accent: #0088b8;
    --avds-accent-strong: #005d82;
    --avds-accent-subtle: #d8f1f8;
  }

  html[data-design-system="avds4"][data-av-theme="map"] {
    --av-color-background: #edf7f8;
    --av-color-foreground: #0b2734;
    --av-color-surface: #f9ffff;
    --av-color-card: #f9ffff;
    --av-color-muted: #dff1f2;
    --av-color-muted-foreground: #3e626b;
    --av-color-border: #c4dfe2;
    --av-color-primary: #087f91;
    --av-color-primary-foreground: #ffffff;
    --avds-surface: #f9ffff;
    --avds-surface-subtle: #edf7f8;
    --avds-surface-inverse: #0b2734;
    --avds-text: #0b2734;
    --avds-text-muted: #4d7078;
    --avds-border: #c4dfe2;
    --avds-accent: #13a6a6;
    --avds-accent-strong: #08717e;
    --avds-accent-subtle: #d6f3f0;
  }

  html[data-design-system="avds4"][data-av-theme="dark"] {
    --av-color-background: #07131d;
    --av-color-foreground: #effcff;
    --av-color-surface: #0d202d;
    --av-color-card: #102b3a;
    --av-color-muted: #163747;
    --av-color-muted-foreground: #b7cbd3;
    --av-color-border: #2a5363;
    --av-color-primary: #6cecf0;
    --av-color-primary-foreground: #03212d;
    --avds-surface: #0d202d;
    --avds-surface-subtle: #07131d;
    --avds-surface-inverse: #effcff;
    --avds-text: #effcff;
    --avds-text-muted: #b7cbd3;
    --avds-border: #2a5363;
    --avds-accent: #6cecf0;
    --avds-accent-strong: #b4f8fa;
    --avds-accent-subtle: #163747;
    --avds-focus-ring: 0 0 0 3px rgb(108 236 240 / .32);
  }

  html[data-design-system="avds4"][data-av-theme="print"] {
    --av-color-background: #ffffff;
    --av-color-foreground: #000000;
    --av-color-surface: #ffffff;
    --av-color-card: #ffffff;
    --av-color-muted: #f4f4f4;
    --av-color-muted-foreground: #242424;
    --av-color-border: #7a7a7a;
    --av-color-primary: #000000;
    --av-color-primary-foreground: #ffffff;
    --avds-surface: #ffffff;
    --avds-surface-subtle: #ffffff;
    --avds-surface-inverse: #000000;
    --avds-text: #000000;
    --avds-text-muted: #242424;
    --avds-border: #7a7a7a;
    --avds-accent: #000000;
    --avds-accent-strong: #000000;
    --avds-accent-subtle: #f4f4f4;
  }
}
