/* ============================================================================
 * @startup/tokens — SEMANTIC LAYER
 *
 * Every token here answers "what is this for", never "what colour is it".
 * Component code consumes ONLY this layer plus the numeric scales in
 * `foundation.css`; reaching for a `--c-*` primitive inside a component is a
 * review block, because it is exactly how a surface ends up hard-coded to one
 * theme.
 *
 * Both themes are first class. Dark is the default (it is what an
 * unconfigured visitor gets), light is a full override — not a patch. Every
 * token declared in the dark block is re-declared in the light block, with no
 * exceptions, so a token can never silently inherit a near-black value into a
 * white UI.
 *
 * `[data-theme="dark"]` is listed next to `:root` on purpose: CSS minifiers
 * that de-duplicate custom properties will otherwise strip declarations from
 * `:root` when they also appear under `[data-theme="light"]`.
 * ========================================================================= */

:root,
[data-theme='dark'] {
  color-scheme: dark;

  /* ==========================================================================
   * SURFACES
   *
   * base       the page itself
   * surface    a raised plane sitting on the page (sidebar, toolbar, sheet)
   * container  a bounded box on that plane (card, panel, menu)
   * item       one interactive row inside a container (menu entry, tab, cell)
   * element    a small filled shape (chip, badge, avatar ring, icon button)
   * ======================================================================= */
  --bg-base: var(--c-base-900);
  --bg-surface: var(--c-neutral-800);

  --bg-overlay-main: var(--c-base-gradient-1);
  --bg-overlay-secondary: var(--c-base-gradient-2);

  --bg-container: var(--c-neutral-700);
  --bg-container-hover: color-mix(in srgb, var(--c-base-white) 4%, var(--c-neutral-700));
  --bg-container-active: var(--c-base-900);
  --bg-container-disabled: var(--c-neutral-800);
  --bg-container-secondary: var(--c-neutral-600);
  --bg-container-tertiary: var(--c-base-black);

  --bg-element-primary: var(--c-brand-200);
  --bg-element-secondary: var(--c-neutral-400);
  --bg-element-tertiary: color-mix(in srgb, var(--c-base-white) 5%, transparent);
  --bg-element-tertiary-hover: color-mix(in srgb, var(--c-base-white) 10%, transparent);
  --bg-element-quaternary: var(--c-neutral-600);

  --bg-utility-primary: color-mix(in srgb, var(--c-base-white) 5%, transparent);

  /* REVIEW NOTE: the reference set `--bg-item` to `var(--c-base-700)`, a
   * primitive that does not exist in its own palette, so every unselected
   * menu row and table cell in dark theme resolved to an invalid value and
   * fell back to transparent. The container tone is what light theme uses
   * for the same token, so dark gets its container tone here. */
  --bg-item: var(--c-neutral-700);
  --bg-item-hover: var(--c-base-900);
  --bg-item-active: var(--c-base-900);
  --bg-item-disabled: color-mix(in srgb, var(--c-base-900) 50%, transparent);
  --bg-item-selected: var(--c-base-900);
  --bg-item-text: var(--c-brand-200);

  --bg-item-secondary: var(--c-base-900);
  --bg-item-secondary-hover: var(--c-neutral-700);
  --bg-item-secondary-active: var(--c-neutral-700);
  --bg-item-secondary-disabled: var(--c-neutral-800);

  /* ==========================================================================
   * TEXT
   *
   * Three levels of prominence, then the roles. `tertiary` is the level the
   * reference never defined despite components referencing it — captions,
   * timestamps, table meta and helper text all land here.
   * ======================================================================= */
  --text-primary: var(--c-base-white);
  --text-secondary: var(--c-neutral-200);
  --text-tertiary: var(--c-neutral-400);
  --text-placeholder: var(--c-neutral-400);
  --text-disabled: color-mix(in srgb, var(--c-base-white) 30%, transparent);

  --text-on-white: var(--c-base-900);
  --text-on-black: var(--c-base-white);
  /* Brass is a LIGHT surface. White on it measures 2.37:1; the page ink
   * measures 8.86:1. Every brass fill in the system takes dark text. */
  --text-on-brand: var(--c-base-900);

  --text-brand-primary: var(--c-brand-200);
  --text-brand-secondary: var(--c-brand-sub-200);
  --text-accent: var(--c-brand-200);

  /* Status text tones. Declared as a complete set so a component never has to
   * fall back to a raw `--c-info-*` to say "this line is an error". */
  --text-success: var(--c-info-green-200);
  --text-warning: var(--c-info-yellow-200);
  --text-danger: var(--c-accent-danger-200);
  --text-info: var(--c-info-blue-200);

  --text-link: var(--c-link-100);
  --text-link-hover: var(--c-link-50);
  --text-link-active: var(--c-link-200);
  --text-link-primary: var(--c-brand-200);
  --text-link-primary-hover: var(--c-brand-100);
  --text-link-accent: var(--c-brand-sub-200);
  --text-link-accent-hover: var(--c-brand-sub-100);

  /* ==========================================================================
   * ICONS
   * ======================================================================= */
  --icon-primary: var(--c-base-white);
  --icon-secondary: var(--c-neutral-200);
  --icon-tertiary: var(--c-neutral-400);
  --icon-disabled: var(--c-neutral-500);

  --icon-interactive-bg: var(--c-neutral-700);
  --icon-interactive-hover: var(--c-neutral-600);
  --icon-interactive-active: var(--c-neutral-500);
  --icon-interactive-focus: var(--c-neutral-600);
  --icon-interactive-disabled: var(--c-neutral-800);

  --icon-on-primary: var(--c-base-white);
  --icon-on-secondary: var(--c-neutral-600);
  --icon-brand: var(--c-brand-200);

  /* ==========================================================================
   * BORDERS
   * ======================================================================= */
  --border-primary: var(--c-base-900);
  --border-secondary: var(--c-brand-100);
  --border-tertiary: var(--c-neutral-500);
  --border-focus: var(--c-brand-200);

  /* Charts
   * =======================================================================
   * A plotted line is not a border and not text, and it cannot borrow either.
   * `--border-brand` is brass-200 in both themes, which reads well on the dark
   * surface and measures about 1.9:1 on the light one — invisible as a 2px
   * line. So the series ink is its own token and it STEPS per theme: 200 on
   * dark, 400 on light, which the ramp's own note calls the only brass dark
   * enough to carry on white.
   *
   * One hue on purpose. This product's palette is ink, brass and mist; a chart
   * that needed three competing hues would be a chart that should have been
   * three charts, and it is. */
  --chart-series: var(--c-brand-200);
  --chart-grid: var(--border);
  --border-gradient: var(--c-accent-gradient);
  --border-gradient-2: var(--c-accent-gradient-2);
  --border-line-title: var(--c-accent-gradient);

  --border-success: var(--c-accent-success-200);
  --border-warning: var(--c-info-yellow-200);
  --border-danger: var(--c-accent-danger-200);
  --border-error: var(--c-accent-danger-200);
  --border-info: var(--c-info-blue-200);
  --border-brand: var(--c-brand-200);

  --divider-color: color-mix(in srgb, var(--c-base-white) 8%, transparent);

  /* ==========================================================================
   * STATUS
   *
   * The dark theme picks the `200` tone of every informational hue, the light
   * theme the `100` tone. That single rule is why component code can say
   * `var(--status-info)` and be correct in both.
   * ======================================================================= */
  --status-success: var(--c-info-green-200);
  --status-warning: var(--c-info-yellow-200);
  --status-info: var(--c-info-blue-200);
  --status-danger: var(--c-info-red-200);
  --status-neutral: var(--c-neutral-300);

  --status-error: var(--c-accent-danger-200);
  --status-error-hover: var(--c-accent-danger-100);
  --status-error-disabled: var(--c-accent-danger-300);

  --status-green: var(--c-info-green-200);
  --status-red: var(--c-info-red-200);
  --status-yellow: var(--c-info-yellow-200);
  --status-blue: var(--c-info-blue-200);
  --status-cyan: var(--c-info-cyan-200);
  --status-teal: var(--c-info-teal-200);
  --status-violet: var(--c-info-violet-200);
  --status-brown: var(--c-info-brown-200);
  --status-orange: var(--c-info-orange-200);

  /* ==========================================================================
   * INTERACTIVE
   * ======================================================================= */
  --interactive-default: var(--c-brand-200);
  --interactive-hover: var(--c-brand-100);
  --interactive-active: var(--c-brand-100);
  /* 500, not 300: on a near-black page a disabled fill has to be DARKER than
   * the live one to read as disabled, and 300 is the pressed tone. */
  --interactive-disabled: var(--c-brand-500);

  /* ==========================================================================
   * CONTROLS — button
   * ======================================================================= */
  --button-primary-bg: var(--c-brand-200);
  --button-primary-text: var(--c-base-900);
  --button-primary-hover: var(--c-brand-100);
  --button-primary-active: var(--c-brand-100);
  --button-primary-disabled: var(--c-brand-500);

  /* A RAISED SURFACE, not a mid-tone fill.
   *
   * This was the subordinate family's `200` step. That was defensible while
   * the family was teal — a coloured button. Once it became the mist ramp,
   * `200` was #7d838d: a mid grey slab on a near-black card, which does not
   * read as raised, it reads as faded, and takes its label down with it.
   *
   * One step above the card, with the page's own text on it, and the variant
   * carries a hairline so the edge is where the eye expects it. */
  --button-secondary-bg: var(--c-neutral-600);
  --button-secondary-text: var(--c-base-white);
  --button-secondary-hover: color-mix(in srgb, var(--c-base-white) 7%, var(--c-neutral-600));
  --button-secondary-active: var(--c-neutral-700);
  --button-secondary-disabled: var(--c-neutral-800);

  --button-tertiary-bg: var(--c-base-900);
  --button-tertiary-text: var(--c-base-white);
  --button-tertiary-hover: var(--c-neutral-700);
  --button-tertiary-active: var(--c-neutral-600);
  --button-tertiary-disabled: var(--c-base-900);

  --button-gradient-bg: var(--c-accent-gradient);
  --button-gradient-text: var(--c-base-black);
  --button-gradient-hover: var(--c-accent-gradient);
  --button-gradient-active: var(--c-accent-gradient);
  --button-gradient-disabled: var(--c-accent-gradient-2);

  --button-danger-bg: var(--c-accent-danger-200);
  --button-danger-text: var(--c-base-white);
  --button-danger-hover: var(--c-accent-danger-100);
  --button-danger-active: var(--c-accent-danger-100);
  --button-danger-disabled: var(--c-accent-danger-300);

  --button-interactive-bg: var(--c-neutral-700);
  --button-interactive-text: var(--c-base-white);
  --button-interactive-hover: var(--c-neutral-600);
  --button-interactive-active: var(--c-neutral-500);
  --button-interactive-disabled: var(--c-neutral-800);

  /* ==========================================================================
   * CONTROLS — input
   *
   * `--input-primary-*` is the filled field used across forms.
   * `--input-surface-*` is the variant that sits ON a container (search boxes
   * inside a card, inline editors) and therefore needs its own resting tone —
   * components referenced it long before anyone defined it.
   * ======================================================================= */
  /* A field in dark theme is a RECESSED WELL: it drops to the page tone so it
   * reads as sunk into the lighter card around it, with a hairline one step up
   * so the edge stays visible. The reference filled it with the container tone
   * and gave it a border of the same colour — invisible both against the card
   * it sits in and against the page, wherever a field sits directly on the
   * background (the page-header search does). This was already being corrected
   * downstream by a per-component override; the correction belongs here. */
  --input-primary-bg: var(--c-base-900);
  --input-primary-border: var(--c-neutral-600);
  --input-primary-text: var(--c-base-white);
  --input-primary-placeholder: var(--c-neutral-400);
  --input-primary-focus: var(--c-base-900);
  --input-primary-disabled: var(--c-neutral-800);

  --input-surface-bg: var(--c-base-900);
  --input-surface-text: var(--c-base-white);
  --input-surface-border: color-mix(in srgb, var(--c-base-white) 8%, transparent);
  --input-surface-placeholder: var(--c-neutral-400);
  --input-surface-focus-bg: var(--c-base-900);
  --input-surface-focus-border: var(--c-brand-200);

  --select-border-primary: var(--c-neutral-700);

  --checkbox-bg: var(--c-base-900);
  --checkbox-border: var(--c-utility-500);
  --checkbox-active-bg: var(--c-brand-200);
  --checkbox-active-border: var(--c-brand-200);
  --checkbox-active-icon: var(--c-base-900);

  /* ==========================================================================
   * ELEVATION — theme aware
   * ======================================================================= */
  --shadow-primary: 0 0 16px -2px color-mix(in srgb, var(--c-base-black) 8%, transparent);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-modal: 0 0 20px 0 rgba(0, 0, 0, 0.4);
  --shadow-dropdown: 0 0 12px rgba(0, 0, 0, 0.4);
  --shadow-tooltip: 0 4px 12px rgba(0, 0, 0, 0.15);

  --shadow-focus: 0 0 0 3px color-mix(in srgb, var(--button-primary-bg) 25%, transparent);
  --shadow-focus-soft: 0 0 0 3px color-mix(in srgb, var(--button-primary-bg) 12%, transparent);
  --shadow-focus-error: 0 0 0 3px color-mix(in srgb, var(--status-error) 15%, transparent);
  --shadow-focus-success: 0 0 0 3px color-mix(in srgb, var(--status-success) 15%, transparent);
  --shadow-focus-warning: 0 0 0 3px color-mix(in srgb, var(--status-warning) 15%, transparent);

  --glow-brand: 0 0 24px -4px color-mix(in srgb, var(--c-brand-200) 45%, transparent);
  --glow-accent: 0 0 24px -4px color-mix(in srgb, var(--c-brand-sub-200) 45%, transparent);

  /* ==========================================================================
   * NAVIGATION — sidebar
   * ======================================================================= */
  --sidebar-z-index: 99;
  --sidebar-background: var(--c-base-900);
  --sidebar-label: color-mix(in srgb, var(--c-base-white) 90%, transparent);
  --sidebar-label-active: var(--c-base-white);
  --sidebar-item-gradient-fill: var(--c-base-900);
  --sidebar-item-shadow-active: 0 0 7px 0
    color-mix(in srgb, var(--c-brand-200) 50%, transparent);
  --sidebar-item-background-active: linear-gradient(
        var(--sidebar-item-gradient-fill),
        var(--sidebar-item-gradient-fill)
      )
      padding-box,
    var(--c-accent-gradient) border-box;
  --sidebar-item-background-hover: color-mix(in srgb, var(--c-base-white) 5%, transparent);
  --sidebar-item-icon-color: color-mix(in srgb, var(--c-base-white) 90%, transparent);
  --sidebar-item-icon-color-active: var(--c-base-white);

  /* ==========================================================================
   * CARD — gradient variant
   * ======================================================================= */
  --card-gradient-bg: var(--c-base-900);
  --card-gradient-text: var(--c-base-white);
  --card-gradient-hover: var(--c-accent-gradient);
  --card-gradient-active: var(--c-accent-gradient-2);
  --card-gradient-disabled: var(--c-base-900);

  /* ==========================================================================
   * SCROLLBARS & OVERLAYS
   * ======================================================================= */
  --scrollbar-bg: transparent;
  --scrollbar-thumb: rgba(255, 255, 255, 0.3);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.4);
  --scrollbar-shadow: inset 0 0 1px rgba(255, 255, 255, 0.2);
  --scrollbar-shadow-hover: inset 0 0 2px rgba(255, 255, 255, 0.3);

  --overlay-bg: color-mix(in srgb, var(--c-base-900) 62%, transparent);
  --overlay-backdrop-filter: blur(12px);

  --avatar-border-color: var(--c-neutral-500);
}

