/* ============================================================
   CSS Design Tokens - Single Source of Truth
   Simplified Dark Theme Palette:
   - #181818 - Dark background
   - #1A1A1A - Lighter dark
   - #252525 - Elevated surfaces (user bubble, input area, selected chat)
   - #5A5A5A - Muted text (scrollbar, chat history, disabled)
   - #7A7A7A - Input buttons
   - #FFFFFF - Primary text, icons, active elements
   - #E5E5E5 - Settings panel buttons
   - #E6CC80 - Highlighted AI response text
   ============================================================ */

:root {
  /* ========== Semantic Colors (kept) ========== */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  /* Hover tooltips (nav rail, jurisdiction flags, [data-tooltip] buttons):
     one dark pill on both themes, like the side menu (Julian, 2026-09-22). */
  --tooltip-bg: #14161c;
  --tooltip-border: rgba(255, 255, 255, 0.08);
  --tooltip-text: #ffffff;

  /* ========== Conversion CTA ========== */
  /* All primary call-to-action buttons (Try for free / Start Free Trial /
     database CTA / hero demo) use the same near-black green. Single source of
     truth so the colour can be tuned in one place. */
  --cta-green: #01300a;
  --cta-green-hover: #005a15;

  /* The same CTA green, but for a DARK surface. --cta-green above is a
     near-black green chosen against the light marketing pages; on the dark app
     (#181818/#1A1A1A) it reads as a black slab rather than a green button,
     which is exactly how the in-chat purchase CTA was reported. These two are
     theme-aware (see the [data-theme] blocks below) and are the values the
     approved in-chat design used. Use them for CTAs that sit on an app surface.
     --cta-green itself is deliberately left theme-blind so the marketing
     buttons that already use it do not shift underfoot. */
  --cta-green-on-dark: #2F7A3E;
  --cta-green-on-dark-hover: #3C9750;

  /* ========== Shared Colors (theme-independent) ========== */
  --color-link: #3b82f6;

  /* ========== Accent (interactive controls) ========== */
  /* The blue used by small in-panel controls (the source panel's translate
     button). It was referenced as `var(--accent-color, #6c8aff)` for months
     with nothing defining it, so every use rendered from its fallback; these
     are those fallback values, promoted to the token they were pretending to
     read. Themed: the dark blue is unreadable on a light surface. */
  --accent-color: #6c8aff;

  /* ========== Simplified Dark Theme (default) ========== */
  /* Core palette */
  --color-dark: #181818;
  --color-dark-lighter: #1A1A1A;
  --color-dark-elevated: #252525;
  --color-light: #FFFFFF;
  --color-button-light: #E5E5E5;
  --color-highlight: #E6CC80;
  --color-primary: #7A7A7A;

  /* ========== Backgrounds ========== */
  --bg-app: #181818;
  --bg-dark-surface: #181818;
  --bg-chat-area: #1A1A1A;
  --bg-user-input: #252525;
  --bg-input: #1A1A1A;
  --bg-input-button: #7A7A7A;
  --bg-input-button-hover: #3d4654;
  --bg-send-button: var(--brand-secondary); /* the chat send button: brand yellow in dark, navy in light */
  --bg-send-button-hover: var(--brand-secondary-hover);
  --text-send-button: var(--brand-primary); /* navy arrow on the yellow button */
  --bg-sidebar: #181818;
  --bg-card: rgba(255, 255, 255, 0.03);
  --scroll-shadow: rgba(0, 0, 0, 0.55); /* bottom-edge cue on a scroll box that has more below */
  --bg-hover: rgba(255, 255, 255, 0.03);
  --bg-hover-strong: rgba(255, 255, 255, 0.1);
  --bg-overlay: rgba(0, 0, 0, 0.8);
  --bg-modal: rgba(0, 0, 0, 0.97);

  /* Scrollbar */
  --scrollbar-thumb: #7a7a7a;

  /* ========== Backgrounds - Semantic ========== */
  --bg-danger: rgba(239, 68, 68, 0.1);

  /* ========== Text Colors ========== */
  --text-primary: #FFFFFF;
  /* #7A7A7A measured 4.49:1 on #1A1A1A, a hair under the 4.5:1 floor. */
  --text-secondary: #8A8A8A;
  /* Lighter than the light theme's #5A5A5A, which is the same grey and only works
     on white: on #1A1A1A it measures 2.5:1, well under the 4.5:1 in WCAG 1.4.3. */
  --text-muted: #9A9A9A;
  --text-dim: #808080;
  --text-placeholder: rgba(255, 255, 255, 0.4);
  --text-gray: #5A5A5A;
  --chat-text: #cccccc;

  /* ========== Icon Colors ========== */
  --icon-default: #FFFFFF;
  --brand-ink: #F5F5F5; /* wordmark: the other theme's --bg-app (brand/BRAND.md section 8) */
  --brand-mark: var(--brand-secondary); /* the mark, stars and ring in one colour: yellow on dark (2026-11-17) */

  /* ========== Borders ========== */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.2);
  --border-dark: #5A5A5A;

  /* ========== Shadows ========== */
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 30px 60px rgba(0, 0, 0, 0.9);

  /* ========== Spacing ========== */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */

  /* ========== Border Radius ========== */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ========== Transitions ========== */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* ========== Typography ========== */
  /* Two families (frontend/docs/brand-style-guide.md section 2): Inter (--font-grotesk)
     for every heading and display number, IBM Plex Sans for body and UI, plus Plex Mono
     for labels, figures and code. No serif anywhere (Julian, 2026-09-26). Inter comes
     from the Google Fonts CDN via the <link> in routes/+layout.svelte, not self-hosted,
     so a surface that bypasses that layout head falls through to Helvetica. */
  --font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --font-grotesk: 'Inter', 'Aktiv Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-hand: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;   /* handwritten notes, self-hosted in static/fonts/caveat */

  /* ========== Type Scale ==========
     Every font-size is one of these (check-css-literals fails the build on a px or
     rem literal). Named by pixel size at the 16px root. /app text uses the
     10-17 steps; the site adds 15, 22 and 28; 17 is the chat answer size; 56 and
     up are display numerals (prices, hero, 404). Fluid headings use clamp() at
     the use site, and glyphs under 9px (an icon drawn inside a fixed box) are not
     on the scale. */
  --text-10: 0.625rem;
  --text-11: 0.6875rem;
  --text-12: 0.75rem;
  --text-13: 0.8125rem;
  --text-14: 0.875rem;
  --text-15: 0.9375rem;
  --text-16: 1rem;
  --text-17: 1.0625rem;
  --text-18: 1.125rem;
  --text-20: 1.25rem;
  --text-22: 1.375rem;
  --text-24: 1.5rem;
  --text-28: 1.75rem;
  --text-32: 2rem;
  --text-40: 2.5rem;
  --text-48: 3rem;
  --text-56: 3.5rem;
  --text-64: 4rem;
  --text-72: 4.5rem;
  --text-128: 8rem;
  /* Display sizes: the fluid headings of the public site, one per role. Each is a
     clamp(min, vw, max), so it grows with the window between the two bounds. A new
     heading picks the role it plays; it does not write its own clamp(). */
  --text-display-home: clamp(2.2rem, 4.4vw, 4.25rem);      /* homepage section headlines */
  --text-display-hero: clamp(2.5rem, 3.9vw, 3.5rem);       /* page h1 */
  --text-display-section: clamp(2rem, 2.85vw, 2.6rem);     /* section h2 */
  --text-display-subsection: clamp(1.5rem, 2.4vw, 2rem);   /* h3 under a section, dialog titles */
  --text-display-card: clamp(1.125rem, 1.6vw, 1.5rem);     /* card headings, pull quotes */
  --text-display-figure: clamp(3.5rem, 7vw, 5rem);         /* a price or key figure */
  --text-display-front-hero: clamp(2.375rem, 3.2vw, 3rem); /* the Danish front page's h1, two lines at desktop */
  /* App text that follows the /app text scale: app.css sets --app-text-scale on
     :root inside /app (1.1), and it is 1 everywhere else. Sizes above 16px (the
     answer text, headings) do not scale. */
  --app-text-10: calc(var(--text-10) * var(--app-text-scale, 1));
  --app-text-11: calc(var(--text-11) * var(--app-text-scale, 1));
  --app-text-12: calc(var(--text-12) * var(--app-text-scale, 1));
  --app-text-13: calc(var(--text-13) * var(--app-text-scale, 1));
  --app-text-14: calc(var(--text-14) * var(--app-text-scale, 1));
  --app-text-16: calc(var(--text-16) * var(--app-text-scale, 1));

  /* ========== Z-Index Scale ==========
     Every stacking layer above local ordering (0, 1, 2, -1 and the small values
     that order siblings inside one component stay literal). Values are the ones
     the app and site already used, collected here so the order is visible in one
     place; a layer one step above another is written calc(var(--z-x) + 1) at the
     use site. Lowest first. */
  --z-raised: 100;           /* in-flow badges that must clear neighbouring content */
  --z-panel: 1000;           /* sidebar, source panel, settings panel, mobile nav bar */
  --z-dropdown: 1000;        /* add menu, mention menu, filter and vault menus */
  --z-overlay: 1000;         /* in-app full-screen overlays (vaults, watch, drop zone, document viewer) */
  --z-modal: 1200;           /* in-app modal dialogs */
  --z-tooltip: 1200;         /* hover tooltips on nav buttons and flags */
  --z-drawer: 2000;          /* user profile overlay and settings drawer */
  --z-app-tooltip: 3000;     /* the shared .app-tooltip, above drawers */
  --z-popover: 9999;         /* menu info bubbles */
  --z-navbar: 9999;          /* the marketing site navbar */
  --z-confirm: 10000;        /* delete confirmation overlay */
  --z-mobile-burger: 10001;  /* the mobile burger button, above confirmations */
  --z-sheet: 10002;          /* the mobile jurisdiction picker (backdrop; panel is +1) */
  --z-dialog: 15000;         /* .modal-overlay-standard */
  --z-notice: 15001;         /* NoticeToast: a notice must stay readable over any dialog */
  --z-dialog-confirm: 16000; /* delete dialog, above a standard modal */
  --z-blocking: 20000;       /* onboarding, session expired, default jurisdictions: must cover everything in the app */
  --z-site-menu: 99999;      /* marketing mobile menu and language menu */
  /* The auth and book-demo dialogs open from the marketing chrome, so they must
     clear --z-site-menu. The cookie banner (consent/banner.css, 100001) loads
     without this file and keeps its literal. */
  --z-auth-modal: 100000;

  /* ========== Tutorial Bubble Colors ========== */
  --tutorial-bg: #1A1A1A;
  --tutorial-text: #FFFFFF;
  --tutorial-border: rgba(255, 255, 255, 0.2);

  /* ========== Light Theme (About Page) ========== */
  --light-text-body: #2d3748;
  --light-text-muted: #4a5568;

  /* ========== Citation markers + source tabs ========== */
  /* One set of values for the inline [n] marker and the source-panel tabs, so the
     two always read as the same object. Gold has no usable light-mode value, hence
     the bronze in the light block. */
  --citation-fg: #E6CC80;
  --citation-edge: rgba(230, 204, 128, 0.34);
  --citation-ink: #F2E3BB;

  /* ========== App component tokens ========== */
  /* Values the app stylesheet (src/lib/app/styles/style.css) used to hardcode.
     Each dark value is the literal it replaced, so the dark theme is unchanged;
     the light values are what the component should have had in light mode.

     The *-rgb tokens are bare channels for rgba(var(--x-rgb), <alpha>), so one
     token serves every alpha a component uses:
       --ink-rgb     translucent lines and fills that contrast with the surface
       --fg-rgb      the app's warm off-white text, at reduced alpha
       --shadow-rgb  shadows and modal scrims (black in both themes) */
  --ink-rgb: 255, 255, 255;
  --fg-rgb: 226, 227, 224;
  --shadow-rgb: 0, 0, 0;
  --shadow-accent-rgb: 36, 47, 83;       /* scroll-to-bottom hover glow */
  --color-success-rgb: 16, 185, 129;     /* = --color-success */
  --color-success-bright: #22c55e;       /* "saved" check mark */
  --color-error-rgb: 239, 68, 68;        /* = --color-error */
  --color-info-rgb: 59, 130, 246;        /* = --color-link */
  --color-selection-rgb: 74, 144, 217;   /* document-library selection / drop target */
  --text-on-accent: #ffffff;             /* text on a coloured button or badge, both themes */
  --text-on-highlight: #181818;          /* text on the gold PRO badge, both themes */
  --brand-gold: #D39E46;                 /* the mark's gold ring */
  /* Brand colours (Julian, 2026-11-14), the same in both themes: navy first, the CTA yellow
     second. The yellow is the v9 front page's CTA fill and the colour of its logo's stars and ring. */
  --brand-primary: #071023;
  --brand-primary-rgb: 7, 16, 35;        /* = --brand-primary, for scrims over imagery (the same on both themes) */
  --brand-primary-hover: #12203d;        /* a navy button under the pointer */
  --brand-secondary: #EDD395;
  --brand-secondary-hover: #F3E0B0;      /* a yellow button under the pointer */
  --brand-secondary-rgb: 237, 211, 149;  /* = --brand-secondary, for tints */
  /* The Danish front page (home-v9.css): its map and illustration colours. Fixed values, the
     public site is light only. */
  --v9-map-land: #E3E0DA;               /* a country on the map with no status colour */
  --v9-map-covered: #1F3364;            /* a searchable country */
  --v9-map-covered-hover: #2E4A8C;
  --v9-card-line: #E3E6EB;              /* hairline around the feature illustrations */
  --v9-skeleton: #ECEAE5;               /* placeholder text bars in the use-case mock-ups */
  --v9-illustration-bg: #F0F1F4;
  --v9-redline-delete: #E7A3A6;         /* tracked-change mock-up: deletion, its strike, insertion */
  --v9-redline-delete-strike: #A3343A;
  --v9-redline-insert: #9DBEEA;
  --v9-muted-glyph: #9AA1AB;
  --v9-search-focus: #CFCBC2;           /* the country search field and its rows */
  --v9-search-icon: #9A9890;
  --v9-row-hover: #FCF8EF;
  --library-doc-tint: rgba(79, 70, 229, 0.15);
  --indent-guide: rgba(150, 150, 150, 0.2);

  /* Surfaces */
  --surface-dialog: #2a2b2d;             /* Modal, delete dialog */
  --border-dialog: #3a3b3d;
  --surface-float: #25262B;              /* scroll-to-bottom button, filter dropdown */
  --surface-float-hover: #2f3035;
  --border-slate: #2a3441;               /* filter dropdown, markdown table rows */

  /* Toggle switch */
  --switch-rgb: 100, 116, 139;
  --switch-focus-rgb: 122, 122, 122;

  /* Subscription tier badges (constant: they are brand metals, not theme colours) */
  --tier-bronze: #CD7F32;
  --tier-bronze-tint: rgba(205, 127, 50, 0.18);
  --tier-silver: #B0B0B0;
  --tier-silver-tint: rgba(192, 192, 192, 0.22);
  --tier-gold: #D4AF37;
  --tier-gold-tint: rgba(255, 215, 0, 0.18);

  /* Export status banners */
  --status-success-bg: #065f46;
  --status-success-text: #d1fae5;
  --status-success-border: #047857;
  --status-error-bg: #7f1d1d;
  --status-error-text: #fecaca;
  --status-error-border: #dc2626;
  --status-warning-bg: #78350f;
  --status-warning-text: #fde68a;
  --status-warning-border: #d97706;

  /* Rendered markdown in AI answers (.ai-message) */
  --md-code-bg: #2D3748;
  --md-code-text: #E2E8F0;
  --md-border: #4A5568;                  /* code border, hr, table head */
  --md-h1-rule: #444;
  --md-pre-accent: #7a7a7a;
  --md-quote-accent: #4299E1;
  --md-quote-rgb: 66, 153, 225;
  --md-quote-text: #CBD5E0;
  /* Code-block language stripe (the languages' own brand colours) */
  --code-lang-js: #f7df1e;
  --code-lang-ts: #3178c6;
  --code-lang-py: #3776ab;
  --code-lang-json: #6b7280;

  /* Role tokens that replaced a dark literal + a [data-theme="light"] override */
  --bg-rail: #181818;                    /* nav icon rail + sidebar wrapper */
  --control-text: rgba(255, 255, 255, 0.78); /* filter label, add-jurisdiction, add-menu trigger */
  --menu-item-text: rgba(255, 255, 255, 0.78); /* add-menu and @mention items */
  --surface-float-active: #2a3441;       /* hovered/active row in a floating menu */
  --accent-rgb: 108, 138, 255;           /* = --accent-color, for tints */
  --shimmer-ink: #ffffff;                /* "thinking" text sweep */
  --shimmer-gap: transparent;
  --status-accent: var(--brand-gold);    /* the answer-in-progress status line: the mark's gold, both themes */
  --status-accent-glint: #F3D9A6;        /* its sweep highlight */
  --text-error-soft: #e57373;            /* inline translate error */
  --redline-del-bg: rgba(209, 36, 47, 0.08);
  --redline-ins-bg: rgba(46, 160, 67, 0.10);
  --action-green: #2F7A3E;               /* recommended step in a dialog, BOTH themes (redaction, oversize, onboarding) */
  --action-green-hover: #3C9750;
  --color-error-hover: #dc2626;
  --color-warning-rgb: 245, 158, 11;     /* = --color-warning */
  --warning-ink: #f59e0b;                /* caution text/icon; --color-warning is too pale on white */
  --file-pdf: #e2483d;                   /* file-type icons */
  --file-word: #2b7cd3;
}

