/* ============================================================================
   Cedrus · Design Tokens (v0.2) — Agentic Commerce seller app
   Adapted from Cyberlack tokens v0.4 (structure, Arco wiring) with Cedrus brand values.
   ----------------------------------------------------------------------------
   Brand: ink + paper + jade. Jade = brand and "good"; the only accent.
   Use: import this file, then reference var(--token) only. No hard-coded colours or sizes.
   Light theme is the default for every user. Dark is a saved user choice
   ([data-theme="dark"]), never taken from the operating system.
   Component library: Arco Design Vue for the standalone app (same as Cyberlack);
   screens embedded in Shopify admin follow Polaris look and feel (to verify, see bottom).
   Single source: the Cedrus Design System artifact (tokens.json). Regenerate this file
   from it; do not edit values here by hand.
   ============================================================================ */

:root {
  /* ---- Raw palette (theme-independent) ---------------------------------- */
  --brand-ink: #14181A;
  --brand-paper: #F7F6F2;
  --brand-jade: #12A594;
  --brand-jade-reversed: #2FD9C0;
  --jade-50: #E4F9F4;
  --jade-100: #C3F0E7;
  --jade-200: #8CE6D6;
  --jade-300: #2CD9C2;
  --jade-400: #1CBFAA;
  --jade-500: #13A593;
  --jade-600: #048B7B;
  --jade-700: #017063;
  --jade-800: #03554B;
  --jade-900: #053C34;
  --neutral-0: #FFFFFF;
  --neutral-50: #F4F7F6;
  --neutral-100: #EAEEED;
  --neutral-200: #D8DDDC;
  --neutral-300: #C2C8C7;
  --neutral-400: #A3ABA9;
  --neutral-500: #838B89;
  --neutral-600: #656D6B;
  --neutral-700: #49504E;
  --neutral-800: #2D3332;
  --neutral-900: #141918;
  --neutral-950: #050807;
  --caution-surface: #FDEACC;
  --caution-solid: #E4A523;
  --caution-text: #8D6302;
  --critical-surface: #FFE6E2;
  --critical-solid: #EB433D;
  --critical-text: #B32322;
  --info-surface: #E2EFFF;
  --info-solid: #1B88EB;
  --info-text: #0064B5;

  /* ---- Semantic tokens (light) ------------------------------------------ */
  --bg-body: var(--neutral-50);
  --bg-surface: var(--neutral-0);
  --bg-subtle: var(--neutral-50);
  --bg-hover: var(--neutral-100);
  --bg-selected: var(--jade-50);
  --bg-inverse: var(--brand-ink);
  --text-primary: var(--brand-ink);
  --text-secondary: var(--neutral-700);
  --text-tertiary: var(--neutral-600);
  --text-disabled: var(--neutral-400);
  --text-inverse: var(--brand-paper);
  --text-link: var(--jade-700);
  --primary: var(--jade-700);
  --primary-hover: var(--jade-800);
  --primary-active: var(--jade-900);
  --on-primary: var(--neutral-0);
  --primary-soft: var(--jade-50);
  --border-subtle: var(--neutral-200);
  --border-control: var(--neutral-500);
  --border-strong: var(--neutral-700);
  --focus-ring: var(--jade-600);
  --status-neutral-fg: var(--neutral-700);
  --status-neutral-bg: var(--neutral-100);
  --status-neutral-dot: var(--neutral-500);
  --status-progress-fg: var(--info-text);
  --status-progress-bg: var(--info-surface);
  --status-progress-dot: var(--info-solid);
  --status-success-fg: var(--jade-700);
  --status-success-bg: var(--jade-50);
  --status-success-dot: var(--jade-500);
  --status-warning-fg: var(--caution-text);
  --status-warning-bg: var(--caution-surface);
  --status-warning-dot: var(--caution-solid);
  --status-danger-fg: var(--critical-text);
  --status-danger-bg: var(--critical-surface);
  --status-danger-dot: var(--critical-solid);
  --status-cedrus-fg: var(--brand-paper);
  --status-cedrus-bg: var(--brand-ink);
  --status-cedrus-dot: var(--brand-jade-reversed);
  --chart-focus: var(--jade-500);
  --chart-context: var(--neutral-300);
  --chart-baseline: var(--neutral-500);
  --chart-loss: var(--critical-solid);
  --chart-grid: var(--neutral-100);
  --chart-marker: var(--brand-ink);
  --heat-0: var(--neutral-100);
  --heat-1: var(--jade-100);
  --heat-2: var(--jade-200);
  --heat-3: var(--jade-300);
  --heat-4: var(--jade-500);
  --heat-5: var(--jade-700);
  --scrim: rgba(20,24,26,0.5);

  /* ---- Typography (system fonts only; no web fonts: they fail in mainland China) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  --fs-display-lg: 32px; --lh-display-lg: 40px; --fw-display-lg: 700;
  --fs-display: 28px; --lh-display: 36px; --fw-display: 700;
  --fs-metric: 28px; --lh-metric: 32px; --fw-metric: 600;
  --fs-h1: 24px; --lh-h1: 32px; --fw-h1: 700;
  --fs-h2: 20px; --lh-h2: 28px; --fw-h2: 600;
  --fs-h3: 18px; --lh-h3: 26px; --fw-h3: 600;
  --fs-h4: 16px; --lh-h4: 24px; --fw-h4: 600;
  --fs-body-lg: 16px; --lh-body-lg: 24px; --fw-body-lg: 400;
  --fs-body: 14px; --lh-body: 22px; --fw-body: 400;
  --fs-body-strong: 14px; --lh-body-strong: 22px; --fw-body-strong: 600;
  --fs-body-sm: 13px; --lh-body-sm: 20px; --fw-body-sm: 400;
  --fs-caption: 12px; --lh-caption: 18px; --fw-caption: 400;
  --fs-label: 12px; --lh-label: 16px; --fw-label: 600;
  --fs-code: 13px; --lh-code: 20px; --fw-code: 400;

  /* ---- Spacing (4px base) · Radius · Shadow ------------------------------ */
  --space-0: 0px; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;
  --radius-xs: 3px; --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px; --radius-2xl: 16px; --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(20,24,26,0.06);
  --shadow-sm: 0 1px 3px rgba(20,24,26,0.08), 0 1px 2px rgba(20,24,26,0.04);
  --shadow-md: 0 4px 12px rgba(20,24,26,0.08);
  --shadow-lg: 0 12px 28px rgba(20,24,26,0.12);
  --shadow-xl: 0 24px 48px rgba(20,24,26,0.16);

  /* ---- Layout · Icons · Z-index · Motion -------------------------------- */
  --layout-topbar-h: 56px; --layout-sidebar-w: 232px; --layout-sidebar-collapsed-w: 64px; --layout-page-pad: 24px; --layout-content-max: 1440px; --layout-min-w: 1280px; --layout-embedded-min-w: 768px; --row-h-comfortable: 48px; --row-h-compact: 40px; --row-h-dense: 36px;
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px;
  --z-base: 0; --z-sticky: 100; --z-dropdown: 1000; --z-drawer: 1100; --z-modal: 1200; --z-toast: 1300;
  --duration-fast: 120ms; --duration-base: 180ms; --duration-slow: 260ms; --ease-standard: cubic-bezier(.2,0,0,1); --ease-entrance: cubic-bezier(0,0,.2,1); --ease-exit: cubic-bezier(.4,0,1,1);
}

