/* Tidrivo design tokens (docs/DESIGN_SYSTEM.md). One file for the website and the workspace.
   Light is the default; dark applies when the visitor chose it (html[data-theme="dark"], set by
   theme-init.js before first paint) or when they chose "System" (no data-theme) and the operating
   system prefers dark. Colours are semantic: components never use a hex value directly.
   Contrast (WCAG 2.2) is checked in tests/theme-contrast.test.mjs for every text/background pair below. */
:root{
  color-scheme:light;
  /* surfaces */
  --bg:#f4f6f8;            /* page background */
  --bg-workspace:#eef2f5;  /* behind tool panels */
  --surface:#ffffff;       /* cards, panels, inputs */
  --surface-2:#f9fafb;     /* raised strip inside a surface (toolbars, table headers) */
  --surface-sunken:#e9edf1;/* wells, chips, hover background */
  --header-bg:rgba(255,255,255,.92);
  /* text */
  --text:#12263a;          /* primary */
  --text-2:#2f4458;        /* secondary */
  --text-muted:#4a5b6c;    /* muted, still ≥4.5:1 on --surface and --bg */
  --on-light:#12263a;      /* text on a surface that is light in both themes */
  /* lines */
  --border:#dce3ea;
  --border-strong:#7b8b9c;
  /* brand and interaction */
  --accent:#0a5c5a;        /* links, primary state, selection marks */
  --accent-bright:#5cc8c2; /* accent on dark bands */
  --accent-soft:#e3f0ef;   /* selected/current background */
  --hover:#e9edf1;
  --selection:#cfe5e3;
  --focus:#d9631e;         /* focus ring: orange, distinct from every state colour */
  --btn-primary-bg:#12263a;--btn-primary-fg:#ffffff;--btn-primary-hover:#1b3550;--btn-primary-fg-soft:#ffd2b5;
  /* states */
  --success:#1c6b3c;--success-soft:#e2f1e7;
  --warn-text:#8a3a0b;--warn-soft:#fbe9dc;--warn-line:#e7b48f;
  --error:#a3261b;--error-text:#7d1d14;--error-soft:#fbe4e1;
  --disabled-bg:#e9edf1;--disabled-text:#56677a;
  --badge-bg:#b4501a;--badge-fg:#ffffff;
  /* dark bands (closing call to action, code listing, footer): dark in both themes */
  --band-bg:#12263a;--band-2:#1b3550;--band-text:#ffffff;--band-text-2:#d5dee7;--band-text-3:#afc0cf;--band-line:#2b4259;
  --footer-bg:#0d1c2b;
  --shadow-rgb:18,38,58;
  /* image preview backgrounds (product photos are never recoloured) */
  --preview-light:#ffffff;--preview-dark:#1b2733;
  --checker-a:#ffffff;--checker-b:#e3e8ee;
  /* legacy names used by existing page styles (keep in step with the tokens above) */
  --paper:var(--bg);--card:var(--surface);--ink:var(--text);--muted:var(--text-muted);--line:var(--border);--soft:var(--surface-sunken);--mist:var(--surface-sunken);
  --teal:var(--accent);--teal-l:var(--accent-bright);--teal-soft:var(--accent-soft);
  --orange:var(--focus);--orange-t:var(--warn-text);--orange-soft:var(--warn-soft);--navy-2:var(--btn-primary-hover);
  /* type, spacing, shape */
  --display:"Newsreader",Georgia,serif;
  --body:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;--space-7:48px;
  --radius-s:6px;--radius-m:10px;--radius-l:14px;
  --control-h:40px;--row-h:44px;--topbar-h:60px;
  --motion-fast:150ms;--motion:220ms;--ease-out:cubic-bezier(.16,1,.3,1);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0e1822;--bg-workspace:#0b141d;--surface:#15212d;--surface-2:#1a2836;--surface-sunken:#1f2d3b;--header-bg:rgba(14,24,34,.92);
    --text:#e6edf3;--text-2:#c6d2dd;--text-muted:#9fb0c0;--on-light:#12263a;
    --border:#2a3a4a;--border-strong:#62778c;
    --accent:#5cc8c2;--accent-bright:#5cc8c2;--accent-soft:#123433;--hover:#1f2d3b;--selection:#1f4a48;--focus:#f08a4b;
    --btn-primary-bg:#5cc8c2;--btn-primary-fg:#06201f;--btn-primary-hover:#7ad6d1;--btn-primary-fg-soft:#1f4a48;
    --success:#6fd49a;--success-soft:#123322;
    --warn-text:#f3b58f;--warn-soft:#3a2416;--warn-line:#8a5a3a;
    --error:#ff8a7d;--error-text:#ffb3aa;--error-soft:#3a1a17;
    --disabled-bg:#1f2d3b;--disabled-text:#8c9cab;
    --badge-bg:#f08a4b;--badge-fg:#2a1205;
    --band-bg:#0b1722;--band-2:#16293b;--band-text:#ffffff;--band-text-2:#d5dee7;--band-text-3:#a9bacb;--band-line:#2b4259;
    --footer-bg:#08111a;
    --shadow-rgb:0,0,0;
    --preview-light:#ffffff;--preview-dark:#0b141d;--checker-a:#2a3644;--checker-b:#1f2a36;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0e1822;--bg-workspace:#0b141d;--surface:#15212d;--surface-2:#1a2836;--surface-sunken:#1f2d3b;--header-bg:rgba(14,24,34,.92);
  --text:#e6edf3;--text-2:#c6d2dd;--text-muted:#9fb0c0;--on-light:#12263a;
  --border:#2a3a4a;--border-strong:#62778c;
  --accent:#5cc8c2;--accent-bright:#5cc8c2;--accent-soft:#123433;--hover:#1f2d3b;--selection:#1f4a48;--focus:#f08a4b;
  --btn-primary-bg:#5cc8c2;--btn-primary-fg:#06201f;--btn-primary-hover:#7ad6d1;--btn-primary-fg-soft:#1f4a48;
  --success:#6fd49a;--success-soft:#123322;
  --warn-text:#f3b58f;--warn-soft:#3a2416;--warn-line:#8a5a3a;
  --error:#ff8a7d;--error-text:#ffb3aa;--error-soft:#3a1a17;
  --disabled-bg:#1f2d3b;--disabled-text:#8c9cab;
  --badge-bg:#f08a4b;--badge-fg:#2a1205;
  --band-bg:#0b1722;--band-2:#16293b;--band-text:#ffffff;--band-text-2:#d5dee7;--band-text-3:#a9bacb;--band-line:#2b4259;
  --footer-bg:#08111a;
  --shadow-rgb:0,0,0;
  --preview-light:#ffffff;--preview-dark:#0b141d;--checker-a:#2a3644;--checker-b:#1f2a36;
}
/* browser surfaces carry the theme too */
::selection{background:var(--selection);color:var(--text)}
html{accent-color:var(--accent)}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* theme control (same markup on every page) */
.themesel{font:inherit;font-size:13.5px;font-weight:500;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:6px 12px;min-height:38px;cursor:pointer}
.themesel:hover{border-color:var(--accent)}
