/* =============================================================================
   sl-tokens.css — StayLinked SmartHub Design Tokens
   -----------------------------------------------------------------------------
   SINGLE SOURCE OF TRUTH for colour, type, space, radius, elevation and motion.

   Imported from Figma: "SL Mobile - components - Testing Anima V2"
     file  ofFLj92pwRv2124o89PR1o
     32:973   Buttons - reusable patterns
     32:829   Text field / inputs
     32:773   Profile pieces (cards + kebab menu)
     48:2445  Active / Inactive - worker experience
     41:2092  Settings button

   RULES
     1. This file must be the FIRST stylesheet loaded on every page.
     2. No other stylesheet may declare a :root block. Add tokens here instead.
     3. Author new CSS against the semantic --sl-* layer, never the raw palette.
     4. The legacy --SLDS-* names at the bottom are a compatibility shim for
        existing stylesheets. Do not use them in new code.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. Typeface
   Light, Regular, Medium, and SemiBold are real files. Weight 700 is still
   synthesised from Regular; there is no Roboto-Bold in /fonts.
   Atkinson is the Dyslexia-friendly face, switched by html[data-font].
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson/AtkinsonHyperlegible-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson/AtkinsonHyperlegible-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Base typography. Replaces the `* { font-family }` reset that was duplicated
   in 22 legacy stylesheets. Form controls don't inherit fonts by default, so
   they are set explicitly; Font Awesome's class selectors still outrank these
   element selectors, so icon fonts are unaffected. */
html {
  font-size: calc(16px * var(--sl-user-font-scale, 1));
}

body {
  font-family: var(--sl-font-family);
}
button, input, select, textarea, optgroup {
  font-family: inherit;
}