[data-theme="dark"] {
  --bg-body: #0d1211;
  --bg-surface: #151b1a;
  --bg-subtle: #121817;
  --bg-hover: #1e2625;
  --bg-selected: #0f2e29;
  --bg-inverse: var(--neutral-950);
  --text-primary: #eef2f1;
  --text-secondary: #c9d0ce;
  --text-tertiary: var(--neutral-400);
  --text-disabled: #5f6765;
  --text-inverse: #eef2f1;
  --text-link: var(--jade-200);
  --primary: var(--brand-jade-reversed);
  --primary-hover: var(--jade-200);
  --primary-active: var(--jade-100);
  --on-primary: #05201c;
  --primary-soft: #0f2e29;
  --border-subtle: #2b3331;
  --border-control: #6b7472;
  --border-strong: var(--neutral-400);
  --focus-ring: var(--brand-jade-reversed);
  --status-neutral-fg: #c9d0ce;
  --status-neutral-bg: #1e2625;
  --status-neutral-dot: var(--neutral-500);
  --status-progress-fg: #7db8ff;
  --status-progress-bg: #0e2744;
  --status-progress-dot: #7db8ff;
  --status-success-fg: var(--brand-jade-reversed);
  --status-success-bg: #0f2e29;
  --status-success-dot: var(--brand-jade-reversed);
  --status-warning-fg: #f5c866;
  --status-warning-bg: #3a2c08;
  --status-warning-dot: var(--caution-solid);
  --status-danger-fg: #ff8a80;
  --status-danger-bg: #3d1715;
  --status-danger-dot: #ff8a80;
  --status-cedrus-fg: var(--brand-ink);
  --status-cedrus-bg: var(--jade-100);
  --status-cedrus-dot: var(--jade-700);
  --chart-focus: var(--brand-jade-reversed);
  --chart-context: #4a5452;
  --chart-baseline: var(--neutral-500);
  --chart-loss: #ff8a80;
  --chart-grid: #1e2625;
  --chart-marker: #eef2f1;
  --heat-0: #1e2625;
  --heat-1: var(--jade-900);
  --heat-2: var(--jade-800);
  --heat-3: var(--jade-600);
  --heat-4: var(--jade-400);
  --heat-5: var(--jade-200);
  --scrim: rgba(0,0,0,0.6);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.45);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.55);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.6);
  color-scheme: dark;
}

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

