/* tokens.css — the ONLY place for raw colours, sizes and spacing.
   Every other CSS file uses these names (var(--...)), so restyling = editing this file.
   Names are meaning-based (profit, loss, surface), not look-based, so they map 1:1 to Figma variables. */

:root {
  /* ---- Colour ---- */
  --color-bg: #14161a;             /* page background, dark graphite */
  --color-surface: #1d2025;        /* cards, panels */
  --color-surface-raised: #272b32; /* buttons, selected states */
  --color-border: #343944;         /* quiet dividers */
  --color-field-border: #737b8a;   /* edges of inputs and option tiles: at least 3:1 against every background */
  --color-text: #f2f3f5;
  --color-text-muted: #a3a9b4;
  --color-accent: #ffb020;         /* amber: main numbers, active items */
  --color-on-accent: #14161a;      /* text on top of the accent colour */
  --color-profit: #4ade80;         /* green */
  --color-loss: #f87171;           /* red */
  --color-warning: #fbbf24;
  --color-focus: #7cc4ff;
  --color-backdrop: rgba(0, 0, 0, 0.6); /* dim layer behind dialogs */

  /* ---- Typography ---- */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-s: 0.875rem;
  --text-m: 1rem;       /* never below 1rem for inputs (stops Safari zooming in) */
  --text-l: 1.25rem;
  --text-xl: 1.75rem;
  --text-odometer: 2rem;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --leading-tight: 1.2;
  --leading-normal: 1.45;

  /* ---- Spacing (4px steps) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;

  /* ---- Shape and size ---- */
  --radius-s: 0.375rem;
  --radius-m: 0.625rem;
  --radius-l: 1rem;
  --border-width: 1px;
  --focus-width: 3px;
  --tap-min: 2.75rem;        /* 44px: smallest comfortable touch target */
  --content-max: 30rem;      /* the app column; centred on wide screens */
  --tabbar-height: 3.5rem;
  --bar-height: 0.5rem;      /* thin share bars */

  /* ---- iPhone safe areas (notch, home bar) ---- */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* ---- Motion ---- */
  --duration-fast: 0.15s;
  --ease: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0s; }
}
