/* KosmoKai UI V3 — design tokens (source of truth for every value in the final designs)
 * Scope: everything is namespaced under .kk-ui so legacy screens and the login page are untouched
 * until each screen is migrated. Never apply .kk-ui to the login / policy acceptance page.
 * If the repo uses Tailwind or a CSS-in-JS theme, map these variables 1:1 (see DESIGN_TOKENS.md).
 */
#dashboard.kk-ui {
  color-scheme: dark;

  /* Ground & surfaces */
  --kk-bg: #080C1A;              /* app canvas */
  --kk-bg-deep: #05070F;         /* behind artboards, modal scrim base */
  --kk-sidebar: #0A1122;         /* sidebar, mobile tab bar, drawer */
  --kk-inspector: rgba(10,17,34,0.60); /* right inspector over canvas */
  --kk-surface: #0E172A;         /* inputs, panels, segmented track */
  --kk-surface-sunken: #0B1325;  /* KPI strips, script editor, telemetry */
  --kk-surface-raised: #132036;  /* chips, active channel row, avatar tiles */
  --kk-surface-hover: #18284A;   /* hover fill, segmented active, progress track */
  --kk-row-hover: #111B30;       /* sidebar row hover */

  /* Lines */
  --kk-line: rgba(170,185,230,0.12);        /* default 1px border */
  --kk-line-soft: rgba(170,185,230,0.08);   /* row separators */
  --kk-line-divider: rgba(170,185,230,0.10);/* header/rail/inspector dividers */
  --kk-line-strong: rgba(170,185,230,0.22); /* secondary button border */
  --kk-line-outline: rgba(170,185,230,0.35);/* not-started stage dot */

  /* Text */
  --kk-text: #F3F2FA;            /* primary */
  --kk-text-body: #D6DAE8;       /* long body copy */
  --kk-text-2: #AEB7CE;          /* secondary */
  --kk-text-3: #7F8BA8;          /* quiet meta, mono labels */
  --kk-text-faint: #4E5A78;      /* breadcrumb separators only (decorative) */

  /* Accent — lavender */
  --kk-primary: #B9A5FF;
  --kk-primary-hover: #C9B8FF;
  --kk-primary-pressed: #A48DF0;
  --kk-primary-text: #CDBEFF;    /* accent text on tinted fills */
  --kk-primary-ink: #120E24;     /* text on primary fill */
  --kk-primary-tint: rgba(160,130,255,0.16);   /* selected row / active pill */
  --kk-primary-tint-soft: rgba(160,130,255,0.08);
  --kk-primary-ring: rgba(185,165,255,0.55);   /* selected card border */

  /* Status */
  --kk-success: #7DE9C8;  --kk-success-tint: rgba(125,233,200,0.10); --kk-success-line: rgba(125,233,200,0.30);
  --kk-warning: #FFC76B;  --kk-warning-tint: rgba(255,199,107,0.10); --kk-warning-line: rgba(255,199,107,0.45);
  --kk-danger:  #FF8BA0;  --kk-danger-tint:  rgba(255,139,160,0.08); --kk-danger-line:  rgba(255,139,160,0.30);
  --kk-info:    #8FB4FF;  --kk-info-tint:    rgba(143,180,255,0.10);
  --kk-chart-secondary: #61718F;
  --kk-chart-alt: #8E76E8;

  /* Type */
  --kk-font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --kk-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --kk-fs-display: 34px; --kk-lh-display: 40px;  /* page title */
  --kk-fs-display-sm: 30px; --kk-lh-display-sm: 36px; /* page title when media sits beside it */
  --kk-fs-kpi: 32px;  --kk-lh-kpi: 38px;
  --kk-fs-h2: 18px;   --kk-lh-h2: 24px;
  --kk-fs-h3: 15px;   --kk-lh-h3: 20px;
  --kk-fs-body: 14px; --kk-lh-body: 21px;
  --kk-fs-ui: 13.5px; --kk-lh-ui: 18px;
  --kk-fs-small: 12.5px; --kk-lh-small: 18px;
  --kk-fs-meta: 12px; --kk-lh-meta: 16px;
  --kk-fs-label: 11px; --kk-ls-label: 0.16em;    /* mono uppercase kicker */
  --kk-fw-regular: 400; --kk-fw-medium: 500; --kk-fw-semibold: 600; --kk-fw-bold: 700;
  --kk-ls-display: -0.025em;

  /* Space (4px base) */
  --kk-space-1: 4px; --kk-space-2: 8px; --kk-space-3: 12px; --kk-space-4: 16px;
  --kk-space-5: 20px; --kk-space-6: 24px; --kk-space-7: 28px; --kk-space-8: 32px; --kk-space-10: 40px; --kk-space-12: 48px;

  /* Radii */
  --kk-radius-xs: 6px;   /* duration badge, thumbnail in table */
  --kk-radius-sm: 8px;   /* sidebar rows, small thumbs */
  --kk-radius-md: 10px;  /* buttons, inputs, search */
  --kk-radius-lg: 12px;  /* media, CTA, dialogs content blocks */
  --kk-radius-xl: 14px;  /* panels / cards */
  --kk-radius-2xl: 18px; /* hero panel */
  --kk-radius-pill: 999px;

  /* Shadow & focus */
  --kk-shadow-float: 0 14px 34px rgba(0,0,0,0.30);   /* sticky action bar */
  --kk-shadow-overlay: 0 24px 60px rgba(0,0,0,0.50); /* dialogs, drawer */
  --kk-focus-ring: 0 0 0 2px #080C1A, 0 0 0 4px #CDBEFF;
  --kk-input-focus: 0 0 0 3px rgba(185,165,255,0.25);

  /* Layout */
  --kk-sidebar-w: 264px;  --kk-sidebar-w-drawer: 320px; --kk-rail-w: 72px;
  --kk-inspector-w: 340px; --kk-inspector-w-wide: 360px;
  --kk-header-h: 64px; --kk-stage-rail-h: 60px; --kk-mobile-bar-h: 56px; --kk-tabbar-h: 64px;
  --kk-gutter: 32px; --kk-gutter-tablet: 24px; --kk-gutter-mobile: 16px;
  --kk-content-max: 1440px;

  /* Motion */
  --kk-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --kk-dur-fast: 120ms; --kk-dur: 180ms; --kk-dur-slow: 280ms;
}
@media (prefers-reduced-motion: reduce) { #dashboard.kk-ui { --kk-dur-fast: 0ms; --kk-dur: 0ms; --kk-dur-slow: 0ms; } }
#dashboard.kk-ui[data-animations="paused"] { --kk-dur-fast: 0ms; --kk-dur: 0ms; --kk-dur-slow: 0ms; } /* wire to the existing "Pause animations" control */

/* Breakpoints (use in media queries; CSS vars cannot be used there)
   --kk-bp-xl: 1600px   large desktop  (inspector 360, gutters 40)
   --kk-bp-lg: 1280px   standard desktop (reference 1440)
   --kk-bp-md: 1024px   small desktop / landscape tablet: sidebar → 72px rail, inspector below content
   --kk-bp-sm: 768px    tablet portrait
   --kk-bp-xs: 390px    mobile reference; <768 uses top bar + drawer + bottom tabs
*/
