:root {
  /* brand */
  --ls-primary: #012d50;
  --ls-primary-hover: #013d6e;
  --ls-header: #012d50;
  --ls-header-ink: #ffffff;
  --ls-link: #2b7fd4;
  --ls-link-muted: #6b93b8;

  /* text (cooled toward navy) */
  --ls-text: #0d141b;   /* darker 16 Oct 2026 (CTO: legacy black reads blacker) */
  --ls-text-secondary: #3f4b57;
  --ls-text-muted: #5c6b79;
  --ls-text-label: #8a97a4;

  /* surfaces */
  --ls-surface: #fff;
  --ls-surface-alt: #f3f6f9;
  --ls-surface-active: rgba(1, 45, 80, .13);
  --ls-field: var(--ls-surface);   /* input fill — only Soft lifts it above the card */
  --ls-search-fill: aliceblue;     /* top-bar search box — the legacy CRM's blue tint */

  /* borders (legacy CRM parity, 18 Sep 2026 — matches this file's own long-standing doc) */
  --ls-border: #e0e0e0;
  --ls-border-mid: #ddd;
  --ls-border-light: #eee;

  /* status pairs */
  --ls-success-bg: #e8f5e9; --ls-success-text: #2e7d32; --ls-success: #28a745;
  --ls-warning-bg: #fff3e0; --ls-warning-text: #e65100; --ls-warning: #f0ad4e;
  --ls-danger-bg: #fce4ec;  --ls-danger-text: #c62828;  --ls-danger: #dc3545;
  --ls-neutral-bg: #f5f5f5; --ls-neutral-text: #9e9e9e;
  --ls-info-bg: #e3f2fd;

  /* search keyword highlight */
  --ls-mark-bg: #ffe58f; --ls-mark-text: #3d2f00;

  /* legacy's pale yellow entry box (the CRM's #ffffcc RadTextBox) — a hand-keyed fact among dates */
  --ls-field-note: #ffffcc;

  /* quoting-client mark — its own violet, so it can't be mistaken for Bill (warning), the lift
     marks (info) or Verified (success), all of which sit in the same grid row */
  --ls-quote-bg: #ede7f6; --ls-quote-text: #5e35b1;

  /* shape (softer / corporate) */
  --ls-radius-control: 8px;
  --ls-radius-tile: 8px;
  --ls-radius-card: 8px;
  --ls-radius-badge: 12px;
  --ls-shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.06);

  /* refresh — corporate accents, surfaces, tints, elevation */
  --ls-steel: #3d6a94;
  --ls-sky: #2b7fd4;
  --ls-vip: #a97b2e;
  --ls-vip-bg: #f7efdd;
  --ls-canvas: #f3f6f9;
  --ls-panel: #eef2f7;
  --ls-primary-tint: rgba(1, 45, 80, .07);
  --ls-primary-tint-2: rgba(1, 45, 80, .13);
  --ls-shadow-1: 0 1px 2px rgba(15, 34, 54, .06), 0 1px 3px rgba(15, 34, 54, .05);
  --ls-shadow-2: 0 10px 24px -8px rgba(15, 34, 54, .16);
  --ls-shadow-pop: 0 22px 50px -14px rgba(4, 20, 38, .34);

  /* shell — app rail gradient (darkest navy) and the module side nav on the brand navy beside it.
     The rail stays a shade darker so the two strips read as separate columns. */
  --ls-nav-top: #021d31;
  --ls-nav-bot: #04263f;
  --ls-nav-bg: #012d50;
  --ls-nav-ink: #c2ccd7;
  --ls-nav-ink-dim: #61788c;

  /* type */
  --ls-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  /* The five-step type scale (spec 2026-10-08-v3-type-scale-design, Je): pick by role, not by eye —
     xs caption/tiny (table headers, count pills), sm meta/eyebrow (chips, hints, band labels),
     base control/label (inputs, buttons, field labels, card titles), md value/body (read values,
     table cells, tabs, links), lg page (body, page headers). Themes never change these.
     16 Oct 2026 (Je): the house default is the 8 Oct scale +1px — staff found a 12px body hard to
     read, and the +2px of PR 4143 was a step too far. Every step rides --ls-text-adjust, the one
     offset the per-user Text size setting moves (Settings → Appearance; data-text-size on <html>,
     steps below). Icons and control heights do not scale with it. */
  --ls-text-adjust: 0px;
  --ls-fs-xs: calc(11px + var(--ls-text-adjust));
  --ls-fs-sm: calc(12px + var(--ls-text-adjust));
  --ls-fs-base: calc(13px + var(--ls-text-adjust));
  --ls-fs-md: calc(14px + var(--ls-text-adjust));
  --ls-fs-lg: calc(15px + var(--ls-text-adjust));
  /* Display steps (Phase 3, 8 Oct 2026; +1px 16 Oct 2026): xl sub-headings and dialog titles, 2xl
     section and page titles, 3xl hero/KPI captions, display KPI numbers. */
  --ls-fs-xl: calc(17px + var(--ls-text-adjust));
  --ls-fs-2xl: calc(19px + var(--ls-text-adjust));
  --ls-fs-3xl: calc(23px + var(--ls-text-adjust));
  --ls-fs-display: calc(29px + var(--ls-text-adjust));
  /* Icon glyph sizes (Phase 3): sm inline/row icons (12-14 -> 14), base (15-16), lg toolbar/head icons
     (17-20 -> 18), xl tile/hero icons (21-32 -> 28). Picked by job, same as the text scale. */
  --ls-icon-sm: 14px;
  --ls-icon: 16px;
  --ls-icon-lg: 18px;
  --ls-icon-xl: 28px;
}