:root {
  /* ===========================================================================
     2. PALETTE — raw values. Never reference these directly in component CSS.
     ======================================================================== */

  /* Blue — primary brand / interactive */
  --sl-palette-blue-10:   #F7FAFF;
  --sl-palette-blue-20:   #E7F3FF;
  --sl-palette-blue-30:   #DCEAF9;
  --sl-palette-blue-40:   #CEE3F9;
  --sl-palette-blue-50:   #A5C7EA;
  --sl-palette-blue-80:   #5999DA;
  --sl-palette-blue-85:   #2B6DE8;
  --sl-palette-blue-100:  #1871CB;   /* Figma primary button fill */
  --sl-palette-blue-110:  #1665B6;
  --sl-palette-blue-120:  #0F4A8C;   /* conflict resolved: was #115BA6 in 5 files */
  --sl-palette-blue-140:  #1F4B7A;   /* was referenced 10x but never defined */
  --sl-palette-blue-150:  #1D3F64;

  /* Blue-grey — surfaces, hairlines */
  --sl-palette-bluegrey-10: #F7F9FD;  /* conflict resolved: was #F0F5FC in 1 file */
  --sl-palette-bluegrey-15: #EDF1F7;  /* app-shell canvas: deep enough that white cards read as floating */
  --sl-palette-bluegrey-20: #E4E9F0;
  --sl-palette-bluegrey-30: #D8E0EE;
  --sl-palette-bluegrey-50: #B7CADE;  /* Figma card border */
  --sl-palette-bluegrey-70: #88A8CA;
  --sl-palette-bluegrey-90: #4D7AA8;

  /* Neutral grey */
  --sl-palette-grey-10:   #F4F4F4;
  --sl-palette-grey-20:   #EFEFEF;   /* was referenced but never defined */
  --sl-palette-grey-30:   #E8E8EB;   /* Figma disabled/readonly input fill */
  --sl-palette-grey-35:   #E5E6EA;   /* Figma pressed surface (card + settings) */
  --sl-palette-grey-50:   #D4D2D2;
  --sl-palette-grey-60:   #B6B6B6;   /* Figma destructive border */
  --sl-palette-grey-65:   #939292;   /* Figma settings-menu chevron */
  --sl-palette-grey-70:   #767676;
  --sl-palette-grey-75:   #7E7E7E;   /* Figma input border */
  --sl-palette-grey-80:   #606060;   /* Figma destructive label */
  --sl-palette-grey-85:   #494949;   /* was referenced but never defined */
  --sl-palette-grey-88:   #414141;   /* Figma input value text */
  --sl-palette-grey-90:   #2E2E2E;   /* was referenced but never defined */
  --sl-palette-grey-100:  #383938;   /* Figma body/card text */
  --sl-palette-grey-800:  #303540;   /* was referenced but never defined */
  --sl-palette-ink:       #1F201F;   /* app header bar */

  /* Red — destructive / error */
  --sl-palette-red-10:    #FEF7F8;
  --sl-palette-red-50:    #F5CFCB;
  --sl-palette-red-80:    #B05F61;
  --sl-palette-red-100:   #DF2D30;
  --sl-palette-red-110:   #BA2A2D;   /* Figma input error border + icon */
  --sl-palette-red-120:   #A32729;
  --sl-palette-coral-100: #FF4B33;   /* filtered column icon */

  /* Green — success / brand mark */
  --sl-palette-green-20:  #E9F0E5;
  --sl-palette-green-60:  #C9DEBD;
  --sl-palette-green-90:  #89AB76;
  --sl-palette-green-100: #70B248;   /* conflict resolved: was #89AB76 in 3 files */
  --sl-palette-green-110: #629D3F;
  --sl-palette-green-120: #528335;
  --sl-palette-green-mark:#64B145;   /* StayLinked logo glyph */
  --sl-palette-neon-green-100: #76D33E;

  /* Amber / purple — accents */
  --sl-palette-orange-10: #FDF9F1;
  --sl-palette-orange-50: #B89A5B;
  --sl-palette-orange-120:#AF6104;
  --sl-palette-go-from:   #FF7426;   /* Convert Now / Download fill start */
  --sl-palette-go-to:     #F93A13;   /* Convert Now / Download fill end */
  --sl-palette-yellow-110:#E8B306;
  --sl-palette-purple-10: #F3F0F5;
  --sl-palette-purple-120:#753385;
  /* Material Design 3 purple (baseline primary) — converted-stage marker */
  --sl-palette-md3-purple-10: #21005D;
  --sl-palette-md3-purple-20: #381E72;
  --sl-palette-md3-purple-30: #4F378B;
  --sl-palette-md3-purple-40: #6750A4;
  --sl-palette-md3-purple-80: #D0BCFF;
  --sl-palette-md3-purple-90: #EADDFF;

  /* Absolutes */
  --sl-palette-white:     #FFFFFF;
  --sl-palette-black:     #000000;

  /* ===========================================================================
     3. SEMANTIC COLOUR — reference these in component CSS.
     ======================================================================== */

  /* Surfaces */
  --sl-surface-page:        var(--sl-palette-bluegrey-10);
  --sl-surface-canvas:      var(--sl-palette-bluegrey-15);  /* ground behind floating shell panels */
  --sl-surface-studio-wash: var(--sl-surface-canvas);       /* Migration Tool outer frame */
  --sl-surface-raised:      var(--sl-palette-white);
  --sl-surface-sunken:      var(--sl-palette-grey-10);
  --sl-surface-pressed:     var(--sl-palette-grey-35);
  --sl-surface-disabled:    var(--sl-palette-grey-30);
  --sl-surface-accent:      var(--sl-palette-blue-20);
  --sl-surface-accent-strong: var(--sl-palette-blue-40);
  --sl-surface-inverse:     var(--sl-palette-ink);

  /* Scrim — the veil over the page behind a modal or a walkthrough spotlight.
     Built from the fixed ink palette, not a surface, so a veil stays dark in
     every theme. Strong is for a spotlight, where the veiled page must
     recede far enough that one element reads as the only live thing. */
  --sl-scrim:               color-mix(in srgb, var(--sl-palette-ink) 45%, transparent);
  --sl-scrim-strong:        color-mix(in srgb, var(--sl-palette-ink) 78%, transparent);

  /* Print sheets (a key map to print, R2): paper and ink, black on white in every theme as paper is,
     so no theme block redefines them. */
  --sl-print-paper:         var(--sl-palette-white);
  --sl-print-ink:           var(--sl-palette-black);

  /* Text */
  --sl-text-primary:        var(--sl-palette-grey-100);
  --sl-text-secondary:      var(--sl-palette-grey-80);
  --sl-text-muted:          var(--sl-palette-grey-70);
  --sl-text-field:          var(--sl-palette-grey-88);
  --sl-text-on-accent:      var(--sl-palette-white);
  --sl-text-inverse:        var(--sl-palette-white);
  --sl-text-link:           var(--sl-palette-blue-100);
  --sl-text-danger:         var(--sl-palette-red-110);
  --sl-icon-filter-active:  var(--sl-palette-coral-100);  /* column filter icon while it filters the list */

  /* Borders */
  --sl-border-subtle:       var(--sl-palette-bluegrey-50);
  --sl-border-hairline:     var(--sl-palette-bluegrey-20);  /* dividers inside a card */
  --sl-border-field:        var(--sl-palette-grey-75);
  --sl-border-strong:       var(--sl-palette-grey-60);
  --sl-border-accent:       var(--sl-palette-blue-100);
  --sl-border-accent-soft:  var(--sl-palette-blue-50);
  --sl-border-danger:       var(--sl-palette-red-110);
  --sl-border-success:      var(--sl-palette-green-60);

  /* Interactive — primary */
  --sl-action-primary-bg:         var(--sl-palette-blue-100);
  --sl-action-primary-bg-hover:   var(--sl-palette-blue-110);
  --sl-action-primary-bg-active:  var(--sl-palette-blue-120);
  --sl-action-primary-fg:         var(--sl-palette-white);

  /* Interactive — secondary (outlined) */
  --sl-action-secondary-bg:        var(--sl-palette-white);   /* Package Editor Redesign: white fill. Was blue-10. */
  --sl-action-secondary-bg-hover:  var(--sl-palette-blue-20);
  --sl-action-secondary-bg-active: var(--sl-palette-blue-30);
  --sl-action-secondary-fg:        var(--sl-palette-blue-100);
  --sl-action-secondary-border:    var(--sl-palette-blue-50);

  /* Interactive — tertiary ("other" in Figma) */
  --sl-action-tertiary-bg:        var(--sl-palette-blue-20);
  --sl-action-tertiary-bg-hover:  var(--sl-palette-blue-30);
  --sl-action-tertiary-bg-active: var(--sl-palette-blue-40);
  --sl-action-tertiary-fg:        var(--sl-palette-blue-100);

  /* Interactive — destructive */
  --sl-action-danger-bg:         var(--sl-palette-blue-10);
  --sl-action-danger-bg-hover:   var(--sl-palette-bluegrey-10);
  --sl-action-danger-bg-active:  var(--sl-palette-bluegrey-20);
  --sl-action-danger-fg:         var(--sl-palette-grey-80);
  --sl-action-danger-border:     var(--sl-palette-grey-60);

  /* Interactive — go (Convert Now, Download). Solid fill; icon plus label. Pages use .vi-btn--go. */
  --sl-action-go-from: var(--sl-palette-go-from);
  --sl-action-go-to:   var(--sl-palette-go-to);
  --sl-action-go-glow: color-mix(in srgb, var(--sl-palette-go-to) 32%, transparent);
  --sl-action-go-fill: var(--sl-action-go-from);
  --sl-action-go-press: color-mix(in srgb, var(--sl-palette-black) 20%, transparent);
  --sl-action-go-fg: var(--sl-palette-white);
  --sl-action-go-fg-active: var(--sl-palette-grey-60);
  --sl-action-go-rule: color-mix(in srgb, var(--sl-action-go-fg) 42%, transparent);

  /* Feedback */
  --sl-feedback-success-bg:  var(--sl-palette-green-20);
  --sl-feedback-success-fg:  var(--sl-palette-green-120);
  --sl-feedback-success-solid: var(--sl-palette-green-100);
  --sl-mode-direct-bg:     var(--sl-palette-purple-10);
  --sl-mode-direct-fg:     var(--sl-palette-purple-120);
  --sl-mode-direct-border: var(--sl-palette-purple-120);
  --sl-phase-converted-bg:     var(--sl-palette-md3-purple-90);
  --sl-phase-converted-fg:     var(--sl-palette-md3-purple-10);
  --sl-phase-converted-border: var(--sl-palette-md3-purple-40);
  --sl-phase-converted-solid:  var(--sl-palette-md3-purple-40);
  --sl-phase-converted-solid-hover: color-mix(in srgb, var(--sl-palette-md3-purple-40) 88%, var(--sl-palette-black));
  --sl-phase-converted-on-solid: var(--sl-palette-white);
  --sl-mode-hosted-bg:     var(--sl-surface-accent);
  --sl-mode-hosted-fg:     var(--sl-text-link);
  --sl-mode-hosted-border: var(--sl-border-accent);
  --sl-feedback-danger-bg:   var(--sl-palette-red-10);
  --sl-feedback-danger-fg:   var(--sl-palette-red-110);
  --sl-feedback-warning-bg:  var(--sl-palette-orange-10);
  --sl-feedback-warning-fg:  var(--sl-palette-orange-50);
  --sl-feedback-info-bg:     var(--sl-palette-blue-20);
  --sl-feedback-info-fg:     var(--sl-palette-blue-120);
  /* A filled alert mark, not text on a tint: the notices badge. Deliberately
     the same red in both themes -- the dark blocks below leave it alone,
     because a badge that dimmed in dark mode would be quietest exactly where
     it most needs to be seen. */
  --sl-feedback-danger-solid: var(--sl-palette-red-100);
  /* A filled "worth a look" mark. Deliberately stronger than
     --sl-feedback-warning-fg, which is tuned to sit beside text: an 8px dot on
     its own needs presence, and the muted gold disappears at that size. */
  --sl-feedback-warning-solid: var(--sl-palette-orange-120);
  /* Velocity import marks: 8px cores inside an 18px halo. The muted
     feedback text colours disappear at that size, so these are saturated fills. */
  --sl-import-as-is:   var(--sl-palette-green-mark);   /* #64B145 */
  --sl-import-adapted: var(--sl-palette-yellow-110);   /* #E8B306 */

  /* Focus ring — WCAG 2.2 focus-visible treatment */
  /* Selected and active — Material Design 3 purple (baseline primary).
     Blue already means "you can act on this". Purple means "this is the one you
     are on": the field with the caret in it, the row you picked, the tab you are
     reading. Keeping the two apart stops a focused input from reading as a
     button. Contrast on white is 6.44:1, better than the blue it accents. */
  --sl-selected-fg:       var(--sl-palette-md3-purple-10);
  --sl-selected-bg:       var(--sl-palette-md3-purple-90);
  --sl-selected-border:   var(--sl-palette-md3-purple-40);
  --sl-selected-ring:     var(--sl-palette-md3-purple-40);
  --sl-selected-ring-soft: var(--sl-palette-md3-purple-90);
  --sl-selected-solid:    var(--sl-palette-md3-purple-40);
  --sl-selected-on-solid: var(--sl-palette-white);

  --sl-focus-ring-color:  var(--sl-selected-ring);
  --sl-focus-ring-offset: 2px;
  --sl-focus-ring-width:  2px;

  /* ===========================================================================
     4. TYPOGRAPHY — scale lifted from the Figma text styles.
     Sizes are rem so browser zoom / OS text scaling works. 1rem = 16px.
     ======================================================================== */
  --sl-font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --sl-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sl-font-weight-light:    300;
  --sl-font-weight-regular:  400;
  --sl-font-weight-medium:   500;
  --sl-font-weight-semibold: 600;
  --sl-font-weight-bold:     700;

  /* Figma "Status indicator / Current" — Roboto Light 11 / 20 */
  --sl-font-size-2xs:  0.6875rem;  /* 11px */
  /* Figma card description — Roboto Regular 12 / 20 */
  --sl-font-size-xs:   0.75rem;    /* 12px */
  /* Figma label-large: button, input value, settings label — 14 / 20 */
  --sl-font-size-sm:   0.875rem;   /* 14px */
  /* Figma card title — Roboto SemiBold 16 / 20 */
  --sl-font-size-md:   1rem;       /* 16px */
  /* Phone/tablet text fields. Never below 16px or iOS zooms the field. */
  --sl-font-size-input: max(16px, 1rem);
  --sl-font-size-lg:   1.125rem;   /* 18px */
  --sl-font-size-xl:   1.25rem;    /* 20px — section card title (h2) */
  --sl-font-size-2xl:  1.5625rem;  /* 25px — app title in header */
  /* Package Editor Redesign (Nov 2026) role steps. Use the role, not the size. */
  --sl-font-size-hint:     0.8125rem;  /* 13px — help text under a field, row hint, table caption */
  --sl-font-size-row:      0.9375rem;  /* 15px — switch row label, button label, list item title */
  --sl-font-size-subhead:  1.0625rem;  /* 17px — block title inside a card (h3), fold title */
  --sl-font-size-page-title: clamp(1.25rem, 1rem + 0.8vw, 1.875rem);  /* up to 30px — page masthead h1 */
  --sl-font-size-breadcrumb: var(--sl-font-size-sm);                    /* 14px — breadcrumb trail on every page; secondary to the page title */
  --sl-breadcrumb-item-max:  20rem;                                     /* 320px — a parent link longer than this ends in an ellipsis */
  /* Text field value. 16px so the value reads at arm's length and iOS never zooms. */
  --sl-field-font-size: var(--sl-font-size-input);

  --sl-line-height-tight:  1.25;
  --sl-line-height-body:   1.4286;  /* 20px on 14px — the Figma default */
  --sl-line-height-loose:  1.6;

  /* Figma label-large/tracking */
  --sl-letter-spacing-label: 0.1px;
  --sl-letter-spacing-none:  0;

  /* ===========================================================================
     5. SPACING — 4px base grid. Figma uses 5/8/10/12/16 which all land on it.
     ======================================================================== */
  --sl-space-0:   0;
  --sl-space-1:   0.25rem;   /*  4px */
  --sl-space-2:   0.5rem;    /*  8px — Figma input icon gap */
  --sl-space-2h:  0.625rem;  /* 10px — Figma card padding, button y-padding */
  --sl-space-3:   0.75rem;   /* 12px — Figma input padding */
  --sl-space-4:   1rem;      /* 16px — Figma button x-padding */
  --sl-space-5:   1.25rem;   /* 20px */
  --sl-space-6:   1.5rem;    /* 24px */
  --sl-space-8:   2rem;      /* 32px */
  --sl-space-10:  2.5rem;    /* 40px */
  --sl-space-12:  3rem;      /* 48px */
  --sl-space-16:  4rem;      /* 64px */

  /* ===========================================================================
     6. RADIUS
     ======================================================================== */
  --sl-radius-xs:   2px;   /* Figma input */
  --sl-radius-sm:   4px;   /* Figma kebab menu; text field */
  --sl-radius-md:   8px;   /* Figma button, card, settings button */
  --sl-radius-lg:   12px;
  --sl-radius-xl:   1.5rem; /* 24px */
  --sl-radius-2xl:  2.25rem; /* 36px studio inner frame */
  --sl-radius-pill: 999px;
  --sl-field-radius: var(--sl-radius-sm);  /* input, select, textarea. Was 2px. */

  /* ===========================================================================
     7. ELEVATION — Figma "M3/Elevation Light" styles, verbatim.
     ======================================================================== */
  --sl-elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.30), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --sl-elevation-2: 0 1px 2px 0 rgba(0, 0, 0, 0.30), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  --sl-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.30);
  --sl-elevation-none: none;
  /* Soft blue lift for start panels and hub cards. Not M3; the hairline
     border does most of the work. */
  --sl-elevation-start: 0 10px 28px color-mix(in srgb, var(--sl-action-primary-bg) 14%, transparent);

  /* ===========================================================================
     8. SIZING — control heights from Figma frames.
     ======================================================================== */
  --sl-touch-min:          44px;  /* WCAG 2.2 minimum pointer target */
  /* Package Editor Redesign (Nov 2026): every button, field, select and icon
     button is at least the touch minimum on every screen size, and grows with
     the text-size preference. Was a fixed 40px. */
  --sl-control-height:     max(var(--sl-touch-min), 2.75rem);  /* button, input, settings button */
  --sl-control-height-sm:  32px;
  --sl-control-height-lg:  48px;
  --sl-icon-button-size:   max(var(--sl-touch-min), 2.75rem);  /* icon-only button, kebab menu */
  --sl-card-min-height:    60px;
  /* Page column for editor-style pages: content never runs wider than this and
     keeps a gutter that scales with the window. */
  --sl-page-max:           75rem;   /* 1200px */
  --sl-page-gutter:        clamp(var(--sl-space-4), 4vw, var(--sl-space-12));
  --sl-header-height:      76px; /* single-row top bar (desktop / tablet) */
  --sl-header-height-phone: 76px; /* single-row top bar (phone; tools are in the tab bar) */
  --sl-appnav-slim-w:      56px;  /* SmartHub's main nav at the left of every page, slim (sl-app-nav.css) */
  --sl-appnav-open-w:      248px; /* the main nav expanded: docked on a wide window, over the page otherwise */
  /* A product's own colour: its mark in the main nav (sl-app-nav.css) and on its product page (product-overview.css). */
  --sl-product-smartte:       #3f7d20;
  --sl-product-smartbrowser:  #0e7490;
  --sl-brand-mark-h:       2rem; /* S-mark in the identity column */
  --sl-brand-mark:         var(--sl-palette-green-mark); /* StayLinked S-mark */

  /* ===========================================================================
     9. LAYOUT — see sl-responsive.css for the matching breakpoints.
     Breakpoints cannot live in custom properties (@media can't read var()),
     so they are documented here and hard-coded there. Keep the two in sync.
     Four displays, same numbers on the window and on the page box:
       smartphone  ≤700px   one column (also landscape + max-height 500px)
       tablet      ≤900px   panes and sidebars stack
       laptop      901–1199px  fluid columns, no new stacking
       external    ≥1600px  same columns, wider gutter
     sm 640px is only an extra-small phone tweak. lg 1200px is the designed desktop width.
     Phone and tablet raise --sl-control-height to --sl-touch-min in sl-shell.css.
     ======================================================================== */
  --sl-container-max:      1440px;
  --sl-container-narrow:   768px;
  --sl-content-gutter:     clamp(1rem, 3vw, 2.5rem);

  /* Workspace start/hub cards. Comfortable density (Accessible, Dyslexia,
     Low vision, Keyboard-first) widens the cluster and the card floor so
     type and spacing can wrap instead of packing into two skinny columns. */
  --sl-ws-start-max:       48rem;
  --sl-ws-hub-max:         80rem;
  --sl-ws-a11y-max:        50.4rem;
  --sl-ws-card-min:        18rem;
  --sl-ws-card-gap:        var(--sl-space-4);
  --sl-ws-card-pad:        var(--sl-space-5);

  /* List and panel (SmartTE / SmartBrowser configuration). Destinations
     in the first column, jobs in the second. The page holds the form. */
  --sl-pane-list:          16.75rem;
  --sl-pane-panel:         19.25rem;

  /* Migration Tool single-page studio */
  --sl-studio-nav-width:   13.75rem; /* 220px labeled rail */
  --sl-studio-rail-width:  16.25rem; /* 260px convert / extract */
  --sl-studio-icon-rail:   3.5rem;   /* 56px tablet icon rail */
  --sl-studio-promo-from:  var(--sl-palette-blue-120);
  --sl-studio-promo-to:    var(--sl-palette-md3-purple-20);
  --sl-studio-promo-fg:    var(--sl-palette-white);
  --sl-studio-promo-chip:  color-mix(in srgb, var(--sl-palette-white) 18%, transparent);
  --sl-studio-promo-complete-from: color-mix(in srgb, var(--sl-palette-green-mark) 78%, var(--sl-palette-ink));
  --sl-studio-promo-complete-to:   color-mix(in srgb, var(--sl-palette-green-120) 55%, var(--sl-palette-ink));

  /* ===========================================================================
     10. MOTION
     ======================================================================== */
  --sl-duration-fast:   120ms;
  --sl-duration-base:   180ms;
  --sl-duration-slow:   280ms;
  --sl-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --sl-easing-decel:    cubic-bezier(0, 0, 0, 1);

  /* ===========================================================================
     11. Z-INDEX
     ======================================================================== */
  --sl-z-base:     0;
  --sl-z-sticky:   50;
  --sl-z-header:   99;
  --sl-z-dropdown: 500;
  --sl-z-overlay:  900;
  --sl-z-modal:    1000;
  --sl-z-toast:    1100;

  /* ===========================================================================
     12. LEGACY COMPATIBILITY SHIM
     Existing stylesheets reference these --SLDS-* names. They now resolve to
     the palette above so there is exactly one place to change a value.
     DO NOT USE IN NEW CODE — use the --sl-* semantic tokens instead.

     Includes the 7 names that were referenced across the codebase but never
     actually defined anywhere (marked *). Two of those had no fallback value,
     so their declarations were silently dead:
       --SLDS-Grey-Grey-20   .btn-secondary:disabled had no background
       --SLDS-Grey-Grey-800  list-table column headers had no text colour
     ======================================================================== */
  --SLDS-White:                 var(--sl-palette-white);

  --SLDS-Blue-Blue-10:          var(--sl-palette-blue-10);
  --SLDS-Blue-Blue-20:          var(--sl-palette-blue-20);
  --SLDS-Blue-Blue-30:          var(--sl-palette-blue-30);
  --SLDS-Blue-Blue-40:          var(--sl-palette-blue-40);
  --SLDS-Blue-Blue-50:          var(--sl-palette-blue-50);
  --SLDS-Blue-Blue-80:          var(--sl-palette-blue-80);
  --SLDS-Blue-Blue-100:         var(--sl-palette-blue-100);
  --SLDS-Blue-Blue-110:         var(--sl-palette-blue-110);
  --SLDS-Blue-Blue-120:         var(--sl-palette-blue-120);
  --SLDS-Blue-Blue-140:         var(--sl-palette-blue-140);   /* * */
  --SLDS-Blue-Blue-150:         var(--sl-palette-blue-150);

  --SLDS-Blue-grey-Blue-grey-10: var(--sl-palette-bluegrey-10);
  --SLDS-Blue-grey-Blue-grey-20: var(--sl-palette-bluegrey-20);
  --SLDS-Blue-grey-Blue-grey-30: var(--sl-palette-bluegrey-30);
  --SLDS-Blue-grey-Blue-grey-50: var(--sl-palette-bluegrey-50);
  --SLDS-Blue-grey-Blue-grey-70: var(--sl-palette-bluegrey-70);
  --SLDS-Blue-grey-Blue-grey-90: var(--sl-palette-bluegrey-90);

  --SLDS-Grey-Grey-10:          var(--sl-palette-grey-10);
  --SLDS-Grey-Grey-20:          var(--sl-palette-grey-20);    /* * */
  --SLDS-Grey-Grey-30:          var(--sl-palette-grey-30);
  --SLDS-Grey-Grey-50:          var(--sl-palette-grey-50);
  --SLDS-Grey-Grey-60:          var(--sl-palette-grey-60);
  --SLDS-Grey-Grey-70:          var(--sl-palette-grey-70);
  --SLDS-Grey-Grey-80:          var(--sl-palette-grey-80);
  --SLDS-Grey-Grey-90:          var(--sl-palette-grey-85);    /* * */
  --SLDS-Grey-Grey-100:         var(--sl-palette-grey-100);
  --SLDS-Grey-Grey-800:         var(--sl-palette-grey-800);   /* * */
  --SLDS-Gray-90:               var(--sl-palette-grey-90);    /* * (Gray/Grey typo kept for compat) */
  --Grey-100:                   var(--sl-palette-grey-100);   /* * */
  --Primary-Gray-800:           var(--sl-palette-grey-800);

  --SLDS-Red-Red-10:            var(--sl-palette-red-10);
  --SLDS-Red-Red-50:            var(--sl-palette-red-50);
  --SLDS-Red-Red-80:            var(--sl-palette-red-80);
  --SLDS-Red-Red-100:           var(--sl-palette-red-100);
  --SLDS-Red-Red-110:           var(--sl-palette-red-110);
  --SLDS-Red-Red-120:           var(--sl-palette-red-120);

  --SLDS-Green-Green-20:        var(--sl-palette-green-20);
  --SLDS-Green-Green-60:        var(--sl-palette-green-60);
  --SLDS-Green-Green-90:        var(--sl-palette-green-90);
  --SLDS-Green-Green-100:       var(--sl-palette-green-100);
  --SLDS-Green-Green-110:       var(--sl-palette-green-110);
  --SLDS-Green-Green-120:       var(--sl-palette-green-120);
  --SLDS-Neon-Green-100:        var(--sl-palette-neon-green-100);
  --SLDS-Neon-Green-130:        var(--sl-palette-neon-green-100);

  --SLDS-Orange-Orange-10:      var(--sl-palette-orange-10);
  --SLDS-Orange-Orange-50:      var(--sl-palette-orange-50);
  --SLDS-Orange-Orange-120:     var(--sl-palette-orange-120);
  --SLDS-Yellow-Yellow-110:     var(--sl-palette-yellow-110);
  --SLDS-Purple-Purple-10:      var(--sl-palette-purple-10);
  --SLDS-Purple-Purple-120:     var(--sl-palette-purple-120);

  --Static-Display-Medium-Tracking: 0;                        /* * */

  /* Pre-token-layer elevation alias kept for SmartBrowser + sbp-file-operations.
     Slightly weaker than the Figma M3 spec; new code uses --sl-elevation-1. */
  --m3-elevation-light-1: 0px 1px 3px rgba(0, 0, 0, 0.2);
}

