/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); }
button { font-family: inherit; }

:root {
  /* ── Typography ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', monospace;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* ── Colors (5 core + functional) ── */
  --color-bg: #f7f7f8;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #6b7280;
  --color-primary: #5b5fc7;

  /* Functional (derived from core) */
  --color-primary-hover: #4e52b5;
  --color-primary-subtle: #ededfc;
  --color-border: #e5e5ea;
  --color-border-subtle: #f0f0f2;
  --color-success: #22c55e;
  --color-success-bg: #f0fdf4;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-field-empty: #d1d5db;
  --color-selection: #f0f0ff;
  --color-selection-border: #c7c8f2;
  --color-source-badge: #e8e8ee;
  --color-manual-badge: #dbeafe;

  /* ── Spacing (8px grid) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Radii ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-ring: 0 0 0 2px var(--color-primary-subtle);

  /* ── Transitions ── */
  --transition-fast: 0.1s ease;
  --transition-normal: 0.15s ease;

  /* ── Layout Constants ── */
  --header-height: 48px;
  --keyboard-bar-height: 40px;
  --brief-width: 320px;
  --palette-height: 44px;
}

/* ── Utility: Disable transitions/animations for test stability ── */
body.no-transitions *, body.no-transitions *::before, body.no-transitions *::after {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
  opacity: 1 !important;
}
