/* Big-Money — the Wallet design tokens: the one shared definition of the Wallet style (colours, type, shape, shadow,
   motion) for every screen that uses it. Big-Money Simple (/m) links this file before its own stylesheet, /m/m.css.
   Light theme by default; the dark theme follows the device setting, or the person's choice in Display (data-theme on
   <html>, set by /m/app.js), and the spring curves upgrade where linear() easing is supported. Text size: data-text on
   <html> sets --text-scale (body text) and --display-scale (headings); /m/m.css multiplies its font sizes by them.
   Layout tokens (--col, --pad, the bar heights) describe the phone column; wider layouts can override them in media
   queries here without touching any component.
   Strict CSP: a same-origin stylesheet; fonts are self-hosted under /fonts. */

/* ── Fonts (self-hosted) ─────────────────────────────────────────────── */
@font-face { font-family: 'BM Sans'; src: url('/fonts/plus-jakarta-sans-latin-variable.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'BM Serif'; src: url('/fonts/instrument-serif-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'BM Serif'; src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'BM Mono'; src: url('/fonts/jetbrains-mono-latin-variable.woff2') format('woff2'); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;
  --font-ui: 'BM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'BM Serif', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'BM Mono', ui-monospace, Menlo, monospace;

  --col: 460px;
  --pad: 16px;
  --r: 20px;
  --r-lg: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-h: 54px;
  --tab-h: 66px;
  --tab-gap: max(10px, var(--safe-bottom));

  /* Brand */
  --forest-950: #06130D; --forest-900: #0A1F15; --forest-800: #0E2A1E; --forest-700: #133627; --forest-600: #17402F; --forest-500: #1F5A41;
  --gold-100: #FBF0CF; --gold-300: #E3C88C; --gold-500: #C29C57; --gold-700: #93713A;

  /* Light theme: warm paper */
  --bg: #F4F1EA;
  --bg-outside: #EAE6DC;
  --surface: #FFFFFF;
  --sheet: #F2EFE7;
  --ink: #0E1A13;
  --ink-2: #3B4842;
  --ink-3: #59655E;
  --line: rgba(14, 26, 19, .08);
  --line-2: rgba(14, 26, 19, .14);
  --press: rgba(14, 26, 19, .045);
  --track: #E8EBE5;
  --accent: #17402F;
  --accent-on: #FBF0CF;
  --link: #1B5E43;
  --focus: #9A6B1F;
  --bar-bg: rgba(250, 248, 243, .97);
  --bar-line: rgba(14, 26, 19, .07);
  --tab-pill: #E3EBE4;
  --more-bg: #E6EDE7;
  --more-ink: #17402F;
  --chip-bg: #ECEDE8;
  --grabber: rgba(14, 26, 19, .2);
  --close-bg: rgba(14, 26, 19, .07);
  --backdrop: rgba(4, 12, 8, .34);
  --sk-1: #E8E4DA;
  --sk-2: #F3F0E9;

  --good: #1E8A57; --good-bg: #E1F3E8; --good-ink: #0E5A36;
  --warn: #C27A12; --warn-bg: #FCEFD2; --warn-ink: #7A4600;
  --bad: #C9473B; --bad-bg: #FCE5E2; --bad-ink: #9F2A21;
  --info: #2B74AA; --info-bg: #E3EEF8; --info-ink: #1A5482;
  --neutral: #8A958E; --neutral-bg: #ECEDE8; --neutral-ink: #45514A;

  /* categorical palette for composition bars on light surfaces */
  --seg-good: #17402F; --seg-info: #3E9E6F; --seg-warn: #C9A35C; --seg-neutral: #A9BDB1; --seg-bad: #B8693A;

  --sh-card: 0 1px 1px rgba(16, 34, 24, .04), 0 2px 6px rgba(16, 34, 24, .05), 0 12px 28px -14px rgba(16, 34, 24, .18);
  --sh-float: 0 1px 2px rgba(16, 34, 24, .06), 0 12px 32px -10px rgba(16, 34, 24, .28);
  --sh-wallet: 0 2px 4px rgba(6, 19, 13, .14), 0 16px 30px -12px rgba(6, 19, 13, .5), 0 34px 60px -30px rgba(6, 19, 13, .55);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.3, .64, 1);
  --spring-pop: cubic-bezier(.34, 1.56, .64, 1);
}
/* Real damped-spring curves (zeta .72 and .58) where linear() easing is supported. */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0301, 0.1057, 0.2082, 0.3234, 0.4408, 0.553, 0.6553, 0.7451, 0.8211, 0.8834, 0.9328, 0.9705, 0.998, 1.017, 1.0291, 1.0357, 1.0383, 1.0378, 1.0354, 1.0317, 1.0274, 1.0229, 1.0185, 1.0144, 1.0108, 1.0077, 1.0052, 1.0031, 1.0015, 1.0004, 0.9995, 0.999, 0.9987, 1);
    --spring-pop: linear(0, 0.0462, 0.161, 0.3127, 0.4766, 0.6346, 0.7749, 0.8907, 0.9797, 1.0426, 1.082, 1.1019, 1.1067, 1.1007, 1.0879, 1.0714, 1.0539, 1.0371, 1.0224, 1.0104, 1.0012, 0.9948, 0.9909, 0.989, 0.9886, 0.9894, 0.9908, 0.9926, 0.9945, 0.9962, 0.9978, 0.999, 1, 1.0006, 1);
  }
}
/* Dark theme: the device's setting, unless the person picked Light in Display (data-theme="light" on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07120E;
    --bg-outside: #040B08;
    --surface: #0F1D16;
    --sheet: #0B1712;
    --ink: #F4F1EA;
    --ink-2: #C6CFC9;
    --ink-3: #909C95;
    --line: rgba(244, 241, 234, .08);
    --line-2: rgba(244, 241, 234, .15);
    --press: rgba(244, 241, 234, .06);
    --track: rgba(244, 241, 234, .1);
    --accent: #E3C88C;
    --accent-on: #0E2A1E;
    --link: #E3C88C;
    --focus: #E3C88C;
    --bar-bg: rgba(13, 26, 20, .97);
    --bar-line: rgba(227, 200, 140, .14);
    --tab-pill: rgba(227, 200, 140, .15);
    --more-bg: rgba(227, 200, 140, .13);
    --more-ink: #EBD6A4;
    --chip-bg: rgba(244, 241, 234, .09);
    --grabber: rgba(244, 241, 234, .26);
    --close-bg: rgba(244, 241, 234, .1);
    --backdrop: rgba(0, 0, 0, .55);
    --sk-1: #0F1D16;
    --sk-2: #182A21;

    --good: #5FD39A; --good-bg: rgba(95, 211, 154, .14); --good-ink: #7FE0B0;
    --warn: #F2C05C; --warn-bg: rgba(242, 192, 92, .14); --warn-ink: #F6CF7D;
    --bad: #FF8A7E; --bad-bg: rgba(255, 138, 126, .14); --bad-ink: #FFA59B;
    --info: #79BDF2; --info-bg: rgba(121, 189, 242, .14); --info-ink: #96CCF6;
    --neutral: #8E9A93; --neutral-bg: rgba(255, 255, 255, .08); --neutral-ink: #C2CBC5;

    --seg-good: #E3C88C; --seg-info: #5FC08F; --seg-warn: #F3EAD2; --seg-neutral: #7FA391; --seg-bad: #D08B5B;

    --sh-card: 0 0 0 1px rgba(227, 200, 140, .13), 0 12px 30px -18px rgba(0, 0, 0, .9);
    --sh-float: 0 0 0 1px rgba(227, 200, 140, .12), 0 16px 40px -12px rgba(0, 0, 0, .85);
    --sh-wallet: 0 0 0 1px rgba(227, 200, 140, .2), 0 24px 50px -24px rgba(0, 0, 0, .9), 0 0 70px -34px rgba(227, 200, 140, .32);
  }
}
/* The same dark palette when the person picked Dark (data-theme="dark"), whatever the device says. The suite checks the
   two copies stay identical. */
