/*
 * UI v2 (new Mondigo mobile design) — the former foundation tokens.
 *
 * Served and injected only when the server runs with QQ_UI_V2=1. Every rule is
 * scoped under html.ui-v2 (set by /ui-v2/ui-v2.js).
 *
 * D16 (design decisions 2026-10-06): every token is an mg- token, defined in
 * mg.css. The v2 screens read only --mg-*; the old --v2-* names below are kept
 * as aliases of the same values so a stylesheet not yet moved keeps its look.
 * Do not use them in new rules (tools/ui-v2-flag-contract_test.mjs).
 */
html.ui-v2 {
  /* Surfaces */
  --v2-page: var(--mg-bg-page);
  --v2-card: var(--mg-bg-card);
  --v2-card-border: var(--mg-border-card);
  --v2-control-border: var(--mg-border-control);
  --v2-dark-bar: var(--mg-layer-bg);

  /* Text */
  --v2-ink: var(--mg-text-primary);
  --v2-muted: var(--mg-text-muted);

  /* Action and status */
  --v2-cta: var(--mg-action);
  --v2-green-700: var(--mg-done);
  --v2-clay-50: var(--mg-source-tint);
  --v2-clay-700: var(--mg-source-text);
  --v2-yellow-100: var(--mg-review-tint);
  --v2-yellow-500: var(--mg-review);
  --v2-yellow-800: var(--mg-review-text);
  --v2-red-700: var(--mg-danger);

  /* Shape and touch */
  --v2-radius-card: var(--mg-radius-card);
  --v2-radius-control: var(--mg-radius-control);
  --v2-touch-min: var(--mg-touch-min);

  /* Type */
  --v2-font: var(--font-mg-sans);

  /* Motion (mg.css zeroes the mg durations under reduced motion). */
  --v2-motion-fast: var(--mg-motion-fast);
  --v2-motion-base: var(--mg-motion-base);
}

/* Reduced motion: kept as its own guard for anything still reading the aliases. */
@media (prefers-reduced-motion: reduce) {
  html.ui-v2 {
    --v2-motion-fast: 0ms;
    --v2-motion-base: 0ms;
  }
}