/* -----------------------------------------------------------------------------
   Respect the user's reduced-motion preference everywhere, unless they
   explicitly chose Off in Accessibility settings (data-reduce-motion="off").
   data-reduce-motion="on" forces reduced motion even when the OS does not.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-reduce-motion="off"]) {
    --sl-duration-fast: 0ms;
    --sl-duration-base: 0ms;
    --sl-duration-slow: 0ms;
  }
}
html[data-reduce-motion="on"] {
  --sl-duration-fast: 0ms;
  --sl-duration-base: 0ms;
  --sl-duration-slow: 0ms;
}

/* =============================================================================
   13. DARK THEME
   -----------------------------------------------------------------------------
   Three states, the macOS/Windows convention:
     • "system" (default)  — no data-theme attribute; prefers-color-scheme decides
     • "light"             — data-theme="light" on <html>, wins over a dark OS
     • "dark"              — data-theme="dark"  on <html>, wins over a light OS

   Only the SEMANTIC layer flips. The raw palette above is never redefined, so
   "blue-100" always means #1871CB — what changes is which token points where.

   Dark surfaces step LIGHTER as they rise (shadows barely read on dark), so
   elevation is carried by surface value plus a border rather than by shadow.
   Accents are lightened and slightly desaturated: #1871CB on a dark ground is
   too low-contrast for text and vibrates against it.

   The two legacy aliases at the end are the bridge that lets un-migrated page
   CSS follow the theme: --SLDS-White backs 210 background declarations and
   --SLDS-Grey-Grey-100 carries 182 text declarations across the app.
   ========================================================================== */