/* ============================================================================
 * LIGHT THEME
 *
 * A complete re-declaration, not a patch. If you add a token above, add it
 * here too — `__tests__/tokens.test.ts` fails the build if the two blocks
 * ever fall out of sync.
 * ========================================================================= */
[data-theme='light'] {
  color-scheme: light;

  /* SURFACES */
  --bg-base: var(--c-base-50);
  --bg-surface: var(--c-base-white);

  --bg-overlay-main: var(--c-base-white);
  --bg-overlay-secondary: var(--c-base-white);

  --bg-container: var(--c-base-white);
  --bg-container-hover: var(--c-neutral-50);
  --bg-container-active: var(--c-neutral-100);
  --bg-container-disabled: color-mix(in srgb, var(--c-neutral-50) 50%, transparent);
  --bg-container-secondary: var(--c-base-50);
  --bg-container-tertiary: var(--c-base-white);

  --bg-element-primary: var(--c-brand-200);
  --bg-element-secondary: var(--c-neutral-200);
  --bg-element-tertiary: color-mix(in srgb, var(--c-base-900) 6%, transparent);
  --bg-element-tertiary-hover: color-mix(in srgb, var(--c-base-900) 10%, transparent);
  --bg-element-quaternary: var(--c-neutral-600);

  --bg-utility-primary: color-mix(in srgb, var(--c-base-900) 4%, transparent);

  --bg-item: var(--c-base-white);
  --bg-item-hover: var(--c-neutral-50);
  --bg-item-active: var(--c-neutral-50);
  --bg-item-disabled: color-mix(in srgb, var(--c-neutral-50) 50%, transparent);
  --bg-item-selected: var(--c-brand-200);
  --bg-item-text: var(--c-base-900);

  /* REVIEW NOTE: the reference declared the `-secondary` item family in its
   * dark block only, so in light theme a secondary row kept the near-black
   * dark value and rendered as a black bar on white. */
  --bg-item-secondary: var(--c-base-50);
  --bg-item-secondary-hover: var(--c-neutral-100);
  --bg-item-secondary-active: var(--c-neutral-100);
  --bg-item-secondary-disabled: var(--c-neutral-50);

  /* TEXT */
  --text-primary: var(--c-neutral-600);
  --text-secondary: var(--c-neutral-400);
  --text-tertiary: var(--c-neutral-300);
  --text-placeholder: var(--c-neutral-300);
  --text-disabled: color-mix(in srgb, var(--c-neutral-600) 30%, transparent);

  --text-on-white: var(--c-neutral-600);
  /* Was `--c-neutral-600` — near-black text on a black surface. The surface
   * named by this token does not change with the theme, so neither does the
   * text that has to sit on it. */
  --text-on-black: var(--c-base-white);
  /* Brass is a LIGHT surface. White on it measures 2.37:1; the page ink
   * measures 8.86:1. Every brass fill in the system takes dark text. */
  --text-on-brand: var(--c-base-900);

  /* 400, not 200, for every brand tone that is TEXT on a light page:
   * brass-200 is 2.25:1 on white, brass-400 is 4.71:1. The fills below keep
   * 200, because a fill is judged by what sits on it, not by what it sits on. */
  --text-brand-primary: var(--c-brand-400);
  --text-brand-secondary: var(--c-brand-sub-400);
  --text-accent: var(--c-brand-400);

  --text-success: var(--c-info-green-100);
  --text-warning: var(--c-info-yellow-100);
  --text-danger: var(--c-accent-danger-200);
  --text-info: var(--c-info-blue-100);

  --text-link: var(--c-link-100);
  --text-link-hover: var(--c-link-50);
  --text-link-active: var(--c-link-200);
  --text-link-primary: var(--c-brand-400);
  /* Hover goes DARKER on a light page. Going lighter, as the dark theme does,
   * walks a link toward the background on hover. */
  --text-link-primary-hover: var(--c-brand-500);
  --text-link-accent: var(--c-brand-sub-400);
  --text-link-accent-hover: var(--c-brand-sub-500);

  /* ICONS */
  --icon-primary: var(--c-neutral-600);
  --icon-secondary: var(--c-neutral-400);
  --icon-tertiary: var(--c-neutral-300);
  --icon-disabled: var(--c-neutral-200);

  --icon-interactive-bg: var(--c-base-white);
  --icon-interactive-hover: var(--c-neutral-100);
  --icon-interactive-active: var(--c-base-white);
  --icon-interactive-focus: var(--c-base-white);
  --icon-interactive-disabled: var(--c-neutral-200);

  --icon-on-primary: var(--c-neutral-600);
  --icon-on-secondary: var(--c-neutral-600);
  --icon-brand: var(--c-brand-200);

  /* BORDERS */
  --border-primary: var(--c-neutral-100);
  --border-secondary: var(--c-brand-100);
  --border-tertiary: var(--c-neutral-200);
  --border-focus: var(--c-brand-200);

  /* Charts
   * =======================================================================
   * A plotted line is not a border and not text, and it cannot borrow either.
   * `--border-brand` is brass-200 in both themes, which reads well on the dark
   * surface and measures about 1.9:1 on the light one — invisible as a 2px
   * line. So the series ink is its own token and it STEPS per theme: 200 on
   * dark, 400 on light, which the ramp's own note calls the only brass dark
   * enough to carry on white.
   *
   * One hue on purpose. This product's palette is ink, brass and mist; a chart
   * that needed three competing hues would be a chart that should have been
   * three charts, and it is. */
  --chart-series: var(--c-brand-400);
  --chart-grid: var(--border);
  --border-gradient: var(--c-accent-gradient);
  --border-gradient-2: var(--c-accent-gradient-2);
  --border-line-title: var(--c-neutral-600);

  --border-success: var(--c-info-green-100);
  --border-warning: var(--c-info-yellow-100);
  --border-danger: var(--c-accent-danger-200);
  --border-error: var(--c-accent-danger-200);
  --border-info: var(--c-info-blue-100);
  --border-brand: var(--c-brand-200);

  --divider-color: color-mix(in srgb, var(--c-base-900) 8%, transparent);

  /* STATUS */
  --status-success: var(--c-info-green-100);
  --status-warning: var(--c-info-yellow-100);
  --status-info: var(--c-info-blue-100);
  --status-danger: var(--c-info-red-100);
  --status-neutral: var(--c-neutral-600);

  --status-error: var(--c-accent-danger-200);
  --status-error-hover: var(--c-accent-danger-100);
  --status-error-disabled: var(--c-accent-danger-300);

  --status-green: var(--c-info-green-100);
  --status-red: var(--c-info-red-100);
  --status-yellow: var(--c-info-yellow-100);
  --status-blue: var(--c-info-blue-100);
  --status-cyan: var(--c-info-cyan-100);
  --status-teal: var(--c-info-teal-100);
  --status-violet: var(--c-info-violet-100);
  --status-brown: var(--c-info-brown-100);
  --status-orange: var(--c-info-orange-100);

  /* INTERACTIVE */
  --interactive-default: var(--c-brand-200);
  --interactive-hover: var(--c-brand-100);
  --interactive-active: var(--c-brand-100);
  --interactive-disabled: var(--c-brand-50);

  /* CONTROLS — button */
  --button-primary-bg: var(--c-brand-200);
  --button-primary-text: var(--c-base-900);
  --button-primary-hover: var(--c-brand-100);
  --button-primary-active: var(--c-brand-100);
  --button-primary-disabled: var(--c-brand-50);

  /* Light theme: the surface a secondary button sits ON is white, so the
   * button is the white one and the page behind it is the tint. Same idea
   * inverted — raised, with an edge, never a grey slab. */
  --button-secondary-bg: var(--c-base-white);
  --button-secondary-text: var(--c-neutral-700);
  --button-secondary-hover: var(--c-neutral-50);
  --button-secondary-active: var(--c-neutral-100);
  --button-secondary-disabled: var(--c-neutral-50);

  --button-tertiary-bg: var(--c-base-white);
  --button-tertiary-text: var(--c-neutral-600);
  --button-tertiary-hover: var(--c-neutral-100);
  --button-tertiary-active: var(--c-neutral-100);
  --button-tertiary-disabled: var(--c-neutral-50);

  --button-gradient-bg: var(--c-accent-gradient);
  --button-gradient-text: var(--c-base-black);
  --button-gradient-hover: var(--c-accent-gradient);
  --button-gradient-active: var(--c-accent-gradient);
  --button-gradient-disabled: var(--c-accent-gradient-2);

  --button-danger-bg: var(--c-accent-danger-200);
  --button-danger-text: var(--c-base-white);
  --button-danger-hover: var(--c-accent-danger-100);
  --button-danger-active: var(--c-accent-danger-100);
  --button-danger-disabled: var(--c-accent-danger-50);

  --button-interactive-bg: var(--c-base-white);
  --button-interactive-text: var(--c-neutral-600);
  --button-interactive-hover: var(--c-neutral-100);
  --button-interactive-active: var(--c-neutral-200);
  --button-interactive-disabled: var(--c-neutral-50);

  /* CONTROLS — input */
  --input-primary-bg: var(--c-neutral-50);
  --input-primary-border: var(--c-base-white);
  --input-primary-text: var(--c-neutral-600);
  --input-primary-placeholder: var(--c-neutral-300);
  --input-primary-focus: var(--c-base-white);
  --input-primary-disabled: color-mix(in srgb, var(--c-neutral-50) 50%, transparent);

  --input-surface-bg: var(--c-base-white);
  --input-surface-text: var(--c-neutral-600);
  --input-surface-border: var(--c-neutral-100);
  --input-surface-placeholder: var(--c-neutral-300);
  --input-surface-focus-bg: var(--c-base-white);
  --input-surface-focus-border: var(--c-brand-200);

  --select-border-primary: var(--c-base-white);

  --checkbox-bg: var(--c-base-white);
  --checkbox-border: var(--c-neutral-200);
  --checkbox-active-bg: var(--c-brand-200);
  --checkbox-active-border: var(--c-brand-200);
  --checkbox-active-icon: var(--c-base-900);

  /* ELEVATION — light theme keeps shadows tighter and softer; the dark values
   * read as smudges on a white page. */
  --shadow-primary: 0 0 16px -2px color-mix(in srgb, var(--c-base-black) 8%, transparent);
  --shadow-card: 0 1px 2px rgba(15, 18, 34, 0.06), 0 2px 8px rgba(15, 18, 34, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(15, 18, 34, 0.1);
  --shadow-modal: 0 24px 48px -16px rgba(15, 18, 34, 0.28);
  --shadow-dropdown: 0 8px 24px -8px rgba(15, 18, 34, 0.18);
  --shadow-tooltip: 0 4px 12px rgba(15, 18, 34, 0.15);

  --shadow-focus: 0 0 0 3px color-mix(in srgb, var(--button-primary-bg) 25%, transparent);
  --shadow-focus-soft: 0 0 0 3px color-mix(in srgb, var(--button-primary-bg) 12%, transparent);
  --shadow-focus-error: 0 0 0 3px color-mix(in srgb, var(--status-error) 15%, transparent);
  --shadow-focus-success: 0 0 0 3px color-mix(in srgb, var(--status-success) 15%, transparent);
  --shadow-focus-warning: 0 0 0 3px color-mix(in srgb, var(--status-warning) 15%, transparent);

  --glow-brand: 0 0 24px -4px color-mix(in srgb, var(--c-brand-200) 35%, transparent);
  --glow-accent: 0 0 24px -4px color-mix(in srgb, var(--c-brand-sub-200) 35%, transparent);

  /* NAVIGATION — sidebar */
  --sidebar-z-index: 99;
  --sidebar-background: var(--c-base-50);
  --sidebar-label: var(--c-neutral-600);
  --sidebar-label-active: var(--c-neutral-900);
  --sidebar-item-gradient-fill: var(--c-base-white);
  --sidebar-item-shadow-active: 0 0 16px -2px color-mix(in srgb, var(--c-base-black) 8%, transparent);
  --sidebar-item-background-active: var(--c-base-white);
  --sidebar-item-background-hover: var(--c-neutral-100);
  --sidebar-item-icon-color: var(--c-neutral-600);
  --sidebar-item-icon-color-active: var(--c-brand-400);

  /* CARD — gradient variant. Stays dark in both themes on purpose: it is the
   * promotional surface, and inverting it is the whole point. */
  --card-gradient-bg: var(--c-base-900);
  --card-gradient-text: var(--c-base-white);
  --card-gradient-hover: var(--c-accent-gradient);
  --card-gradient-active: var(--c-accent-gradient-2);
  --card-gradient-disabled: var(--c-base-900);

  /* SCROLLBARS & OVERLAYS */
  --scrollbar-bg: transparent;
  --scrollbar-thumb: rgba(0, 0, 0, 0.1);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.3);
  --scrollbar-shadow: inset 0 0 1px rgba(0, 0, 0, 0.1);
  --scrollbar-shadow-hover: inset 0 0 2px rgba(0, 0, 0, 0.3);

  --overlay-bg: rgba(0, 0, 0, 0.4);
  --overlay-backdrop-filter: blur(5px);

  --avatar-border-color: var(--c-neutral-100);
}