/* ========== Light Theme (App) ========== */
[data-theme="light"] {
  /* On a light surface the near-black green IS the readable one, so this pair
     collapses back onto --cta-green and the button matches the marketing site. */
  --cta-green-on-dark: #01300a;
  --cta-green-on-dark-hover: #005a15;

  --accent-color: #4a6cf7;

  /* Core Light Palette
     - #FFFFFF - Primary background (inputs, modals, chat area)
     - #F5F5F5 - Surface background (app, sidebar, accordions)
     - #E8E8E8 - Elevated surfaces (user bubble, file attachments)
     - #D1D5DB - Borders, dividers
     - #181818 - Primary text, icons
     - #5A5A5A - Muted text
     - #828282 - Buttons, inactive elements
     - #B45309 - Bold/emphasized text (amber)
  */
  --color-light-button: #828282;

  /* Backgrounds */
  --bg-app: #F5F5F5;
  --bg-dark-surface: #E8E8E8;
  --bg-chat-area: #FFFFFF;
  --bg-user-input: #F5F5F5;
  --bg-input-button: #181818;
  --bg-input-button-hover: #5A5A5A;
  --bg-send-button: var(--brand-primary);
  --bg-send-button-hover: var(--brand-primary-hover);
  --text-send-button: var(--text-on-accent);
  --bg-sidebar: #F5F5F5;
  --bg-input: #FFFFFF;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-hover-strong: rgba(0, 0, 0, 0.08);
  --bg-modal: rgba(255, 255, 255, 0.97);
  --scrollbar-thumb: #333333;

  /* Text Colors */
  --text-primary: #181818;
  --text-secondary: #181818;
  --text-muted: #5A5A5A;
  --text-dim: #5A5A5A;
  --text-placeholder: rgba(24, 24, 24, 0.5);
  --text-gray: #5A5A5A;
  --chat-text: #181818;

  /* Icon Colors */
  --icon-default: #181818;
  --brand-ink: #181818; /* wordmark: the other theme's --bg-app (brand/BRAND.md section 8) */
  --brand-mark: var(--brand-primary);   /* the mark, stars and ring in one colour: navy on light (2026-11-17) */

  /* Borders */
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-light: rgba(24, 24, 24, 0.3); /* the rail icons' ink (--icon-default at .5 opacity), but a solid 1px line reads heavier than a thin icon stroke at the same alpha, so .3 is what looks level with them */
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-dark: #D1D5DB;

  /* Shadows */
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  /* Cards */
  --bg-card: rgba(0, 0, 0, 0.02);
  --scroll-shadow: rgba(0, 0, 0, 0.14);

  /* Tutorial Bubble Colors (Light theme) */
  --tutorial-bg: #FFFFFF;
  --tutorial-text: #181818;
  --tutorial-border: rgba(0, 0, 0, 0.15);

  /* ========== Citation markers + source tabs ========== */
  --citation-fg: #8A6A1F;
  --citation-edge: rgba(138, 106, 31, 0.32);
  --citation-ink: #5C4512;

  /* ========== App component tokens (light) ========== */
  --ink-rgb: 0, 0, 0;
  --fg-rgb: 24, 24, 24;
  --library-doc-tint: rgba(0, 0, 0, 0.05);
  --indent-guide: rgba(0, 0, 0, 0.12);
  --surface-dialog: #FFFFFF;
  --border-dialog: #D1D5DB;
  --surface-float: #FFFFFF;
  --surface-float-hover: #F5F5F5;
  --border-slate: rgba(24, 24, 24, 0.3);
  --status-success-bg: #d1fae5;
  --status-success-text: #065f46;
  --status-success-border: #6ee7b7;
  --status-error-bg: #fee2e2;
  --status-error-text: #7f1d1d;
  --status-error-border: #fca5a5;
  --status-warning-bg: #fef3c7;
  --status-warning-text: #78350f;
  --status-warning-border: #fcd34d;
  --md-code-bg: #F5F5F5;
  --md-code-text: #181818;
  --md-border: #D1D5DB;
  --md-h1-rule: #D1D5DB;
  --md-quote-text: #181818;
  --bg-rail: #FAFAFA;
  --control-text: rgba(0, 0, 0, 0.7);
  --menu-item-text: #333333;
  --surface-float-active: #E8E8E8;
  --accent-rgb: 74, 108, 247;
  --shimmer-ink: #1a1a1a;
  --shimmer-gap: rgba(26, 26, 26, 0.2);
  --status-accent-glint: #A87A2E;        /* the ring gold stays on light; its sweep darkens instead of lightening */
  --warning-ink: #B45309;
}

