/* The Algo — brand theme MESH (S20). The skin's corpus-sync.js: one file, served
   root-absolute at /lib/theme.css, loaded by every page. Edit here → push once →
   every page re-skins. Anti-drift by construction.
   SOURCE: lifted verbatim from the brand doc's token export (exportTokens()), NOT
   hand-authored. 38 canonical tokens. accent-hover #3579f7 = the export's value
   (the live :root's #4a7ad4 was the self-disagreement; export wins).
   DEPLOY: lives at apps/lib/ so it serves at /lib/ (apps/. is the Pages web root;
   repo-root lib/ does NOT deploy). Brings the self-hosted fonts (zero CDN) via fonts.css.
   MODES: dark is :root (default); light applies on body.light OR [data-theme="light"]
   so the one mesh serves both the canonical pages and the data-theme tools.
   plumb-vii (#147) · 2026-06-15 · many soundings, one floor */
@import url('/lib/fonts/fonts.css');

:root {
  /* ── brand constants (mode-independent) ── */
  --db-accent:#618FEC; --db-accent-hover:#3579f7;
  --db-navy:#254078; /* Algo Navy — used estate-wide (nav gradient, 6 pages); tokenized per Justin's call, Tare-ii 2026-07-06 */
  --db-accent-bg:rgba(97,143,236,.1); --db-accent-border:rgba(97,143,236,.25);
  --db-up:#10b981; --db-up-bg:rgba(16,185,129,.1);
  --db-down:#ef4444; --db-down-bg:rgba(239,68,68,.1);
  --db-flat:#f59e0b; --db-flat-bg:rgba(245,158,11,.1);
  --db-info:#3b82f6; --db-info-bg:rgba(59,130,246,.1); --db-warn:#f59e0b; --db-warn-bg:rgba(245,158,11,.1);
  --db-error:#dc2626; --db-error-bg:rgba(220,38,38,.1); --db-success:#059669; --db-success-bg:rgba(5,150,105,.1);
  --db-tf-trade:#d3bd58; --db-tf-swing:#294aba; --db-tf-invest:#51b2a7;
  --db-alert-whisper:#b038ab; --db-pool-dark:#6e23c0; --db-pool-lit:#5ca2b1;
  --db-action-buy:#10b981; --db-action-order:#3469c1; --db-action-add:#79ba8c;
  --db-action-trim:#cd5651; --db-action-exit:#771a13; --db-action-expired:#b14434;
  /* sector pills (8) */
  --db-sector-tech:#818cf8; --db-sector-health:#34d399; --db-sector-finance:#60a5fa;
  --db-sector-energy:#fbbf24; --db-sector-consumer:#f472b6; --db-sector-industrial:#a78bfa;
  --db-sector-realestate:#fb923c; --db-sector-utilities:#2dd4bf;
  /* type + radius */
  --db-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --db-mono:'SF Mono','Fira Code','Cascadia Code',Consolas,monospace;
  --db-r-sm:3px; --db-r:6px; --db-r-lg:8px; --db-r-pill:20px;

  /* ── dark mode (default) surfaces ── */
  --m-bg:#080c14; --m-surface:#111827; --m-sAlt:#1a2332; --m-sHov:#1e293b;
  --m-border:#1e2d3d; --m-borderS:#162030;
  --m-text:#e2e8f0; --m-text2:#8899aa; --m-text3:#4a5568; --m-heading:#ffffff;
  --m-rowAlt:#0d1420; --m-cardHov:#182038;
  /* hero band + theme-toggle pills (used by the digest + the shells) — completes the mesh */
  --m-heroB:#0a0e18; --m-heroT:#ffffff; --m-heroSub:rgba(226,232,240,.5);
  --m-heroMark:rgba(97,143,236,.12); --m-heroMarkB:rgba(97,143,236,.3);
  --tg-active-bg:#618FEC; --tg-active-text:#080c14;
  --tg-inactive-bg:transparent; --tg-inactive-text:#4a5568; --tg-inactive-border:#1e2d3d;
  --m-shadow-sm:rgba(15,23,42,.2) 0px 2px 4px;
  --m-shadow-md:rgba(15,23,42,.25) 0px 8px 24px -4px,rgba(0,0,0,.1) 0px 4px 12px -4px;
  --m-shadow-lg:rgba(15,23,42,.3) 0px 20px 40px -8px,rgba(0,0,0,.15) 0px 8px 20px -8px;
}

/* ── light mode (secondary, for print/toggle) — applies on EITHER convention ── */
body.light, [data-theme="light"] {
  --m-bg:#f4f6f9; --m-surface:#ffffff; --m-sAlt:#f0f2f5; --m-sHov:#f8f9fb;
  --m-border:#e2e8f0; --m-borderS:#edf0f4;
  --m-text:#1a2030; --m-text2:#64748b; --m-text3:#94a3b8; --m-heading:#0a1628;
  --m-rowAlt:#f8f9fb; --m-cardHov:#f0f4ff;
  --m-heroB:#0a1628; --m-heroSub:rgba(255,255,255,.55);
  --m-heroMark:rgba(97,143,236,.1); --m-heroMarkB:rgba(97,143,236,.2);
  --tg-active-bg:#0a1628; --tg-active-text:#ffffff;
  --tg-inactive-bg:transparent; --tg-inactive-text:#94a3b8; --tg-inactive-border:#e2e8f0;
  --m-shadow-sm:rgba(15,23,42,.06) 0px 2px 4px;
  --m-shadow-md:rgba(15,23,42,.08) 0px 8px 24px -4px;
  --m-shadow-lg:rgba(15,23,42,.1) 0px 20px 40px -8px;
}
