/* fitsel app — design tokens
   Light is the default theme. Dark applies with <html data-theme="dark">.
   Fonts: Outfit and DM Mono, both SIL Open Font License 1.1. Self-host the woff2 files
   (fonts/ folder, @font-face in your app); if they are missing, the system stacks below take over. */

:root,
[data-theme="light"] {
  /* Ground and surfaces */
  --color-page: #e3e8da;              /* outside the app frame (desktop margins) */
  --color-bg: #f7f9f2;                /* app background */
  --color-surface: #ffffff;           /* cards, inputs, dialogs */
  --color-surface-sunken: #e3e8da;    /* segmented tracks, chart wells, map ground, row hover */

  /* Text */
  --color-text: #1c2118;
  --color-text-secondary: #4a5244;
  --color-text-muted: #687061;        /* labels, captions, axis text */
  --color-text-faint: #8f9886;        /* placeholders, decorative only (not for body copy) */

  /* Lines */
  --color-border: #c4ccb8;
  --color-border-subtle: #e3e8da;
  --color-border-strong: #1c2118;     /* hover and selected outline */

  /* Brand */
  --color-primary: #c8f560;           /* lime: primary buttons, selected tab/segment, week panel */
  --color-on-primary: #1c2118;
  --color-primary-ink: #3f6b00;       /* lime as text/lines on light ground (AA) */
  --color-highlight: #ffc8e4;         /* pink: hover fill, error notice fill, text highlight */
  --color-on-highlight: #1c2118;

  /* Feedback */
  --color-error-bg: #ffc8e4;
  --color-error-text: #1c2118;
  --color-success-bg: #e3e8da;
  --color-success-text: #3f6b00;
  --color-status-connected: #c8f560;
  --color-status-sample: #e3e8da;
  --color-status-disconnected: #ffc8e4;

  /* Data */
  --color-sport-run: #3f6b00;
  --color-sport-ride: #1c2118;
  --color-sport-swim: #8f9886;
  --color-sport-strength: #d6dccb;
  --color-series-1: #3f6b00;          /* compare: reference activity */
  --color-series-2: #1c2118;
  --color-series-3: #8f9886;
  --color-chart-line: #3f6b00;
  --color-chart-area: rgba(200, 245, 96, 0.45);
  --color-chart-grid: #d6dccb;
  --color-chart-axis: #8f9886;
  --color-route: #3f6b00;
  --color-route-casing: #f7f9f2;
  --color-tooltip-bg: #1c2118;
  --color-tooltip-text: #f7f9f2;
  --color-tooltip-link: #c8f560;

  --color-backdrop: rgba(28, 33, 24, 0.45);
  --color-focus: #3f6b00;

  --shadow-tooltip: 0 6px 20px rgba(28, 33, 24, 0.25);
  --shadow-banner: 0 10px 30px rgba(28, 33, 24, 0.25);
  --shadow-dialog: 0 24px 60px rgba(28, 33, 24, 0.25);
  --shadow-frame: 0 30px 60px rgba(28, 33, 24, 0.18);
}

[data-theme="dark"] {
  --color-page: #0b0d0a;
  --color-bg: #141712;
  --color-surface: #1c2118;
  --color-surface-sunken: #262b22;
  --color-text: #f7f9f2;
  --color-text-secondary: #c4ccb8;
  --color-text-muted: #a9b19f;
  --color-text-faint: #6a7362;
  --color-border: #3a4135;
  --color-border-subtle: #262b22;
  --color-border-strong: #f7f9f2;
  --color-primary: #c8f560;
  --color-on-primary: #1c2118;
  --color-primary-ink: #c8f560;
  --color-highlight: #ffc8e4;
  --color-on-highlight: #1c2118;
  --color-error-bg: #ffc8e4;
  --color-error-text: #1c2118;
  --color-success-bg: #262b22;
  --color-success-text: #c8f560;
  --color-status-sample: #3a4135;
  --color-sport-run: #c8f560;
  --color-sport-ride: #f7f9f2;
  --color-sport-swim: #6a7362;
  --color-sport-strength: #3a4135;
  --color-series-1: #c8f560;
  --color-series-2: #f7f9f2;
  --color-series-3: #6a7362;
  --color-chart-line: #c8f560;
  --color-chart-area: rgba(200, 245, 96, 0.16);
  --color-chart-grid: #3a4135;
  --color-chart-axis: #6a7362;
  --color-route: #c8f560;
  --color-route-casing: #141712;
  --color-tooltip-bg: #f7f9f2;
  --color-tooltip-text: #1c2118;
  --color-tooltip-link: #3f6b00;
  --color-backdrop: rgba(0, 0, 0, 0.6);
  --color-focus: #c8f560;
}

:root {
  /* Type */
  --font-body: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --weight-thin: 200;      /* display numbers and page titles */
  --weight-light: 300;     /* body */
  --weight-regular: 400;   /* labels, buttons, emphasis */

  --text-2xs: 11px;   /* axis ticks, chip meta */
  --text-xs: 12px;    /* eyebrows, captions */
  --text-sm: 13px;    /* secondary rows, tables */
  --text-md: 14px;    /* controls, list meta */
  --text-base: 15px;  /* body */
  --text-lg: 17px;    /* card titles */
  --text-xl: 20px;    /* stat values */
  --text-2xl: 24px;   /* panel headings */
  --text-3xl: 32px;   /* page titles */
  --text-4xl: 40px;   /* hero numbers */
  --leading-tight: 1.1;
  --leading-normal: 1.5;
  --tracking-tight: -0.02em;
  --tracking-eyebrow: 0.06em;

  /* Spacing (4px base) */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-2-5: 10px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Radius */
  --radius-xs: 4px;    /* checkboxes */
  --radius-sm: 6px;    /* inline code */
  --radius-md: 9px;    /* segment option inside a track */
  --radius-lg: 12px;   /* cards, inputs, buttons, tracks */
  --radius-xl: 16px;   /* dialogs */
  --radius-2xl: 20px;  /* bottom sheets (top corners) */
  --radius-full: 999px;

  /* Sizes */
  --size-tap: 44px;          /* minimum touch target on phone */
  --size-control: 40px;
  --size-control-sm: 32px;
  --size-tabbar: 64px;
  --size-sidenav: 240px;
  --size-rail: 92px;
  --size-list: 440px;
  --size-list-md: 360px;
  --size-compare-list: 340px;
  --size-metric-list: 400px;
  --size-dialog: 520px;
  --size-drawer: 380px;
  --size-tooltip: 180px;
  --size-content-max: 640px; /* settings column */

  /* Layers */
  --z-tooltip: 3;
  --z-banner: 8;
  --z-tabbar: 10;
  --z-sheet: 20;
  --z-dialog: 40;

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Breakpoints (reference only: custom properties do not work inside @media)
     phone   < 768px
     tablet  768–1199px  (icon rail)
     desktop ≥ 1200px    (full sidebar, inline filters) */
}