/* ========== Dark Theme (explicit) ========== */
[data-theme="dark"] {
  /* Same as root - dark is default */
  --cta-green-on-dark: #2F7A3E;
  --cta-green-on-dark-hover: #3C9750;

  --accent-color: #6c8aff;

  --bg-app: #181818;
  --bg-dark-surface: #181818;
  --bg-chat-area: #1A1A1A;
  --bg-user-input: #252525;
  --bg-input-button: #7A7A7A;
  --bg-input-button-hover: #3d4654;
  --bg-send-button: var(--brand-secondary); /* the chat send button: brand yellow in dark, navy in light */
  --bg-send-button-hover: var(--brand-secondary-hover);
  --text-send-button: var(--brand-primary); /* navy arrow on the yellow button */
  --bg-sidebar: #181818;
  --bg-input: #1A1A1A;
  --bg-hover: rgba(255, 255, 255, 0.03);
  --bg-hover-strong: rgba(255, 255, 255, 0.1);
  --bg-modal: rgba(0, 0, 0, 0.97);
  --scrollbar-thumb: #7a7a7a;

  /* Text Colors */
  --text-primary: #FFFFFF;
  /* #7A7A7A measured 4.49:1 on #1A1A1A, a hair under the 4.5:1 floor. */
  --text-secondary: #8A8A8A;
  /* Lighter than the light theme's #5A5A5A, which is the same grey and only works
     on white: on #1A1A1A it measures 2.5:1, well under the 4.5:1 in WCAG 1.4.3. */
  --text-muted: #9A9A9A;
  --text-dim: #808080;
  --text-placeholder: rgba(255, 255, 255, 0.4);
  --text-gray: #5A5A5A;
  --chat-text: #cccccc;

  /* Icon Colors */
  --icon-default: #FFFFFF;
  --brand-ink: #F5F5F5; /* wordmark: the other theme's --bg-app (brand/BRAND.md section 8) */
  --brand-mark: var(--brand-secondary); /* the mark, stars and ring in one colour: yellow on dark (2026-11-17) */

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.2);
  --border-dark: #5A5A5A;

  /* Shadows */
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);

  /* Cards */
  --bg-card: rgba(255, 255, 255, 0.03);
  --scroll-shadow: rgba(0, 0, 0, 0.55);

  /* Tutorial Bubble Colors (Dark theme) */
  --tutorial-bg: #1A1A1A;
  --tutorial-text: #FFFFFF;
  --tutorial-border: rgba(255, 255, 255, 0.2);

  /* ========== Citation markers + source tabs ========== */
  /* One set of values for the inline [n] marker and the source-panel tabs, so the
     two always read as the same object. Gold has no usable light-mode value, hence
     the bronze in the light block. */
  --citation-fg: #E6CC80;
  --citation-edge: rgba(230, 204, 128, 0.34);
  --citation-ink: #F2E3BB;
}

