/* =====================================================================
   tokens.css — the one colour file (UX-B2: Atelier, qa/UX-PLAN.md §1;
   UX-B2b: ruling 31, Atelier's shapes and type with Console's palette,
   qa/UX-W.md, qa/PHASE-UX-B2b.md)

   ── The rule ──────────────────────────────────────────────────────────
   Every colour the app paints is declared here, as a --color-* role (or a
   role-named family: --toast-*, --file-accent-*, --chart-*, --sidebar-*).
   A colour literal anywhere else is counted by
   backend/tests/ux/test_ux_no_literal_colours.py, whose per-file baseline
   may only go down (B21 takes it to zero). Every text/surface pair is
   asserted AA by backend/tests/ux/test_ux_tokens_contrast.py, which
   resolves var() and color-mix() exactly as the browser does.

   ── How a recolour works ──────────────────────────────────────────────
   Three seeds per theme: --color-primary, --color-danger, --color-warning.
   Their tints are color-mix() expressions in the DERIVED block below, with
   the mix percentages as per-theme --mix-* tokens. Change a seed, run the
   contrast test; if a pair fails, the fix is that theme's --mix-* value.

   ── Structure ─────────────────────────────────────────────────────────
   1. :root                            the light literals (and non-colour scales)
   2. html.dark-mode, body.dark-mode   the dark literals (keyed on the class
                                       the boot script and dark-mode.js write)
   3. :root, html.dark-mode, body.dark-mode
                                       the DERIVED roles and the legacy aliases.
      Declared on all three selectors on purpose: a custom property that
      holds var() is resolved on the element that declares it, so an alias
      declared on :root alone would keep its LIGHT value on a page where
      only <body> carries .dark-mode.
   4. @font-face (Figtree, self-hosted, SIL OFL 1.1: static/fonts/OFL.txt;
      Rubik for Hebrew: static/fonts/Rubik-OFL.txt)
   5. opt-in primitives, reduced motion, shell layout tokens

   Names: the app's --color-* names stay canonical; Atelier's short names
   (--bg, --accent, --surface2 …, qa/ux-v/atelier/tokens.css) are mapped
   onto them (UX-PLAN §1.1), not adopted. Old namespaces (--primary-color,
   --ks-*, --ihub-*, marketing's) are aliases of these roles, never values.
   ===================================================================== */

/* B21 s3 (CODE-13): the one cascade-layer order. Every stylesheet is one of
   these layers; a later layer wins over an earlier one whatever the
   specificity (for !important declarations the order is reversed).
   tokens.css loads first on every page, so this statement sets it. */
@layer tokens, base, legacy, components, overrides;