/* Tell the browser which form-control / scrollbar chrome to render */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Surfaces — deepest to highest */
    --sl-surface-canvas:        #101419;
    --sl-surface-page:          #161B22;
    --sl-surface-studio-wash:  var(--sl-surface-canvas);
    --sl-surface-raised:        #1C222C;
    --sl-surface-sunken:        #232A35;
    --sl-surface-pressed:       #2A3240;
    --sl-surface-disabled:      #262C35;
    --sl-surface-accent:        #1B2E45;
    --sl-surface-accent-strong: #24405E;
    --sl-surface-inverse:       #1C222C;

    /* Text */
    --sl-text-primary:    #E3E8EF;
    --sl-text-secondary:  #A9B3C0;
    --sl-text-muted:      #7E8895;
    --sl-text-field:      #DCE2EA;
    --sl-text-on-accent:  #FFFFFF;
    --sl-text-inverse:    #E3E8EF;
    --sl-text-link:       #71ABE8;
    --sl-text-danger:     #F08C8E;

    /* Borders */
    --sl-border-subtle:      #2B3440;
    --sl-border-hairline:    #252D38;
    --sl-border-field:       #4A5563;
    --sl-border-strong:      #3D4855;
    --sl-border-accent:      #4D9BE8;
    --sl-border-accent-soft: #35506F;
    --sl-border-danger:      #C25A5C;
    --sl-border-success:     #528335;

    /* Actions */
    --sl-action-primary-bg:         #2470C8;   /* 4.97:1 under white text (AA); was #2478D4, 4.46:1 */
    --sl-action-primary-bg-hover:   #1F6ABF;   /* 5.42:1; a step darker, as in the light theme (was #2E86E0, 3.75:1) */
    --sl-action-primary-bg-active:  #1A63B0;
    --sl-action-primary-fg:         #FFFFFF;

    --sl-action-secondary-bg:        #1A2331;
    --sl-action-secondary-bg-hover:  #212C3C;
    --sl-action-secondary-bg-active: #283548;
    --sl-action-secondary-fg:        #8FBEF0;
    --sl-action-secondary-border:    #35506F;

    --sl-action-tertiary-bg:        #1E2A3A;
    --sl-action-tertiary-bg-hover:  #24344A;
    --sl-action-tertiary-bg-active: #2B4059;
    --sl-action-tertiary-fg:        #8FBEF0;

    --sl-action-danger-bg:        #20262F;
    --sl-action-danger-bg-hover:  #262D38;
    --sl-action-danger-bg-active: #2E3642;
    --sl-action-danger-fg:        #B9C2CE;
    --sl-action-danger-border:    #4A5563;

    /* Feedback */
    --sl-feedback-success-bg: #1B2A1B;
    --sl-feedback-success-fg: #9CC384;
    --sl-feedback-success-solid: #9CC384;
    --sl-mode-direct-bg:     #241E32;
    --sl-mode-direct-fg:     #C3BBE4;
    --sl-mode-direct-border: #6E62A8;
    --sl-phase-converted-bg:     var(--sl-palette-md3-purple-30);
    --sl-phase-converted-fg:     var(--sl-palette-md3-purple-90);
    --sl-phase-converted-border: var(--sl-palette-md3-purple-80);
    --sl-phase-converted-solid:  var(--sl-palette-md3-purple-80);
    --sl-phase-converted-solid-hover: color-mix(in srgb, var(--sl-palette-md3-purple-80) 88%, var(--sl-palette-white));
    --sl-phase-converted-on-solid: var(--sl-palette-md3-purple-20);
    --sl-mode-hosted-bg:     var(--sl-surface-accent);
    --sl-mode-hosted-fg:     var(--sl-text-link);
    --sl-mode-hosted-border: var(--sl-border-accent);
    --sl-feedback-danger-bg:  #2A1C1D;
    --sl-feedback-danger-fg:  #F08C8E;
    --sl-feedback-warning-bg: #2A2416;
    --sl-feedback-warning-fg: #D9A85B;
    --sl-feedback-warning-solid: #D9A85B;   /* orange-120 goes muddy on dark */
    --sl-feedback-info-bg:    #16283C;
    --sl-feedback-info-fg:    #8FBEF0;
    --sl-import-as-is:   #76D33E;
    --sl-import-adapted: #FFC933;
  /* Selected and active, dark. Same M3 container swap the converted phase uses:
     the 80 steps up to carry the line, the 30 comes down behind a row. The row
     tint is mixed toward the page because a full 30 is a chip weight, not a
     row weight. */
  --sl-selected-fg:       var(--sl-palette-md3-purple-90);
  --sl-selected-bg:       color-mix(in srgb, var(--sl-palette-md3-purple-30) 52%, var(--sl-surface-page));
  --sl-selected-border:   var(--sl-palette-md3-purple-80);
  --sl-selected-ring:     var(--sl-palette-md3-purple-80);
  --sl-selected-ring-soft: color-mix(in srgb, var(--sl-palette-md3-purple-80) 30%, transparent);
  --sl-selected-solid:    var(--sl-palette-md3-purple-80);
  --sl-selected-on-solid: var(--sl-palette-md3-purple-20);


    --sl-focus-ring-color: var(--sl-selected-ring);

    /* Elevation: deeper, since dark shadows read weakly */
    --sl-elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.60), 0 1px 3px 1px rgba(0, 0, 0, 0.40);
    --sl-elevation-2: 0 1px 2px 0 rgba(0, 0, 0, 0.60), 0 2px 6px 2px rgba(0, 0, 0, 0.40);
    --sl-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.45), 0 1px 3px 0 rgba(0, 0, 0, 0.60);
    --sl-elevation-start: 0 10px 28px color-mix(in srgb, var(--sl-action-primary-bg) 22%, transparent);

    /* Legacy bridge — lets un-migrated page CSS follow the theme */
    --SLDS-White:         #1C222C;
    --SLDS-Grey-Grey-100: #E3E8EF;
    --SLDS-Grey-Grey-10:  #232A35;
    --SLDS-Grey-Grey-30:  #262C35;
    --SLDS-Grey-Grey-80:  #A9B3C0;
    --SLDS-Grey-Grey-70:  #7E8895;
  --SLDS-Grey-Grey-90:  #A9B3C0;
    --SLDS-Blue-grey-Blue-grey-10: #161B22;
    --SLDS-Blue-grey-Blue-grey-20: #232A35;
    --SLDS-Blue-grey-Blue-grey-30: #2B3440;
    --SLDS-Blue-Blue-10:  #1A2331;
    --SLDS-Blue-Blue-20:  #1B2E45;
    --SLDS-Purple-Purple-10: #1F1B26;
    --SLDS-Purple-10: #161B22;
    --SLDS-Grey-100: #E3E8EF;
    --SLDS-Grey-80: #A9B3C0;
    --SLDS-Grey-30: #2A3240;
    --SLDS-Grey-20: #262C35;
    --SLDS-Blue-Grey-20: #232A35;
    --SLDS-Blue-Grey-30: #2B3440;
  }
}

