/**
 * Calm Canvas design tokens — static UI prototype
 * Source: docs/architecture/09-design-system.md
 * Light + dark semantic roles; Inter + JetBrains Mono via Bunny Fonts (prototype only).
 */

:root,
html[data-surface="app"] {
  --canvas: #f3f4fa;
  --sidebar: #f3f4fa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --background: #ffffff;
  --card: #ffffff;
  --popover: #ffffff;
  --foreground: #17173a;
  --secondary-foreground: #26264d;
  --muted-foreground: #4d4e69;
  --faint: #8b8ba3;
  --muted: #eff0f6;
  --secondary: #eff0f6;
  --accent: #eceef7;
  --sidebar-accent: #e7e8f4;
  --border: #e6e7f0;
  --border-strong: #d8d9e6;
  --input: #8586a0;
  --row-hover: #f6f7fc;
  --row-selected: #f0f0fd;
  --row-selected-border: #c8c8f4;
  --primary: #3d3cd6;
  --primary-hover: #3332bd;
  --primary-subtle: #efeffd;
  --primary-text: #3534c4;
  --primary-foreground: #ffffff;
  --ring: #3d3cd6;
  --scrim: rgba(23, 23, 58, 0.22);
  --ink: #17173a;
  --ink-foreground: #ffffff;

  --success: #1f9d55;
  --success-bg: #e9f6ee;
  --success-text: #146235;
  --warning: #c27a07;
  --warning-bg: #fcf2e1;
  --warning-text: #874a05;
  --destructive: #d23f3f;
  --destructive-bg: #fdeded;
  --destructive-text: #a12525;
  --info: #2f6fdf;
  --info-bg: #ebf2fe;
  --info-text: #1c4ea8;
  --neutral: #9a9aa6;
  --neutral-bg: #f1f1f6;
  --neutral-text: #4f4f63;

  --chart-1: #3d3cd6;
  --chart-2: #0f8a7a;
  --chart-3: #c27a07;
  --chart-4: #c23d8a;
  --chart-grid: #e6e7f0;

  --brand-gradient: linear-gradient(145deg, #3b3ac4 0%, #3130a6 32%, #25247c 68%, #1d1c5c 100%);

  --radius: 8px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  --elevation-sm: 0 1px 2px rgba(23, 23, 58, 0.06), 0 1px 3px rgba(23, 23, 58, 0.04);
  --elevation-md: 0 4px 12px rgba(23, 23, 58, 0.08), 0 2px 4px rgba(23, 23, 58, 0.04);
  --elevation-lg: 0 12px 28px rgba(23, 23, 58, 0.12), 0 4px 8px rgba(23, 23, 58, 0.06);
  --elevation-xl: 0 24px 48px rgba(23, 23, 58, 0.16), 0 8px 16px rgba(23, 23, 58, 0.08);
  --shadow-focus: 0 0 0 3px rgba(61, 60, 214, 0.28);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --row-height: 36px;
  --control-height: 32px;
  --font-size-base: 13.5px;
  --pane-gutter: 20px;
}

html[data-density="comfortable"] {
  --row-height: 44px;
  --control-height: 40px;
  --font-size-base: 15px;
  --pane-gutter: 24px;
}

html.dark,
html[data-surface="app"].dark {
  --canvas: #0f0f12;
  --sidebar: #0f0f12;
  --surface: #16161a;
  --surface-raised: #1c1c21;
  --background: #16161a;
  --card: #16161a;
  --popover: #1c1c21;
  --foreground: #ececf0;
  --secondary-foreground: #d4d4dc;
  --muted-foreground: #a3a3b0;
  --faint: #6b6b77;
  --muted: #1c1c21;
  --secondary: #1c1c21;
  --accent: #222228;
  --sidebar-accent: #222228;
  --border: #26262d;
  --border-strong: #32323b;
  --input: #6b6b77;
  --row-hover: #1a1a1f;
  --row-selected: #1e1e2a;
  --row-selected-border: #4a4a8a;
  --primary: #8a89f6;
  --primary-hover: #9b9af8;
  --primary-subtle: #22223a;
  --primary-text: #a5a4fa;
  --primary-foreground: #101014;
  --ring: #8a89f6;
  --scrim: rgba(0, 0, 0, 0.5);
  --chart-grid: #26262d;
  --success: #3ecf7a;
  --success-bg: #143524;
  --success-text: #b6f0cb;
  --warning: #e0a53a;
  --warning-bg: #3a2a12;
  --warning-text: #f5d9a0;
  --destructive: #f07171;
  --destructive-bg: #3a1616;
  --destructive-text: #f5b4b4;
  --info: #6b9ef0;
  --info-bg: #15233a;
  --info-text: #b8d0f8;
  --neutral: #8a8a96;
  --neutral-bg: #222228;
  --neutral-text: #c8c8d0;
  --elevation-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --elevation-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --elevation-lg: 0 12px 28px rgba(0, 0, 0, 0.45);
  --elevation-xl: 0 24px 48px rgba(0, 0, 0, 0.5);
  --shadow-focus: 0 0 0 3px rgba(138, 137, 246, 0.35);
}

/* Public / token chrome layer (light only; used by /c /i /s token pages) */
html[data-surface="public"] {
  --canvas: #f7f7fb;
  --surface: #ffffff;
  --foreground: #17173a;
  --muted-foreground: #4d4e69;
  --primary: #3d3cd6;
  --primary-text: #3534c4;
  --border: #e6e7f0;
  --font-size-base: 16px;
}
