/* SPACE — design tokens (modern flat design, 2026 update) */

:root {
  --space-bg-desktop: transparent;
  --space-bg-panel: rgba(255, 255, 255, 0.88);
  --space-bg-window: #f7f7f8;
  --space-bg-window-active: #ffffff;
  --space-bg-titlebar: rgba(247, 247, 248, 0.96);
  --space-bg-app-grid: rgba(245, 245, 247, 0.94);
  --space-bg-context: rgba(255, 255, 255, 0.98);
  --space-bg-notification: rgba(255, 255, 255, 0.98);
  --space-bg-input: #ffffff;
  --space-bg-hover: rgba(0, 0, 0, 0.04);
  --space-bg-active: rgba(0, 0, 0, 0.08);
  --space-bg-selected: rgba(0, 122, 255, 0.12);
  --space-bg-sidebar: rgba(245, 245, 247, 0.95);
  --space-bg-toolbar: rgba(248, 248, 249, 0.95);
  --space-bg-card: #ffffff;

  --space-accent: #0066ff;
  --space-accent-hover: #0052cc;
  --space-accent-soft: rgba(0, 102, 255, 0.08);
  --space-accent-secondary: #6366f1;
  --space-success: #16a34a;
  --space-success-soft: rgba(22, 163, 74, 0.1);
  --space-error: #dc2626;
  --space-error-soft: rgba(220, 38, 38, 0.1);
  --space-warning: #f59e0b;
  --space-warning-soft: rgba(245, 158, 11, 0.1);
  --space-info: #0ea5e9;
  --space-info-soft: rgba(14, 165, 233, 0.1);

  --space-text-primary: #111827;
  --space-text-secondary: #6b7280;
  --space-text-tertiary: #9ca3af;
  --space-text-disabled: #d1d5db;
  --space-text-inverse: #ffffff;

  --space-border-subtle: rgba(0, 0, 0, 0.04);
  --space-border-default: rgba(0, 0, 0, 0.08);
  --space-border-strong: rgba(0, 0, 0, 0.14);
  --space-border-focus: var(--space-accent);

  --space-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --space-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --space-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --space-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --space-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.16), 0 8px 20px rgba(0, 0, 0, 0.08);
  --space-shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  --space-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --space-ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --space-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --space-ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --space-duration-fast: 120ms;
  --space-duration-normal: 200ms;
  --space-duration-slow: 350ms;

  --space-radius-none: 0;
  --space-radius-xs: 4px;
  --space-radius-sm: 6px;
  --space-radius-md: 8px;
  --space-radius-lg: 12px;
  --space-radius-xl: 16px;
  --space-radius-2xl: 20px;
  --space-radius-full: 9999px;

  --space-font-xs: 11px;
  --space-font-sm: 12px;
  --space-font-base: 13px;
  --space-font-md: 14px;
  --space-font-lg: 16px;
  --space-font-xl: 18px;
  --space-font-2xl: 24px;
  --space-font-3xl: 32px;

  --space-gap-none: 0;
  --space-gap-xs: 2px;
  --space-gap-sm: 4px;
  --space-gap-md: 8px;
  --space-gap-lg: 12px;
  --space-gap-xl: 16px;
  --space-gap-2xl: 24px;
  --space-gap-3xl: 32px;

  --space-width-sidebar: 264px;
  --space-width-sidebar-narrow: 220px;
  --space-height-header: 44px;
  --space-height-toolbar: 36px;
  --space-height-statusbar: 28px;
  --space-height-titlebar: 32px;
}

html[data-theme='dark'] {
  --space-bg-panel: rgba(30, 30, 32, 0.92);
  --space-bg-window: #1c1c1e;
  --space-bg-window-active: #242426;
  --space-bg-titlebar: rgba(36, 36, 38, 0.96);
  --space-bg-app-grid: rgba(22, 22, 24, 0.94);
  --space-bg-context: rgba(40, 40, 44, 0.98);
  --space-bg-notification: rgba(40, 40, 44, 0.98);
  --space-bg-input: #1c1c1e;
  --space-bg-hover: rgba(255, 255, 255, 0.06);
  --space-bg-active: rgba(255, 255, 255, 0.1);
  --space-bg-selected: rgba(10, 132, 255, 0.24);
  --space-bg-sidebar: rgba(24, 24, 26, 0.96);
  --space-bg-toolbar: rgba(36, 36, 40, 0.96);
  --space-bg-card: #2a2a2d;

  --space-accent: #3b82f6;
  --space-accent-hover: #60a5fa;
  --space-accent-soft: rgba(59, 130, 246, 0.15);

  --space-text-primary: #f3f4f6;
  --space-text-secondary: #9ca3af;
  --space-text-tertiary: #6b7280;
  --space-text-disabled: #4b5563;

  --space-border-subtle: rgba(255, 255, 255, 0.06);
  --space-border-default: rgba(255, 255, 255, 0.1);
  --space-border-strong: rgba(255, 255, 255, 0.16);

  --space-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --space-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --space-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --space-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  --space-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);
}

html[data-accent='purple'] { --space-accent: #7c3aed; --space-accent-hover: #8b5cf6; }
html[data-accent='green'] { --space-accent: #22c55e; --space-accent-hover: #4ade80; }
html[data-accent='orange'] { --space-accent: #f97316; --space-accent-hover: #fb923c; }
html[data-accent='pink'] { --space-accent: #ec4899; --space-accent-hover: #f472b6; }
html[data-accent='teal'] { --space-accent: #06b6d4; --space-accent-hover: #22d3ee; }

html[data-theme='dark'][data-accent='purple'] { --space-accent: #a78bfa; --space-accent-hover: #c4b5fd; }
