:root {
  color-scheme: light;

  /* Canonical Atlas brand colors — ATLAS Manual de Identidade Visual. */
  --atlas-green: #0e4a3b;
  --atlas-green-deep: #063d33;
  --atlas-green-ink: #123e34;
  --atlas-gold: #c99a45;
  --atlas-ivory: #f8f3eb;
  --atlas-surface-soft: #f6efe5;
  --atlas-text: #23372f;
  --atlas-muted: #74817b;

  /* Shared surfaces and semantic aliases. */
  --atlas-surface: #fffdfa;
  --atlas-white: #ffffff;
  --surface-page: var(--atlas-ivory);
  --surface-card: var(--atlas-surface);
  --surface-subtle: #eee8da;
  --surface-strong: var(--atlas-green-deep);
  --surface-input: #fffefa;
  --surface-disabled: #e9e4d9;
  --surface-selected: #e4ede6;
  --surface-cognitive: #f3ead8;
  --text-primary: var(--atlas-text);
  --text-secondary: var(--atlas-green-ink);
  /* Small functional copy uses Green Ink for AA contrast; official Muted stays decorative. */
  --text-muted: var(--atlas-green-ink);
  --text-decorative: var(--atlas-muted);
  --text-error: #8b2f2f;
  --text-success: #176a4f;
  --text-warning: #7b5418;
  --border-subtle: rgba(18, 62, 52, 0.19);
  --border-strong: rgba(18, 62, 52, 0.34);
  --border-section: rgba(18, 62, 52, 0.24);
  --border-cognitive: rgba(201, 154, 69, 0.46);
  --gold-soft: rgba(201, 154, 69, 0.14);
  --green-soft: rgba(14, 74, 59, 0.09);
  --green-medium: rgba(14, 74, 59, 0.16);
  --focus-ring: var(--atlas-green);
  --overlay: rgba(6, 61, 51, 0.64);
  --shadow-soft: 0 10px 28px rgba(42, 49, 43, 0.07);
  --shadow-raised: 0 20px 52px rgba(34, 51, 44, 0.12);
  --shadow-app: 0 8px 26px rgba(6, 61, 51, 0.08);

  /* State grammar: color supports the icon, label and border treatment; it never acts alone. */
  --state-ready-surface: #e8f0e9;
  --state-ready-border: #7d9e8b;
  --state-ready-ink: #174f3d;
  --state-loading-surface: #eef0ea;
  --state-loading-border: #8a948e;
  --state-loading-ink: #3e5248;
  --state-empty-surface: #f4efe4;
  --state-empty-border: #a89c84;
  --state-empty-ink: #5b5140;
  --state-readonly-surface: #f5ecd8;
  --state-readonly-border: #b88a3c;
  --state-readonly-ink: #694814;
  --state-denied-surface: #f4e7e5;
  --state-denied-border: #a76863;
  --state-denied-ink: #772f2c;
  --state-unavailable-surface: #ecebe7;
  --state-unavailable-border: #777f7b;
  --state-unavailable-ink: #3f4a45;
  --state-error-surface: #f7e4e1;
  --state-error-border: #b5524c;
  --state-error-ink: #7f2926;
  --state-required-surface: #ebe9f0;
  --state-required-border: #817891;
  --state-required-ink: #4e465d;
  --state-locked-surface: #ece7df;
  --state-locked-border: #766959;
  --state-locked-ink: #493d30;
  --state-success-surface: #e1efe8;
  --state-success-border: #4f8b70;
  --state-success-ink: #14543b;

  /*
   * Product-safe font strategy: the canonical Cormorant Garamond/Inter files are
   * not present in this package. Until licensed webfonts are supplied, use an
   * explicit browser-safe stack instead of silently depending on local installs.
   */
  --font-editorial: Georgia, "Times New Roman", serif;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --type-page-title: clamp(2rem, 3vw, 2.75rem);
  --type-section-title: 1.35rem;
  --type-card-title: 1.125rem;
  --type-subgroup-title: 1rem;
  --type-body: 0.9375rem;
  --type-label: 0.8125rem;
  --type-helper: 0.75rem;
  --type-meta: 0.6875rem;
  --type-eyebrow: 0.6875rem;

  --page-max: 1440px;
  --content-max: 1280px;
  --page-gutter: clamp(24px, 5vw, 72px);
  --app-gutter: clamp(16px, 2.1vw, 30px);
  --section-gap: clamp(14px, 1.4vw, 20px);
  --card-padding: clamp(16px, 1.8vw, 24px);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  --control-height: 48px;
  --touch-target: 44px;
  --ease: 180ms ease;
  --ease-slow: 320ms ease;
}

[data-theme="dark"] {
  color-scheme: dark;
  /* Sampled from the approved desktop-dark master: near-black base, stepped green surfaces. */
  --surface-page: #07150e;
  --surface-card: #0f2a1e;
  --surface-subtle: #123023;
  --surface-strong: #061b12;
  --surface-input: #0b2117;
  --surface-disabled: #17271d;
  --surface-selected: #194732;
  --surface-cognitive: #242f1c;
  --text-primary: var(--atlas-ivory);
  --text-secondary: #e5dfd3;
  --text-muted: #bcc2b9;
  --text-decorative: #9fa99f;
  --text-error: #ffb3ad;
  --text-success: #a7e6ca;
  --text-warning: #f2cd8d;
  --border-subtle: rgba(248, 243, 235, 0.18);
  --border-strong: rgba(248, 243, 235, 0.34);
  --border-section: rgba(248, 243, 235, 0.24);
  --border-cognitive: rgba(201, 154, 69, 0.5);
  --gold-soft: rgba(201, 154, 69, 0.16);
  --green-soft: rgba(126, 166, 140, 0.12);
  --green-medium: rgba(126, 166, 140, 0.2);
  --focus-ring: var(--atlas-gold);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.28);
  --shadow-raised: 0 24px 60px rgba(0, 0, 0, 0.38);
  --shadow-app: 0 12px 32px rgba(0, 0, 0, 0.3);
  --state-ready-surface: #123524;
  --state-ready-border: #6c9a7c;
  --state-ready-ink: #c9e5d4;
  --state-loading-surface: #202b23;
  --state-loading-border: #879189;
  --state-loading-ink: #dde1dc;
  --state-empty-surface: #2d2b20;
  --state-empty-border: #a79a76;
  --state-empty-ink: #eadfbe;
  --state-readonly-surface: #342a18;
  --state-readonly-border: #c99a45;
  --state-readonly-ink: #f1d9a8;
  --state-denied-surface: #351e1d;
  --state-denied-border: #c57871;
  --state-denied-ink: #f1c5c1;
  --state-unavailable-surface: #252a27;
  --state-unavailable-border: #8d9691;
  --state-unavailable-ink: #d6dcd8;
  --state-error-surface: #3a1e1c;
  --state-error-border: #d26c64;
  --state-error-ink: #ffc5bf;
  --state-required-surface: #282430;
  --state-required-border: #9e91b3;
  --state-required-ink: #ddd2ec;
  --state-locked-surface: #2b2721;
  --state-locked-border: #a69680;
  --state-locked-ink: #ded3c3;
  --state-success-surface: #123524;
  --state-success-border: #69a883;
  --state-success-ink: #c6ead5;
}
