/* tokens.css — foundation-ui platform design tokens (the shared floor).
 *
 * These are the GENERIC app-shell tokens: palette, semantic mapping, layout
 * dimensions, typography, radii/shadows/motion. Dark is the default (:root);
 * light comes from themes.css [data-theme="light"].
 *
 * CONTRACT (see docs/theming.md):
 *   - A consumer RE-SKINS by overriding these token VALUES in its own stylesheet
 *     loaded AFTER this file — never by redeclaring the shell's .fui-* selectors.
 *   - App-specific tokens (marker pills, badge kinds, dependency-graph hues,
 *     datagrid --dg-* aliases) are NOT here — they live in the consumer's own
 *     override stylesheet. foundation-ui owns only the shell floor.
 *   - No raw #hex / rgb() outside this file + themes.css (A1/A3 platform rule).
 */

:root {
  /* ── Catppuccin Mocha palette (dark default) ── */
  --base:     #1e1e2e;
  --mantle:   #181825;
  --crust:    #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --overlay0: #6c7086;
  --overlay1: #7f849c;
  --overlay2: #9399b2;
  --subtext0: #a6adc8;
  --subtext1: #bac2de;
  --text:     #cdd6f4;

  --rosewater: #f5e0dc;
  --flamingo:  #f2cdcd;
  --pink:      #f5c2e7;
  --mauve:     #cba6f7;
  --red:       #f38ba8;
  --maroon:    #eba0ac;
  --peach:     #fab387;
  --yellow:    #f9e2af;
  --green:     #a6e3a1;
  --teal:      #94e2d5;
  --sky:       #89dceb;
  --sapphire:  #74c7ec;
  --blue:      #89b4fa;
  --lavender:  #b4befe;

  /* ── Semantic mapping (shell chrome reads only these, never raw palette) ── */
  --bg:            var(--base);
  --bg-alt:        var(--mantle);
  --bg-card:       var(--surface0);
  --bg-card-hover: var(--surface1);
  --bg-hover:      var(--surface0); /* header/menu hover surface (shell chrome) */
  --bg-input:      var(--mantle);

  --fg:        var(--text);
  --fg-muted: var(--subtext0); /* overlay1 was 3.40:1 on --bg-card (heritage-contrast-scheme HC-U3) */
  --fg-subtle: var(--subtext0);

  --border:        var(--surface1);
  --border-strong: var(--surface2);

  --accent:    var(--blue);
  --accent-fg: var(--base);
  --success:   var(--green);
  --warning:   var(--yellow);
  --danger:    var(--red);
  --info:      var(--sky);

  /* RGB triplets — for rgba(var(--X-rgb), opacity) tints. CSS cannot derive
   * rgb from a #hex var, so every tinted surface declares its triplet. */
  --accent-rgb:   137, 180, 250;
  --success-rgb:  166, 227, 161;
  --warning-rgb:  249, 226, 175;
  --danger-rgb:   243, 139, 168;
  --info-rgb:     137, 220, 235;
  --fg-muted-rgb: 166, 173, 200;
  --fg-rgb:       205, 214, 244;

  /* ── Layout dimensions (shell geometry) ── */
  --header-h:       56px;
  --footer-h:       32px;
  --sidebar-w:      260px;
  --sidebar-w-mini: 64px;
  --chat-panel-w:   320px;
  --ctx-panel-w:    300px;
  --content-pad:    20px;

  /* ── Typography ── */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --fs-xs:  11px;
  --fs-sm:  12px;
  --fs-md:  14px;
  --fs-lg:  16px;
  --fs-xl:  20px;
  --fs-2xl: 28px;
  --lh:     1.5;

  /* ── Radii ── */
  --r-xs:   4px;
  --r-sm:   4px;
  --r-md:   6px;
  --r-lg:   10px;
  --r-pill: 999px;

  /* tiling panes (panes.css, spec tiling-panes) — flat defaults onto the shell vocabulary */
  --fui-pane-bg:         var(--bg-card);
  --fui-pane-border:     var(--border);
  --fui-pane-fg:         var(--fg);
  --fui-pane-fg-muted:   var(--fg-muted);
  --fui-pane-accent:     var(--accent);
  --fui-pane-accent-rgb: var(--accent-rgb);
  --fui-pane-input-bg:   var(--bg-input);
  --fui-pane-radius:     var(--r-lg);

  /* column resizer (table-columns.css, spec table-columns) */
  --fui-col-grip: var(--accent);
  --fui-col-min:  48px;

  /* dashboard frame (dash-grid.css, claude-base docs/specs/dashboard-frame) */
  --fui-dash-bg:         var(--bg-card);
  --fui-dash-border:     var(--border);
  --fui-dash-fg:         var(--fg);
  --fui-dash-fg-muted:   var(--fg-muted);
  --fui-dash-accent:     var(--accent);
  --fui-dash-accent-rgb: var(--accent-rgb);
  --fui-dash-radius:     var(--r-md);
  --fui-dash-shadow:     var(--shadow-md);
  --fui-dash-gap:        12px;
  --fui-dash-pad:        12px;
  --fui-dash-body-min:   64px;

  /* ── Shadows / scrim (black-with-opacity is universal; tokenized so the
   *    "no raw rgb() literals" rule holds) ── */
  --shadow-rgb: 0, 0, 0;
  --crust-rgb:  0, 0, 0;
  --shadow-sm: 0 1px 2px  rgba(var(--shadow-rgb), 0.30);
  --shadow-md: 0 4px 12px rgba(var(--shadow-rgb), 0.35);
  --shadow-lg: 0 12px 32px rgba(var(--shadow-rgb), 0.45);
  --shadow-pop: 0 8px 24px rgba(var(--shadow-rgb), 0.35); /* popovers: the bell, the tooltip */


  /* The data-visualisation palette (--viz-*) lives in viz.css (increment-viz-data-palette VZ-U1). */

  /* ── Motion ── */
  --t-fast: 120ms ease;
  --t-med:  200ms ease;
}