:root[data-theme="dark"] {
  --bg: #07120E;
  --bg-outside: #040B08;
  --surface: #0F1D16;
  --sheet: #0B1712;
  --ink: #F4F1EA;
  --ink-2: #C6CFC9;
  --ink-3: #909C95;
  --line: rgba(244, 241, 234, .08);
  --line-2: rgba(244, 241, 234, .15);
  --press: rgba(244, 241, 234, .06);
  --track: rgba(244, 241, 234, .1);
  --accent: #E3C88C;
  --accent-on: #0E2A1E;
  --link: #E3C88C;
  --focus: #E3C88C;
  --bar-bg: rgba(13, 26, 20, .97);
  --bar-line: rgba(227, 200, 140, .14);
  --tab-pill: rgba(227, 200, 140, .15);
  --more-bg: rgba(227, 200, 140, .13);
  --more-ink: #EBD6A4;
  --chip-bg: rgba(244, 241, 234, .09);
  --grabber: rgba(244, 241, 234, .26);
  --close-bg: rgba(244, 241, 234, .1);
  --backdrop: rgba(0, 0, 0, .55);
  --sk-1: #0F1D16;
  --sk-2: #182A21;

  --good: #5FD39A; --good-bg: rgba(95, 211, 154, .14); --good-ink: #7FE0B0;
  --warn: #F2C05C; --warn-bg: rgba(242, 192, 92, .14); --warn-ink: #F6CF7D;
  --bad: #FF8A7E; --bad-bg: rgba(255, 138, 126, .14); --bad-ink: #FFA59B;
  --info: #79BDF2; --info-bg: rgba(121, 189, 242, .14); --info-ink: #96CCF6;
  --neutral: #8E9A93; --neutral-bg: rgba(255, 255, 255, .08); --neutral-ink: #C2CBC5;

  --seg-good: #E3C88C; --seg-info: #5FC08F; --seg-warn: #F3EAD2; --seg-neutral: #7FA391; --seg-bad: #D08B5B;

  --sh-card: 0 0 0 1px rgba(227, 200, 140, .13), 0 12px 30px -18px rgba(0, 0, 0, .9);
  --sh-float: 0 0 0 1px rgba(227, 200, 140, .12), 0 16px 40px -12px rgba(0, 0, 0, .85);
  --sh-wallet: 0 0 0 1px rgba(227, 200, 140, .2), 0 24px 50px -24px rgba(0, 0, 0, .9), 0 0 70px -34px rgba(227, 200, 140, .32);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ── Text size (Display: data-text on <html>) ──────────────────────────── */
/* Body text up to 20px scales fully, headings from 21px to 27px half as much; display figures of 28px and up and the
   labels drawn inside charts keep their size. */
:root { --text-scale: 1; --display-scale: 1; }
:root[data-text="large"] { --text-scale: 1.12; --display-scale: 1.06; }
:root[data-text="larger"] { --text-scale: 1.25; --display-scale: 1.12; }
