/* I Agent Pro — единственный слой токенов.
   Ни одна страница не объявляет свои цвета, размеры или тайминги: всё отсюда. */

:root {
  /* --- Примитивы --- */
  --c-white: #ffffff;
  --c-ink-950: #0b1120;
  --c-ink-900: #0f172a;
  --c-ink-800: #131b2b;
  --c-ink-700: #1b2436;
  --c-ink-600: #24304a;
  --c-slate-500: #5f6e82;
  --c-slate-400: #94a3b8;
  --c-slate-200: #e2e8f0;
  --c-slate-100: #eef1f5;
  --c-slate-50: #f6f7f9;
  --c-blue-600: #2563eb;
  --c-blue-500: #3b82f6;
  --c-blue-400: #60a5fa;
  --c-green-700: #15803d;
  --c-green-400: #4ade80;
  --c-amber-700: #b45309;
  --c-amber-400: #fbbf24;
  --c-red-600: #dc2626;
  --c-red-400: #f87171;

  /* --- Семантика: светлая тема --- */
  --bg: var(--c-slate-50);
  --surface: var(--c-white);
  --surface-2: var(--c-slate-100);
  --text: var(--c-ink-900);
  --text-muted: var(--c-slate-500);
  --text-inverse: var(--c-white);
  --border: var(--c-slate-200);
  --border-strong: #cbd5e1;

  --accent: var(--c-blue-600);
  --accent-hover: #1d4ed8;
  --accent-active: #1e40af;
  --accent-fg: var(--c-white);
  --accent-soft: #e8efff;
  --accent-on-soft: #1d4ed8;

  --success: var(--c-green-700);
  --success-soft: #e7f6ec;
  --success-on-soft: #0f5f2c;
  --warning: var(--c-amber-700);
  --warning-soft: #fdf1e0;
  --warning-on-soft: #8a3e06;
  --danger: var(--c-red-600);
  --danger-hover: #b91c1c;
  --danger-soft: #fdeaea;
  --danger-on-soft: #991b1b;

  --focus-ring: 0 0 0 3px rgb(37 99 235 / 0.35);
  --overlay: rgb(15 23 42 / 0.55);

  /* --- Размеры --- */
  --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;

  --space-05: 2px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* --- Типографика --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", monospace;

  --text-display: 40px;
  --text-display-lh: 44px;
  --text-h1: 25px;
  --text-h1-lh: 30px;
  --text-h2: 19px;
  --text-h2-lh: 25px;
  --text-body: 15px;
  --text-body-lh: 22px;
  --text-sm: 13px;
  --text-sm-lh: 18px;
  --text-xs: 11px;
  --text-xs-lh: 15px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* --- Тени и движение --- */
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 4px 16px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 12px 32px rgb(15 23 42 / 0.14);

  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --header-h: 56px;
  --nav-h: 62px;
  --content-max: 720px;

  /* --- Размеры элементов управления --- */
  --size-icon: 20px;
  --size-icon-sm: 16px;
  --size-control: 44px; /* минимальная зона касания */
  --size-control-sm: 34px;
  --size-control-xs: 36px;
  --size-spinner: 18px;
  --size-thumb: 56px;
  --size-marker: 30px;
  --size-bar: 6px;
  --size-textarea: 110px;
  --size-skeleton: 72px;
  --size-gallery-w: 132px;
  --size-gallery-h: 96px;

  --motion-spin: 700ms;
  --motion-shimmer: 1300ms;
}

:root[data-theme="dark"] {
  --bg: var(--c-ink-950);
  --surface: var(--c-ink-800);
  --surface-2: var(--c-ink-700);
  --text: #e7ecf3;
  --text-muted: var(--c-slate-400);
  --text-inverse: var(--c-ink-950);
  --border: var(--c-ink-600);
  --border-strong: #33415c;

  --accent: var(--c-blue-400);
  --accent-hover: #7cb6fb;
  --accent-active: #93c5fd;
  --accent-fg: var(--c-ink-950);
  --accent-soft: #16273f;
  --accent-on-soft: var(--c-blue-400);

  --success: var(--c-green-400);
  --success-soft: #10281a;
  --success-on-soft: var(--c-green-400);
  --warning: var(--c-amber-400);
  --warning-soft: #2b2010;
  --warning-on-soft: var(--c-amber-400);
  --danger: var(--c-red-400);
  --danger-hover: #fca5a5;
  --danger-soft: #2c1618;
  --danger-on-soft: var(--c-red-400);

  --focus-ring: 0 0 0 3px rgb(96 165 250 / 0.45);
  --overlay: rgb(2 6 16 / 0.7);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--c-ink-950);
    --surface: var(--c-ink-800);
    --surface-2: var(--c-ink-700);
    --text: #e7ecf3;
    --text-muted: var(--c-slate-400);
    --text-inverse: var(--c-ink-950);
    --border: var(--c-ink-600);
    --border-strong: #33415c;

    --accent: var(--c-blue-400);
    --accent-hover: #7cb6fb;
    --accent-active: #93c5fd;
    --accent-fg: var(--c-ink-950);
    --accent-soft: #16273f;
    --accent-on-soft: var(--c-blue-400);

    --success: var(--c-green-400);
    --success-soft: #10281a;
    --success-on-soft: var(--c-green-400);
    --warning: var(--c-amber-400);
    --warning-soft: #2b2010;
    --warning-on-soft: var(--c-amber-400);
    --danger: var(--c-red-400);
    --danger-hover: #fca5a5;
    --danger-soft: #2c1618;
    --danger-on-soft: var(--c-red-400);

    --focus-ring: 0 0 0 3px rgb(96 165 250 / 0.45);
    --overlay: rgb(2 6 16 / 0.7);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.55);
  }
}
