/* ============================================================
   Alpheya — AI investment assistant · Design tokens
   Source of truth: Alpheya product design system
   (Figma "WIP Testing" node 1139:43416 variable definitions).
   Dark sidebar is a deliberate deviation kept from v1.
   Teal is reserved for AI actions and AI states only.
   ============================================================ */

:root{
  /* Neutrals (Alpheya ink + cool grays) */
  --background:#f7f9fb;
  --surface:#ffffff;
  --foreground:#1f2123;
  --card:#ffffff;
  --muted:#f2f6f9;
  --muted-2:#f8fafb;
  --muted-foreground:#9ea5ac;
  --secondary-foreground:#687178;
  --border:#1f21231a;
  --border-strong:#cfd6db;
  --input:#dee3e7;
  --ring:#1f2123;
  --accent:#e9edf1;

  /* Primary (ink) */
  --primary:#1f2123;
  --primary-hover:#33373b;
  --primary-foreground:#ffffff;
  --secondary:#f2f6f9;

  /* Semantic (Alpheya custom palette) */
  --destructive:#d2031b;
  --destructive-muted:#d2031b1a;
  --positive:#016630;
  --positive-muted:#00a63e33; /* DS custom/success-20 */
  --negative:#d2031b;
  --negative-muted:#d2031b1a;
  --amber:#7b3306;
  --amber-muted:#fef3c6;
  --amber-border:#fee685;
  --info:#193cb8;
  --info-muted:#dbeafe;

  /* Charts — official Dionysus DS categorical palette (brand-aligned; --chart-14 = brand aqua) */
  --chart-1:#6ecef7;
  --chart-2:#f7c06e;
  --chart-3:#a9bc81;
  --chart-4:#6e8df7;
  --chart-5:#fcdf7d;
  --chart-6:#60f5c9;
  --chart-7:#cbbf8b;
  --chart-8:#bc9481;
  --chart-9:#0a8bc2;
  --chart-10:#c1780b;
  --chart-11:#667840;
  --chart-12:#1449ff;
  --chart-13:#c2980a;
  --chart-14:#08d2ae;
  --chart-15:#8d7e3f;
  --chart-16:#855b47;
  --chart-ink:#1f2123;
  --chart-neutral:#dee3e7;
  --chart-other:#78859c; /* cool slate — de-emphasis "Other" tone; ~3.7:1 on white (passes WCAG 1.4.11 non-text 3:1) */

  /* Alpheya AI accent — teal, AI moments only */
  --teal:#08d2ae;
  --teal-ink:#067a66;
  --teal-deep:#0a5c4e;
  --teal-muted:#e6faf6;
  --teal-border:#b8efe3;

  /* Sidebar (dark — kept from v1 by design) */
  --sidebar:#101214;
  --sidebar-fg:#e6e7e8;
  --sidebar-muted:#84888c;
  --sidebar-active:#1d2023;
  --sidebar-border:rgba(255,255,255,.07);

  /* Shape (Figma: radius 12, rounded-button 8, rounded 4) */
  --radius:12px;
  --radius-sm:8px;
  --radius-tag:4px;

  /* Elevation (Figma shadow/2xs + shadow/md) */
  --shadow-xs:0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm:0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-md:0 4px 6px -1px rgb(0 0 0 / .05), 0 2px 4px -2px rgb(0 0 0 / .05);
  --shadow-lg:0 20px 40px -12px rgb(31 33 35 / .18);
  --shadow-pop:0 10px 30px -8px rgb(31 33 35 / .16), 0 2px 8px -2px rgb(31 33 35 / .08);

  /* Type — Inter everywhere, tabular figures for numbers */
  --font-ui:'Inter',-apple-system,'Segoe UI',sans-serif;
  --font-num:'Inter',-apple-system,sans-serif;

  /* Motion */
  --ease-out:cubic-bezier(.16,1,.3,1);
  --dur:180ms;
}

*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%;background:var(--background)}
[hidden]{display:none!important}

/* Smooth cross-document navigation (Chrome) — removes the hard page-to-page cut */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.18s}
body{
  font-family:var(--font-ui);
  font-size:14px;
  color:var(--foreground);
  background:var(--background);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button{font-family:inherit;font-size:inherit;cursor:pointer;background:none;border:none;color:inherit}
input,textarea,select{font-family:inherit;font-size:inherit;color:inherit}
/* Placeholders are readable text — AA requires ≥4.5:1, which --muted-foreground fails */
::placeholder{color:var(--secondary-foreground);opacity:1}
a{color:inherit}
svg{flex:none}
strong{font-weight:600}

/* Financial figures — Inter with tabular numerals (per Alpheya product type) */
.num{font-variant-numeric:tabular-nums;letter-spacing:0;font-weight:500}
.num.up{color:var(--positive)}
.num.down{color:var(--negative)}

:focus-visible{outline:2px solid var(--ring);outline-offset:2px;border-radius:4px}
::selection{background:var(--info-muted)}

::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#dde2e6;border-radius:8px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#cbd2d7}   /* hover changes colour only — never the width */
::-webkit-scrollbar-track{background:transparent}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important}
}