/* ============================================================
   Marketing site theme  (--mkt-*)
   ============================================================
   The marketing and content pages switch on `body.light-landing`, NOT on
   [data-theme]. So the palette above cannot serve them: it is the APP's, it
   is dark on bare :root, and nothing on the marketing site ever sets
   [data-theme="light"] — which is why `var(--text-primary)` resolves to white
   on a white page there, and why every marketing page had resorted to literal
   hex instead (see the note in mcp/+page.svelte).

   These tokens fix that by keying off the class the marketing site actually
   toggles. Both states are authored deliberately; dark is not an inversion of
   light. Every text/background pair below clears WCAG AA (4.5:1) in BOTH
   states — check with scripts/check-contrast.mjs before changing a value.

   Scope: marketing + content pages only. /app keeps the app's own --text- and --bg- set. */
:root {
  --mkt-bg: #181818;
  --mkt-surface: #1f1f1f;
  --mkt-surface-hover: #262626;
  --mkt-text: #f5f5f5;        /* headings                    16.3:1 on --mkt-bg */
  --mkt-text-muted: #b3bac4;  /* body copy, list items        9.3:1 */
  --mkt-text-dim: #8c949f;    /* eyebrows, captions, chips    5.8:1 */
  --mkt-border: rgba(255, 255, 255, 0.1);
  --mkt-code-bg: #1f1f1f;
  --mkt-code-text: #e8e8e8;
  --mkt-card-bg: rgba(255, 255, 255, 0.03);
  --mkt-card-shadow: none;

  /* Themed marketing roles (light values under body.light-landing) */
  --mkt-line-rgb: 255, 255, 255;      /* hairlines and hover fills: rgba(var(--mkt-line-rgb), a) */
  --mkt-panel: #1f1f1f;               /* floating panel (cookie box) */
  --mkt-danger-text: #ff9ea1;         /* form and consent error text */
  --mkt-link: #4a6fd4;

  /* Marketing constants: the SAME in both marketing themes. The navbar is dark on
     every page, button faces are fixed, and the older dark-homepage sections keep
     their own blues. Use these only where a colour must not follow the theme;
     otherwise use the themed --mkt-* tokens above. */
  --mkt-white: #ffffff;
  --mkt-white-rgb: 255, 255, 255;
  --mkt-black: #000000;
  --mkt-dark: #181818;
  --mkt-dark-rgb: 24, 24, 24;
  --mkt-paper: #f7f7f7;
  --mkt-paper-rgb: 247, 247, 247;
  --mkt-snow: #f5f5f5;
  --mkt-graphite: #1f1f1f;
  --mkt-navy: #1a202c;                /* brand ink and navbar */
  --mkt-navy-rgb: 26, 32, 44;
  --mkt-slate: #2d3748;               /* quiet link, dark-button hover */
  --mkt-slate-muted: #4a5568;
  --mkt-slate-soft: #718096;
  --mkt-slate-faint: #94a3b8;
  --mkt-slate-line: #e2e8f0;
  --mkt-gray: #9ca3af;
  --mkt-gray-light: #c8c8c8;
  --mkt-gray-dim: #7a7a7a;
  --mkt-gray-deep: #5a5a5a;
  --mkt-button-face: #e5e5e5;
  --mkt-ink-deep: #14171d;
  --mkt-ink-deep-rgb: 20, 23, 29;
  --mkt-panel-dark: #1c1c1c;
  --mkt-void: #0a0a0a;
  --mkt-void-rgb: 10, 10, 10;
  --mkt-hero-shade: #3a3a3a;
  --mkt-hero-accent: #1c232e;
  --mkt-divider-rgb: 128, 128, 128;   /* section rules, see brand-style-guide.md section 3 */
  --mkt-blue: #345d9a;                /* accent: eyebrows, figures, hover edges */
  --mkt-blue-bright: #3e67a1;
  --mkt-blue-soft: #6f9bd8;
  --mkt-blue-rgb: 43, 76, 126;        /* hero and card glows */
  --mkt-blue-glow-rgb: 61, 109, 181;
  --mkt-blue-night: #16213e;
  --mkt-blue-night-rgb: 22, 33, 62;
  --mkt-blue-dusk: #1e3a5f;
  --mkt-blue-deep: #2c5282;
  --mkt-violet-rgb: 102, 126, 234;
  --mkt-star: #ffd700;
  --mkt-danger: #e5484d;
  --mkt-danger-rgb: 229, 72, 77;
  --mkt-danger-deep: #b42318;
  --mkt-ink-night: #12161b;           /* role-landing and animation ink */
  --mkt-ink-night-rgb: 18, 22, 27;
  --mkt-steel: #8a93a0;
  --mkt-bronze: #7a5c1e;
  --mkt-bronze-glow-rgb: 138, 106, 31;
  --mkt-live: #4ade80;                /* "live" status dot */
  --mkt-amber: #a4610a;               /* "beta" status dot */

  /* Feature animations (src/lib/components/home-animations/: home page and /word-addin). They draw the app on a
     warm paper palette that is the same on both themes: an illustration, not UI. */
  --anim-text: #12161b;
  --anim-text-rgb: 18, 22, 27;
  --anim-text-body: #4a4f57;
  --anim-text-muted: #615c52;
  --anim-text-label: #6a6459;
  --anim-text-faint: #8c867a;
  --anim-text-fainter: #a8a295;
  --anim-text-ghost: #bdb7a9;
  --anim-on-ink: #ffffff;
  --anim-surface: #ffffff;
  --anim-stage: #fcfbf9;
  --anim-surface-soft: #faf8f4;
  --anim-fill: #f4f1eb;
  --anim-fill-2: #f1eee8;
  --anim-fill-3: #efece5;
  --anim-fill-4: #ebe7df;
  --anim-line: #e4e0d8;
  --anim-line-strong: #ddd7cb;
  --anim-accent: #c2941f;             /* the gold the sources tiles flash */
  --anim-accent-blue: #1f5fd0;        /* upload animation accent */
  --anim-accent-blue-tint: #eff4fe;
  --anim-line-soft: #e0dbd1;
  --anim-text-tab: #7a7467;           /* inactive tab label in the citations animation */
  --anim-status: #8a6a1f;             /* Word add-in animation: the light pane's status line and the page's tracked insertion (bronze;
                                         the gold glint is --brand-gold, which fails on white as text) */
}