/* B21 s3 (CODE-13): this sheet is the `tokens` cascade layer; the order is declared once, in tokens.css. */
@layer tokens {




:root {
  /* ---- Colour: the light literals (Console · light, ruling 31) ---- */
  --color-background:         #ffffff;   /* Console --bg */
  --color-foreground:         #111827;   /* --text */
  --color-card:               #ffffff;   /* --surface */
  --color-surface-2:          #f4f5f8;   /* --surface2: the tonal tier */
  --color-text-secondary:     #374151;   /* --text2 */
  --color-muted-foreground:   #5b6472;   /* --muted */
  --color-primary:            #2f4ddb;   /* --accent: THE accent seed */
  --color-primary-foreground: #ffffff;   /* --accent-fg */
  --color-danger:             #b91c1c;   /* --danger: seed */
  --color-danger-foreground:  #ffffff;   /* --danger-fg */
  --color-warning:            #9a4d00;   /* --warn: seed */
  --color-success:            #15803d;   /* --success: its own green (ruling 31) */
  --color-success-foreground: #ffffff;   /* UX-B21 s1: text on a success fill (5.02:1, asserted) */
  --color-warning-foreground: #ffffff;   /* UX-B21 s1: text on a warning fill (6.11:1, asserted) */
  --color-on-brand:           #ffffff;   /* UX-B21 s1: the glyph on a connector's own brand fill
                                            (data, not a role): white in both themes, as it was */
  --color-inverse:            #374151;   /* UX-B21 s1: the dark slate of the legacy dialogs' headers and
                                            bars, the same in both themes (they kept it in dark) */
  --color-inverse-foreground: #ffffff;   /* UX-B21 s1: text on --color-inverse (10.31:1, asserted) */
  --color-contrast:           #000000;   /* B21 s3: the neutral inverse fill (components.css's inverse
                                            button): hard black in light, hard white in dark */
  --color-contrast-foreground: #ffffff;  /* B21 s3: text on --color-contrast (21:1, asserted) */
  --color-border:             #d5d9e0;   /* --border */
  --color-input:              #8b95a5;   /* --border-strong: the 3:1 control border */
  --color-code-bg:            #f4f5f8;   /* --code-bg */
  /* B21 s3 (INT-NEW-204): highlight.js's token colours (GitHub's primer
     syntax palette), each AA on every code ground (--color-code-bg,
     --color-surface-2, --color-card, #fff): asserted in c10 */
  --color-code-keyword:       #cf222e;
  --color-code-title:         #8250df;
  --color-code-attr:          #0550ae;
  --color-code-string:        #0a3069;
  --color-code-builtin:       #953800;
  --color-code-comment:       #57606a;
  --color-code-name:          #116329;
  --color-code-bullet:        #3b2300;
  --color-code-addition:      #116329;
  --color-code-addition-bg:   #dafbe1;
  --color-code-deletion:      #82071e;
  --color-code-deletion-bg:   #ffebe9;
  --color-scrim:              rgba(17, 24, 39, .55);   /* UX-B9: the dialog backdrop on the app pages (billing's modals) */
  --color-shadow:             #111827;   /* UX-B21 s1: the ink of a drop shadow, always at an alpha
                                            (color-mix(in srgb, var(--color-shadow) N%, transparent));
                                            the elevation tokens' own rgba(17,24,39,…) */

  /* ---- Mix percentages for the derived tints (light). Fixed by running
         test_ux_tokens_contrast.py: each is the whole percentage whose
         painted tint is closest in relative luminance to Console's
         (qa/ux-v/console/tokens.css), every pair AA; test_ux2b_tokens t6
         pins the fit (qa/PHASE-UX-B2b.md §3). ---- */
  --mix-accent-tint:   11%;   /* primary into the page → --color-accent */
  --mix-primary-text:  86%;   /* primary toward --mix-primary-text-toward */
  --mix-primary-text-toward: var(--color-foreground);
  --mix-danger-tint:   10%;
  --mix-warning-tint:   7%;
  --mix-success-tint:   8%;   /* UX-B9: --color-success-tint (billing's paid / trial notes) */

  /* ---- (B21 s3, UX-B21S2-NEW-004) The legacy palette names (--primary-color …
         --gray-color) are gone: UX-B21 s1 and s2 re-pointed every consumer to the
         --color-* roles. ---- */

  /* ---- File-type accents. Role-named: the glyph tint for a spreadsheet,
     not "green"; the leading glyph on file cards only. Light: Tailwind 600
     steps (each ≥ 3:1 on the card, asserted). ---- */
  --file-accent-sheet:  #16a34a;
  --file-accent-doc:    #2563eb;
  --file-accent-slide:  #ea580c;
  --file-accent-pdf:    #dc2626;
  --file-accent-image:  #9333ea;

  /* ---- Elevation (shadows are colour too; they live here) ---- */
  --shadow-xs:    0 1px 2px 0 rgba(17,24,39,.05);
  --shadow-sm:    0 4px 6px rgba(17,24,39,.1);
  --shadow-md:    0 10px 15px -3px rgba(17,24,39,.1),
                  0 4px 6px -2px rgba(17,24,39,.05);
  --shadow-lg:    0 20px 25px -5px rgba(17,24,39,.1),
                  0 10px 10px -5px rgba(17,24,39,.04);
  --shadow-ring:  0 0 0 1px rgba(17,24,39,.08);      /* hairline ring */
  --shadow-composer: 0 2px 6px rgba(17,24,39,.06);
  --shadow-sheet:    0 18px 40px -10px rgba(17,24,39,.22);

  /* ---- Radius (Atelier: 8 / 12 / 16 / 22, pills for chips and buttons) ---- */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-pill: 9999px;

  /* ---- Spacing (the 8-pt grid on a 4 px rhythm) ---- */
  --space-0:    0;
  --space-1:    4px;
  --space-1_5:  6px;
  --space-2:    8px;
  --space-2_5:  10px;
  --space-3:    12px;
  --space-4:    16px;
  --space-5:    20px;
  --space-6:    24px;
  --space-8:    32px;
  --space-12:   48px;
  --space-16:   64px;
  --space-24:   96px;

  /* Phase B3: shared card rhythm — one source of truth for card internals */
  --card-spacing:      var(--space-3);
  --card-padding:      var(--space-5);
  --card-padding-lg:   var(--space-6);
  --card-padding-sm:   var(--space-4);

  /* ---- Control heights ---- */
  --h-xs: 24px;
  --h-sm: 28px;
  --h-md: 32px;
  --h-lg: 36px;
  --h-xl: 40px;
  --h-row:     38px;   /* Atelier list row (new; adopted by B3/B12) */
  --h-control: 40px;   /* Atelier button/field (new; adopted by B3/B7) */

  /* ---- Icon sizes and stroke (Lucide at 2.0 to match Figtree's weight) ---- */
  --icon-xs: 12px;
  --icon-sm: 14px;
  --icon-md: 16px;
  --icon-lg: 20px;
  --icon-stroke: 2;

  /* ---- Motion (Atelier: 220 ms with a soft overshoot) ---- */
  --dur-fast:     100ms;
  --dur-base:     220ms;
  --dur-slow:     300ms;
  /* Rotation period for indeterminate spinners — a period, not a transition. */
  --dur-spin:     800ms;
  --ease-standard: cubic-bezier(.2,.8,.2,1);

  /* ---- Focus ring: solid, ≥ 3:1 on the page (asserted) ---- */
  --ring-width:  3px;
  --ring-offset: 0px;

  /* ---- Z-index ladder, low to high (one value per name):
         base 1 < sticky 100 < header 200 < dropdown 800 < overlay 1000
         < drawer 1002 < modal-l1-backdrop 9000 < modal = modal-l1-panel 9001
         < modal-l2-backdrop 9100 < modal-l2-panel 9101 < tooltip 9400
         < toast 9500 < loading 9600.
         L1 = a primary modal; L2 = an overlay opened FROM an L1 modal. ---- */
  --z-base:                1;
  --z-sticky:              100;
  --z-header:              200;
  --z-dropdown:            800;
  --z-overlay:             1000;
  --z-drawer:              1002;
  --z-modal-l1-backdrop:   9000;
  --z-modal-l1-panel:      9001;
  --z-modal:               9001;   /* the measured truth: == modal-l1-panel */
  --z-modal-l2-backdrop:   9100;
  --z-modal-l2-panel:      9101;
  --z-tooltip:             9400;
  --z-toast:               9500;
  --z-loading:             9600;

  /* ---- Typography (Figtree for Latin, Rubik for Hebrew; both self-hosted
         below. Rubik's face covers Hebrew only (unicode-range), so the
         browser takes Latin from Figtree and Hebrew and ₪ from Rubik.) ---- */
  --font-sans:    'Figtree', 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: var(--font-sans);
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* B21 s3 (R22, the font-size census): the type scale is these twelve sizes;
     every font-size in static/css is one of them (test_b21s3_css_order o4).
     2xs, ui, h2, 4xl and display are new: the sizes the sheets used most off
     the old scale (11, 13 and 20 px), the greeting's size for headings, and
     the marketing hero. */
  --text-2xs:     11px;          /* B21 s3: badges, counts, dense meta */
  --text-xs:      12px;
  --text-ui:      13px;          /* B21 s3: dense UI rows (hub cards, lists, menus) */
  --text-sm:      14px;
  --text-base:    16px;          /* ruling 31: base text 16 px (Atelier's 15 is not adopted) */
  --text-prose:   17px;          /* prose (UX-W: 17 for this audience; adopted by B6) */
  --text-title:   18px;          /* the top-bar title; 17 px under 768 px (the @media
                                    below). New in UX-B2b; adopted by B3 (the shell) */
  --weight-title: 700;
  --text-lg:      18px;
  --text-h2:      20px;          /* B21 s3: section and dialog heads (the wordmark's size) */
  --text-xl:      22px;
  --text-2xl:     22px;          /* Atelier headings */
  --text-3xl:     30px;
  --text-greeting:     36px;     /* Atelier greeting (new; adopted by B7) */
  --text-4xl:          36px;     /* B21 s3: the largest heading step (the greeting's size) */
  --text-display:      clamp(2.5rem, 5vw, 4rem);   /* B21 s3: the marketing hero */
  --weight-greeting:   800;
  --tracking-greeting: -.025em;
  --text-wordmark:     20px;     /* the wordmark (new; adopted by B8) */
  --weight-wordmark:   800;
  --tracking-wordmark: -.03em;
  --leading-tight:  1.25;
  --leading-normal: 1.6;         /* Atelier's 1.5 UI leading is held for B3 */
  --leading-prose:  1.6;
  --leading-relaxed: var(--leading-prose);   /* consumed at chat.css:39 */
  --measure:        70ch;
}

