:root {
  --black: #121212;
  --white: #ffffff;
  --grey-200: #f2f2f7;
  --grey-400: #b6b6c0;
  --grey-800: #313131;
  --coral-300: #fec2b8;
  --coral-500: #ff6047;
  --coral-700: #c7351e;
  --orange-300: #feceae;
  --orange-500: #fd6b0a;
  --orange-700: #c24d00;
  --blue-300: #99d8fd;
  --blue-500: #009df9;
  --blue-700: #017bc2;
  --yellow-300: #fee797;
  --yellow-500: #ffc900;
  --yellow-700: #ad6500;
  --green-300: #a9eb98;
  --green-500: #00b742;
  --green-700: #008832;
  --cyan-300: #a5edeb;
  --cyan-500: #00d0cf;
  --cyan-700: #008f8d;
  --indigo-300: #cad9fd;
  --indigo-500: #7da4fe;
  --indigo-700: #456bde;
  --pink-300: #ffb9f5;
  --pink-500: #ff57e7;
  --pink-700: #c51aaf;

  /* Semantic tokens below are aliases of the primitives above, not
     independent copies — chained via var() (and, for an alpha tier,
     color-mix() against the Opacity primitives just above the primitive
     colour list) so a primitive's value has exactly one place to change.
     2026-09-14 architecture fix: every semantic token here used to hardcode
     its own literal duplicate of the primitive's hex, so the two tiers
     could drift out of sync silently — e.g. `--blue-500: #009df9` and
     `--color-accent-blue-strong: #009df9` as two unrelated literals that
     only happened to agree. `color-mix(in srgb, X transparent)` mixes only
     alpha, not hue — per the CSS Color 4 spec `transparent` carries the
     mixed-in colour's own RGB channels at zero alpha, so this reproduces
     the original `#xxxxxxYY` hex-with-alpha values exactly, not an
     approximation. `calc(var(--opacity-N) * 100%)` chains in the Opacity
     primitive too, instead of a second hardcoded percentage. Every
     semantic token aliases a primitive. Re-synced with live Figma
     2026-09-26: every Accent Strong tier → 700, Coral/700 = #c7351e and
     Yellow/700 = #ad6500 (Content/Error and Content/Warning alias them),
     Border/Subtle = Black 12%, new Surface/Action/Tertiary and Border/Brand;
     primitives and semantics Figma no longer has (Warm, the 100 tier,
     Purple, *-strong / *-muted status fills, Border/Accent) are removed.
     2026-09-29: Grey/400, Surface/Tertiary and Size/Element xs/xl/xxl added
     (Figma Web code syntax fixed the same day — it had duplicated
     --grey-200 / --color-background-surface / --size-element-sm/-lg).
     Tokens that do not exist in Figma are not added here. */
  --color-background-body: var(--white);
  --color-background-inverted: var(--grey-800);
  --color-background-action-secondary: var(--white);
  /* Figma Surface/Action/Tertiary: Button/Main and Button/Icon Tertiary. */
  --color-background-action-tertiary: var(--grey-200);
  --color-background-surface: var(--grey-200);
  /* Figma Surface/Tertiary (added 2026-09-29): one step darker than
     Surface/Secondary. */
  --color-background-tertiary: var(--grey-400);
  --color-background-brand: color-mix(in srgb, var(--indigo-500) calc(var(--opacity-20) * 100%), transparent);
  --color-overlay-scrim: color-mix(in srgb, var(--black) calc(var(--opacity-40) * 100%), transparent);
  --color-overlay-black: color-mix(in srgb, var(--black) calc(var(--opacity-6) * 100%), transparent);
  --color-overlay-white: color-mix(in srgb, var(--white) calc(var(--opacity-40) * 100%), transparent);
  --color-content-primary: var(--black);
  --color-content-secondary: color-mix(in srgb, var(--black) calc(var(--opacity-60) * 100%), transparent);
  --color-content-placeholder: color-mix(in srgb, var(--black) calc(var(--opacity-40) * 100%), transparent);
  --color-content-inverse-primary: var(--white);
  --color-content-inverse-secondary: color-mix(in srgb, var(--white) calc(var(--opacity-80) * 100%), transparent);
  --color-content-link: var(--blue-700);
  --color-content-brand: var(--indigo-700);
  --color-content-error: var(--coral-700);
  --color-content-success: var(--green-700);
  --color-content-warning: var(--yellow-700);
  --color-border-strong: var(--black);
  --color-border-default: var(--grey-200);
  --color-border-subtle: color-mix(in srgb, var(--black) calc(var(--opacity-12) * 100%), transparent);
  --color-border-inverse: color-mix(in srgb, var(--white) calc(var(--opacity-40) * 100%), transparent);
  --color-border-info: var(--blue-500);
  /* Figma Border/Brand: the Контент tree connectors. */
  --color-border-brand: var(--indigo-300);
  --color-border-warning: var(--yellow-500);
  --color-border-error: var(--coral-500);
  --color-border-success: var(--green-500);
  --color-info-default: color-mix(in srgb, var(--blue-500) calc(var(--opacity-20) * 100%), transparent);
  --color-warning-default: color-mix(in srgb, var(--yellow-500) calc(var(--opacity-40) * 100%), transparent);
  --color-error-default: color-mix(in srgb, var(--coral-500) calc(var(--opacity-20) * 100%), transparent);
  --color-success-default: color-mix(in srgb, var(--green-500) calc(var(--opacity-20) * 100%), transparent);
  --color-accent-brand-strong: var(--indigo-700);
  --color-accent-brand-medium: var(--indigo-500);
  --color-accent-brand-light: var(--indigo-300);
  --color-accent-coral-strong: var(--coral-700);
  --color-accent-coral-medium: var(--coral-500);
  --color-accent-coral-light: var(--coral-300);
  --color-accent-orange-strong: var(--orange-700);
  --color-accent-orange-medium: var(--orange-500);
  --color-accent-orange-light: var(--orange-300);
  --color-accent-yellow-strong: var(--yellow-700);
  --color-accent-yellow-medium: var(--yellow-500);
  --color-accent-yellow-light: var(--yellow-300);
  --color-accent-green-strong: var(--green-700);
  --color-accent-green-medium: var(--green-500);
  --color-accent-green-light: var(--green-300);
  --color-accent-cyan-strong: var(--cyan-700);
  --color-accent-cyan-medium: var(--cyan-500);
  --color-accent-cyan-light: var(--cyan-300);
  --color-accent-blue-strong: var(--blue-700);
  --color-accent-blue-medium: var(--blue-500);
  --color-accent-blue-light: var(--blue-300);
  --color-accent-pink-strong: var(--pink-700);
  --color-accent-pink-medium: var(--pink-500);
  --color-accent-pink-light: var(--pink-300);
  --color-module-accent-medium: var(--indigo-500);
  --color-module-accent-light: var(--indigo-300);
  --color-module-accent-dark: var(--indigo-700);

  --spacing-0: 0;
  --spacing-0-5: 2px;
  --spacing-1: 4px;
  --spacing-1-5: 6px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-7: 28px;
  --spacing-8: 32px;
  --spacing-9: 36px;
  --spacing-10: 40px;
  --spacing-11: 44px;
  --spacing-12: 48px;

  --size-element-xs: 24px;
  --size-element-sm: 28px;
  --size-element-md: 32px;
  --size-element-lg: 36px;
  --size-element-xl: 40px;
  --size-element-xxl: 44px;
  --size-touch-target: 44px;
  --size-blur-soft: 6px;
  --size-blur-strong: 100px;

  --radius-none: 0;
  --radius-micro: 2px;
  --radius-detail: 4px;
  --radius-inner: 8px;
  --radius-element: 12px;
  --radius-container: 16px;
  --radius-full: 9999px;

  --border-width-sm: 1px;
  --border-width-md: 1.5px;
  --border-width-lg: 2px;
  --border-width-xl: 3px;

  --motion-duration-fast-min: 130ms;
  --motion-duration-fast: 175ms;
  --motion-duration-fast-max: 230ms;
  --motion-duration-medium-min: 310ms;
  --motion-duration-medium: 410ms;
  --motion-duration-medium-max: 550ms;
  --motion-duration-slow-min: 730ms;
  --motion-duration-slow: 975ms;
  --motion-duration-slow-max: 1300ms;
  --motion-easing-standard: cubic-bezier(0.24, 1, 0.4, 1);

  --typography-font-family-default: "Manrope", sans-serif;
  --typography-font-weight-regular: 400;
  --typography-font-weight-medium: 500;
  --typography-font-weight-semibold: 600;
  --typography-font-weight-bold: 700;
  --typography-font-size-sm: 12px;
  --typography-font-size-base: 14px;
  --typography-font-size-lg: 16px;
  --typography-font-size-xl: 20px;
  --typography-font-size-2xl: 24px;
  --typography-font-size-3xl: 29px;
  --typography-line-height-16: 16px;
  --typography-line-height-20: 20px;
  --typography-line-height-22: 22px;
  --typography-line-height-28: 28px;
  --typography-line-height-32: 32px;
  --typography-line-height-36: 36px;
  --typography-letter-spacing-tight: -1px;
  --typography-letter-spacing-slight: -0.5px;
  --typography-letter-spacing-default: 0;
  --typography-letter-spacing-relaxed: 0.5px;
  /* Paragraph spacing per text style (Figma text styles, bound to Spacing). */
  --typography-paragraph-spacing-display: 0;
  --typography-paragraph-spacing-h1: 0;
  --typography-paragraph-spacing-h2: 0;
  --typography-paragraph-spacing-h3: var(--spacing-2);
  --typography-paragraph-spacing-body: var(--spacing-3);
  --typography-paragraph-spacing-body-small: var(--spacing-2);
  --typography-paragraph-spacing-body-small-strong: var(--spacing-2);
  --typography-paragraph-spacing-label: 0;
  --typography-paragraph-spacing-supporting: var(--spacing-1-5);

  --opacity-100: 1;
  --opacity-80: 0.8;
  --opacity-60: 0.6;
  --opacity-40: 0.4;
  --opacity-20: 0.2;
  --opacity-12: 0.12;
  --opacity-6: 0.06;
  --opacity-state-disabled: 0.4;

  --shadow-action: 0 2px 0 var(--black);
  --shadow-action-hover: 0 4px 0 var(--black);
  /* Effect styles Shadow/Action Neutral (0 2) and Shadow/Action Hover
     Neutral (0 4), Grey/400 — live 2026-10-09 (was Black 40%). Hover Neutral
     = Button/Main and Button/Icon Tertiary on hover; Neutral is not used by
     a component yet. */
  --shadow-action-neutral: 0 var(--spacing-0-5) 0 var(--grey-400);
  --shadow-action-hover-neutral: 0 var(--spacing-1) 0 var(--grey-400);
  /* Shadow/Action Accent (0 2) and Shadow/Action Hover Accent (0 4) use
     Surface/Module/Accent/Dark, which only exists inside a `data-accent`
     scope — so they are declared there (app.css «Module Accent modes»). */
  /* Effect styles Focus/Action and Focus/Default (live Figma). Figma's
     effect list runs bottom → top (black ring, white ring, Shadow/Action);
     CSS paints the first shadow on top, so the order is reversed here.
     Shadow/Action must stay on top of the white ring: the rings sit 1px low
     so they are centred on button + 2px shadow, and with the shadow hidden
     under the white ring the whole focus looked shifted down (2026-09-29). */
  --focus-action: var(--shadow-action), 0 1px 0 3px var(--white), 0 1px 0 5px var(--black);
  --focus-default: 0 0 0 2px var(--white), 0 0 0 4px var(--black);
  /* Effect style Shadow/Floating (live 2026-10-09): two layers, spread 0,
     offsets/radii bound to Spacing, colours to Surface/Overlay/Black (6%)
     and Border/Subtle (12%). Reward Badge emoji, the ProgressBar Max star
     and floating panels — no longer on cards. */
  --shadow-floating:
    0 var(--spacing-1) var(--spacing-1) 0 var(--color-overlay-black),
    0 var(--spacing-4) var(--spacing-8) 0 var(--color-border-subtle);
}