body.light-landing {
  --mkt-bg: #f7f7f7;
  --mkt-surface: #f7f7f7;
  --mkt-surface-hover: #ececec;
  --mkt-text: #1a202c;        /*                             16.3:1 on --mkt-bg */
  --mkt-text-muted: #4a5568;  /*                              7.5:1 */
  --mkt-text-dim: #5f6b7a;    /*                              5.4:1 */
  --mkt-border: rgba(0, 0, 0, 0.1);
  --mkt-code-bg: #f7f7f7;
  --mkt-code-text: #1a202c;
  --mkt-card-bg: #ffffff;
  --mkt-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --mkt-line-rgb: 0, 0, 0;
  --mkt-panel: #ffffff;
  --mkt-danger-text: #b4282c;
  --mkt-link: #2b4fb5;

  /* Brand colours on the public site (2026-11-17): its dark ink, dark bands and navbar navy are the
     brand navy. Redefined here, not on :root, because --color-dark is also the app's. */
  --mkt-dark: var(--brand-primary);
  --mkt-dark-rgb: 7, 16, 35;
  --mkt-navy: var(--brand-primary);
  --mkt-navy-rgb: 7, 16, 35;
  --color-dark: var(--brand-primary);
  --mkt-panel-dark: var(--brand-primary);   /* the mobile and language menus */
}

/* Animatable CSS Custom Properties */
@property --gradient-angle {
  syntax: '<angle>';
  initial-value: 140deg;
  inherits: false;
}