/* Explicit dark choice — same values, and it beats a light OS setting */
:root[data-theme="dark"] {
  --sl-surface-canvas:        #101419;
  --sl-surface-page:          #161B22;
  --sl-surface-studio-wash:  var(--sl-surface-canvas);
  --sl-surface-raised:        #1C222C;
  --sl-surface-sunken:        #232A35;
  --sl-surface-pressed:       #2A3240;
  --sl-surface-disabled:      #262C35;
  --sl-surface-accent:        #1B2E45;
  --sl-surface-accent-strong: #24405E;
  --sl-surface-inverse:       #1C222C;

  --sl-text-primary:    #E3E8EF;
  --sl-text-secondary:  #A9B3C0;
  --sl-text-muted:      #7E8895;
  --sl-text-field:      #DCE2EA;
  --sl-text-on-accent:  #FFFFFF;
  --sl-text-inverse:    #E3E8EF;
  --sl-text-link:       #71ABE8;
  --sl-text-danger:     #F08C8E;

  --sl-border-subtle:      #2B3440;
  --sl-border-hairline:    #252D38;
  --sl-border-field:       #4A5563;
  --sl-border-strong:      #3D4855;
  --sl-border-accent:      #4D9BE8;
  --sl-border-accent-soft: #35506F;
  --sl-border-danger:      #C25A5C;
  --sl-border-success:     #528335;

  --sl-action-primary-bg:         #2470C8;   /* 4.97:1 under white text (AA); was #2478D4, 4.46:1 */
  --sl-action-primary-bg-hover:   #1F6ABF;   /* 5.42:1; a step darker, as in the light theme (was #2E86E0, 3.75:1) */
  --sl-action-primary-bg-active:  #1A63B0;
  --sl-action-primary-fg:         #FFFFFF;

  --sl-action-secondary-bg:        #1A2331;
  --sl-action-secondary-bg-hover:  #212C3C;
  --sl-action-secondary-bg-active: #283548;
  --sl-action-secondary-fg:        #8FBEF0;
  --sl-action-secondary-border:    #35506F;

  --sl-action-tertiary-bg:        #1E2A3A;
  --sl-action-tertiary-bg-hover:  #24344A;
  --sl-action-tertiary-bg-active: #2B4059;
  --sl-action-tertiary-fg:        #8FBEF0;

  --sl-action-danger-bg:        #20262F;
  --sl-action-danger-bg-hover:  #262D38;
  --sl-action-danger-bg-active: #2E3642;
  --sl-action-danger-fg:        #B9C2CE;
  --sl-action-danger-border:    #4A5563;

  --sl-feedback-success-bg: #1B2A1B;
  --sl-feedback-success-fg: #9CC384;
  --sl-feedback-success-solid: #9CC384;
  --sl-mode-direct-bg:     #241E32;
  --sl-mode-direct-fg:     #C3BBE4;
  --sl-mode-direct-border: #6E62A8;
  --sl-phase-converted-bg:     var(--sl-palette-md3-purple-30);
  --sl-phase-converted-fg:     var(--sl-palette-md3-purple-90);
  --sl-phase-converted-border: var(--sl-palette-md3-purple-80);
  --sl-phase-converted-solid:  var(--sl-palette-md3-purple-80);
  --sl-phase-converted-solid-hover: color-mix(in srgb, var(--sl-palette-md3-purple-80) 88%, var(--sl-palette-white));
  --sl-phase-converted-on-solid: var(--sl-palette-md3-purple-20);
  --sl-mode-hosted-bg:     var(--sl-surface-accent);
  --sl-mode-hosted-fg:     var(--sl-text-link);
  --sl-mode-hosted-border: var(--sl-border-accent);
  --sl-feedback-danger-bg:  #2A1C1D;
  --sl-feedback-danger-fg:  #F08C8E;
  --sl-feedback-warning-bg: #2A2416;
  --sl-feedback-warning-fg: #D9A85B;
  --sl-feedback-warning-solid: #D9A85B;   /* orange-120 goes muddy on dark */
  --sl-feedback-info-bg:    #16283C;
  --sl-feedback-info-fg:    #8FBEF0;
  --sl-import-as-is:   #76D33E;
  --sl-import-adapted: #FFC933;
  /* Selected and active, dark. Same M3 container swap the converted phase uses:
     the 80 steps up to carry the line, the 30 comes down behind a row. The row
     tint is mixed toward the page because a full 30 is a chip weight, not a
     row weight. */
  --sl-selected-fg:       var(--sl-palette-md3-purple-90);
  --sl-selected-bg:       color-mix(in srgb, var(--sl-palette-md3-purple-30) 52%, var(--sl-surface-page));
  --sl-selected-border:   var(--sl-palette-md3-purple-80);
  --sl-selected-ring:     var(--sl-palette-md3-purple-80);
  --sl-selected-ring-soft: color-mix(in srgb, var(--sl-palette-md3-purple-80) 30%, transparent);
  --sl-selected-solid:    var(--sl-palette-md3-purple-80);
  --sl-selected-on-solid: var(--sl-palette-md3-purple-20);


  --sl-focus-ring-color: var(--sl-selected-ring);

  --sl-elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.60), 0 1px 3px 1px rgba(0, 0, 0, 0.40);
  --sl-elevation-2: 0 1px 2px 0 rgba(0, 0, 0, 0.60), 0 2px 6px 2px rgba(0, 0, 0, 0.40);
  --sl-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.45), 0 1px 3px 0 rgba(0, 0, 0, 0.60);
  --sl-elevation-start: 0 10px 28px color-mix(in srgb, var(--sl-action-primary-bg) 22%, transparent);

  --SLDS-White:         #1C222C;
  --SLDS-Grey-Grey-100: #E3E8EF;
  --SLDS-Grey-Grey-10:  #232A35;
  --SLDS-Grey-Grey-30:  #262C35;
  --SLDS-Grey-Grey-80:  #A9B3C0;
  --SLDS-Grey-Grey-70:  #7E8895;
  --SLDS-Grey-Grey-90:  #A9B3C0;
  --SLDS-Blue-grey-Blue-grey-10: #161B22;
  --SLDS-Blue-grey-Blue-grey-20: #232A35;
  --SLDS-Blue-grey-Blue-grey-30: #2B3440;
  --SLDS-Blue-Blue-10:  #1A2331;
  --SLDS-Blue-Blue-20:  #1B2E45;
  --SLDS-Purple-Purple-10: #1F1B26;
  --SLDS-Purple-10: #161B22;
  --SLDS-Grey-100: #E3E8EF;
  --SLDS-Grey-80: #A9B3C0;
  --SLDS-Grey-30: #2A3240;
  --SLDS-Grey-20: #262C35;
  --SLDS-Blue-Grey-20: #232A35;
  --SLDS-Blue-Grey-30: #2B3440;
}

