/* Design tokens. Light is the default; [data-theme=dark] is set on <html> by js/theme-boot.js and js/theme.js
   (Settings > Appearance: System, Light or Dark). Views use these variables, never raw colours.
   Every text colour below is at least 4.5:1 on --bg and on --surface. Colour marks meaning only: a gain or a
   loss always carries a sign or a word as well.
   An element marked data-theme="light" keeps the light tokens inside it in the dark theme too (the front page's
   example cards, white on navy in both). */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F6F7F9;          /* cards on the page, table stripes, chip backgrounds */
  --surface-2: #EEF0F3;        /* hover and pressed */
  --border: #EEF0F3;           /* hairlines between rows and around cards */
  --border-strong: #D5D9E0;    /* buttons, segmented controls */
  --control-border: #8A93A3;   /* inputs: 3:1 against the page */
  --text: #0B1220;
  --muted: #5B6475;
  --gain: #067A35;  --gain-bg: #E7F6EC;   /* gains, buy */
  --loss: #C0281C;  --loss-bg: #FDECEA;   /* losses, sell, avoid, errors */
  --watch: #8A5300; --watch-bg: #FFF4E0;  /* watch, warnings, provisional */
  --info: #1F4FB8;  --info-bg: #EAF0FD;   /* links, neutral notices */
  --primary: #0B1220;          /* primary button */
  --on-primary: #FFFFFF;
  --focus: #1F4FB8;            /* focus ring */
  --overlay: rgba(11, 18, 32, .45);
  --tip-bg: #0B1220;  --tip-text: #FFFFFF;
  --chart-line: #0B1220;  --chart-fill: rgba(11, 18, 32, .06);  --chart-grid: #EEF0F3;
  --series-1: #2A78D6;  --series-2: #C2530F;                     /* two-line charts (holdings vs SPY) */

  --font: Inter, -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 12px;  --text-sm: 13.5px;  --text-base: 15px;  --text-md: 16px;
  --text-lg: 18px;  --text-xl: 22px;   --text-2xl: 30px;
  --weight-num: 600;
  --radius: 12px;  --radius-sm: 8px;  --radius-pill: 999px;
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;  --space-4: 16px;  --space-5: 24px;  --space-6: 32px;  --space-7: 48px;
  --shadow-pop: 0 8px 28px rgba(11, 18, 32, .14);   /* dialogs, menus and toasts only */
  --page-max: 1120px;
  --gutter: 16px;
  --tap: 44px;                 /* minimum touch target */
  --top-h: 60px;
  --tabbar-h: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1117;
  --surface: #161B23;
  --surface-2: #1F2630;
  --border: #252C37;
  --border-strong: #3A4352;
  --control-border: #7D8798;
  --text: #E9EDF3;
  --muted: #A3ADBD;
  --gain: #5BD38A;  --gain-bg: #10301F;
  --loss: #FF8F84;  --loss-bg: #3A1714;
  --watch: #F2B65A; --watch-bg: #33240C;
  --info: #8DB4FF;  --info-bg: #15233D;
  --primary: #E9EDF3;
  --on-primary: #0B1220;
  --focus: #8DB4FF;
  --overlay: rgba(0, 0, 0, .6);
  --tip-bg: #E9EDF3;  --tip-text: #0B1220;
  --chart-line: #E9EDF3;  --chart-fill: rgba(233, 237, 243, .07);  --chart-grid: #252C37;
  --series-1: #5D9CEC;  --series-2: #F08A4B;
  --shadow-pop: 0 8px 28px rgba(0, 0, 0, .5);
}

/* The front page (#/welcome) is navy in the light and the dark theme alike, in the logo's palette: each band a
   little deeper than the one above. data-front on <html> marks it, set by js/theme-boot.js before the first paint
   and by app.js while the page is open, so the shell (base.css) is navy before the view loads (css/views/auth.css).
   Every text colour is at least 8:1 on the bands. */
:root[data-front] {
  color-scheme: dark;
  --fp-band-0: #0D2F40;              /* the surface: the hero and 0 ft */
  --fp-band-1: #0B2938;              /* 6 ft */
  --fp-band-2: #092331;              /* 12 ft, the week and the end */
  --fp-text: #F6F1E7;                /* cream */
  --fp-muted: #C9D6DD;
  --fp-faint: #B7C6CE;
  --fp-gold: #EAC568;                /* the markers and the primary button */
  --fp-line: rgba(246, 241, 231, .3);
  --fp-tick: rgba(246, 241, 231, .45);
  --fp-rule: rgba(246, 241, 231, .16);
  --fp-edge: rgba(246, 241, 231, .5); /* the second button's border: 4.2:1 */
  --fp-focus: #8DB4FF;
}
