/* MRAi design tokens. Light on :root, dark under [data-theme="dark"]. Spacing on an 8 px grid (4 px half-step). */

:root {
  color-scheme: light;

  /* surfaces: 0 = app background, 1 = cards and panels, 2 = subtle fills (hover, wells), 3 = pressed */
  --surface-0: #f6f6f9;
  --surface-1: #ffffff;
  --surface-2: #f0f0f5;
  --surface-3: #e6e5ee;
  --surface-overlay: rgba(20, 18, 38, 0.36);

  --text-primary: #1b1a26;
  --text-secondary: #4a4858;
  --text-muted: #6b6981;
  --text-on-accent: #ffffff;

  --border: #e3e2ec;
  --border-strong: #cfcddc;

  /* brand */
  --accent: #534ab7;
  --accent-hover: #463e9f;
  --accent-active: #3b3488;
  --accent-soft: #eeedfa;
  --accent-text: #463e9f;
  --lesion: #1d9e75;

  /* status: base (icons, dots, borders), soft (fills), text (on soft) */
  --urgent: #c8372d;
  --urgent-soft: #fcecea;
  --urgent-text: #a02a21;
  --attention: #c27a0e;
  --attention-soft: #fdf3e2;
  --attention-text: #8a5300;
  --routine: #2f6fb0;
  --routine-soft: #e9f1fa;
  --routine-text: #245a92;
  --success: #1d8a5e;
  --success-soft: #e4f4ec;
  --success-text: #166b49;
  --danger: #c8372d;
  --danger-hover: #ad2d24;
  --danger-soft: #fcecea;
  --danger-text: #a02a21;
  --neutral-soft: #efeef4;
  --neutral-text: #4a4858;

  --viewer-bg: #000000;

  /* focus */
  --focus-ring: 0 0 0 2px var(--surface-1), 0 0 0 4px rgba(83, 74, 183, 0.55);

  /* elevation */
  --shadow-1: 0 1px 2px rgba(20, 18, 38, 0.06), 0 0 0 1px rgba(20, 18, 38, 0.02);
  --shadow-2: 0 4px 12px rgba(20, 18, 38, 0.08), 0 1px 3px rgba(20, 18, 38, 0.06);
  --shadow-3: 0 16px 40px rgba(20, 18, 38, 0.16), 0 2px 8px rgba(20, 18, 38, 0.08);

  --skeleton-a: #ecebf2;
  --skeleton-b: #f5f4f9;

  /* radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 999px;

  /* spacing (8 px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 40px;
  --sp-8: 48px;
  --sp-9: 64px;

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --lh-tight: 1.25;
  --lh-normal: 1.5;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* sizes */
  --control-h: 36px;
  --control-h-sm: 28px;
  --topbar-h: 56px;
  --nav-w: 232px;
  --nav-w-collapsed: 64px;

  /* motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
}

[data-theme="dark"] {
  color-scheme: dark;

  --surface-0: #111117;
  --surface-1: #19191f;
  --surface-2: #22222b;
  --surface-3: #2c2c37;
  --surface-overlay: rgba(0, 0, 0, 0.6);

  --text-primary: #ecebf3;
  --text-secondary: #b9b7c9;
  --text-muted: #8c8aa0;
  --text-on-accent: #ffffff;

  --border: #2d2c38;
  --border-strong: #3d3c4b;

  --accent: #6c63d6;
  --accent-hover: #7d75e0;
  --accent-active: #8d86e8;
  --accent-soft: rgba(124, 116, 224, 0.16);
  --accent-text: #aea8f2;
  --lesion: #2cb98b;

  --urgent: #ec5b50;
  --urgent-soft: rgba(236, 91, 80, 0.15);
  --urgent-text: #f59a92;
  --attention: #e09a35;
  --attention-soft: rgba(224, 154, 53, 0.15);
  --attention-text: #f0bd6f;
  --routine: #5b9be0;
  --routine-soft: rgba(91, 155, 224, 0.15);
  --routine-text: #93bdec;
  --success: #34b37f;
  --success-soft: rgba(52, 179, 127, 0.15);
  --success-text: #7fd3ae;
  --danger: #e2493f;
  --danger-hover: #ec5b50;
  --danger-soft: rgba(236, 91, 80, 0.15);
  --danger-text: #f59a92;
  --neutral-soft: #2a2a34;
  --neutral-text: #c6c4d4;

  --focus-ring: 0 0 0 2px var(--surface-1), 0 0 0 4px rgba(141, 134, 232, 0.7);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);

  --skeleton-a: #23232c;
  --skeleton-b: #2b2b35;
}
