/* Praxis — токены дизайн-системы (spec 009, FR-1; значения — plan.md §3).
 * Единственное место цветов проекта: компоненты (app.css, praxis-table.css) берут цвета только отсюда.
 * Светлая тема — :root; тёмная — [data-theme=dark] и «Системная» ([data-theme=system]) при тёмной настройке ОС.
 * Контраст пар проверяется тестом tests/core/test_ui.py::test_token_contrast (WCAG 2.1 AA).
 */
:root {
  color-scheme: light;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --border: #D5DAE1;
  --border-strong: #7C8594;
  --text: #1A1D23;
  --text-muted: #5B6472;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --on-accent: #FFFFFF;
  --row-hover: #F4F7FD;
  --overlay: rgba(15, 17, 21, 0.45);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.08);

  --tone-neutral-text: #475467;
  --tone-neutral-bg: #EEF1F5;
  --tone-neutral-border: #D0D5DD;
  --tone-info-text: #1D4ED8;
  --tone-info-bg: #E8F0FE;
  --tone-info-border: #BFD3FB;
  --tone-success-text: #137A39;
  --tone-success-bg: #E7F6EC;
  --tone-success-border: #B7E1C4;
  --tone-warning-text: #B45309;
  --tone-warning-bg: #FEF4E6;
  --tone-warning-border: #F5D3A6;
  --tone-danger-text: #B91C1C;
  --tone-danger-bg: #FDECEC;
  --tone-danger-border: #F4C2C2;
  /* Рамка предложения ИИ, изменённого человеком (spec 020, FR-9). */
  --ai-edited: #7C3AED;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1115;
  --surface: #171A21;
  --surface-2: #1E222B;
  --border: #2E3440;
  --border-strong: #6B7483;
  --text: #E6E8EC;
  --text-muted: #A0A8B5;
  --accent: #60A5FA;
  --accent-hover: #93C5FD;
  --on-accent: #0F1115;
  --row-hover: #1C2330;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);

  --tone-neutral-text: #C3CAD5;
  --tone-neutral-bg: #252A33;
  --tone-neutral-border: #3A414D;
  --tone-info-text: #93C5FD;
  --tone-info-bg: #14233F;
  --tone-info-border: #1E3A6E;
  --tone-success-text: #86EFAC;
  --tone-success-bg: #12291B;
  --tone-success-border: #1F4A2E;
  --tone-warning-text: #FCD34D;
  --tone-warning-bg: #2E2410;
  --tone-warning-border: #5A4517;
  --tone-danger-text: #FCA5A5;
  --tone-danger-bg: #341515;
  --tone-danger-border: #5E2424;
  --ai-edited: #C4B5FD;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    color-scheme: dark;
    --bg: #0F1115;
    --surface: #171A21;
    --surface-2: #1E222B;
    --border: #2E3440;
    --border-strong: #6B7483;
    --text: #E6E8EC;
    --text-muted: #A0A8B5;
    --accent: #60A5FA;
    --accent-hover: #93C5FD;
    --on-accent: #0F1115;
    --row-hover: #1C2330;
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);

    --tone-neutral-text: #C3CAD5;
    --tone-neutral-bg: #252A33;
    --tone-neutral-border: #3A414D;
    --tone-info-text: #93C5FD;
    --tone-info-bg: #14233F;
    --tone-info-border: #1E3A6E;
    --tone-success-text: #86EFAC;
    --tone-success-bg: #12291B;
    --tone-success-border: #1F4A2E;
    --tone-warning-text: #FCD34D;
    --tone-warning-bg: #2E2410;
    --tone-warning-border: #5A4517;
    --tone-danger-text: #FCA5A5;
    --tone-danger-bg: #341515;
    --tone-danger-border: #5E2424;
    --ai-edited: #C4B5FD;
  }
}

/* Шрифт, размеры, отступы, радиусы — общие для обеих тем. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --control-h: 32px;
  --control-h-sm: 28px;
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 56px;
  --topbar-h: 48px;

  /* Прежние имена переменных шаблонов 001–008 (до перевода экранов, T003–T004) — ссылки на токены. */
  --panel: var(--surface);
  --line: var(--border);
  --muted: var(--text-muted);
  --danger: var(--tone-danger-text);
  --ok: var(--tone-success-text);
  --focus: var(--accent);
  --accent-text: var(--on-accent);
}
