/* NestMint v149.314 — authoritative design tokens and global foundation. */
:root {
  color-scheme: light;

  /* Brand and semantic colors */
  --brand-green: #1d9f5f;
  --brand-green-hover: #16864f;
  --brand-green-soft: #e7f6ee;
  --brand-navy: #0d2a5b;
  --action-blue: #0664e8;
  --action-blue-hover: #0555c7;
  --action-blue-soft: #eaf3ff;
  --status-positive: #0ea45c;
  --status-positive-soft: #e7f8ef;
  --status-warning: #d96f16;
  --status-warning-soft: #fff2e6;
  --status-danger: #c73535;
  --status-negative: var(--status-danger);
  --status-danger-soft: #fff0f0;
  --chart-taxable: #063985;
  --chart-traditional: #08ad5f;
  --chart-roth: #6735d7;
  --chart-other: #f07811;
  --chart-cash: #2e8bd8;
  /* v149.321 — Chart.js palette read by getChartColors() (app.js). These
     were never defined after the v149.314 token rebuild; getPropertyValue
     returned '' and hexAlpha('') rendered every chart series translucent
     BLACK. Values reuse the app's semantic tokens so charts match the
     design language: 1=action blue (primary series/withdrawals), 2=teal
     (secondary income, distinct from blue/purple/amber in the stacked
     income chart), 3=positive green, 4=warning amber (federal tax),
     5=purple (state tax/pension, sparkline family), 6=danger red. */
  --chart-1: #0664e8;
  --chart-2: #0d9488;
  --chart-3: #0ea45c;
  --chart-4: #d96f16;
  --chart-5: #6940dd;
  --chart-6: #c73535;

  /* Compatibility aliases consumed throughout the existing app */
  --color-bg: #f6f9fd;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-surface-2: #f3f6fa;
  --color-surface-raised: #ffffff;
  --color-surface-offset: #f1f5f9;
  --color-surface-hover: #edf4fd;
  --color-primary: var(--action-blue);
  --color-primary-hover: var(--action-blue-hover);
  --color-primary-light: #4f93f3;
  --color-primary-bg: var(--action-blue-soft);
  --color-primary-highlight: var(--action-blue-soft);
  --color-secondary: #7242dd;
  --color-accent: var(--brand-green);
  --color-success: var(--status-positive);
  --color-success-highlight: var(--status-positive-soft);
  --color-warning: var(--status-warning);
  --color-error: var(--status-danger);
  --color-danger: var(--status-danger);
  --color-error-highlight: var(--status-danger-soft);
  --color-text: var(--brand-navy);
  --color-text-default: var(--brand-navy);
  --color-text-primary: var(--brand-navy);
  --color-text-secondary: #536b8b;
  --color-text-tertiary: #71839b;
  --color-text-muted: #607797;
  --color-text-faint: #93a2b5;
  --color-text-inverse: #ffffff;
  --text-secondary: var(--color-text-secondary);
  --color-border-faint: #edf1f6;
  --color-border: #dfe7f1;
  --color-border-strong: #c6d3e2;
  --color-divider: #e4eaf2;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --text-2xs: 0.6875rem;
  --text-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.14vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.04rem + 0.35vw, 1.25rem);
  --text-xl: clamp(1.5rem, 1.28rem + 0.8vw, 2rem);
  --text-2xl: clamp(2.25rem, 1.75rem + 1.8vw, 3.75rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Shape, depth, layout and motion */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;
  --card-padding: 1rem;
  --shadow-sm: 0 1px 2px rgba(15, 35, 70, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 35, 70, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 35, 70, 0.11);
  --shadow-xl: 0 28px 72px rgba(15, 35, 70, 0.15);
  --content-default: 62rem;
  --content-wide: 90rem;
  --transition-interactive: 160ms cubic-bezier(0.2, 0, 0, 1);
  --focus-ring: 0 0 0 3px rgba(6, 100, 232, 0.23);
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0d1726;
  --color-surface: #142033;
  --color-surface-alt: #101b2c;
  --color-surface-2: #1b2b42;
  --color-surface-raised: #19273c;
  --color-surface-offset: #1a2940;
  --color-surface-hover: #20334e;
  --color-primary: #69a5ff;
  --color-primary-hover: #8bb9ff;
  --color-primary-light: #9dc6ff;
  --color-primary-bg: #172f53;
  --color-primary-highlight: #172f53;
  --color-secondary: #a88cff;
  --color-accent: #4fd38c;
  --color-success: #4fd38c;
  --color-success-highlight: #153b2c;
  --color-warning: #f3a55d;
  --color-error: #ff8585;
  --color-danger: #ff8585;
  --color-error-highlight: #461f25;
  --color-text: #eef4ff;
  --color-text-default: #eef4ff;
  --color-text-primary: #eef4ff;
  --color-text-secondary: #bdcbe0;
  --color-text-tertiary: #97a9c1;
  --color-text-muted: #9eafc7;
  --color-text-faint: #70839e;
  --color-text-inverse: #081423;
  --text-secondary: #bdcbe0;
  --color-border-faint: #1e3048;
  --color-border: #2a3d58;
  --color-border-strong: #405672;
  --color-divider: #263a55;
  /* v149.321 — dark-theme chart palette: brightened variants of the light
     hues (aligned with the dark --color-primary/-success/-warning/-error
     values above) so series stay legible on the dark surfaces. */
  --chart-1: #69a5ff;
  --chart-2: #35c4b5;
  --chart-3: #4fd38c;
  --chart-4: #f3a55d;
  --chart-5: #a88cff;
  --chart-6: #ff8585;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 28px 72px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100dvh; font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: none; box-shadow: var(--focus-ring); }
::selection { background: rgba(6, 100, 232, 0.2); }
