/* EMMCB — design tokens
   The single source of truth for colour, type, space, and motion.
   Nothing below this file should hard-code a hex value. */

:root {
  /* ---- Surfaces ------------------------------------------------------ */
  --app-bg:        #f5f5f5;  /* application ground */
  --surface:       #ffffff;  /* primary analytical surface */
  --surface-2:     #f8f8f8;  /* secondary zone */
  --surface-3:     #eeeeee;  /* tertiary zone / table head */
  --surface-inset: #fafafa;  /* recessed strips */

  /* ---- Ink ----------------------------------------------------------- */
  --ink:        #111111;  /* primary text */
  --ink-strong: #000000;  /* page-level headings only */
  --ink-2:      #666666;  /* secondary information */
  --ink-3:      #8a8a8a;  /* muted metadata */
  --ink-invert: #ffffff;

  /* ---- Lines --------------------------------------------------------- */
  --line:        #e5e5e5;  /* default hairline */
  --line-strong: #d6d6d6;  /* structural division */
  --line-faint:  #efefef;  /* grid lines inside charts */

  /* ---- Accent -------------------------------------------------------- */
  --accent:       #4f46e5;
  --accent-ink:   #3730a3;  /* accent text on white, passes contrast */
  --accent-wash:  #eef2ff;
  --accent-line:  #c7d2fe;

  /* ---- Semantic (meaning only, never decoration) --------------------- */
  --pos:      #16803c;
  --pos-wash: #eaf5ee;
  --neg:      #c0392b;
  --neg-wash: #fbeceb;
  --warn:     #b7791f;
  --warn-wash:#fdf6e7;

  /* Severity ladder used by the bot + risk layers */
  --sev-critical: var(--neg);
  --sev-high:     #d4681f;
  --sev-medium:   var(--warn);
  --sev-low:      var(--ink-2);
  --sev-ok:       var(--pos);

  /* ---- Data series (restrained, ordered by priority) ------------------ */
  --series-1: #4f46e5;
  --series-2: #111111;
  --series-3: #8a8a8a;
  --series-ghost: #d6d6d6;

  /* ---- Type ---------------------------------------------------------- */
  --font-ui: "Inter", "Inter var", -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SF Mono", Consolas,
               "Liberation Mono", Menlo, monospace;

  --fs-micro: 10px;
  --fs-tiny:  11px;
  --fs-xs:    12px;
  --fs-sm:    13px;
  --fs-base:  14px;
  --fs-md:    16px;
  --fs-lg:    19px;
  --fs-xl:    24px;
  --fs-2xl:   30px;

  --lh-tight: 1.12;
  --lh-snug:  1.4;
  --lh-body:  1.6;

  /* Optical tracking. Large numerals need negative tracking or they look
     loose; small uppercase labels need positive tracking to stay legible. */
  --tracking-tight:  -0.028em;
  --tracking-snug:   -0.014em;
  --tracking-label:  0.07em;

  /* A reading measure for prose. Longer than this and the eye loses the
     line on the way back. */
  --measure: 68ch;

  /* ---- Space (4px base) ---------------------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  /* ---- Shell geometry ------------------------------------------------ */
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 60px;
  --header-h: 56px;
  --subheader-h: 48px;
  --radius: 6px;
  --radius-sm: 4px;

  /* ---- Motion -------------------------------------------------------- */
  --dur-fast: 90ms;
  --dur: 160ms;
  --dur-slow: 280ms;
  --ease: cubic-bezier(0.2, 0, 0.13, 1);

  /* ---- Depth (surface contrast first, shadow as a last resort) -------- */
  --shadow-pop: 0 1px 2px rgba(17, 17, 17, 0.06),
                0 8px 24px rgba(17, 17, 17, 0.10);
}

/* Compact density — toggled from Settings. Squeezes the vertical rhythm
   without changing type size, which is what dense BI users actually want. */
:root[data-density="compact"] {
  --s3: 10px; --s4: 12px; --s5: 16px; --s6: 18px; --s7: 24px;
  --header-h: 48px;
  --subheader-h: 42px;
}

/* The console is a daylight instrument by design (see Instructions §3).
   We honour prefers-color-scheme only to the extent of not fighting the
   host: the page paints its own light ground explicitly either way. */