/* ---- Dark: the dark literals (Console · dark: graphite, ruling 31) ---- */
html.dark-mode, body.dark-mode {
  --color-background:         #121417;
  --color-foreground:         #e6e8eb;
  --color-card:               #17191d;
  --color-surface-2:          #1f2227;
  --color-text-secondary:     #b3b9c2;
  --color-muted-foreground:   #8f98a3;
  --color-primary:            #8aa0ff;
  --color-primary-foreground: #0b0e14;
  --color-danger:             #ff8a80;
  --color-danger-foreground:  #2a0b08;
  --color-warning:            #f5b454;
  --color-success:            #5ad078;
  --color-success-foreground: #0b0e14;
  --color-warning-foreground: #0b0e14;
  --color-on-brand:           #ffffff;
  --color-inverse:            #374151;
  --color-inverse-foreground: #ffffff;
  --color-contrast:           #ffffff;
  --color-contrast-foreground: #000000;
  --color-border:             #2a2e35;
  --color-input:              #5a6370;
  --color-code-bg:            #0d0f12;
  --color-code-keyword:       #ff7b72;
  --color-code-title:         #d2a8ff;
  --color-code-attr:          #79c0ff;
  --color-code-string:        #a5d6ff;
  --color-code-builtin:       #ffa657;
  --color-code-comment:       #8b949e;
  --color-code-name:          #7ee787;
  --color-code-bullet:        #f2cc60;
  --color-code-addition:      #aff5b4;
  --color-code-addition-bg:   #033a16;
  --color-code-deletion:      #ffdcd7;
  --color-code-deletion-bg:   #67060c;
  --color-scrim:              rgba(0, 0, 0, .65);
  --color-shadow:             #000000;

  --mix-accent-tint:   12%;
  --mix-primary-text:  83%;
  --mix-primary-text-toward: #ffffff;
  --mix-danger-tint:   11%;
  --mix-warning-tint:  15%;
  --mix-success-tint:  14%;

  /* File accents lift two Tailwind steps on dark ground (400 vs 600). */
  --file-accent-sheet:  #4ade80;
  --file-accent-doc:    #60a5fa;
  --file-accent-slide:  #fb923c;
  --file-accent-pdf:    #f87171;
  --file-accent-image:  #c084fc;

  --shadow-ring:     0 0 0 1px rgba(255,255,255,.08);
  --shadow-composer: none;
  /* the dark sheet's 1 px edge (ruling 31): without it the sheet melts
     into the scrim (qa/UX-W.md, Atelier's weakest #1) */
  --shadow-sheet-edge: 0 0 0 1px var(--color-border);
  --shadow-sheet:    0 18px 40px -10px rgba(0,0,0,.7), var(--shadow-sheet-edge);
}

/* =====================================================================
   DERIVED roles and legacy aliases — both themes, no literal.
   ===================================================================== */
:root, html.dark-mode, body.dark-mode {
  /* ---- Roles that are another role ---- */
  --color-card-foreground:      var(--color-foreground);
  --color-popover:              var(--color-card);
  --color-popover-foreground:   var(--color-foreground);
  --color-muted:                var(--color-surface-2);
  --color-ring:                 var(--color-primary);
  --color-selection:            var(--color-primary);
  --color-selection-foreground: var(--color-primary-foreground);

  /* ---- The accent's tints: one seed, one edit recolours ---- */
  --color-accent:            color-mix(in srgb, var(--color-primary) var(--mix-accent-tint), var(--color-background));
  --color-accent-foreground: var(--color-primary-text);
  --color-primary-text:      color-mix(in srgb, var(--color-primary) var(--mix-primary-text), var(--mix-primary-text-toward));
  /* B21 s3: success as text on a success tint (the seed reads 4.27:1 on its 12 % tint in light) */
  --color-success-text:      color-mix(in srgb, var(--color-success) 80%, var(--color-foreground));
  --color-user-bubble:       var(--color-accent);
  --color-danger-tint:       color-mix(in srgb, var(--color-danger) var(--mix-danger-tint), var(--color-background));
  --color-warning-tint:      color-mix(in srgb, var(--color-warning) var(--mix-warning-tint), var(--color-background));
  --color-success-tint:      color-mix(in srgb, var(--color-success) var(--mix-success-tint), var(--color-background));

  /* ---- Focus ring ---- */
  --ring-color: var(--color-ring);

  /* ---- Toasts: the status roles ---- */
  --toast-success: var(--color-success);
  --toast-error:   var(--color-danger);
  --toast-warning: var(--color-warning);
  --toast-info:    var(--color-muted-foreground);

  --file-accent-text: var(--color-muted-foreground);
  --file-accent-file: var(--color-muted-foreground);

  /* ---- Charts: the accent plus four neutrals (chart-theme.js reads these) ---- */
  --chart-1: var(--color-primary);
  --chart-2: var(--color-text-secondary);
  --chart-3: var(--color-input);
  --chart-4: var(--color-muted-foreground);
  --chart-5: var(--color-foreground);

  /* ---- Nav / sidebar surfaces (the chat page's ground is --sidebar) ---- */
  --sidebar:                   var(--color-background);
  --sidebar-foreground:        var(--color-foreground);
  --sidebar-accent:            var(--color-accent);
  --sidebar-accent-foreground: var(--color-primary-text);
  --sidebar-border:            var(--color-border);
  --sidebar-ring:              var(--color-ring);

  /* ---- Legacy aliases: style.css's old :root (deleted in B2). Its
         colour names are in the light block above (theme-invariant);
         these three are not colours. ---- */
  --border-radius:   var(--radius-sm);
  --box-shadow:      var(--shadow-sm);
  /* --transition (all 0.3s ease) deleted at B21 s3 (UX-B21S1-NEW-008): its last readers name their properties now */

  /* ---- Deprecated `-t` bridge names (UX-PLAN §1.3). The design-system
         files read the plain names since B2; these remain only for the
         files B2 does not own: settings.css (B10, HC8's file),
         integrations_hub.css (B12/B14), chat_enhanced.css past :70 and the
         chat template (B3/B4). Deleted when the last of those moves. ---- */
  --radius-sm-t:  var(--radius-sm);
  --radius-md-t:  var(--radius-md);
  --radius-lg-t:  var(--radius-lg);
  --radius-xl-t:  var(--radius-xl);
  --radius-2xl-t: var(--radius-xl);
  --z-modal-l1-backdrop-t: var(--z-modal-l1-backdrop);
  --z-modal-l1-panel-t:    var(--z-modal-l1-panel);
  --z-modal-l2-backdrop-t: var(--z-modal-l2-backdrop);
  --z-modal-l2-panel-t:    var(--z-modal-l2-panel);
  --z-toast-t:             var(--z-toast);
}

