/* Design tokens — the only place raw colour values live.
   Brand: ST.JAMES | TREND is black on white — neutral greys, black primary buttons, no purple/violet.
   Contrast ratios (WCAG 2.x) noted against the surface each pair is used on. */
:root {
  /* Colour: base */
  --color-bg: #FFFFFF;
  --color-surface: #FFFFFF;          /* cards */
  --color-surface-muted: #F5F5F4;    /* quiet fills (hover, read-only) — text 17.4:1 */
  --color-text: #141414;             /* near-black ink — 18.6:1 on white */
  --color-text-muted: #555555;       /* secondary text — 7.46:1 on white */
  --color-border: #E6E6E4;           /* thin decorative borders (cards, dividers) */
  --color-border-strong: #8C8C8A;    /* input/control boundaries — 3.36:1 on white (≥ 3:1) */
  --color-placeholder: #6B6B69;      /* example text in empty fields — 5.3:1 on white, lighter than real values */
  --color-selection: #DEDEDB;        /* selected text background — ink on it 13.7:1 */

  /* Colour: accent — primary buttons ONLY */
  --color-accent: #141414;           /* black button, white on it 18.6:1 */
  --color-accent-hover: #3A3A3A;     /* white on it 11.6:1 */
  --color-on-accent: #FFFFFF;

  /* Colour: focus ring (black, sits on white via offset — 18.6:1) */
  --color-focus: #141414;
  --color-backdrop: rgba(20, 20, 20, 0.45);
  --shadow-overlay: 0 8px 24px rgba(20, 20, 20, 0.14);  /* lists/dialogs that float over the page */

  /* Colour: status (text on matching soft background) */
  --color-danger: #B3261E;           /* 6.54:1 on white */
  --color-danger-hover: #8E1E18;     /* white on it 8.9:1 */
  --color-danger-bg: #FCEEEE;        /* danger text on it 5.79:1 */
  --color-success: #1E6B3A;
  --color-success-bg: #E8F5EC;       /* 5.81:1 */
  --color-warning: #7A4A00;
  --color-warning-bg: #FFF3D6;       /* 6.78:1 */
  --color-info: #1F4A86;
  --color-info-bg: #EAF1FB;          /* 7.76:1 */
  --color-neutral: #3D3D3D;
  --color-neutral-bg: #F1F1F0;       /* 10.2:1 */

  /* Colour: sheet card preview (copied from the sample workbook) */
  --color-sheet-highlight: #FFF2CC;  /* product-name cell fill — text 17.3:1 */
  --color-sheet-grid: #D4D4D2;       /* cell borders (decorative) */

  /* Colour: A4 print sheets (spec §15, Ruling R9) — like the team's printed workbook */
  --color-print-ink: #000000;        /* text, card outline, colour-table rules */
  --color-print-grid: #BDBDBD;       /* 1px sheet gridlines */
  --color-print-name: #FFF2CC;       /* product-name cell (layoutSpec s14) — text 18.2:1 */
  --color-print-newcat: #FFFF00;     /* NEW CAT cells, bright yellow — text 19.6:1 */

  /* Typography */
  --font-heading: "SN Pro", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --text-sm: 0.9375rem;   /* 15px — meta text, badges */
  --text-base: 1.0625rem; /* 17px — body (constraint) */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 1.875rem;   /* 30px — page titles */
  --leading-body: 1.6;    /* Thai needs room for vowels/tone marks */
  --leading-tight: 1.3;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing (4px grid) */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */

  /* Shape & sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --border-width: 1px;
  --control-height: 3rem;  /* 48px minimum for inputs/buttons */
  --focus-width: 3px;
  --focus-offset: 2px;
  --icon-size: 1.25rem;
  --content-max: 72rem;    /* 1152px */
  --form-max: 46rem;
  --topbar-height: 4rem;
}
