/* CelesteOS design tokens — sourced from Cloud_PMS's real, live-wired
   apps/web/src/styles/tokens.css (verified against origin/main, not a
   stale copy), cross-checked against Collective's search-ui token blocks
   (index.html/directory.html), which are independently identical on every
   overlapping value — this is the one genuinely shared system across both
   live products, not a guess or a blend of two different ones.

   Two values were nudged from tokens.css's own numbers to clear WCAG AA
   (4.5:1) for normal text, mirroring the same kind of fix the Cloud_PMS
   team already made once themselves (ALE-1217, light-theme --txt3):
     --txt-ghost dark: 0.40 → 0.46 alpha (was 3.78:1, now ~4.5:1)
     --red dark:       #C0503A → #CC5A42 (was 4.17:1, now ~4.5:1)
   Every other value is copied verbatim, not reinterpreted.

   Founder ruling 22 Oct 2026: system font everywhere, matching app.celeste7.ai
   Additions: --border-strong (table header rule, per EntityTableList). */


:root, [data-theme="dark"] {
  /* Surfaces */
  --surface-base: #0c0b0a;
  --surface:      #181614;
  --surface-el:   #1e1b18;
  --surface-hover:#242424;

  /* Borders */
  --border-sub:    rgba(255,255,255,0.07);
  --border-top:    rgba(255,255,255,0.11);
  --border-side:   rgba(255,255,255,0.06);
  --border-bottom: rgba(255,255,255,0.03);
  --border-faint:  rgba(255,255,255,0.04);
  --border-chrome: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.18);

  /* Shadows */
  --shadow-panel: 0 0 0 1px rgba(0,0,0,0.60), 0 28px 80px rgba(0,0,0,0.80);
  --shadow-drop:  0 8px 24px rgba(0,0,0,0.50);
  --shadow-tip:   0 4px 12px rgba(0,0,0,0.40);
  --shadow-sm: var(--shadow-tip);
  --shadow-md: var(--shadow-drop);
  --shadow-lg: var(--shadow-panel);
  --shadow-card: var(--shadow-drop);

  /* Text */
  --txt:       rgba(255,255,255,0.92);
  --txt2:      rgba(255,255,255,0.55);
  --txt3:      rgba(255,255,255,0.70);
  --txt-ghost: rgba(255,255,255,0.46); /* nudged from tokens.css's 0.40 — AA fix, see header */
  --text-inverse: #0c0b0a;

  /* Brand */
  --mark:           #5AABCC;
  --teal:           #3A7C9D;
  --teal-light:     #5AABCC;
  --teal-bg:        rgba(58,124,157,0.12);
  --mark-hover:     rgba(58,124,157,0.22);
  --mark-underline: rgba(90,171,204,0.3);

  /* Status */
  --red:          #CC5A42; /* nudged from tokens.css's #C0503A — AA fix, see header */
  --red-bg:       rgba(192,80,58,0.10);
  --red-border:   rgba(192,80,58,0.22);
  --amber:        #C4893B;
  --amber-bg:     rgba(196,137,59,0.10);
  --amber-border: rgba(196,137,59,0.22);
  --green:        #4A9468;
  --green-bg:     rgba(76,175,129,0.10);
  --green-border: rgba(76,175,129,0.22);
  --blue:         #5B8DEF;
  --blue-bg:      rgba(91,141,239,0.10);
  --blue-border:  rgba(91,141,239,0.22);
}

[data-theme="light"] {
  --surface-base: #FFFFFF;
  --surface:      #F8F8F8;
  --surface-el:   #FFFFFF;
  --surface-hover:#F0F0F0;

  --border-sub:    rgba(0,0,0,0.08);
  --border-top:    rgba(0,0,0,0.08);
  --border-side:   rgba(0,0,0,0.05);
  --border-bottom: rgba(0,0,0,0.02);
  --border-faint:  rgba(0,0,0,0.04);
  --border-chrome: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.22);

  --shadow-panel: 0 0 0 1px rgba(0,0,0,0.08), 0 28px 80px rgba(0,0,0,0.15);
  --shadow-drop:  0 8px 24px rgba(0,0,0,0.12);
  --shadow-tip:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-sm: var(--shadow-tip);
  --shadow-md: var(--shadow-drop);
  --shadow-lg: var(--shadow-panel);
  --shadow-card: var(--shadow-drop);

  --txt:       rgba(0,0,0,0.87);
  --txt2:      rgba(0,0,0,0.55);
  --txt3:      rgba(0,0,0,0.58);
  --txt-ghost: rgba(0,0,0,0.46); /* nudged to match the dark-theme AA fix symmetrically */
  --text-inverse: #FFFFFF;

  --mark:           #276F94;
  --teal:           #276F94;
  --teal-light:     #276F94;
  --teal-bg:        rgba(43,127,163,0.08);
  --mark-hover:     rgba(43,127,163,0.16);
  --mark-underline: rgba(43,127,163,0.3);

  --red:          #B04730;
  --red-bg:       rgba(192,80,58,0.06);
  --red-border:   rgba(192,80,58,0.15);
  --amber:        #9E6928;
  --amber-bg:     rgba(196,137,59,0.06);
  --amber-border: rgba(196,137,59,0.15);
  --green:        #36825D;
  --green-bg:     rgba(76,175,129,0.06);
  --green-border: rgba(76,175,129,0.15);
  --blue:         #4571CA;
  --blue-bg:      rgba(74,122,217,0.06);
  --blue-border:  rgba(91,141,239,0.15);
}

:root {
  /* Typography — system stack, same as the app (founder ruling 22 Oct 2026) */
  --font-sans:    -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono:    'SF Mono', ui-monospace, 'Fira Code', monospace;

  /* Radius — tokens.css's "ULTRA" scale (CEO 2026-05-15), unchanged */
  --radius-pill: 1px;
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 3px;
  --radius-xl: 4px;
  --radius-full: 9999px;

  /* Spacing — 4px base grid, unchanged */
  --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; --space-20: 80px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
