/* Design tokens — docs/console/DESIGN_SYSTEM.md §2-§4.
   Light is the default; dark follows the OS unless the viewer picks a theme.
   The dark block is declared twice on purpose: the media query covers the OS
   setting, the [data-theme] scope covers the viewer's toggle and must win both ways.
   tests/console/test_tokens_contrast.py reads these three blocks. */
:root {
  color-scheme: light;
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #EDF1F7;
  --border: #D3DBE6;
  --border-strong: #6B7A90;
  --text: #0F1B2D;
  --text-2: #475569;
  --text-3: #5A6A80;
  --accent: #1D4ED8;
  --accent-strong: #1E40AF;
  --on-accent: #FFFFFF;
  --accent-soft: #E6EDFD;
  --ok-fg: #166534;
  --ok-bg: #DCFCE7;
  --warn-fg: #92400E;
  --warn-bg: #FEF3C7;
  --err-fg: #B42318;
  --err-bg: #FEE4E2;
  --info-fg: #334155;
  --info-bg: #E2E8F0;
  --unk-fg: #475569;
  --unk-bg: #F1F5F9;
  --series-1: #2A78D6;
  --series-2: #EB6834;
  --series-3: #1BAF7A;
  --series-4: #EDA100;
  --seq-1: #CDE2FB;
  --seq-2: #86B6EF;
  --seq-3: #3987E5;
  --seq-4: #1C5CAB;
  --seq-5: #0D366B;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .08);
  --shadow-3: 0 12px 32px rgba(15, 27, 45, .20);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1220;
    --surface: #111A2B;
    --surface-2: #17233A;
    --border: #2B3A55;
    --border-strong: #8CA0BF;
    --text: #E5EDF8;
    --text-2: #B6C4D8;
    --text-3: #8FA2BC;
    --accent: #8AB4FF;
    --accent-strong: #A8C7FF;
    --on-accent: #0B1220;
    --accent-soft: #1B2A4A;
    --ok-fg: #86EFAC;
    --ok-bg: #12301F;
    --warn-fg: #FCD34D;
    --warn-bg: #3A2A07;
    --err-fg: #FCA5A5;
    --err-bg: #3F1414;
    --info-fg: #CBD5E1;
    --info-bg: #1E293B;
    --unk-fg: #9FB0C8;
    --unk-bg: #172338;
    --series-1: #3987E5;
    --series-2: #D95926;
    --series-3: #199E70;
    --series-4: #C98500;
    --seq-1: #0D366B;
    --seq-2: #1C5CAB;
    --seq-3: #3987E5;
    --seq-4: #86B6EF;
    --seq-5: #CDE2FB;
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-3: 0 16px 40px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;
  --surface: #111A2B;
  --surface-2: #17233A;
  --border: #2B3A55;
  --border-strong: #8CA0BF;
  --text: #E5EDF8;
  --text-2: #B6C4D8;
  --text-3: #8FA2BC;
  --accent: #8AB4FF;
  --accent-strong: #A8C7FF;
  --on-accent: #0B1220;
  --accent-soft: #1B2A4A;
  --ok-fg: #86EFAC;
  --ok-bg: #12301F;
  --warn-fg: #FCD34D;
  --warn-bg: #3A2A07;
  --err-fg: #FCA5A5;
  --err-bg: #3F1414;
  --info-fg: #CBD5E1;
  --info-bg: #1E293B;
  --unk-fg: #9FB0C8;
  --unk-bg: #172338;
  --series-1: #3987E5;
  --series-2: #D95926;
  --series-3: #199E70;
  --series-4: #C98500;
  --seq-1: #0D366B;
  --seq-2: #1C5CAB;
  --seq-3: #3987E5;
  --seq-4: #86B6EF;
  --seq-5: #CDE2FB;
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, .55);
}

/* Theme-independent scales. */
:root {
  --font: "Vazirmatn", "Vazir", "IRANSansX", system-ui, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --r-control: 6px;
  --r-card: 10px;
  --r-pill: 999px;
  --row-h: 44px;
  --control-h: 40px;
  --nav-w: 248px;
  --header-h: 56px;
  --z-nav: 10;
  --z-header: 20;
  --z-dropdown: 30;
  --z-dialog: 40;
  --z-toast: 50;
  --dur: 150ms;
}

:root[data-density="compact"] {
  --row-h: 34px;
  --control-h: 32px;
}
