/* ProcurementOS colour tokens (docs/design/visual-spec.md, D-130, D-132).
   The only file that names a colour, under the v04.2 names. It is held equal to
   mockups/v04.2/tokens.css by tests/api/test_tokens.py, and passes
   scripts/contrast_check.py with --spec. Type, spacing and shape tokens are in
   type.css. Light is :root. Dark follows the device through @media
   (prefers-color-scheme: dark) when no theme is set, and :root[data-theme="dark"]
   is the user's override; the two dark blocks hold the same values. theme.js only
   applies a stored choice. Every colour is declared in every block.

   Contrast pairs, checked by scripts/contrast_check.py in each theme: kind,
   foreground, background, minimum ratio, then where the pair occurs. Disabled
   controls are exempt (WCAG 1.4.3). --border is decorative (dividers and panel
   edges) and identifies no control, so it has no pair. There is no alternate
   row shading; table rows sit on --surface. The focus ring is offset 2 px, so on
   a solid button it is measured against the gap colour, never the fill.
   @pair text   --text           --bg          4.5 body text on the page
   @pair text   --text           --surface     4.5 body text in a panel or table row
   @pair text   --text           --surface-2   4.5 panel and table headings
   @pair text   --text           --banner-bg   4.5 the page banner
   @pair text   --text           --accent-soft 4.5 selected row
   @pair text   --text-muted     --bg          4.5 help text on the page
   @pair text   --text-muted     --surface     4.5 help text and codes in a panel
   @pair text   --text-muted     --surface-2   4.5 labels in a panel heading
   @pair text   --text-muted     --accent-soft 4.5 codes in a selected row
   @pair text   --text-nav-off   --surface     4.5 greyed menu item in the sidebar
   @pair text   --text-nav-off   --bg          4.5 greyed menu item on the page (phone menu)
   @pair text   --accent         --bg          4.5 link on the page
   @pair text   --accent         --surface     4.5 link in a panel
   @pair text   --accent         --surface-2   4.5 link in a panel heading
   @pair text   --accent         --accent-soft 4.5 selected menu item
   @pair text   --on-accent      --accent      4.5 solid button text, checkbox tick
   @pair text   --success-fg     --success-bg  4.5 success chip
   @pair text   --warning-fg     --warning-bg  4.5 warning chip
   @pair text   --error-fg       --error-bg    4.5 error chip
   @pair text   --neutral-fg     --neutral-bg  4.5 neutral chip and count badge
   @pair border --control-border --bg          3   inputs, selects, checkboxes, outlined buttons on the page
   @pair border --control-border --surface     3   inputs, selects, checkboxes, outlined buttons in a panel
   @pair border --control-border --surface-2   3   controls in a panel heading
   @pair border --accent         --bg          3   solid button and checked box edge on the page
   @pair border --accent         --surface     3   solid button and checked box edge in a panel
   @pair focus  --focus          --bg          3   focus on the page; solid button on the page (offset gap)
   @pair focus  --focus          --surface     3   focus in a panel and table row; solid button in a panel (offset gap)
   @pair focus  --focus          --surface-2   3   focus in a panel or table heading
   @pair focus  --focus          --accent-soft 3   focus on a selected row or menu item
   @pair focus  --focus          --banner-bg   3   focus on a link in the banner
*/

:root{
  --bg:#F5F6F8;
  --surface:#FFFFFF;
  --surface-2:#F0F2F5;
  --banner-bg:#EDEFF2;
  --text:#14181F;
  --text-muted:#4A5463;
  --text-nav-off:#666E7B;
  --border:#D5DAE1;
  --control-border:#737D8C;
  --accent:#1F4E8C;
  --on-accent:#FFFFFF;
  --accent-soft:#E8EEF7;
  --focus:#1F4E8C;
  --success-fg:#1E6B3F;
  --success-bg:#E6F4EC;
  --warning-fg:#7A4A00;
  --warning-bg:#FCF1DC;
  --error-fg:#A11D1D;
  --error-bg:#FBEAEA;
  --neutral-fg:#3F4856;
  --neutral-bg:#EDEFF2;
  color-scheme:light;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0F1216;
    --surface:#171B21;
    --surface-2:#1E232B;
    --banner-bg:#1E232B;
    --text:#EEF1F5;
    --text-muted:#AEB6C2;
    --text-nav-off:#828994;
    --border:#2C333D;
    --control-border:#7A8494;
    --accent:#7FAEF0;
    --on-accent:#0F1216;
    --accent-soft:#1B2A40;
    --focus:#7FAEF0;
    --success-fg:#6FD39B;
    --success-bg:#10301F;
    --warning-fg:#F2C66B;
    --warning-bg:#33260A;
    --error-fg:#F59A9A;
    --error-bg:#3A1616;
    --neutral-fg:#C4CBD5;
    --neutral-bg:#262C35;
    color-scheme:dark;
  }
}

:root[data-theme="dark"]{
  --bg:#0F1216;
  --surface:#171B21;
  --surface-2:#1E232B;
  --banner-bg:#1E232B;
  --text:#EEF1F5;
  --text-muted:#AEB6C2;
  --text-nav-off:#828994;
  --border:#2C333D;
  --control-border:#7A8494;
  --accent:#7FAEF0;
  --on-accent:#0F1216;
  --accent-soft:#1B2A40;
  --focus:#7FAEF0;
  --success-fg:#6FD39B;
  --success-bg:#10301F;
  --warning-fg:#F2C66B;
  --warning-bg:#33260A;
  --error-fg:#F59A9A;
  --error-bg:#3A1616;
  --neutral-fg:#C4CBD5;
  --neutral-bg:#262C35;
  color-scheme:dark;
}