/* =============================================================================
   14. ACCESSIBILITY PREFERENCES
   Stamped on <html> by themeHead (pre-paint) and sl-a11y.js. High contrast and
   color-blind are token overlays, not filters and not a third theme.
   ========================================================================== */

html[data-contrast="high"] {
  --sl-text-primary:        #000000;
  --sl-text-secondary:      #1F201F;
  --sl-text-muted:          #2E2E2E;
  --sl-text-field:          #000000;
  --sl-text-link:           #003D82;
  --sl-text-danger:         #8B1214;
  --sl-border-subtle:       #414141;
  --sl-border-hairline:     #414141;
  --sl-border-field:        #1F201F;
  --sl-border-strong:       #000000;
  --sl-border-accent:       #003D82;
  --sl-surface-page:        #FFFFFF;
  --sl-surface-canvas:      #F4F4F4;
  --sl-surface-raised:      #FFFFFF;
  --sl-surface-sunken:      #E8E8EB;
  /* High contrast: the selection line goes to the darkest step. */
  --sl-selected-border:   #21005D;
  --sl-selected-ring:     #21005D;
  --sl-selected-ring-soft: #21005D;
  --sl-selected-fg:       #21005D;

  --sl-focus-ring-color:    var(--sl-selected-ring);
  --sl-focus-ring-width:    3px;
  --sl-action-primary-bg:   #003D82;
  /* Secondary and quiet buttons get full-strength outlines too. Without these
     they kept the soft light-theme borders (about 2:1) in high contrast. */
  --sl-action-secondary-bg:        #FFFFFF;
  --sl-action-secondary-bg-hover:  #E7F3FF;
  --sl-action-secondary-bg-active: #CEE3F9;
  --sl-action-secondary-fg:        #003D82;
  --sl-action-secondary-border:    #003D82;
  --sl-action-danger-bg:           #FFFFFF;
  --sl-action-danger-bg-hover:     #F4F4F4;
  --sl-action-danger-bg-active:    #E8E8EB;
  --sl-action-danger-fg:           #000000;
  --sl-action-danger-border:       #1F201F;
  --sl-action-go-from:       #C44A00;
  --sl-action-go-to:         #9B2200;
  --sl-action-go-glow:      color-mix(in srgb, var(--sl-action-go-to) 48%, transparent);
  --sl-phase-converted-fg:     #21005D;
  --sl-phase-converted-border: #21005D;
  --sl-phase-converted-solid:  #4F378B;
  --SLDS-White:             #FFFFFF;
  --SLDS-Grey-Grey-100:     #000000;
  --SLDS-Grey-Grey-80:      #1F201F;
  --SLDS-Grey-Grey-70:      #2E2E2E;
}