/* Text size steps (Settings → Appearance, 16 Oct 2026): one offset moves the whole scale. Compact
   is the 8 Oct scale; Large is the 15 Oct +2px readability scale; Larger is the ceiling — at +2px the
   13px control text is 15px inside the fixed 28px input box, the most it holds cleanly. */
:root[data-text-size="compact"] { --ls-text-adjust: -1px; }
:root[data-text-size="large"] { --ls-text-adjust: 1px; }
:root[data-text-size="larger"] { --ls-text-adjust: 2px; }

/* Soft theme — dimmed light for long sessions. Same ink and layout as light, every surface dropped
   ~10% in luminance and cooled toward the brand navy; fields lift slightly above the card so forms
   still read as forms without pure-white glare. Header and nav inherit the light navy shell. */
:root[data-theme="soft"] {
  --ls-primary: #0b3a61;
  --ls-primary-hover: #0d4674;
  --ls-nav-bg: #0b3a61;
  --ls-link: #1f6cb8;
  --ls-link-muted: #5c87ac;

  --ls-text: #1c2630;
  --ls-text-secondary: #414d59;
  --ls-text-muted: #5d6c7a;
  --ls-text-label: #7f8d9a;

  --ls-surface: #edf1f5;
  --ls-surface-alt: #e2e8ef;
  --ls-surface-active: rgba(11, 58, 97, .15);
  --ls-field: #f6f8fb;
  --ls-search-fill: #e6f0fa;       /* aliceblue, a shade deeper so it still reads on Soft's grey bar */

  --ls-border: #c9d4de;
  --ls-border-mid: #bfcbd7;
  --ls-border-light: #dae2ea;

  --ls-success-bg: #dcebdd; --ls-success-text: #276b2c; --ls-success: #2f9048;
  --ls-warning-bg: #f4e6d0; --ls-warning-text: #a34a06; --ls-warning: #dc9a45;
  --ls-danger-bg: #f0dbe2;  --ls-danger-text: #a92c31;  --ls-danger: #c93a4c;
  --ls-neutral-bg: #e4e9ed; --ls-neutral-text: #75818c;
  --ls-info-bg: #d7e6f2;

  --ls-mark-bg: #ecd98e;
  --ls-field-note: #f7f1c6;

  --ls-quote-bg: #e3dbf1; --ls-quote-text: #4d2a9e;

  --ls-shadow-card-hover: 0 2px 8px rgba(15, 34, 54, 0.10);

  --ls-sky: #1f6cb8;
  --ls-vip-bg: #eee4cc;
  --ls-canvas: #d9e1e9;
  --ls-panel: #d2dce5;
  --ls-primary-tint: rgba(11, 58, 97, .09);
  --ls-primary-tint-2: rgba(11, 58, 97, .16);
  --ls-shadow-1: 0 1px 2px rgba(15, 34, 54, .08), 0 1px 4px rgba(15, 34, 54, .07);
  --ls-shadow-2: 0 10px 24px -8px rgba(15, 34, 54, .20);
  --ls-shadow-pop: 0 22px 50px -14px rgba(4, 20, 38, .38);
}