/* =====================================================================
   Figtree, self-hosted (SIL OFL 1.1; static/fonts/OFL.txt). The variable
   files of the official release v2.0.3 (github.com/erikdkennedy/figtree);
   shas in qa/PHASE-UX-B2.md §4. No outside font request anywhere.
   The brackets are written percent-encoded, exactly as Flask's url_for
   writes them in the chat page's <link rel="preload">, so the preload and
   the face are one request, not two.
   ===================================================================== */
@font-face {
  font-family: 'Figtree';
  font-style:  normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/Figtree%5Bwght%5D.woff2") format("woff2");
}
@font-face {
  font-family: 'Figtree';
  font-style:  italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/Figtree-Italic%5Bwght%5D.woff2") format("woff2");
}

/* =====================================================================
   Rubik for Hebrew, self-hosted (SIL OFL 1.1; static/fonts/Rubik-OFL.txt).
   The variable roman of googlefonts/rubik @ e337a5f69a9b (the file Google
   Fonts ships), subset to Hebrew, the bidi and joiner marks and ₪; the
   source, the subset command and the shas are in qa/PHASE-UX-B2b.md §4.
   The unicode-range keeps every Latin glyph on Figtree, and the browser
   fetches this file only when a page shows Hebrew (no preload, on
   purpose). Hebrew has no italic; an italic run is synthesised.
   ===================================================================== */
