/* Synced from the Moony app repository (docs/design-system/tokens.css). Do not edit here; run npm run tokens:sync. */
/* Moony design tokens — single source of truth.
   Two themes: the `:root` block is light, `:root[data-theme="dark"]` is dark (same names,
   README.md §2 and §11). `src/index.css` carries the same declarations; `src/index.test.ts`
   guards it. Every value here has a name; components never use raw hex. */
:root {
  /* ---- Surfaces (from outer canvas to the elevated workspace) ---- */
  --canvas: #eeece7;        /* outer canvas, one tone darker than content */
  --canvas-glow: #fbfaf7;   /* radial highlight top-right of the canvas */
  --sidebar: #f8f7f3;       /* sidebar layer */
  --sidebar-2: #f5f4f0;     /* sidebar gradient end */
  --paper: #ffffff;         /* working surfaces: cards, tables, modals */
  --paper-2: #fdfcf9;       /* card gradient end (barely warmer than paper) */
  --well: #f7f6f2;          /* inset areas: table header, modal footer, hover rows */
  --well-2: #e9e7e1;        /* segmented-control track, chips, avatar */
  --well-3: #e3e0d9;        /* stronger inset: progress track, skeleton */
  --hero-orb: #f0eee8;      /* decorative circle in the hero card */

  /* ---- Lines ---- */
  --line: #e2dfd7;          /* card and table borders */
  --line-soft: #efede8;     /* row dividers, chart grid */
  --line-strong: #d9d5cd;   /* secondary button border, input border */
  --line-sidebar: #e1ded6;
  --line-hover: #c9c5bc;    /* input hover border */

  /* ---- Ink (text), from primary to faintest ---- */
  --ink: #292822;           /* headings, primary values, names */
  --ink-2: #504d46;         /* body copy, table values */
  --ink-3: #5f5c56;         /* secondary text, descriptions */
  --ink-4: #6e6b64;         /* labels, captions, eyebrows */
  --ink-5: #8a8882;         /* axis ticks, placeholders */
  --ink-inverse: #ffffff;
  --ink-inverse-2: #d6d3cc; /* secondary text on dark material */
  --ink-hover: rgba(41, 40, 34, 0.05); /* 5 % ink: nav and ghost hover */

  /* ---- Dark material (active nav, primary button) ---- */
  --dark: #2c2a25;
  --dark-hi: #3b3932;       /* gradient start (light edge) */
  --dark-lo: #27251f;       /* gradient end */
  --dark-hover-hi: #46433b;
  --dark-hover-lo: #2f2d27;
  --dark-grad: linear-gradient(145deg, var(--dark-hi), var(--dark-lo));
  --dark-grad-hover: linear-gradient(145deg, var(--dark-hover-hi), var(--dark-hover-lo));

  /* ---- Semantic: the only two chromatic colors in the UI ---- */
  --gain: #107a60;          /* positive change ONLY (never decoration) */
  --gain-soft: #e6f5ee;     /* tint for gain badges */
  --loss: #bf4224;          /* negative change, destructive, validation errors */
  --loss-soft: #fcece6;
  --loss-line: #f1cfc3;     /* error alert border, danger-zone card */
  --loss-hover: #a8391d;    /* destructive button hover */
  --loss-ring: 0 0 0 3px rgba(191, 66, 36, 0.14); /* invalid field focus ring */

  /* ---- Data series (one muted indigo family, max 4 + other; validated ΔE ≥ 15 between neighbours) ---- */
  --s1: #212339;
  --s2: #454a73;
  --s3: #7176a0;
  --s4: #a6a9c8;
  --s-other: #ebe9e3;       /* "Ostatní" bucket, always labeled */
  --chart-line: #3c3f67;    /* primary value line */
  --chart-area: #e1e1ee;    /* area fill start (fades to transparent) */
  --chart-grid: #efeeea;
  --chart-cost: #a8a49b;    /* dashed "invested" step line */
  --chart-axis: #8a8882;

  /* ---- Focus ---- */
  --focus-border: #57544d;
  --focus-ring: 0 0 0 3px rgba(39, 38, 32, 0.10);

  /* ---- Radius ---- */
  --r-1: 6px;   /* inputs, segmented buttons, small chips */
  --r-2: 8px;   /* buttons, nav rows, menu, badges */
  --r-3: 13px;  /* stat cards */
  --r-4: 15px;  /* cards, tables */
  --r-5: 17px;  /* modal */

  /* ---- Elevation ---- */
  --sh-sidebar: 7px 0 22px rgba(58, 53, 36, 0.03);
  --sh-1: 0 2px 5px rgba(64, 58, 43, 0.05), 0 9px 22px rgba(64, 58, 43, 0.02);     /* stat card */
  --sh-2: 0 4px 10px rgba(68, 60, 43, 0.05), 0 16px 35px rgba(68, 60, 43, 0.03);   /* card */
  --sh-3: 0 4px 11px rgba(68, 60, 43, 0.055), 0 20px 38px rgba(68, 60, 43, 0.035); /* table (workspace) */
  --sh-pop: 0 8px 24px rgba(18, 17, 13, 0.12), 0 1px 2px rgba(18, 17, 13, 0.06);  /* menu, tooltip */
  --sh-modal: 0 26px 80px rgba(18, 17, 13, 0.44);
  --sh-dark: inset 0 1px rgba(255, 255, 255, 0.13), 0 3px 7px rgba(39, 35, 28, 0.15); /* dark material */
  --sh-btn: 0 1px 2px rgba(52, 46, 34, 0.06);                                       /* secondary button */
  --sh-btn-hover: 0 1px 3px rgba(52, 46, 34, 0.1);                                  /* secondary button hover */
  --sh-seg: 0 1px 3px rgba(34, 34, 34, 0.13);                                       /* active segmented pill */
  --sh-destructive: inset 0 1px rgba(255, 255, 255, 0.12), 0 3px 7px rgba(191, 66, 36, 0.2); /* destructive button */
  --scrim: rgba(30, 29, 25, 0.63);

  /* ---- Typography ---- */
  --font: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-display: 42px;  --fw-display: 580; --ls-display: -0.08em;  /* hero number */
  --fs-h1: 36px;       --fw-h1: 570;      --ls-h1: -0.07em;       /* page title */
  --fs-h2: 18px;       --fw-h2: 650;      --ls-h2: -0.045em;      /* card / table title */
  --fs-h3: 16px;       --fw-h3: 620;      --ls-h3: -0.04em;       /* section inside a card */
  --fs-stat: 22px;     --fw-stat: 580;    --ls-stat: -0.06em;     /* stat value */
  --fs-modal: 21px;    --fw-modal: 600;   --ls-modal: -0.05em;    /* modal title */
  --fs-body: 13px;     --fw-body: 450;
  --fs-nav: 14px;      --fw-nav: 600;     --ls-nav: -0.015em;
  --fs-table: 12px;    --fw-table: 480;   --fw-table-name: 650;
  --fs-caption: 11px;  --fw-caption: 500;
  --fs-micro: 10px;    --fw-micro: 600;
  --fs-eyebrow: 10px;  --fw-eyebrow: 700; --ls-eyebrow: 0.12em;
  --fs-thead: 10px;    --fw-thead: 750;   --ls-thead: 0.08em;

  /* ---- Spacing (4px base) ---- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;

  /* ---- Layout ---- */
  --sidebar-w: 264px;
  --page-max: 1480px;
  --page-pad-x: 48px;
  --page-pad-t: 32px;
  --control-h: 36px;
  --control-h-sm: 32px;
  --input-h: 39px;
  --nav-row-h: 36px;
  --table-row-h: 56px;

  /* ---- Motion ---- */
  --t-fast: 120ms;
  --t-base: 180ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ===== Dark theme: the shared token set (same names as tokens.css, no new names). =====
   Warm near-black, never #000. Depth comes from surface steps (canvas < sidebar < paper);
   wells go deeper = darker in both themes. The contrast material (`dark`) inverts: it is the
   light material in the dark theme, so active nav, primary button, tooltip, checked controls
   keep `background: var(--dark); color: var(--ink-inverse)` unchanged. */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* ---- Surfaces ---- */
  --canvas: #1a1917;
  --canvas-glow: #22211e;
  --sidebar: #1f1e1b;
  --sidebar-2: #1c1b19;
  --paper: #292826;
  --paper-2: #2b2a27;
  --well: #232220;
  --well-2: #1e1d1b;
  --well-3: #181715;
  --hero-orb: #302f2b;

  /* ---- Lines ---- */
  --line: #363531;
  --line-soft: #302f2c;
  --line-strong: #45443f;
  --line-sidebar: #2b2a27;
  --line-hover: #56544e;

  /* ---- Ink ---- */
  --ink: #eceae4;
  --ink-2: #cdcbc4;
  --ink-3: #aba8a0;
  --ink-4: #918f85;
  --ink-5: #73716a;
  --ink-inverse: #1d1c19;
  --ink-inverse-2: #5f5c54;
  --ink-hover: rgba(0, 0, 0, 0.18);

  /* ---- Contrast material (light on dark) ---- */
  --dark: #e9e7e1;
  --dark-hi: #f3f1ec;
  --dark-lo: #e2e0d9;
  --dark-hover-hi: #faf9f5;
  --dark-hover-lo: #ebe9e3;

  /* ---- Semantic ---- */
  --gain: #45c6a6;
  --gain-soft: #203c30;
  --loss: #ef7f5e;
  --loss-soft: #4a2d25;
  --loss-line: #6e3e32;
  --loss-hover: #ff9e84;
  --loss-ring: 0 0 0 3px rgba(239, 127, 94, 0.22);

  /* ---- Data series (same indigo family, re-stepped for dark paper) ---- */
  --s1: #d8dbf0;
  --s2: #a2a7ec;
  --s3: #7b7ea5;
  --s4: #4f508e;
  --s-other: #3a3935;
  --chart-line: #b5b9eb;
  --chart-area: #393b52;
  --chart-grid: #302f2c;
  --chart-cost: #78756d;
  --chart-axis: #73716a;

  /* ---- Focus ---- */
  --focus-border: #a09d94;
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.12);

  /* ---- Elevation (black-based, stronger; the 1 px line and the surface step carry the card) ---- */
  --sh-sidebar: 7px 0 22px rgba(0, 0, 0, 0.22);
  --sh-1: 0 2px 5px rgba(0, 0, 0, 0.24), 0 9px 22px rgba(0, 0, 0, 0.14);
  --sh-2: 0 4px 10px rgba(0, 0, 0, 0.26), 0 16px 35px rgba(0, 0, 0, 0.18);
  --sh-3: 0 4px 11px rgba(0, 0, 0, 0.28), 0 20px 38px rgba(0, 0, 0, 0.2);
  --sh-pop: 0 8px 24px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-modal: 0 26px 80px rgba(0, 0, 0, 0.7);
  --sh-dark: inset 0 1px rgba(255, 255, 255, 0.55), 0 3px 7px rgba(0, 0, 0, 0.35);
  --sh-btn: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sh-btn-hover: 0 1px 3px rgba(0, 0, 0, 0.4);
  --sh-seg: 0 1px 3px rgba(0, 0, 0, 0.45);
  --sh-destructive: inset 0 1px rgba(255, 255, 255, 0.12), 0 3px 7px rgba(0, 0, 0, 0.35);
  --scrim: rgba(12, 11, 9, 0.7);
}