/* Dark theme — navy-tinted slate. Applied via data-theme="dark" on <html>. Only token values change;
   every component reads these, so the whole UI re-themes. */
:root[data-theme="dark"] {
  --ls-primary: #3d8bd4;
  --ls-primary-hover: #4f9bdf;
  --ls-header: #011d33;
  --ls-header-ink: #dfeaf5;
  --ls-link: #4b9bec;
  --ls-link-muted: #4a7ba3;

  --ls-text: #e8eef4;
  --ls-text-secondary: #b4bcc6;
  --ls-text-muted: #9aa7b4;
  --ls-text-label: #6d7c8a;

  --ls-surface: #0f1a25;
  --ls-surface-alt: #0a141d;
  --ls-surface-active: rgba(90, 150, 205, .22);
  --ls-search-fill: #16283a;       /* the same blue lift, in the dark register */

  --ls-border: #20303e;
  --ls-border-mid: #26323f;
  --ls-border-light: #182430;

  --ls-success-bg: #16301f; --ls-success-text: #6fd18c; --ls-success: #3ea55f;
  --ls-warning-bg: #35260f; --ls-warning-text: #f0a95f; --ls-warning: #c97a26;
  --ls-danger-bg: #351720;  --ls-danger-text: #f08a9c;  --ls-danger: #e0556b;
  --ls-neutral-bg: #1e252e; --ls-neutral-text: #8a929b;
  --ls-info-bg: #122536;

  --ls-mark-bg: #5a4a12; --ls-mark-text: #ffe08a;
  --ls-field-note: #3a371a;

  --ls-quote-bg: #2c2440; --ls-quote-text: #c6b3f0;

  --ls-shadow-card-hover: 0 2px 10px rgba(0, 0, 0, 0.45);

  /* refresh — dark counterparts */
  --ls-steel: #5b86af;
  --ls-sky: #4b9bec;
  --ls-vip: #d0a960;
  --ls-vip-bg: rgba(208, 169, 96, .15);
  --ls-canvas: #0a141d;
  --ls-panel: #101d29;
  --ls-primary-tint: rgba(90, 150, 205, .12);
  --ls-primary-tint-2: rgba(90, 150, 205, .22);
  --ls-shadow-1: 0 1px 3px rgba(0, 0, 0, .4);
  --ls-shadow-2: 0 12px 26px -10px rgba(0, 0, 0, .6);
  --ls-shadow-pop: 0 22px 50px -14px rgba(0, 0, 0, .7);
  --ls-nav-top: #050d15;
  --ls-nav-bot: #0a1722;
  /* the dark --ls-primary is the sky accent, not a ground — the nav takes the header navy instead */
  --ls-nav-bg: #011d33;
  --ls-nav-ink: #b8c4d0;
  --ls-nav-ink-dim: #56697b;
  color-scheme: dark;
}