html[data-theme="dark"][data-contrast="high"] {
  --sl-text-primary:        #FFFFFF;
  --sl-text-secondary:      #E3E8EF;
  --sl-text-muted:          #C5CDD8;
  --sl-text-field:          #FFFFFF;
  --sl-text-link:           #9EC9F5;
  --sl-text-danger:         #FFB4B4;
  --sl-border-subtle:       #8A93A0;
  --sl-border-hairline:     #8A93A0;
  --sl-border-field:        #C5CDD8;
  --sl-border-strong:       #FFFFFF;
  --sl-border-accent:       #9EC9F5;
  --sl-surface-page:        #000000;
  --sl-surface-canvas:      #000000;
  --sl-surface-raised:      #161B22;
  --sl-surface-sunken:      #232A35;
  /* High contrast, dark: the selection line goes to the lightest step. */
  --sl-selected-border:   #EADDFF;
  --sl-selected-ring:     #EADDFF;
  --sl-selected-ring-soft: #EADDFF;
  --sl-selected-fg:       #EADDFF;

  --sl-focus-ring-color:    var(--sl-selected-ring);
  --sl-action-primary-bg:   #4D9BE8;
  /* Black label: white on this blue is under 3:1. */
  --sl-action-primary-fg:   #000000;
  --sl-action-secondary-bg:        #000000;
  --sl-action-secondary-bg-hover:  #1A2331;
  --sl-action-secondary-bg-active: #24344A;
  --sl-action-secondary-fg:        #9EC9F5;
  --sl-action-secondary-border:    #9EC9F5;
  --sl-action-danger-bg:           #000000;
  --sl-action-danger-bg-hover:     #161B22;
  --sl-action-danger-bg-active:    #232A35;
  --sl-action-danger-fg:           #FFFFFF;
  --sl-action-danger-border:       #C5CDD8;
  --sl-action-go-from:       #FF8A3A;
  --sl-action-go-to:         #FF5A2A;
  --sl-action-go-glow:      color-mix(in srgb, var(--sl-action-go-to) 48%, transparent);
  --sl-phase-converted-fg:     #EADDFF;
  --sl-phase-converted-border: #EADDFF;
  --sl-phase-converted-solid:  #D0BCFF;
  --SLDS-White:             #161B22;
  --SLDS-Grey-Grey-100:     #FFFFFF;
  --SLDS-Grey-Grey-80:      #E3E8EF;
  --SLDS-Grey-Grey-70:      #C5CDD8;
}

/* Color-blind palette: remap semantic success/danger/warning for red-green
   colour vision deficiency. Success = deep azure; info = lighter blue-grey;
   danger = vermillion-orange; warning = gold. Separate by luminance as well
   as hue. Not a filter. */
html[data-color="cb"] {
  --sl-text-danger:            #B83D00;
  --sl-border-danger:          #B83D00;
  --sl-border-success:         #053A6B;
  --sl-feedback-success-bg:    #D0E4F7;
  --sl-feedback-success-fg:    #053A6B;
  --sl-feedback-success-solid: #053A6B;
  --sl-feedback-danger-bg:     #FDE8D6;
  --sl-feedback-danger-fg:     #B83D00;
  --sl-feedback-danger-solid:  #D35400;
  --sl-feedback-warning-bg:    #FBF0C4;
  --sl-feedback-warning-fg:    #6B5200;
  --sl-feedback-warning-solid: #B8860B;
  --sl-feedback-info-bg:       #E8ECF0;
  --sl-feedback-info-fg:       #3A4A5C;
  --sl-import-as-is:           #053A6B;
  --sl-import-adapted:         #B8860B;
  --sl-studio-promo-complete-from: var(--sl-feedback-success-solid);
  --sl-studio-promo-complete-to:   color-mix(in srgb, var(--sl-feedback-success-solid) 62%, var(--sl-palette-ink));
}

html[data-theme="dark"][data-color="cb"] {
  --sl-text-danger:            #FF9A4A;
  --sl-border-danger:          #E07020;
  --sl-border-success:         #8EC4F0;
  --sl-feedback-success-bg:    #0E2A45;
  --sl-feedback-success-fg:    #8EC4F0;
  --sl-feedback-success-solid: #8EC4F0;
  --sl-feedback-danger-bg:     #2E1C10;
  --sl-feedback-danger-fg:     #FF9A4A;
  --sl-feedback-danger-solid:  #D35400;
  --sl-feedback-warning-bg:    #2A220E;
  --sl-feedback-warning-fg:    #E8C84A;
  --sl-feedback-warning-solid: #E8C84A;
  --sl-feedback-info-bg:       #1A222C;
  --sl-feedback-info-fg:       #A8B4C4;
  --sl-import-as-is:           #8EC4F0;
  --sl-import-adapted:         #E8C84A;
  --sl-studio-promo-complete-from: var(--sl-feedback-success-solid);
  --sl-studio-promo-complete-to:   color-mix(in srgb, var(--sl-feedback-success-solid) 70%, var(--sl-palette-ink));
}

html[data-contrast="high"][data-color="cb"] {
  --sl-text-danger:            #7A2800;
  --sl-border-danger:          #7A2800;
  --sl-border-success:         #002952;
  --sl-feedback-success-bg:    #B8D4F0;
  --sl-feedback-success-fg:    #002952;
  --sl-feedback-success-solid: #002952;
  --sl-feedback-danger-bg:     #FCD9B8;
  --sl-feedback-danger-fg:     #7A2800;
  --sl-feedback-danger-solid:  #A33A00;
  --sl-feedback-warning-bg:    #F5E29A;
  --sl-feedback-warning-fg:    #4A3800;
  --sl-feedback-warning-solid: #6B5200;
  --sl-feedback-info-bg:       #D8DEE6;
  --sl-feedback-info-fg:       #1A2430;
  --sl-import-as-is:           #002952;
  --sl-import-adapted:         #6B5200;
  --sl-studio-promo-complete-from: var(--sl-feedback-success-solid);
  --sl-studio-promo-complete-to:   color-mix(in srgb, var(--sl-feedback-success-solid) 62%, var(--sl-palette-ink));
}