@font-face {
  font-family: 'Rubik';
  font-style:  normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/Rubik-Hebrew%5Bwght%5D.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

/* =====================================================================
   Opt-in primitives (class-gated; unused until component phases)
   ===================================================================== */
.u-focus-ring:focus-visible {
  outline: none;
  border-color: var(--color-ring);
  box-shadow: 0 0 0 var(--ring-width) var(--ring-color);
}

/* =====================================================================
   Reduced motion (accessibility foundation). Duration/iteration/scroll
   only, never `display`, so essential UI like spinners stays functional.
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:        .01ms !important;
    animation-iteration-count: 1       !important;
    transition-duration:       .01ms !important;
    scroll-behavior:           auto    !important;
  }
}

/* =====================================================================
   B22 s2 (MEM-M7): the reading preferences, as tokens. Settings › Language
   and look stores them on this device; page/theme_boot.js writes each as an
   <html data-look-*> attribute before first paint, and these give the
   tokens their values. chat_enhanced.css's reading region (the overrides
   layer) reads them for the column, the font and the motion; the text size
   is the transcript's own --text-base. Each default is today's value, and
   with no attribute nothing here or there applies. The sizes are the type
   scale's (o4);
   the font is the British Dyslexia Association's advice (a plain sans with
   open letters: Verdana, else Tahoma; Rubik draws the Hebrew) with WCAG
   2.2's text spacing (1.4.12: letters .12em, words .16em; the leading above
   its 1.5), so no font file is added.
   ===================================================================== */
:root {
  --read-measure:      var(--measure);      /* Medium (70ch): the column's reading measure */
  --font-read:         var(--font-sans);
  --tracking-read:     normal;
  --word-spacing-read: normal;
  --leading-read:      var(--leading-prose);
}
/* Text size: the transcript's base step (its messages and an answer's body
   are --text-base, 16 px, today) becomes the type scale's next step down or
   up, inside the transcript only; no sheet needs a rule for it. */
html[data-look-size="small"] #chat-messages { --text-base: var(--text-sm); }   /* 14 px */
html[data-look-size="large"] #chat-messages { --text-base: var(--text-lg); }   /* 18 px */
html[data-look-width="narrow"] { --read-measure: 56ch; }
html[data-look-width="wide"]   { --read-measure: 90ch; }
html[data-look-font="readable"] {
  --font-read:         Verdana, Tahoma, 'Rubik', 'DejaVu Sans', sans-serif;
  --tracking-read:     .12em;
  --word-spacing-read: .16em;
  --leading-read:      1.8;
}

/* =====================================================================
   Shell layout tokens. Values only. Atelier's 280 px sidebar and 60 px
   top bar are held for B3 (the phone shell), where layout is in scope.
   ===================================================================== */
:root {
  --header-height:        64px;
  --sidebar-width:        16rem;        /* 256px */
  --sidebar-width-icon:   3rem;         /* 48px  */
  --sidebar-width-mobile: 18rem;        /* 288px */

  /* Breakpoints (documented values; used as literals in @media — CSS
     media queries cannot consume custom properties).
     Convention: sm=640, md=768, lg=1024, xl=1280. */
  --bp-sm:  640px;
  --bp-md:  768px;
  --bp-lg:  1024px;
  --bp-xl:  1280px;
}

/* The top-bar title steps down on the phone (qa/UX-W.md: 18 / 17 px). */
@media (max-width: 767px) {
  :root {
    --text-title: 17px;
  }
}

/* =====================================================================
   B21 s3 (CODE-13): every custom property the other sheets defined, moved
   here with its selector and @media, in the chat page's link order. A
   sheet may still define a component-local --_name (read only in it).
   ===================================================================== */
/* ── Moved from wordmark.css (B21 s3: custom properties are defined only in tokens.css) ── */
.wordmark-lg {
  --text-wordmark: 26px;
}

/* ── Moved from chat_enhanced.css (B21 s3: custom properties are defined only in tokens.css) ── */
/* ── Integrations Hub — premium design tokens ─────────────────────────
   Neutral surfaces + a single accent. App icons provide the colour;
   the UI itself stays quiet. Theming is token-driven so dark mode only
   flips the values below — no per-element .dark-mode overrides.
   UX-B2: every value is an alias of a tokens.css role (UX-PLAN §1.3):
   the hub accent is the app's one accent. */
:root {
    /* Not a value — a pointer. --sidebar is the app's single surface
       token: sidebar, chat column, Activity panel, Artifact panel and
       now every hub page all resolve it, so a hub page and a
       conversation cannot differ in tone. Retargeting this ONE
       declaration moves every hub consumer at once, because
       everything else in this block (--ihub-surface, -hover, -active,
       --ihub-field, --ihub-border) is an alpha layer composited OVER
       it and keeps its relationship to whatever the base becomes. */
    --ihub-bg:             var(--sidebar);
    --ihub-surface:        color-mix(in srgb, var(--color-foreground) 3.5%, transparent);
    --ihub-surface-hover:  color-mix(in srgb, var(--color-foreground) 5.5%, transparent);
    --ihub-surface-active: color-mix(in srgb, var(--color-foreground) 8%, transparent);
    --ihub-field:          color-mix(in srgb, var(--color-foreground) 3%, transparent);
    --ihub-border:         color-mix(in srgb, var(--color-foreground) 8%, transparent);
    --ihub-border-strong:  color-mix(in srgb, var(--color-foreground) 14%, transparent);
    --ihub-text:           var(--color-foreground);
    --ihub-muted:          var(--color-muted-foreground);
    --ihub-chip-bg:        color-mix(in srgb, var(--color-foreground) 5%, transparent);
    --ihub-icon-chip-bg:   var(--color-surface-2);
    --ihub-accent:         var(--color-primary);
    --ihub-accent-contrast:var(--color-primary-foreground);
    --ihub-success:        var(--color-success);
    --ihub-success-bg:     color-mix(in srgb, var(--color-success) 12%, transparent);
    --ihub-degrade:        var(--color-warning);   /* advisory heads-up, not alarm */
}
.dark-mode {
    /* Re-declared, not inherited: this selector matches html OR body,
       and a var() alias resolves on the element that declares it, so
       a body-only dark page needs its own copy (tokens.css header).
       UX-B2: every value is a tokens.css role now; the alpha layers
       are the foreground at a few percent (black on light, the warm
       white on dark), so only their percentages differ by theme. */
    --ihub-bg:             var(--sidebar);
    --ihub-surface:        color-mix(in srgb, var(--color-foreground) 4.5%, transparent);
    --ihub-surface-hover:  color-mix(in srgb, var(--color-foreground) 7.5%, transparent);
    --ihub-surface-active: color-mix(in srgb, var(--color-foreground) 10.5%, transparent);
    --ihub-field:          color-mix(in srgb, var(--color-foreground) 4.5%, transparent);
    --ihub-border:         color-mix(in srgb, var(--color-foreground) 8%, transparent);
    --ihub-border-strong:  color-mix(in srgb, var(--color-foreground) 16%, transparent);
    --ihub-text:           var(--color-foreground);
    --ihub-muted:          var(--color-muted-foreground);
    --ihub-chip-bg:        color-mix(in srgb, var(--color-foreground) 7%, transparent);
    --ihub-icon-chip-bg:   var(--color-surface-2);
    --ihub-accent:         var(--color-primary);
    --ihub-accent-contrast:var(--color-primary-foreground);
    --ihub-success:        var(--color-success);
    --ihub-success-bg:     color-mix(in srgb, var(--color-success) 12%, transparent);
    --ihub-degrade:        var(--color-warning);   /* advisory heads-up, not alarm */
}
/* Camera List Modal - CSS Color Variables System */
:root {
    /* Primary Colors */
    --cam-primary-blue: color-mix(in srgb, var(--color-primary) 81%, var(--color-background));
    --cam-primary-blue-hover: var(--color-primary);
    --cam-primary-blue-light: color-mix(in srgb, var(--color-primary) 72%, var(--color-background));

    /* Status Colors */
    --cam-success-green: color-mix(in srgb, var(--color-success) 74%, var(--color-background));
    --cam-danger-red: color-mix(in srgb, var(--color-danger) 78%, var(--color-background));
    --cam-warning-yellow: color-mix(in srgb, var(--color-warning) 32%, var(--color-background));
    --cam-info-cyan: color-mix(in srgb, var(--color-primary) 63%, var(--color-background));

    /* Gray Scale - Light Mode */
    --cam-gray-50: var(--color-surface-2);
    --cam-gray-100: var(--color-surface-2);
    --cam-gray-200: var(--color-surface-2);
    --cam-gray-300: var(--color-surface-2);
    --cam-gray-400: color-mix(in srgb, var(--color-foreground) 19%, var(--color-background));
    --cam-gray-500: color-mix(in srgb, var(--color-foreground) 36%, var(--color-background));
    --cam-gray-600: color-mix(in srgb, var(--color-foreground) 55%, var(--color-background));
    --cam-gray-700: color-mix(in srgb, var(--color-foreground) 76%, var(--color-background));
    --cam-gray-800: color-mix(in srgb, var(--color-foreground) 87%, var(--color-background));
    --cam-gray-900: color-mix(in srgb, var(--color-foreground) 97%, var(--color-background));

    /* Semantic Colors - Light Mode */
    --cam-bg-primary: var(--color-card);
    --cam-bg-secondary: var(--color-surface-2);
    --cam-bg-tertiary: var(--color-surface-2);
    --cam-text-primary: var(--color-text-secondary);
    --cam-text-secondary: var(--color-text-secondary);
    --cam-text-tertiary: var(--color-muted-foreground);
    --cam-border-primary: var(--color-border);
    --cam-border-secondary: var(--color-border);
}
/* Dark Mode Color Variables */
html.dark-mode {
    /* Gray Scale - Dark Mode */
    --cam-gray-50: var(--color-surface-2);
    --cam-gray-100: color-mix(in srgb, var(--color-foreground) 16%, var(--color-background));
    --cam-gray-200: color-mix(in srgb, var(--color-foreground) 21%, var(--color-background));
    --cam-gray-300: color-mix(in srgb, var(--color-foreground) 30%, var(--color-background));
    --cam-gray-400: color-mix(in srgb, var(--color-foreground) 39%, var(--color-background));
    --cam-gray-500: color-mix(in srgb, var(--color-foreground) 50%, var(--color-background));
    --cam-gray-600: color-mix(in srgb, var(--color-foreground) 72%, var(--color-background));
    --cam-gray-700: var(--color-foreground);
    --cam-gray-800: var(--color-foreground);
    --cam-gray-900: var(--color-foreground);

    /* Semantic Colors - Dark Mode */
    --cam-bg-primary: var(--color-surface-2);
    --cam-bg-secondary: color-mix(in srgb, var(--color-foreground) 16%, var(--color-background));
    --cam-bg-tertiary: color-mix(in srgb, var(--color-foreground) 21%, var(--color-background));
    --cam-text-primary: var(--color-foreground);
    --cam-text-secondary: var(--color-foreground);
    --cam-text-tertiary: var(--color-text-secondary);
    --cam-border-primary: var(--color-border);
    --cam-border-secondary: var(--color-input);
}
/* CSS Variables for Advanced Forecasting Configuration Form */
:root {
    --chat-bg-color: var(--color-primary-foreground);
    --section-bg-color: var(--color-primary-foreground);
    --text-color: var(--color-text-secondary);
    --text-secondary: var(--color-muted-foreground);
    --border-color: var(--color-border);
    --input-bg-color: var(--color-primary-foreground);
    /* Notification Modal Variables - Light Mode */
    --card-bg: var(--color-card);
    --text-primary: var(--color-foreground);
    --text-secondary: var(--color-muted-foreground);
    --sidebar-bg: var(--color-surface-2);
    --modal-bg: var(--color-card);
    --modal-border: var(--color-border);
    --button-bg: color-mix(in srgb, var(--color-foreground) 61%, var(--color-background));
    --button-hover: color-mix(in srgb, var(--color-foreground) 74%, var(--color-background));
    --input-border: var(--color-border);
    --input-focus-border: color-mix(in srgb, var(--color-primary) 80%, var(--color-background));
    /* Success/Error/Warning colors for modals */
    --success-bg: var(--color-success-tint);
    --success-text: var(--color-success);
    --error-bg: var(--color-danger-tint);
    --error-text: var(--color-danger);
    --warning-bg: var(--color-warning-tint);
    --warning-text: var(--color-warning);
    --info-bg: var(--color-accent);
    --info-text: var(--color-primary-text);
}
html.dark-mode {
    --chat-bg-color: var(--color-foreground);
    --section-bg-color: var(--color-foreground);
    --text-color: var(--color-foreground);
    --text-secondary: var(--color-muted-foreground);
    --border-color: var(--color-border);
    --input-bg-color: var(--color-foreground);
    /* Notification Modal Variables - Dark Mode */
    --card-bg: var(--color-surface-2);
    --text-primary: var(--color-foreground);
    --text-secondary: var(--color-muted-foreground);
    --sidebar-bg: var(--color-background);
    --modal-bg: var(--color-surface-2);
    --modal-border: var(--color-border);
    --button-bg: color-mix(in srgb, var(--color-foreground) 30%, var(--color-background));
    --button-hover: color-mix(in srgb, var(--color-foreground) 44%, var(--color-background));
    --input-border: var(--color-input);
    --input-focus-border: color-mix(in srgb, var(--color-primary) 68%, var(--color-background));
    /* Success/Error/Warning colors for modals */
    --success-bg: color-mix(in srgb, var(--color-success) 30%, var(--color-background));
    --success-text: var(--color-success);
    --error-bg: color-mix(in srgb, var(--color-danger) 31%, var(--color-background));
    --error-text: var(--color-danger);
    --warning-bg: color-mix(in srgb, var(--color-warning) 31%, var(--color-background));
    --warning-text: var(--color-warning);
    --info-bg: color-mix(in srgb, var(--color-primary) 31%, var(--color-background));
    --info-text: var(--color-primary-text);
}
/* ── Artifact panel layout tokens ────────────────────────────────────────
   Width is a custom property so the drag handle in ArtifactPanel.js can
   write directly to it without touching layout JS. Clamps live in JS;
   default matches the Slice-1 fixed-480px width. */
:root {
    /* Default is a clamp, not a fixed px: 46vw at 1920 is ~883px, and the
       bounds keep a small laptop readable and an ultrawide sane. JS still
       writes a plain px value here on drag — parseInt in ArtifactPanel.js
       requires that, so only the *default* is a clamp. */
    --artifact-panel-width: clamp(560px, 46vw, 900px);
    /* Chat keeps 520px minimum; the panel yields first. */
    --artifact-panel-min: 520px;
    --artifact-panel-max: 70vw;
    /* Clear space between the chat's scrollbar and a panel's edge. Only
       applied while a panel is open — with no panel the scrollbar sits at
       the window edge, where an inset would read as a misaligned column. */
    --chat-panel-gap: var(--space-2);
    /* Width of the painted classic scrollbar (style.css:51). The composer is
       position:fixed to the same inline-end edge .chat-main-area paints its
       bar at, so it must hold this much clear or it covers the bottom of the
       track and the whole :increment:end button slot. */
    --chat-scrollbar-w: 10px;
    /* The ONE definition of the panel's rendered width. Lives on :root, not
       on body.artifact-panel-open, because .artifact-panel needs it while
       closed too (it is translated off-screen at its real width, not zero). */
    --artifact-panel-rendered:
        min(var(--artifact-panel-width), 50vw, calc(100vw - 520px));
    /* Activity panel. Plain px — the JS twin of ArtifactPanel's _applyWidth
       reads it with parseInt and must stay numeric. The 55vw clamp lives at
       the use sites, mirroring the artifact panel exactly. */
    --activity-panel-width: 420px;
}
.chat-enhanced-container {
  --sidebar-width: var(--sidebar-open-width, 260px);
}
.chat-enhanced-container.sidebar-collapsed {
    /* Icon column only: 10px + 18px icon + 10px. The label box starts at
       10 + 18 + 12(gap) = 40px, so it is fully outside the 38px clip rect —
       at 60px it started at 47px and 13px of every label survived. */
    --sidebar-width: 38px;
}
/* `said` is the message's OWN resting colour, not a stronger one: the
   effect is a reveal, so its endpoint must be indistinguishable from a
   message that was never spoken. #374151 is .message-ai's colour in light
   (chat_enhanced.css:1105); #d1d5db is body.dark-mode's (7421).
   `unsaid` is deliberately much lighter than before — 9aa0a6 against a
   6c757d pane was a ~1.2:1 step and read as noise. These land near 2.6:1
   against `said`, which is legible as two states at a glance while
   keeping the unspoken text readable enough to follow ahead of the voice. */
:root {
    --vk-said:   color-mix(in srgb, var(--color-foreground) 82%, var(--color-background));
    --vk-unsaid: color-mix(in srgb, var(--color-foreground) 29%, var(--color-background));
}
html.dark-mode, body.dark-mode {
    --vk-said:   color-mix(in srgb, var(--color-foreground) 91%, var(--color-background));
    --vk-unsaid: color-mix(in srgb, var(--color-foreground) 30%, var(--color-background));
}
/* UX-B7: where the centred welcome composer's box ends, from the viewport's
   bottom: 56vh - 30px as before, but never so high that the greeting, its
   line and two rows of starters (about 205px) cannot fit above the bar —
   100vh - 360px wins below about 750px of height (a laptop's 1280 x 720
   window), so the block never runs off the top. The greeting and the bar
   both read it, so they move as one. */
:root {
    --welcome-bar-bottom: min(calc(56vh - 30px), calc(100vh - 360px));
}
/* Diff 6: publish the artifact's right-region offset as a CSS variable
   so the source-drawer (and any future right-rail surface) can anchor
   to the artifact's left edge without JS coordination. Updated whenever
   the artifact panel's width changes — see the open/close/resize
   handlers in ArtifactPanel.js. */
body.artifact-panel-open {
    --artifact-right-offset: var(--artifact-panel-rendered);
}
.chat-enhanced-container {
  --sidebar-width: var(--sidebar-open-width, 260px);
}
.chat-enhanced-container.sidebar-collapsed {
    /* Keep in sync with the collapse rule near the top of this sheet. */
    --sidebar-width: 38px;
}
@media (max-width: 767px) {
  .chat-enhanced-container,
      .chat-enhanced-container.sidebar-collapsed {
    --sidebar-width: 0px;
  }
}
/* Analytics Tab - CSS Color Variables */
:root {
    /* Primary Colors */
    --analytics-primary-blue: color-mix(in srgb, var(--color-primary) 81%, var(--color-background));
    --analytics-primary-blue-hover: var(--color-primary);
    --analytics-primary-blue-light: color-mix(in srgb, var(--color-primary) 72%, var(--color-background));
    --analytics-success-green: color-mix(in srgb, var(--color-success) 74%, var(--color-background));
    --analytics-danger-red: color-mix(in srgb, var(--color-danger) 78%, var(--color-background));
    --analytics-warning-orange: color-mix(in srgb, var(--color-warning) 48%, var(--color-background));
    --analytics-info-cyan: color-mix(in srgb, var(--color-primary) 63%, var(--color-background));
    --analytics-purple: var(--color-primary);

    /* Semantic Colors - Light Mode */
    --analytics-bg-primary: var(--color-card);
    --analytics-bg-secondary: var(--color-surface-2);
    --analytics-bg-tertiary: var(--color-surface-2);
    --analytics-text-primary: var(--color-text-secondary);
    --analytics-text-secondary: var(--color-text-secondary);
    --analytics-text-tertiary: var(--color-muted-foreground);
    --analytics-border-primary: var(--color-border);
    --analytics-border-secondary: var(--color-border);
    --analytics-shadow-sm: 0 1px 3px color-mix(in srgb, var(--color-shadow) 8%, transparent);
    --analytics-shadow-md: 0 2px 6px color-mix(in srgb, var(--color-shadow) 8%, transparent);
    --analytics-shadow-lg: 0 2px 8px color-mix(in srgb, var(--color-shadow) 6%, transparent);
}
/* Dark Mode Color Variables */
html.dark-mode {
    --analytics-bg-primary: var(--color-surface-2);
    --analytics-bg-secondary: color-mix(in srgb, var(--color-foreground) 16%, var(--color-background));
    --analytics-bg-tertiary: color-mix(in srgb, var(--color-foreground) 21%, var(--color-background));
    --analytics-text-primary: var(--color-foreground);
    --analytics-text-secondary: var(--color-foreground);
    --analytics-text-tertiary: var(--color-text-secondary);
    --analytics-border-primary: var(--color-border);
    --analytics-border-secondary: var(--color-input);
    --analytics-shadow-sm: 0 1px 3px color-mix(in srgb, var(--color-shadow) 30%, transparent);
    --analytics-shadow-md: 0 2px 6px color-mix(in srgb, var(--color-shadow) 30%, transparent);
    --analytics-shadow-lg: 0 2px 8px color-mix(in srgb, var(--color-shadow) 30%, transparent);
}
/* Camera Dashboard Modal - CSS Color Variables */
:root {
    /* Primary Colors */
    --dash-primary-blue: color-mix(in srgb, var(--color-primary) 81%, var(--color-background));
    --dash-primary-blue-hover: var(--color-primary);
    --dash-primary-blue-light: color-mix(in srgb, var(--color-primary) 72%, var(--color-background));

    /* Status Colors */
    --dash-success-green: color-mix(in srgb, var(--color-success) 74%, var(--color-background));
    --dash-danger-red: color-mix(in srgb, var(--color-danger) 78%, var(--color-background));
    --dash-warning-yellow: color-mix(in srgb, var(--color-warning) 32%, var(--color-background));
    --dash-warning-orange: color-mix(in srgb, var(--color-warning) 48%, var(--color-background));
    --dash-info-cyan: color-mix(in srgb, var(--color-primary) 63%, var(--color-background));
    --dash-purple: var(--color-primary);
    --dash-purple-light: var(--color-primary);

    /* Gray Scale - Light Mode */
    --dash-gray-50: var(--color-surface-2);
    --dash-gray-100: var(--color-surface-2);
    --dash-gray-200: var(--color-surface-2);
    --dash-gray-300: var(--color-surface-2);
    --dash-gray-400: color-mix(in srgb, var(--color-foreground) 19%, var(--color-background));
    --dash-gray-500: color-mix(in srgb, var(--color-foreground) 36%, var(--color-background));
    --dash-gray-600: color-mix(in srgb, var(--color-foreground) 55%, var(--color-background));
    --dash-gray-700: color-mix(in srgb, var(--color-foreground) 76%, var(--color-background));
    --dash-gray-800: color-mix(in srgb, var(--color-foreground) 87%, var(--color-background));
    --dash-gray-900: color-mix(in srgb, var(--color-foreground) 97%, var(--color-background));

    /* Semantic Colors - Light Mode */
    --dash-bg-primary: var(--color-card);
    --dash-bg-secondary: var(--color-surface-2);
    --dash-bg-tertiary: var(--color-surface-2);
    --dash-text-primary: var(--color-text-secondary);
    --dash-text-secondary: var(--color-text-secondary);
    --dash-text-tertiary: var(--color-muted-foreground);
    --dash-border-primary: var(--color-border);
    --dash-border-secondary: var(--color-border);
    --dash-shadow-sm: 0 1px 3px color-mix(in srgb, var(--color-shadow) 8%, transparent);
    --dash-shadow-md: 0 2px 6px color-mix(in srgb, var(--color-shadow) 8%, transparent);
    --dash-shadow-lg: 0 2px 8px color-mix(in srgb, var(--color-shadow) 6%, transparent);
}
/* Dark Mode Color Variables */
html.dark-mode {
    --dash-gray-50: var(--color-surface-2);
    --dash-gray-100: color-mix(in srgb, var(--color-foreground) 16%, var(--color-background));
    --dash-gray-200: color-mix(in srgb, var(--color-foreground) 21%, var(--color-background));
    --dash-gray-300: color-mix(in srgb, var(--color-foreground) 30%, var(--color-background));
    --dash-gray-400: color-mix(in srgb, var(--color-foreground) 39%, var(--color-background));
    --dash-gray-500: color-mix(in srgb, var(--color-foreground) 50%, var(--color-background));
    --dash-gray-600: color-mix(in srgb, var(--color-foreground) 72%, var(--color-background));
    --dash-gray-700: var(--color-foreground);
    --dash-gray-800: var(--color-foreground);
    --dash-gray-900: var(--color-foreground);

    /* Semantic Colors - Dark Mode */
    --dash-bg-primary: var(--color-surface-2);
    --dash-bg-secondary: color-mix(in srgb, var(--color-foreground) 16%, var(--color-background));
    --dash-bg-tertiary: color-mix(in srgb, var(--color-foreground) 21%, var(--color-background));
    --dash-text-primary: var(--color-foreground);
    --dash-text-secondary: var(--color-foreground);
    --dash-text-tertiary: var(--color-text-secondary);
    --dash-border-primary: var(--color-border);
    --dash-border-secondary: var(--color-input);
    --dash-shadow-sm: 0 1px 3px color-mix(in srgb, var(--color-shadow) 30%, transparent);
    --dash-shadow-md: 0 2px 6px color-mix(in srgb, var(--color-shadow) 30%, transparent);
    --dash-shadow-lg: 0 2px 8px color-mix(in srgb, var(--color-shadow) 30%, transparent);
}

/* ── Moved from settings.css (B21 s3: custom properties are defined only in tokens.css) ── */
.hub-set-dialog-overlay {
  --z-modal-l1-panel: var(--z-modal-l2-panel);
}

/* ── Moved from unified_knowledge.css (B21 s3: custom properties are defined only in tokens.css) ── */
/* Both themes, one block: every value is a token, and a var() alias is
   resolved where it is declared, so body.dark-mode re-declares the same
   aliases instead of keeping a dark twin of literals (tokens.css header). */
:root, html.dark-mode, body.dark-mode {
  /* --sidebar, the app surface token. --bg-primary is defined nowhere in the
     repo, so this was always the #ffffff fallback; --ks-bg-soft's
     #f7f8fa was a second, unrelated near-white. */
  --ks-bg:        var(--ihub-bg, var(--sidebar));
  --ks-bg-soft:   color-mix(in srgb, var(--color-foreground) 4%, var(--ihub-bg, var(--sidebar)));
  --ks-fg:        var(--ihub-fg, var(--color-foreground));
  --ks-fg-soft:   var(--ihub-fg-soft, var(--color-muted-foreground));
  --ks-border:    var(--ihub-border, var(--color-border));
  /* B2: aliases of tokens.css's roles (were literals). The modal z-layers
     that used to be declared here are tokens.css's own names now (same
     values: 9000/9001/9100/9101, toast 9500), so the collision is gone. */
  --ks-accent-fg: var(--color-primary-foreground);
  --ks-danger:    var(--color-danger);
  --ks-success:   var(--color-success);
  --ks-warning:   var(--color-warning);
  --ks-radius:    var(--radius-lg);
  --ks-shadow:    var(--shadow-sheet);
}

/* ── Moved from integrations_hub.css (B21 s3: custom properties are defined only in tokens.css) ── */
/* Shared centered content column — ONE source of truth for header + body, so
   the title's leading edge lines up exactly with the search input / first card.
   Reused by every hub view (RTL-safe: margin-inline:auto + logical padding
   centers it and mirrors automatically in RTL). */
/* UX-B42 (the operator, 2026-11-04): ONE content width for every hub, 72rem (~1150 px),
   with the content's own pad inside it (components.css: the hub column). */
:root { --ihub-col-max: 72rem; --ihub-col-pad: var(--space-6); }
/* Re-point data-display's --color-* at the hub neutrals for this scope only.
   Re-valuing the tokens beats overriding the rules: data-display.css keeps
   sole ownership of table geometry, and a future change there lands here
   automatically. */
.adm-table-wrap {
    --color-foreground:       var(--ihub-text);
    --color-muted-foreground: var(--ihub-muted);
    --color-border:           var(--ihub-border);
    --color-muted:            var(--ihub-surface-hover);
}
@media (max-width: 768px) {
  :root { --ihub-col-pad: var(--space-4); }
}

/* ── Moved from marketing.css (B21 s3: custom properties are defined only in tokens.css) ── */
/* B2 (UX-PLAN §1.3): the Inter @import is gone (Figtree via --font-sans,
   self-hosted); this :root is aliases of tokens.css's roles, never values.
   tokens.css loads first on marketing/base.html. */
:root {
    /* Colours: aliases of the canonical roles */
    --primary-blue: var(--color-primary);
    --primary-dark: var(--color-primary-text);
    --primary-light: var(--color-accent);

    --dark-navy: var(--color-foreground);
    --gray-900: var(--color-foreground);
    --gray-800: var(--color-foreground);
    --gray-700: var(--color-text-secondary);
    --gray-600: var(--color-muted-foreground);
    --gray-500: var(--color-muted-foreground);
    --gray-400: var(--color-input);
    --gray-300: var(--color-border);
    --gray-200: var(--color-border);
    --gray-100: var(--color-surface-2);
    --white: var(--color-card);

    --accent-green: var(--color-success);
    --accent-orange: var(--color-warning);
    --accent-red: var(--color-danger);

    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-text) 100%);
    --gradient-hero: linear-gradient(135deg, var(--color-foreground) 0%, var(--color-primary) 100%);
    --gradient-overlay: linear-gradient(180deg, color-mix(in srgb, var(--color-foreground) 90%, transparent) 0%, color-mix(in srgb, var(--color-primary) 80%, transparent) 100%);

    /* Spacing: the canonical 8-pt steps (same pixel values as before) */
    --spacing-xs: var(--space-2);
    --spacing-sm: var(--space-4);
    --spacing-md: var(--space-6);
    --spacing-lg: var(--space-8);
    --spacing-xl: var(--space-12);
    --spacing-2xl: var(--space-16);
    --spacing-3xl: var(--space-24);

    /* Radius: --radius-sm/md/lg/xl are tokens.css's (Atelier); these two
       names have no canonical twin */
    --radius-2xl: var(--radius-xl);
    --radius-full: var(--radius-pill);
    
    /* Shadows (UX-B8): --shadow-sm/md/lg are tokens.css's own names and were
       re-declared here with eight literals; they are the canonical values now,
       and the two names without a canonical twin alias the nearest role. */
    --shadow-xl: var(--shadow-lg);
    --shadow-2xl: var(--shadow-sheet);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ── The glyph tokens: GENERATED by scripts/gen_lucide_partial.py (B21 s3). Do not edit. ── */
:root {
  --lci-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --lci-circle-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12a10 10 0 1 0 20 0a10 10 0 1 0 -20 0M12 8L12 12M12 16L12.01 16'/%3E%3C/svg%3E");
  --lci-database: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5a9 3 0 1 0 18 0a9 3 0 1 0 -18 0M3 5V19A9 3 0 0 0 21 19V5M3 12A9 3 0 0 0 21 12'/%3E%3C/svg%3E");
  --lci-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-7a2 2 0 0 1 2 -2ZM7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
/* ── End of the generated glyph tokens ── */

} /* end @layer tokens */
