/*
 * tokens.css: the May look's design tokens, copied whole for fos/ (nothing under fos/ may import from outside it).
 * Source: wb-modules-core foundry/ui/css/tokens.css and tokens-data.css at 7038ae7, in that order, unchanged.
 * Change a value in the source first; this copy follows it.
 */

/**
 * Rockhopper design tokens — the single source of truth.
 *
 * Imported once at the root layout so every route inherits the same vars.
 * Component CSS (cloud-theme.css, etc.) consumes these and MUST NOT redeclare
 * the :root token block — that fork is what N1 removed.
 *
 * Two orthogonal axes on <html>:
 *   [data-theme]   = dark (default) | light
 *   [data-surface] = foundry (alpha, default) | bridge (beta customers)
 * data-surface overrides accent + brand chrome only; the structural ramp
 * (bg / text / line / spacing) is shared so one layout themes twice.
 *
 * --on-accent is the text colour for anything FILLED with --accent (primary
 * buttons, active segments, badges). CU-16 (#2165): those all used #fff, which
 * measured 2.73:1 on the dark-theme accent (the sign-in button). Every
 * theme x surface pair below is held to WCAG AA 4.5:1 for --on-accent on
 * --accent and on --accent-hover, and for --accent as text on --bg, by
 * src/lib/__tests__/a11y-contrast-cu16.test.ts.
 */

/* The touch floor (Apple's 44pt) every tap target meets on phone and tablet (#4783). */
:root {
  --tap-min: 44px;
}

:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0e1a;
  --bg-2: #111827;
  --bg-3: #1a2236;
  --line: #1e293b;
  --line-2: #334155;
  --text: #e5e7eb;
  --text-2: #9ca3af;
  --text-3: #8897a9; /* lifted from #6b7280 — AA 4.55:1 on --bg (#0a0e1a) */
  --accent: #4f9eff;
  --accent-2: #1d4ed8;
  --accent-hover: #3b8fff;
  --on-accent: #0a0e1a; /* dark text on the bright dark-theme accents: 7.0:1 */
  --penguin-blue: #4f9eff;
  --rockhopper: #fbbf24;
  --african: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --ok-text: #34d399; /* green AS TEXT: 10:1 on --bg (#0a0e1a) */
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.5);
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  --chat-w: 400px;
  --chat-h: 420px;
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --bg-3: #f1f5f9;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #4b5563; /* darkened from #64748b — AA 4.68:1 on --bg (#f8fafc) */
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-hover: #1d4ed8;
  --on-accent: #ffffff; /* white on the deep light-theme accents: 5.2:1 */
  --penguin-blue: #2563eb;
  --rockhopper: #d97706;
  --african: #059669;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --ok-text: #047857; /* --ok is 3.5:1 as text on --bg (#f8fafc); this is AA 5.2:1 */
  --shadow-strong: 0 20px 60px rgba(15, 23, 42, 0.12);
  /* Chip text on its own tint (#4864): every chip is held to AA 4.5:1 over the
     light page and over a white card by lib/__tests__/light-polish-4864.test.ts. */
  --chip-opus-text: #7e22ce; /* 5.6:1 on the opus tint */
  --chip-info-text: #1d4ed8; /* 5.6:1 on the sonnet / bound tint */
  --chip-danger-text: #b91c1c; /* 5.2:1 on the high-severity tint */
  --chip-warn-text: #92400e; /* 6.2:1 on the amber tint */
}

/**
 * Per-surface seam. Default (foundry) inherits the penguin-blue accent above.
 * Bridge (beta customers) shifts the accent to the african-green brand line.
 * Structural tokens are intentionally NOT overridden here.
 */
[data-surface='bridge'] {
  --accent: #2dd4a7;
  --accent-2: #0f9d74;
  --accent-hover: #34e6b6;
}

[data-theme='light'][data-surface='bridge'] {
  /* Deepened from #0f9d74 / #0b7a5a (CU-16): #0f9d74 gave white text 3.45:1 and,
     as link text on --bg, 3.29:1. Same green line, now AA both ways. */
  --accent: #047857;
  --accent-2: #065f46;
  --accent-hover: #065f46;
}

/**
 * tokens-data.css: the design tokens fosFoundry adds beside the pinned tokens.css (S-6; the design system plan, wb-platform wiki
 * design-fosfoundry-design-system, Layer 1). tokens.css is the pinned copy of experance-dev/fosfoundry's file and is never edited here; this file is
 * linked after it and declares only new names: the chart series (categorical and sequential), the unknown state, and the type, spacing, radius,
 * motion and layout scales. The chart module (pb-227) and every telemetry panel read only these.
 *
 * Colour rule (test/ui/tokens-data.test.mjs): every series and every step of the ramp is 3:1 or more against --bg-2 in its theme, and every pair of
 * series (not only neighbours) stays 15 or more apart (CIE76) with normal vision, deuteranopia and protanopia, so a chart of six series reads to
 * either reader. A series is never the only cue: a line carries its label and a bar its value. The ramp steps one hue in one direction of luminance.
 *
 * 2026-11-15 (S-6): first version. 2026-11-15 (check round 1): the ramp at 3:1 in both themes; every pair of series apart (dark series-6 and
 * light series-5 and -6 replaced).
 *
 * Built by fosFoundry, by fndrix.ai
 */

:root {
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-figure: 28px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --page-inset: 24px;
  --r-sm: 3px;
  --r-md: 8px;
  --dur-fast: 120ms;
  --dur-mark: 10s;
  --bar-h: 52px;
}

@media (max-width: 719.98px) {
  :root { --page-inset: 14px; }
}

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

:root,
[data-theme='dark'] {
  --series-1: #56b4e9;
  --series-2: #e69f00;
  --series-3: #2fc19a;
  --series-4: #f0e442;
  --series-5: #ff7a45;
  --series-6: #245ef1;
  --seq-1: #3b82f6;
  --seq-2: #60a5fa;
  --seq-3: #93c5fd;
  --seq-4: #bfdbfe;
  --seq-5: #dbeafe;
  --unknown: var(--text-3);
}

[data-theme='light'] {
  --series-1: #0072b2;
  --series-2: #b35200;
  --series-3: #007a5a;
  --series-4: #a33d7f;
  --series-5: #5b5bd6;
  --series-6: #0e066a;
  --seq-1: #2563eb;
  --seq-2: #1d4ed8;
  --seq-3: #1e40af;
  --seq-4: #1e3a8a;
  --seq-5: #172554;
  --unknown: var(--text-3);
}
