/* ============================================================
   TradingTrainer — Design tokens ("Desk" palette, D-038/T-080a)
   Ported from the Claude Design project "TradingTrainer Design
   System" (tokens/colors.css, tokens/typography.css,
   tokens/spacing.css) — values only, no invented hexes.
   Linked in App.razor BEFORE bootstrap/app.css so it can remap
   Bootstrap's --bs-* variables app-wide.
   ============================================================ */
:root {
  /* ================= Color — "Desk" palette ================= */

  /* ---- Brand: graphite "ink" structure ---- */
  --ink-900: #0e1620;   /* structural anchor: header, sidebar, chart surface */
  --ink-800: #131c28;
  --ink-700: #1f2937;

  /* Back-compat names (kept so components/cards follow automatically) */
  --brand-navy-900: var(--ink-900);
  --brand-navy-800: var(--ink-800);
  --brand-indigo-700: var(--ink-700);
  --brand-purple-900: #0b1119;
  --brand-nav-active: var(--blue-600);
  --brand-fab: var(--ink-900);
  --brand-sidebar-gradient: linear-gradient(180deg, #0e1620 0%, #0b1119 100%);

  /* ---- Signal Blue: the single P&L-neutral accent ---- */
  --blue-600: #2d6ff0;
  --blue-700: #1f5bd4;
  --blue-800: #1a4cb3;
  --blue-050: #eaf1fe;

  /* ---- Market UP / bullish / long / "HIT" ---- */
  --green-700: #178a67;
  --green-600: #1fa67e;
  --green-500: #4fb89a;
  --green-050: #e6f5ef;

  /* ---- Caution / attention: amber ---- */
  --amber-500: #e2a12c;
  --amber-600: #c8881a;
  --amber-050: #fbf1db;
  --amber-100: #f1dca4;

  /* ---- Market DOWN / bearish / short / danger / "MISS" ---- */
  --red-600: #e5564e;
  --red-700: #cc4640;
  --red-050: #fbe4e2;
  --red-100: #f3bbb7;

  /* ---- Neutral gray scale (cool, ink-tinted) ---- */
  --gray-900: #0e1620;
  --gray-800: #2a323c;
  --gray-700: #44505e;
  --gray-600: #5b6675;
  --gray-500: #8a93a0;
  --gray-400: #c2c9d2;
  --gray-300: #e2e6ec;
  --gray-200: #eceff3;
  --gray-100: #f4f6f9;
  --white: #ffffff;

  /* ---- Chart / trading semantics ---- */
  --chart-surface: #0e1620;
  --candle-up: #1fa67e;
  --candle-down: #e5564e;
  --chart-axis: #8a93a0;
  --chart-grid: rgba(255, 255, 255, 0.06);

  --zone-support-fill: rgba(31, 166, 126, 0.20);
  --zone-support-line: #1fa67e;
  --zone-resistance-fill: rgba(229, 86, 78, 0.18);
  --zone-resistance-line: #e5564e;
  --zone-corridor-line: #1fa67e;

  /* ---- Trading terminal chrome ---- */
  --term-rail: #ffffff;
  --term-border: #e2e6ec;
  --term-icon: #5b6675;
  --term-icon-active: #2d6ff0;
  --vol-up: rgba(31, 166, 126, 0.42);
  --vol-down: rgba(229, 86, 78, 0.40);
  --quote-sell: var(--red-600);
  --quote-buy: var(--blue-600);
  --quote-up: var(--candle-up);
  --quote-down: var(--candle-down);
  --crosshair: #5b6675;

  /* ---- Semantic aliases ---- */
  --text-heading: var(--gray-900);
  --text-body: var(--gray-800);
  --text-muted: var(--gray-600);
  --text-on-brand: var(--white);
  --text-on-accent: var(--white);
  --text-link: var(--blue-600);

  --surface-page: var(--white);
  --surface-subtle: var(--gray-100);
  --surface-card: var(--white);
  --surface-sidebar: var(--brand-sidebar-gradient);
  --surface-topbar: var(--gray-100);
  --surface-overlay: rgba(8, 12, 20, 0.58);

  --border-default: var(--gray-300);
  --border-strong: var(--gray-400);
  --border-focus: var(--blue-600);

  --action-primary: var(--blue-600);
  --action-secondary: var(--ink-900);
  --action-success: var(--green-600);
  --action-check: var(--green-500);
  --action-warning: var(--amber-500);
  --action-danger: var(--red-600);

  --focus-ring: 0 0 0 0.2rem rgba(45, 111, 240, 0.32);

  /* ================= Typography ================= */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --font-numeric: var(--font-mono);

  --text-display: 3rem;
  --text-h1: 2.25rem;
  --text-h2: 1.5rem;
  --text-h3: 1.25rem;
  --text-lead: 1.25rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;

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

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.06em;

  /* ================= Spacing / radius / shadow / layout ================= */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-pill: 50rem;

  --border-width: 1px;
  --border-width-thick: 2px;

  --shadow-none: none;
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.02);
  --shadow-raised: 0 1px 2px rgba(16, 24, 40, 0.06),
                   0 1px 3px rgba(16, 24, 40, 0.10);
  --shadow-panel: 0 1px 3px rgba(16, 24, 40, 0.08),
                  0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-modal: 0 20px 60px rgba(8, 12, 28, 0.45);
  --shadow-fab: 0 6px 18px rgba(13, 27, 62, 0.45);

  --sidebar-width: 224px;
  --topbar-height: 56px;
  --content-max: 1080px;

  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration: 180ms;

  /* ================= Bootstrap remap (T-080a) =================
     App bundles Bootstrap 5.3.3 and defines no tokens today; this
     remap re-skins every raw btn/card/badge/alert/progress app-wide
     from this one file. Only Bootstrap's OWN --bs-* variables are
     touched here — nothing else is clobbered. */
  --bs-primary: var(--blue-600);
  --bs-primary-rgb: 45, 111, 240;
  --bs-secondary: var(--ink-900);
  --bs-secondary-rgb: 14, 22, 32;
  --bs-success: var(--green-600);
  --bs-success-rgb: 31, 166, 126;
  --bs-warning: var(--amber-500);
  --bs-warning-rgb: 226, 161, 44;
  --bs-danger: var(--red-600);
  --bs-danger-rgb: 229, 86, 78;

  --bs-body-bg: var(--white);
  --bs-body-color: var(--gray-800);
  --bs-border-color: #dee2e6;
  --bs-border-radius: var(--radius);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-border-radius-pill: var(--radius-pill);
  --bs-link-color: var(--blue-600);
  --bs-link-hover-color: var(--blue-700);
  --bs-focus-ring-color: rgba(45, 111, 240, 0.32);

  /* ================= Chart CSS vars (chart-canvas.js seam) =================
     Read via chart-canvas.js's _css()/_resolveColor() seam (T-068) with
     JS fallbacks — defining values here recolors the chart with zero
     test risk (no test asserts a color string; the locks are fillRect
     COUNT + geometry). --ink/--panel/--panel2/--line/--accent/
     --chart-surface are consumed by later slices (T-080c/d). */
  --bull: var(--candle-up);
  --bear: var(--candle-down);
  --support: var(--zone-support-line);
  --resist: var(--zone-resistance-line);
  --muted: var(--chart-axis);
  --ink: var(--ink-900);
  --panel: var(--ink-800);
  --panel2: var(--ink-700);
  --line: var(--chart-grid);
  --accent: var(--blue-600);

  /* ================= Belt-rank pass-state palette (T-084, D-046; supersedes D-045 X3) =================
     Fixed per-MODULE karate-belt colors (NOT a DAG-position ramp — a belt keeps its color
     regardless of ladder length/order). Each Built module key gets FOUR tokens:
       --belt-{key}-strap      / --belt-{key}-knot       — FULL hue, shown when Passed/TestedOut
       --belt-{key}-strap-soft / --belt-{key}-knot-soft   — LIGHT TINT of the same hue, shown when
                                                             in-progress (Unlocked/InProgress) or Locked
     Saturation encodes pass-state (D-046): earned progress reads at a glance without the old
     grayscale/opacity "Dim" treatment (dropped — Belt's Dim param now stays false at both /learn
     call sites). Reuses existing scale tokens (amber/green/blue/gray) where they fit; orange and
     brown have no existing scale, so their hex lives here (this token layer), per D-046. The
     breakout_followthrough "Black" belt is achromatic — its "soft" tint is necessarily a light gray
     (there is no non-gray light tint of black), unlike the other five hues.
     Palette (DAG order): daily_regime=Yellow · trend_range=Orange · sr=Green · transitions=Blue ·
     breakout_reversal=Brown · breakout_followthrough=Black. Consumed by the belt ladder (Learn.razor
     spine + card + card-strip) via Learn.razor.cs's BeltStrapVar/BeltKnotVar helpers, keyed on
     ModuleKey + IsEarned(State). Additive named tokens; extend as new-content epics flip Built. */

  /* ---- Orange + Brown: no existing scale token — hex added at this layer (D-046) ---- */
  --orange-600: #ef7f22;
  --orange-700: #cc6512;
  --orange-tint-050: #fce8d3;
  --orange-tint-100: #f7d1a1;
  --brown-600: #8a5a2b;
  --brown-700: #5e3c18;
  --brown-tint-050: #e8d9c8;
  --brown-tint-100: #d9c2a5;

  --belt-daily_regime-strap:            var(--amber-500);  /* Yellow */
  --belt-daily_regime-knot:             var(--amber-600);
  --belt-daily_regime-strap-soft:       var(--amber-050);
  --belt-daily_regime-knot-soft:        var(--amber-100);

  --belt-trend_range-strap:             var(--orange-600); /* Orange */
  --belt-trend_range-knot:              var(--orange-700);
  --belt-trend_range-strap-soft:        var(--orange-tint-050);
  --belt-trend_range-knot-soft:         var(--orange-tint-100);

  --belt-sr-strap:                      var(--green-600);  /* Green */
  --belt-sr-knot:                       var(--green-700);
  --belt-sr-strap-soft:                 var(--green-050);
  --belt-sr-knot-soft:                  #cbe9dc;

  --belt-transitions-strap:             var(--blue-600);   /* Blue */
  --belt-transitions-knot:              var(--blue-800);
  --belt-transitions-strap-soft:        var(--blue-050);
  --belt-transitions-knot-soft:         #c9dbfb;

  --belt-breakout_reversal-strap:       var(--brown-600);  /* Brown */
  --belt-breakout_reversal-knot:        var(--brown-700);
  --belt-breakout_reversal-strap-soft:  var(--brown-tint-050);
  --belt-breakout_reversal-knot-soft:   var(--brown-tint-100);

  --belt-breakout_followthrough-strap:      var(--gray-900); /* Black */
  --belt-breakout_followthrough-knot:       #000000;
  --belt-breakout_followthrough-strap-soft: var(--gray-300);
  --belt-breakout_followthrough-knot-soft:  var(--gray-400);
}
