/*
 * plc-tokens.css — the ONE alias layer between themes and domain components.
 *
 * Components in docs/wc/ read only --plc-* tokens. Themes (daisyUI 4, daisyUI 5,
 * or the studio's own --bg-* / --state-* blocks) are mapped here, once.
 * Adding a theme never touches a component; renaming a daisyUI token touches
 * only this file.
 *
 * Resolution order per token: studio override -> daisyUI 5 -> daisyUI 4 -> literal.
 * daisyUI 4 stores raw "L C H" triplets (--su: 0.6 0.2 150), hence oklch(var(--su)).
 *
 * Declared on [data-theme] too, so a themed subtree recomputes the aliases
 * (custom properties inherit their *computed* value from where they are declared).
 */
:root,
[data-theme] {
  --plc-surface:    var(--bg-card,       var(--color-base-200, oklch(var(--b2, 0.25 0.01 260))));
  --plc-surface-2:  var(--bg-canvas,     var(--color-base-100, oklch(var(--b1, 0.21 0.01 260))));
  --plc-border:     var(--border-subtle, var(--color-base-300, oklch(var(--b3, 0.32 0.01 260))));
  --plc-text:       var(--text-main,     var(--color-base-content, oklch(var(--bc, 0.85 0.01 260))));
  --plc-text-muted: var(--text-muted,    color-mix(in oklab, var(--plc-text) 60%, transparent));

  /* ISA-101: grey for normal, saturated colour reserved for state and abnormal. */
  --plc-off:    color-mix(in oklab, var(--plc-text) 18%, var(--plc-surface));
  --plc-on:     var(--state-on, var(--color-success, oklch(var(--su, 0.65 0.17 150))));
  --plc-forced: var(--color-warning, oklch(var(--wa, 0.8 0.16 85)));
  --plc-warn:   var(--color-warning, oklch(var(--wa, 0.8 0.16 85)));
  --plc-alarm:  var(--color-error,   oklch(var(--er, 0.62 0.21 25)));
  --plc-accent: var(--color-info,    oklch(var(--in, 0.7 0.12 230)));

  --plc-font-mono: var(--font-mono, ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace);
}
