/* Design tokens (UI.md §2): the panel palette as --sh-* tokens, mapped onto Bootstrap 5.3's variables for light and
   dark. Contrast ratios (WCAG 2.1) are noted where text sits on a surface; keep them ≥ 4.5:1 (text) / 3:1 (controls).

   Petrol — the one brand colour: links, primary actions, the active nav item, focus, short links.
   Canvas — the page and the sidebar; Surface — cards, tables, inputs, menus; Raised — headers and hovers. */
:root,
[data-bs-theme="light"] {
  --sh-canvas: #F2F5F4;
  --sh-surface: #FFFFFF;
  --sh-raised: #F6F8F7;
  --sh-line: #DCE3E1;
  --sh-line-strong: #8C9995;        /* input borders: 3.0:1 on surface */
  --sh-ink: #1B2523;                /* 15.4:1 on surface */
  --sh-ink-soft: #3A4643;           /* labels: 9.9:1 */
  --sh-muted: #56635F;              /* secondary text: 6.3:1 on surface, 5.7:1 on canvas */
  --sh-petrol: #0B6E69;             /* 6.1:1 on surface; white on petrol 6.1:1 */
  --sh-petrol-hover: #095B57;
  --sh-petrol-press: #074B48;
  --sh-petrol-subtle: #E2F0EE;
  --sh-petrol-border: #B5D9D4;
  --sh-petrol-text: #075450;        /* 7.5:1 on petrol-subtle */
  --sh-on-petrol: #FFFFFF;
  --sh-shadow-pop: 0 1px 2px rgba(16, 42, 39, 0.06), 0 12px 32px -8px rgba(16, 42, 39, 0.18);

  --bs-body-color-rgb: 27, 37, 35;
  --bs-secondary-color-rgb: 86, 99, 95;
  --bs-border-color-translucent: rgba(27, 37, 35, 0.12);
  --bs-primary-rgb: 11, 110, 105;
  --bs-link-color-rgb: 11, 110, 105;
  --bs-link-hover-color-rgb: 9, 91, 87;
  --bs-focus-ring-color: rgba(11, 110, 105, 0.28);
}

[data-bs-theme="dark"] {
  --sh-canvas: #0D1312;
  --sh-surface: #141C1B;
  --sh-raised: #1A2422;
  --sh-line: #26322F;
  --sh-line-strong: #5B6B68;        /* 3.1:1 on surface */
  --sh-ink: #E4ECEA;                /* 14.6:1 on surface */
  --sh-ink-soft: #C3CFCC;
  --sh-muted: #98A8A4;              /* 7.0:1 on surface */
  --sh-petrol: #3BC2B4;             /* links/text: 8.6:1 on surface */
  --sh-petrol-hover: #5ED3C6;
  --sh-petrol-press: #2FA89B;
  --sh-petrol-subtle: #0F2E2B;
  --sh-petrol-border: #1E5550;
  --sh-petrol-text: #7FDCD1;        /* 9.6:1 on petrol-subtle */
  --sh-on-petrol: #04201D;          /* 7.4:1 on petrol */
  --sh-shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -10px rgba(0, 0, 0, 0.6);

  --bs-body-color-rgb: 228, 236, 234;
  --bs-secondary-color-rgb: 152, 168, 164;
  --bs-border-color-translucent: rgba(228, 236, 234, 0.12);
  --bs-primary-rgb: 59, 194, 180;
  --bs-link-color-rgb: 59, 194, 180;
  --bs-link-hover-color-rgb: 94, 211, 198;
  --bs-focus-ring-color: rgba(59, 194, 180, 0.32);
}

/* Bootstrap variables mapped onto the tokens. Identical for both themes: every [data-bs-theme] scope re-resolves
   them against its own --sh-* values (this block comes after Bootstrap's own theme blocks, so it wins). */
:root,
[data-bs-theme] {
  --sh-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sh-radius-surface: 14px;        /* cards, tables, modals */
  --sh-radius-control: 9px;         /* buttons, inputs, nav items */
  --sh-sidebar-width: 252px;
  --sh-navbar-height: 60px;
  --sh-shorturl-color: var(--sh-petrol-text);

  --bs-body-bg: var(--sh-canvas);
  --bs-body-color: var(--sh-ink);
  --bs-emphasis-color: var(--sh-ink);
  --bs-heading-color: var(--sh-ink);
  --bs-secondary-color: var(--sh-muted);
  --bs-secondary-bg: var(--sh-surface);
  --bs-tertiary-bg: var(--sh-raised);
  --bs-border-color: var(--sh-line);
  --bs-primary: var(--sh-petrol);
  --bs-primary-text-emphasis: var(--sh-petrol-text);
  --bs-primary-bg-subtle: var(--sh-petrol-subtle);
  --bs-primary-border-subtle: var(--sh-petrol-border);
  --bs-link-color: var(--sh-petrol);
  --bs-link-hover-color: var(--sh-petrol-hover);
  --bs-code-color: var(--sh-petrol-text);
  --bs-border-radius: var(--sh-radius-control);
  --bs-border-radius-lg: var(--sh-radius-surface);
  --bs-border-radius-sm: 6px;
  --bs-body-font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-font-monospace: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bs-body-font-size: 0.9375rem;
  --bs-body-line-height: 1.55;
}