/* ============================================================================
   Arco Design Vue wiring (same three options as Cyberlack v0.4; values changed)
   ----------------------------------------------------------------------------
   A · Runtime CSS variables (recommended)
     :root{
       --primary-1:#E4F9F4; --primary-2:#C3F0E7; --primary-3:#8CE6D6; --primary-4:#2CD9C2;
       --primary-5:#048B7B; --primary-6:#017063; --primary-7:#03554B; --primary-8:#053C34;
       --primary-9:#053C34; --primary-10:#053C34;
       --success-6:#13A593; --warning-6:#E4A523; --danger-6:#EB433D; --link-6:#017063;
       --border-radius-small:4px; --border-radius-medium:6px; --border-radius-large:8px;
     }
     Note: Arco step 6 = jade-700 (#017063), not the logo jade, so white text on
     primary buttons passes 4.5:1. The logo jade (#12A594) stays for marks and charts.
   B · Build-time Less: @arcoblue-6:#017063; @green-6:#13A593; @gold-6:#E4A523;
       @red-6:#EB433D; @border-radius-medium:6px;
   C · Arco Design Lab theme package with the same values.

   Semantic map
     primary action  → primary            → jade-700  #017063
     in progress     → status-progress-*  → info      #1B88EB / #0064B5
     success / live  → status-success-*   → jade      #13A593 / #017063
     needs review    → status-warning-*   → caution   #E4A523 / #8D6302
     failed/blocked  → status-danger-*    → critical  #EB433D / #B32322
     by Cedrus       → status-cedrus-*    → ink chip  #14181A / #F7F6F2 (custom; Arco has none)

   Shopify-embedded screens (to verify with Jack)
     If parts of the app run inside Shopify admin (App Bridge), Built for Shopify asks
     for Polaris look and behaviour there. Keep these tokens for colour and status
     meaning; use Polaris components and spacing on those screens.
   ============================================================================ */
