/* SkyTerra global design tokens — the ONE shared substrate for new UI work.
 *
 * Added 2026-08-15 as part of the mobile revitalization (see
 * docs/ui-design-doctrine.md for the full doctrine this encodes).
 *
 * Contract:
 *  - This file only DEFINES custom properties. It restyles nothing by itself,
 *    so loading it anywhere is safe and side-effect-free.
 *  - Components reference these semantic tokens (--st-*) instead of raw hex.
 *    Feature-scoped islands (--calm-*, --sck-*, --cx-*) may alias onto these,
 *    but never mutate them.
 *  - Neutral ramp is SLATE. The legacy #2c3e50/#5a6c7d/#e1e8ed ramp is being
 *    retired: do not reference it in new work.
 *  - Light theme only (CLAUDE.md mandate).
 */
:root {
  /* brand */
  --st-navy: #1a365d;
  --st-navy-grad-end: #245f92;          /* canonical button/FAB gradient terminus */
  --st-navy-deep: #12293F;              /* calm shell navy */
  --st-blue: var(--st-accent-solid);    /* the same value it always had */
  --st-blue-bright: var(--st-accent);   /* the same value: focus ring + non-text accents only */
  --st-blue-action: var(--st-accent-solid); /* was a second blue (royal); now the one action blue (4.87:1 on white) */
  --st-blue-deep: #004A99;
  --st-sky: var(--st-accent-tint);      /* a near-miss of the rail's tint until 16 Oct 2026; now the tint */
  --st-sky-select: #dbeafe;             /* selection wash / bulk bars (never black) */

  /* ONE ACCENT, IN TWO STEPS (Jonathan, 16 Oct 2026: "It's all these different blues and colors, whereas if you look
   * at the SkyTerra Group left-side panel, it's very simplistic."). Every value is read from the left rail, which is
   * the reference look; DESIGN-RULES 1 and docs/ui-design-doctrine.md 3.6. The rail's blue fails as a fill under white
   * text (3.32:1), so the fill is the same hue one step deeper. Never accent-blue text on the tint; never navy or black
   * fills; never a gradient. If he prefers navy for the one primary, the fill is one line: the solid below. */
  --st-accent: #0096D6;                 /* rings, resize edges, dots: non-text only (3.32:1 on white) */
  --st-accent-solid: #0077B6;           /* the ONE filled primary and link text (white on it 4.87:1) */
  --st-accent-solid-hover: #006EA8;     /* hover: one step darker (white 5.53:1); no lift, glow or filter */
  --st-accent-solid-press: #00679E;     /* pressed (white 6.12:1); no scale */
  --st-accent-tint: #E8F4FA;            /* the rail's wash: hover, selected, on */
  --st-accent-ink: #0B2A4A;             /* text and icons on the tint (12.98:1) */
  --st-line-strong: var(--st-input-border); /* form-control borders only */
  --st-focus-ring: 2px solid var(--st-accent); /* outline; offset 2px outside a control, -2px inside a row */
  /* The rail's edge (templates/client_agents.html .rail-resize-edge): a 7px invisible strip that shows one hard-stop
   * 2px line on hover, drag and keyboard focus. Every resize edge reads these, so they cannot drift apart again. */
  --st-edge-bg: linear-gradient(to right, transparent 0 2px, var(--st-accent) 2px 4px, transparent 4px);
  --st-edge-bg-y: linear-gradient(to bottom, transparent 0 2px, var(--st-accent) 2px 4px, transparent 4px);
  --st-shadow-pop: 0 4px 6px -1px rgba(15, 23, 42, .1), 0 2px 4px -2px rgba(15, 23, 42, .1); /* menus, popovers (the rail's row menu) */
  --st-r-control: 8px;                  /* controls, chips, menus (the rail's rows) */
  --st-h-compact: 28px;                 /* chips and header buttons */
  --st-fs-xs: 12px;                     /* meta and chip labels; nothing smaller (Jonathan, 11 Sep) */
  --st-fs-sm: 14px;                     /* controls and UI */
  --st-fs-base: 16px;                   /* phone inputs and primary list text; avoids iOS focus zoom */
  --st-fs-md: 15px;                     /* answer prose */
  --st-fs-lg: 20px;                     /* titles */
  --st-fw-regular: 400;
  --st-fw-medium: 500;
  --st-fw-semibold: 600;

  /* slate neutral ramp (the winner; retire legacy grays) */
  --st-rail-ink: #172334;             /* rail glyphs, including the Sources R5 reopen chip */
  --st-ink: #0f172a;
  --st-ink-2: #1e293b;
  --st-slate: #475569;
  --st-slate-2: #64748b;
  --st-muted: #63707e;                  /* AA-safe muted text on white (5.06:1); NOT #8895a3 */
  --st-mist: #94a3b8;                   /* non-text only: icons, hairlines on dark */
  --st-line: #e2e8f0;
  --st-wash: #f1f5f9;
  --st-bg: #f8fafc;
  --st-surface: #ffffff;
  --st-clear: transparent;             /* unfilled icon controls, including touch hover */

  /* semantic status (color = state, never decoration) */
  --st-success: #1a7f48;
  --st-success-soft: #1f9d64;           /* icon/badge fills only, fails AA as text */
  --st-danger: #b42318;
  --st-danger-strong: #c0392b;
  --st-danger-bg: #fef2f2;              /* danger hover/state background */
  --st-danger-border: #fecaca;          /* danger state border */
  --st-warn: var(--st-slate);           /* neutral notice indicator; MVP-PNL-05 */
  --st-warn-bg: var(--st-bg);           /* quiet light notice surface */
  --st-warn-text: var(--st-ink);        /* ink on the neutral notice surface */
  --st-warn-badge-bg: var(--st-wash);    /* neutral warning badge background */
  /* session policy state: the phone header's Restricted badge is an outline, never the selected tint (round 3, S1) */
  --st-state-restricted-ink: var(--st-ink-2);
  --st-state-restricted-line: var(--st-slate-2);
  --st-state-restricted-bg: var(--st-surface);
  /* role badge backgrounds */
  --st-admin-bg: #e0edff;               /* co-owner badge fill (blue-tinted wash) */
  /* form chrome */
  --st-input-border: #cbd5e1;           /* form input default border */

  /* Classic Chats/Directory controls, extracted without changing their values. */
  --st-chat-line: #e3e8ee;
  --st-chat-hairline: #eef2f6;
  --st-chat-ink: #1f2a37;
  --st-chat-action: var(--st-accent-solid); /* was a third blue until 16 Oct 2026 */
  --st-chat-radius: 16px;
  --st-chat-shadow: 0 5px 20px rgba(31, 42, 55, 0.06);
  --st-chat-focus-shadow: 0 0 0 3px rgba(0, 119, 182, 0.16), var(--st-chat-shadow); /* the accent solid's hue */
  --st-chat-mobile-shadow: 0 -6px 18px rgba(31, 42, 55, 0.06);
  --st-chat-text-size: 15px;
  /* Send is flat (Jonathan, 16 Oct 2026: "The send button is like a gradient."): one fill, no glow, desktop and phone. */
  --st-chat-send-background: var(--st-accent-solid);
  --st-chat-send-shadow: none;
  --st-chat-mobile-send-shadow: none;
  --st-chat-mobile-send-background: var(--st-accent-solid); /* the phone Send: the same flat fill (mobile ask A2) */
  --st-chat-mobile-input-line: rgba(203, 213, 225, 0.95);
  --st-chat-mobile-input-bg: #f8fbff;
  --st-chat-mobile-input-radius: 18px;
  --st-field-line: #d8e0ea;
  --st-field-mobile-line: #cfdae8;
  --st-field-mobile-bg: #f4f8fc;

  /* Stakeholder-map category ramp (data hexes; mirrored for CSS consumers).
   * Authoritative runtime copy lives in stakeholder_map.py (_BRAND_CATEGORY_RAMP).
   * Cool teal --st-cat-2 is brand-adjacent and must NOT be used as success. */
  --st-cat-0: #1a365d;
  --st-cat-1: #0077B6;
  --st-cat-2: #0e7490;
  --st-cat-3: #2563EB;
  --st-cat-4: #475569;
  --st-cat-5: #334155;
  --st-cat-6: #004A99;
  --st-cat-7: #245f92;

  /* type */
  --st-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --st-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* spacing (8pt, tight rhythm preferred) */
  --st-sp-1: 4px; --st-sp-2: 8px; --st-sp-3: 12px; --st-sp-4: 16px;
  --st-sp-5: 24px; --st-sp-6: 32px; --st-sp-8: 48px;

  /* shape + depth (hairline elevation, quiet chrome) */
  --st-r-none: 0;                       /* edge-to-edge phone sheets */
  --st-shadow-none: none;              /* flat surfaces that fill the viewport */
  --st-r-sm: 6px;                       /* small controls: chips, outline buttons, logos */
  --st-r-input: 10px;
  --st-r-card: 14px;
  --st-r-pill: 999px;
  --st-shadow-soft: 0 1px 2px rgba(18, 41, 63, .06);
  --st-shadow-card: 0 1px 2px rgba(15, 37, 64, .05), 0 4px 14px rgba(15, 37, 64, .05);

  /* touch (see doctrine: 44px gated primaries, 36px secondary, 24px AA floor) */
  --st-tap-primary: 44px;
  --st-tap-secondary: 36px;
  --st-tap-floor: 24px;

  /* z-ladder (settled after real collisions; do not free-hand new z-indexes) */
  --st-z-bottom-nav: 2101;
  --st-z-top-bar: 2102;
  --st-z-popover: 9500;
  --st-z-sheet: 10000;
}
