:root {
  color-scheme: dark;
  --bg: #101114;
  --bg-soft: #15171b;
  --panel: #1b1e23;
  --border: #2a2e35;
  --text: #d7dade;
  --muted: #9aa0aa;
  --accent: #d99540;
  --accent-strong: #e0a557;
  --accent-soft: rgba(217, 149, 64, 0.1);
  --accent-hover: rgba(217, 149, 64, 0.16);
  --accent-border: rgba(217, 149, 64, 0.35);
  --accent-ring: rgba(217, 149, 64, 0.18);
  --accent-contrast: #1a1206;
  --ok: #63a878;
  --ok-soft: rgba(99, 168, 120, 0.1);
  --err: #cf6a6a;
  --err-text: #eab0b0;
  --danger-soft: rgba(207, 106, 106, 0.1);
  --danger-border: rgba(207, 106, 106, 0.5);
  --info: #6f97c9;
  --info-soft: rgba(111, 151, 201, 0.08);
  --info-soft-strong: rgba(111, 151, 201, 0.1);
  --info-border: rgba(111, 151, 201, 0.45);
  --header-bg: rgba(16, 17, 20, 0.92);
  --row-hover: rgba(255, 255, 255, 0.03);
  --editor-text: #e3e6ea;
  --pre-text: #b9c0ca;
  --autocomplete-bg: #1e2126;
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.18);
  --overlay: rgba(8, 9, 11, 0.5);
  --tok-kw: #d99a5b;
  --tok-str: #9ec4a4;
  --tok-num: #8fb0e0;
  --tok-bool: #b99ad6;
  --tok-comment: #6b7280;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 999px;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Inter", sans-serif;

  /* ---------- spacing scale ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ---------- typography ---------- */
  --font-sans: var(--sans);
  --font-mono: var(--mono);
  --line-tight: 1.3;
  --line-base: 1.5;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* ---------- borders / shadows / transitions ---------- */
  --border-strong: #343945;
  --ring: var(--accent-ring);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.36);
  --transition-fast: 0.1s ease;
  --transition-base: 0.15s ease;
  --transition-slow: 0.25s ease;

  /* ---------- z-index scale ---------- */
  --z-base: 1;
  --z-sticky: 5;
  --z-sidebar: 30;
  --z-topbar: 20;
  --z-statusbar: 20;
  --z-dropdown: 40;
  --z-toast: 50;
  --z-modal: 60;
  --z-palette: 60;
  --z-login: 80;

  /* ---------- shell dimensions ---------- */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 52px;
  --statusbar-h: 28px;

  /* ---------- extended status colors (не только зелёный/красный) ---------- */
  --warn: #d9a441;
  --warn-soft: rgba(217, 164, 65, 0.12);
  --warn-border: rgba(217, 164, 65, 0.45);
  --ok-strong: #7cc493;
  --ok-border: rgba(99, 168, 120, 0.5);
  --unknown: #9aa0aa;
  --unknown-soft: rgba(134, 140, 150, 0.12);
  --disabled-fg: #5b616b;

  /* ---------- breakpoints (для справки, используются в media) ---------- */
  --bp-mobile: 700px;
  --bp-tablet: 1100px;
  --bp-desktop: 1400px;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f6f3;
  --bg-soft: #efeee9;
  --panel: #ffffff;
  --border: #e0ddd5;
  --text: #23262b;
  --muted: #6b7079;
  --accent: #b0671c;
  --accent-strong: #95561a;
  --accent-soft: rgba(176, 103, 28, 0.1);
  --accent-hover: rgba(176, 103, 28, 0.14);
  --accent-border: rgba(176, 103, 28, 0.35);
  --accent-ring: rgba(176, 103, 28, 0.15);
  --accent-contrast: #ffffff;
  --ok: #3f8a55;
  --ok-soft: rgba(63, 138, 85, 0.1);
  --err: #b34545;
  --err-text: #7c2626;
  --danger-soft: rgba(179, 69, 69, 0.08);
  --danger-border: rgba(179, 69, 69, 0.4);
  --info: #3d6fa8;
  --info-soft: rgba(61, 111, 168, 0.08);
  --info-soft-strong: rgba(61, 111, 168, 0.1);
  --info-border: rgba(61, 111, 168, 0.4);
  --header-bg: rgba(247, 246, 243, 0.92);
  --row-hover: rgba(35, 38, 43, 0.04);
  --editor-text: #23262b;
  --pre-text: #3b4048;
  --autocomplete-bg: #ffffff;
  --shadow: rgba(35, 38, 43, 0.16);
  --shadow-sm: 0 4px 12px rgba(35, 38, 43, 0.1);
  --overlay: rgba(35, 38, 43, 0.35);
  --tok-kw: #9a5a12;
  --tok-str: #2f6b3d;
  --tok-num: #2a55a3;
  --tok-bool: #6b4fa0;
  --tok-comment: #8a8f98;
  --radius-lg: 10px;
  --radius-full: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --line-tight: 1.3;
  --line-base: 1.5;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --border-strong: #d4d0c6;
  --ring: rgba(176, 103, 28, 0.15);
  --shadow-md: 0 8px 24px rgba(35, 38, 43, 0.14);
  --shadow-lg: 0 16px 48px rgba(35, 38, 43, 0.18);
  --transition-fast: 0.1s ease;
  --transition-base: 0.15s ease;
  --transition-slow: 0.25s ease;
  --z-base: 1;
  --z-sticky: 5;
  --z-sidebar: 30;
  --z-topbar: 20;
  --z-statusbar: 20;
  --z-dropdown: 40;
  --z-toast: 50;
  --z-modal: 60;
  --z-palette: 60;
  --z-login: 80;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 52px;
  --statusbar-h: 28px;
  --warn: #9a6b12;
  --warn-soft: rgba(154, 107, 18, 0.1);
  --warn-border: rgba(154, 107, 18, 0.4);
  --ok-strong: #3f8a55;
  --ok-border: rgba(63, 138, 85, 0.45);
  --unknown: #6b7079;
  --unknown-soft: rgba(107, 112, 121, 0.12);
  --disabled-fg: #9aa0aa;
  --bp-mobile: 700px;
  --bp-tablet: 1100px;
  --bp-desktop: 1400px;
}

