/* ═══ ADE ALGO — CENTRAL TYPOGRAPHY SYSTEM ═══════════════════════════════════════════════════
   One authoritative type system for the whole LW terminal. Native-system-first UI font (feels
   like a desktop trading app, not a downloaded-font website), a monospace ONLY for numeric
   readouts, and Cormorant reserved for the brand mark. Kills the forced Trebuchet default and
   the global tabular-nums rule. Loaded from terminal.html <head>.  (Commit 1/5 of the rebuild.)
   ─────────────────────────────────────────────────────────────────────────────────────────── */

:root {
  /* families */
  --font-ui:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-data:  "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --font-brand: "Cormorant Garamond", Georgia, serif;

  /* type scale (no essential UI text below 10px) */
  --text-2xs: 10px;
  --text-xs:  11px;
  --text-sm:  12px;
  --text-md:  13px;
  --text-lg:  14px;
  --text-xl:  16px;
  --text-2xl: 20px;
  --text-price: 22px;

  /* line-height */
  --leading-tight:    1.15;
  --leading-compact:  1.3;
  --leading-normal:   1.45;
  --leading-readable: 1.55;

  /* weight */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* tracking (restrained — wide tracking on tiny caps is the #1 "AI dashboard" tell) */
  --tracking-tight:  -0.015em;
  --tracking-normal: 0;
  --tracking-label:  0.015em;
  --tracking-caps:   0.04em;

  /* remap the legacy variable the whole app inherits → native system font */
  --ui-font: var(--font-ui);
}

/* Numeric typography — applied ONLY to numbers, never to words/labels/buttons.
   (Replaces the removed `body *{ font-variant-numeric: tabular-nums }`.) */
.num, .price, .qty, .percent, .pct, .timestamp,
.axis-value, .dom-value, .table-number, .data-value {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
/* Compatibility: keep existing numeric-bearing elements aligned during migration without
   forcing tabular figures onto prose. Narrow, class/id-name based — not `body *`. */
td, .val, .kv-val,
[class*="price"], [class*="-num"], [class*="num-"],
[class*="delta"], [class*="qty"], [class*="pct"], [class*="percent"], [class*="value"] {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Data font for genuine fixed-width numeric readouts (prices, sizes, times, R, machine ids). */
.data-value, .dom-price, .dom-size, .tape-time, .tape-price, .position-price, .mono {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ── Semantic typography utilities (JS-generated panels use these instead of inline font CSS) ── */
.t-ui        { font-family: var(--font-ui); }
.t-data      { font-family: var(--font-data); font-variant-numeric: tabular-nums lining-nums; }
.t-brand     { font-family: var(--font-brand); }

.panel-title { font-family: var(--font-ui); font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-normal); text-transform: none; }
.section-label { font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-medium); letter-spacing: var(--tracking-label); }
.modal-title { font-family: var(--font-ui); font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-compact); letter-spacing: var(--tracking-normal); }
.ui-btn, .ui-menu-item { font-family: var(--font-ui); font-size: var(--text-sm); font-weight: var(--weight-medium); letter-spacing: var(--tracking-normal); }
.ui-helper   { font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--mut2, #7c7a86); }
.ui-shortcut { font-family: var(--font-data); font-size: var(--text-2xs); font-weight: var(--weight-regular); }
.value-major { font-family: var(--font-data); font-size: var(--text-2xl); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums lining-nums; }
.status-code { font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }

/* symbol codes / financial abbreviations keep uppercase + light tracking */
.sym-code { font-family: var(--font-ui); letter-spacing: 0.02em; text-transform: uppercase; }

/* input placeholders stay legible on near-black */
input::placeholder, textarea::placeholder { color: var(--mut2, #7c7a86); opacity: 1; }