html[data-theme="dark"][data-contrast="high"][data-color="cb"] {
  --sl-text-danger:            #FFB070;
  --sl-border-danger:          #FFB070;
  --sl-border-success:         #A8D4FF;
  --sl-feedback-success-bg:    #0A2038;
  --sl-feedback-success-fg:    #A8D4FF;
  --sl-feedback-success-solid: #A8D4FF;
  --sl-feedback-danger-bg:     #32180C;
  --sl-feedback-danger-fg:     #FFB070;
  --sl-feedback-danger-solid:  #FF7A20;
  --sl-feedback-warning-bg:    #2A2008;
  --sl-feedback-warning-fg:    #F5D860;
  --sl-feedback-warning-solid: #F5D860;
  --sl-feedback-info-bg:       #161C24;
  --sl-feedback-info-fg:       #C5CDD8;
  --sl-import-as-is:           #A8D4FF;
  --sl-import-adapted:         #F5D860;
  --sl-studio-promo-complete-from: var(--sl-feedback-success-solid);
  --sl-studio-promo-complete-to:   color-mix(in srgb, var(--sl-feedback-success-solid) 70%, var(--sl-palette-ink));
}

html[data-density="comfortable"] {
  --sl-control-height:    var(--sl-touch-min);
  --sl-control-height-sm: var(--sl-touch-min);
  --sl-icon-button-size:  var(--sl-touch-min);
  --sl-header-height:       84px;
  --sl-header-height-phone: 84px;
  --sl-brand-mark-h:        2.25rem;
  --sl-ws-start-max:      58rem;
  --sl-ws-hub-max:        96rem;
  --sl-ws-a11y-max:       61.6rem;
  --sl-ws-card-min:       22rem;
  --sl-ws-card-gap:       var(--sl-space-5);
  --sl-ws-card-pad:       var(--sl-space-6);
}

html[data-focus="enhanced"] {
  --sl-focus-ring-width:  3px;
  --sl-focus-ring-offset: 3px;
}

html[data-font="dyslexia"] {
  --sl-font-family: 'Atkinson Hyperlegible', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
html[data-font="dyslexia"] body,
html[data-font="dyslexia"] button,
html[data-font="dyslexia"] input,
html[data-font="dyslexia"] select,
html[data-font="dyslexia"] textarea {
  font-family: var(--sl-font-family);
}

html[data-spacing="extra"] {
  --sl-line-height-tight: 1.45;
  --sl-line-height-body:  1.7;
  --sl-line-height-loose: 1.85;
  --sl-letter-spacing-label: 0.04em;
}

html[data-spacing="extra"] body {
  letter-spacing: 0.03em;
  word-spacing: 0.08em;
  line-height: var(--sl-line-height-body);
}


/* Existing-page tokens, lifted so sl-tokens.css stays the only :root. */
:root {
  --sl-user-font-scale: 1;
  --SLDS-Grey-Grey-40: #D9D9D9;
  --SLDS-Red-Red-20: #FFF1F3;
  --SLDS-Neon-Blue-80: #93D6FA;
  --SLDS-Neon-Blue-90: #69CAFF;
  --SLDS-Neon-Blue-100: #25AEF8;
  --SLDS-Orange-10: #FDF9F1;
  --SLDS-Orange-20: #FCF2DF;
  --SLDS-Orange-15: #F6EEDE;
  --SLDS-Orange-40: #F8E7C6;
  --SLDS-Orange-50: #FEDB97;
  --SLDS-Orange-100: #FCB11B;
  --SLDS-Orange-110: #E88206;
  --SLDS-Orange-120: #AF6104;
  --SLDS-Green-10: #FBFBFB;
  --SLDS-Green-15: #F2F7EE;
  --SLDS-Green-20: #E9F0E5;
  --SLDS-Green-50: #CEE7BE;
  --SLDS-Green-60: #C9DEBD;
  --SLDS-Green-90: #89AB76;
  --SLDS-Green-100: #70B248;
  --SLDS-Green-110: #609E3C;
  --SLDS-Green-120: #528335;
  --SLDS-Green-150: #226D09;
  --SLDS-Green-StayLinked: #64B145;
  --SLDS-Yellow-10: #FAF8EE;
  --SLDS-Yellow-20: #F8F1D3;
  --SLDS-Yellow-30: #FFF0A4;
  --SLDS-Yellow-50: #FFE773;
  --SLDS-Yellow-100: #FFDD36;
  --SLDS-Yellow-110: #E8B306;
  --SLDS-Yellow-120: #A86808;
  --SLDS-Red-10: #FEF7F8;
  --SLDS-Red-20: #FFF1F3;
  --SLDS-Red-25: #FAEDEF;
  --SLDS-Red-30: #FBE8EB;
  --SLDS-Red-50: #F5CFCB;
  --SLDS-Red-60: #EFB9B4;
  --SLDS-Red-80: #B05F61;
  --SLDS-Red-100: #DF2D30;
  --SLDS-Red-110: #BA2A2D;
  --SLDS-Red-120: #A32729;
  --SLDS-Purple-10: #F3F0F5;
  --SLDS-Purple-20: #F5E9FD;
  --SLDS-Purple-30: #F0E1F9;
  --SLDS-Purple-40: #EDD9F5;
  --SLDS-Purple-50: #E6D0EB;
  --SLDS-Purple-80: #8B69A3;
  --SLDS-Purple-100: #9B45B1;
  --SLDS-Purple-110: #8E39A4;
  --SLDS-Purple-120: #753385;
  --SLDS-Blue-10: #F7FAFF;
  --SLDS-Blue-20: #E7F3FF;
  --SLDS-Blue-30: #DCEAF9;
  --SLDS-Blue-40: #CEE3F9;
  --SLDS-Blue-45: #C5DDF7;
  --SLDS-Blue-50: #A5C7EA;
  --SLDS-Blue-80: #5999DA;
  --SLDS-Blue-100: #1871CB;
  --SLDS-Blue-110: #1665B6;
  --SLDS-Blue-120: #0F4A8C;
  --SLDS-Blue-130: #1D5693;
  --SLDS-Blue-140: #1F4B7A;
  --SLDS-Blue-150: #1D3F64;
  --SLDS-Blue-170: #123153;
  --SLDS-Black: #000000;
  --SLDS-Grey-10: #F4F4F4;
  --SLDS-Grey-20: #F1F2F6;
  --SLDS-Grey-30: #E8E8EB;
  --SLDS-Grey-50: #D4D2D2;
  --SLDS-Grey-60: #B6B6B6;
  --SLDS-Grey-70: #767676;
  --SLDS-Grey-80: #606060;
  --SLDS-Grey-100: #383938;
  --SLDS-Grey-110: #1F201F;
  --SLDS-Banner-Head-BG: #2F3D32;
  --SLDS-Blue-Grey-10: #F0F5FC;
  --SLDS-Blue-Grey-20: #E4E9F0;
  --SLDS-Blue-Grey-30: #D8E0EE;
  --SLDS-Blue-Grey-40: #C9D5E4;
  --SLDS-Blue-Grey-50: #B7CADE;
  --SLDS-Blue-Grey-70: #88A8CA;
  --SLDS-Blue-Grey-90: #4D7AA8;
  --SLDS-Blue-Grey-95: #48719C;
  --SLDS-Blue-Grey-100: #666971;
  --ds-btn-focus-ring: 0 0 0 3px var(--SLDS-White), 0 0 0 5px var(--SLDS-Green-100);
  --maintenance-valid-border: var(--SLDS-Green-120, #528335);
  --maintenance-valid-surface: #BAD5AB;
  --maintenance-valid-text: var(--SLDS-Black, #000000);
  --maintenance-warning-border: var(--SLDS-Yellow-120, #A86808);
  --maintenance-warning-surface: var(--SLDS-Yellow-10, #FAF8EE);
  --maintenance-warning-text: var(--SLDS-Black, #000000);
  --maintenance-error-border: var(--SLDS-Red-120, #A32729);
  --maintenance-error-surface: #EED2D0;
  --maintenance-error-text: var(--SLDS-Black, #000000);
  --SLDS-Yellow-Yellow-10: #FAF8EE;
  --SLDS-Yellow-Yellow-120: #A86808;
}