/* ---------- акцентные палитры ---------- */

html[data-accent='blue'] {
  --accent: #6f97c9;
  --accent-strong: #82a8d6;
  --accent-soft: rgba(111, 151, 201, 0.12);
  --accent-hover: rgba(111, 151, 201, 0.18);
  --accent-border: rgba(111, 151, 201, 0.4);
  --accent-ring: rgba(111, 151, 201, 0.18);
  --accent-contrast: #0b1220;
}

html[data-accent='green'] {
  --accent: #7aa87f;
  --accent-strong: #8cba91;
  --accent-soft: rgba(122, 168, 127, 0.12);
  --accent-hover: rgba(122, 168, 127, 0.18);
  --accent-border: rgba(122, 168, 127, 0.4);
  --accent-ring: rgba(122, 168, 127, 0.18);
  --accent-contrast: #0a140c;
}

html[data-theme='light'][data-accent='blue'] {
  --accent: #3d6fa8;
  --accent-strong: #315a8a;
  --accent-soft: rgba(61, 111, 168, 0.12);
  --accent-hover: rgba(61, 111, 168, 0.16);
  --accent-border: rgba(61, 111, 168, 0.4);
  --accent-ring: rgba(61, 111, 168, 0.15);
  --accent-contrast: #ffffff;
}

html[data-theme='light'][data-accent='green'] {
  --accent: #3f8a55;
  --accent-strong: #346f45;
  --accent-soft: rgba(63, 138, 85, 0.12);
  --accent-hover: rgba(63, 138, 85, 0.16);
  --accent-border: rgba(63, 138, 85, 0.4);
  --accent-ring: rgba(63, 138, 85, 0.15);
  --accent-contrast: #ffffff;
}
