/* One reading face across the website. Legacy campaign display faces remain scoped. */
:root {
  --bsui-font-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bsui-font-display: var(--bsui-font-sans);
  --bsui-font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --bsui-type-caption: 0.8125rem;
  --bsui-type-small: 0.875rem;
  --bsui-type-body: 1rem;
  --bsui-type-lead: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --bsui-type-card-title: 1.125rem;
  --bsui-type-page-title: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --bsui-type-section-title: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --bsui-type-marketing-title: clamp(2.25rem, 1.5rem + 2.5vw, 4rem);
  --bsui-type-marketing-section: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  /* Semantic layout roles: related copy stays closer than neighboring sections. */
  --bsui-marketing-gutter: clamp(1rem, 2.5vw, 2rem);
  --bsui-marketing-width: 76rem;
  --bsui-section-space: clamp(3rem, 6vw, 5rem);
  --bsui-section-gap: clamp(1.5rem, 3vw, 3rem);
  --bsui-copy-gap: 1rem;
  --bsui-action-gap: 1.5rem;
  --bsui-reading-measure: 60ch;
  --bsui-leading-display: 1.12;
  --bsui-weight-regular: 400;
  --bsui-weight-medium: 500;
  --bsui-weight-semibold: 600;
  --bsui-weight-bold: 700;
  --bsui-leading-body: 1.6;
  --bsui-leading-ui: 1.45;
  --bsui-leading-heading: 1.15;
  --bsui-tracking-heading: -0.025em;
  --bsui-tracking-display: -0.04em;
  --bs-font-sans-serif: var(--bsui-font-sans);
  --bs-body-font-family: var(--bsui-font-sans);
  --bs-body-font-size: var(--bsui-type-body);
  --bs-body-line-height: var(--bsui-leading-body);
}

body {
  font-family: var(--bsui-font-sans);
  font-size: var(--bsui-type-body);
  font-optical-sizing: auto;
  line-height: var(--bsui-leading-body);
}

:where(button, input, select, textarea) {
  font-family: inherit;
  letter-spacing: inherit;
}

:where(h1, h2, h3, h4, h5, h6) {
  font-weight: var(--bsui-weight-semibold);
  letter-spacing: var(--bsui-tracking-heading);
  line-height: var(--bsui-leading-heading);
  overflow-wrap: break-word;
  text-wrap: balance;
}

:where(code, pre, kbd, samp) {
  font-family: var(--bsui-font-mono);
  font-variant-ligatures: none;
}

/* Stable columns without making normal prose look like a terminal. */
:where(td, th, .bsui-stat__value, .bsui-metric__value) {
  font-variant-numeric: tabular-nums;
}

:root {
  --bsui-color-scheme: dark;
  --bsui-backdrop: rgba(2, 6, 12, 0.72);
  --bsui-bg: #070b12;
  --bsui-color-canvas-hsl: 217 44% 5%;
  --bsui-bg-raised: #0b111b;
  --bsui-color-surface-elevated-hsl: 216 42% 7%;
  --bsui-marketplace-page-background:
    radial-gradient(circle at 50% 50%, rgba(255, 107, 53, 0.05) 0%, transparent 60%),
    linear-gradient(135deg, #0b0e17 0%, #151922 100%);
  --bsui-page-background: var(--bsui-bg);
  --bsui-surface: #101827;
  --bsui-color-surface-hsl: 217 42% 11%;
  --bsui-surface-2: #141f30;
  --bsui-color-muted-hsl: 216 41% 13%;
  --bsui-surface-3: #192538;
  --bsui-library-card-bg: color-mix(in srgb, var(--bsui-surface) 72%, transparent);
  --bsui-library-card-hover-bg: color-mix(in srgb, var(--bsui-surface-2) 76%, transparent);
  --bsui-border: #253246;
  --bsui-color-border-hsl: 217 31% 21%;
  --bsui-border-strong: #35445c;
  --bsui-color-border-strong-hsl: 217 27% 28%;
  --bsui-border-subtle: rgba(148, 163, 184, 0.14);
  --bsui-border-soft: rgba(148, 163, 184, 0.18);
  --bsui-border-hover: rgba(217, 119, 6, 0.34);
  --bsui-text: #f8fafc;
  --bsui-color-text-hsl: 210 40% 98%;
  --bsui-text-muted: #aab6c8;
  --bsui-color-text-muted-hsl: 217 23% 73%;
  --bsui-text-muted-rgb: 170, 182, 200;
  --bsui-text-subtle: #7f8da3;
  --bsui-text-inverse: #08111f;
  --bsui-primary: #d97706;
  --bsui-color-primary-hsl: 32 95% 44%;
  --bsui-primary-border: #b45309;
  --bsui-primary-hover: #f59e0b;
  --bsui-primary-action-hover: #f59e0b;
  --bsui-primary-bg: rgba(217, 119, 6, 0.14);
  --bsui-primary-contrast: #ffffff;
  --bsui-color-primary-foreground-hsl: 0 0% 100%;
  --bsui-primary-focus-border: rgba(217, 119, 6, 0.78);
  --bsui-ai-action-background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  --bsui-ai-action-background-hover: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  --bsui-ai-action-border: 1px solid rgba(249, 115, 22, 0.35);
  --bsui-ai-action-border-hover: 1px solid rgba(251, 146, 60, 0.5);
  --bsui-ai-action-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
  --bsui-ai-action-shadow-hover: 0 6px 20px rgba(249, 115, 22, 0.4);
  --bsui-ai-action-text: #ffffff;
  /* Flat orange for buttons that open the AI Agent (Button variant "ai"). The same orange as the
     palette's primary above. The signed-in shell re-points --bsui-primary at blue, so these are
     kept as their own tokens and are not overridden there. */
  --bsui-ai-button: #d97706;
  --bsui-ai-button-hover: #f59e0b;
  --bsui-ai-button-border: #b45309;
  --bsui-ai-button-text: #ffffff;
  /* Purple for buttons that open a chart (Button variant "chart"). Orange is always AI and
     purple is always charts (Rob, 2026-11-15). */
  --bsui-chart-button: #7c3aed;
  --bsui-chart-button-hover: #8b5cf6;
  --bsui-chart-button-border: #6d28d9;
  --bsui-chart-button-text: #ffffff;
  --bsui-accent: #f59e0b;
  --bsui-color-accent-hsl: 38 92% 50%;
  --bsui-color-accent-foreground-hsl: 222 59% 8%;
  --bsui-auth-primary: #ededed;
  --bsui-auth-primary-rgb: 237, 237, 237;
  --bsui-auth-primary-hsl: 0 0% 93%;
  --bsui-auth-primary-border: #ededed;
  --bsui-auth-primary-hover: #ffffff;
  --bsui-auth-primary-bg: rgba(237, 237, 237, 0.14);
  --bsui-auth-primary-contrast: #111111;
  --bsui-auth-primary-foreground-hsl: 0 0% 7%;
  --bsui-auth-primary-focus-border: rgba(237, 237, 237, 0.78);
  --bsui-auth-link: #ededed;
  --bsui-auth-border-hover: rgba(237, 237, 237, 0.5);
  --bsui-auth-focus: 0 0 0 3px rgba(237, 237, 237, 0.24);
  --bsui-success: #22c55e;
  --bsui-danger: #ef4444;
  --bsui-color-danger-hsl: 0 84% 60%;
  --bsui-warning: #eab308;
  --bsui-green: #22c55e;
  --bsui-red: #ef4444;
  --bsui-yellow: #eab308;
  --bsui-info: #38bdf8;
  --bsui-success-bg: rgba(34, 197, 94, 0.12);
  --bsui-danger-bg: rgba(239, 68, 68, 0.12);
  --bsui-warning-bg: rgba(234, 179, 8, 0.12);
  --bsui-info-bg: rgba(56, 189, 248, 0.12);
  --bsui-hover-bg: rgba(148, 163, 184, 0.1);
  --bsui-hover-bg-soft: rgba(148, 163, 184, 0.08);
  --bsui-alert-danger-bg: rgba(127, 29, 29, 0.22);
  --bsui-alert-success-bg: rgba(20, 83, 45, 0.22);
  --bsui-alert-warning-bg: rgba(120, 74, 12, 0.2);
  --bsui-danger-border: rgba(239, 68, 68, 0.32);
  --bsui-danger-border-soft: rgba(239, 68, 68, 0.28);
  --bsui-danger-border-strong: rgba(239, 68, 68, 0.34);
  --bsui-warning-border-soft: rgba(234, 179, 8, 0.28);
  --bsui-warning-border-strong: rgba(234, 179, 8, 0.34);
  --bsui-success-border-soft: rgba(34, 197, 94, 0.28);
  --bsui-success-border-strong: rgba(34, 197, 94, 0.34);
  --bsui-info-border-soft: rgba(56, 189, 248, 0.28);
  --bsui-danger-text: #fecaca;
  --bsui-danger-text-muted: #fca5a5;
  --bsui-success-text: #bbf7d0;
  --bsui-success-text-muted: #86efac;
  --bsui-warning-text-muted: #fde68a;
  --bsui-info-text-muted: #bfdbfe;
  --bsui-neutral-text-muted: #cbd5e1;
  --bsui-spinner-track: rgba(226, 232, 240, 0.22);
  --bsui-radius-xs: 4px;
  --bsui-radius-sm: 6px;
  --bsui-radius-md: 8px;
  --bsui-radius-lg: 8px;
  --bsui-radius-pill: 999px;
  --bsui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --bsui-shadow-md: 0 12px 30px rgba(0, 0, 0, 0.28);
  --bsui-focus: 0 0 0 3px rgba(217, 119, 6, 0.28);
  --bsui-color-focus-hsl: 32 95% 44%;
  --bsui-transition: 150ms ease;
  --bsui-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --bsui-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --bsui-page-gutter: clamp(16px, 4vw, 64px);
  --bsui-container: 1180px;
  --bsui-space-1: 4px;
  --bsui-space-2: 8px;
  --bsui-space-3: 12px;
  --bsui-space-4: 16px;
  --bsui-space-5: 20px;
  --bsui-space-6: 24px;
  --bsui-space-7: 28px;
  --bsui-space-8: 32px;
  --bsui-title-meta-gap: var(--bsui-space-2);
  --bsui-title-copy-gap: var(--bsui-space-3);
  --bsui-title-block-gap: var(--bsui-space-7);
  --bsui-title-tabs-gap: var(--bsui-space-4);
  --bsui-tabs-content-gap: var(--bsui-space-6);
  --bsui-subnav-link-gap: var(--bsui-space-6);
  --bsui-page-title-size: var(--bsui-type-page-title);
  --bsui-page-title-line-height: var(--bsui-leading-heading);
  --bsui-page-subtitle-size: var(--bsui-type-body);
  --bsui-section-title-copy-gap: var(--bsui-space-2);
  --bsui-section-title-block-gap: var(--bsui-space-6);
  --bsui-section-title-size: var(--bsui-type-section-title);
  --bsui-section-title-line-height: var(--bsui-leading-heading);
  --bsui-section-subtitle-size: var(--bsui-type-small);
  --bsui-divider-color: var(--bsui-border-subtle);
  --bsui-row-title-size: 15px;
  --bsui-row-title-line-height: 1.3;
  --bsui-row-copy-size: 14px;
  --bsui-row-title-copy-gap: var(--bsui-space-2);
  --bsui-row-block-gap: var(--bsui-space-4);
  --bsui-row-padding-y: var(--bsui-space-5);
  --bsui-row-gap: var(--bsui-row-block-gap);
  --bsui-modal-title-copy-gap: var(--bsui-space-3);
  --bsui-font-size-1: var(--bsui-type-caption);
  --bsui-font-size-2: var(--bsui-type-small);
  --bsui-font-size-3: var(--bsui-type-body);
}

.bsui-scope {
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

html[data-bs-theme='light'],
.bsui-scope[data-bs-theme='light'] {
  --bsui-color-scheme: light;
  --bsui-backdrop: rgba(15, 23, 42, 0.4);
  --bsui-bg: #f6f7f9;
  --bsui-color-canvas-hsl: 220 20% 97%;
  --bsui-bg-raised: #ffffff;
  --bsui-color-surface-elevated-hsl: 0 0% 100%;
  --bsui-page-background: var(--bsui-bg);
  --bsui-surface: #ffffff;
  --bsui-color-surface-hsl: 0 0% 100%;
  --bsui-surface-2: #f2f4f7;
  --bsui-color-muted-hsl: 220 24% 96%;
  --bsui-surface-3: #e8edf4;
  --bsui-library-card-bg: #ffffff;
  --bsui-library-card-hover-bg: #f8fafc;
  --bsui-border: #d7dde7;
  --bsui-color-border-hsl: 218 29% 87%;
  --bsui-border-strong: #b9c2d0;
  --bsui-color-border-strong-hsl: 218 23% 77%;
  --bsui-border-subtle: rgba(15, 23, 42, 0.09);
  --bsui-border-soft: rgba(15, 23, 42, 0.12);
  --bsui-border-hover: rgba(180, 83, 9, 0.34);
  --bsui-text: #0f172a;
  --bsui-color-text-hsl: 222 47% 11%;
  --bsui-text-muted: #475569;
  --bsui-color-text-muted-hsl: 215 16% 47%;
  --bsui-text-muted-rgb: 71, 85, 105;
  --bsui-text-subtle: #596579;
  --bsui-text-inverse: #ffffff;
  --bsui-primary: #b45309;
  --bsui-color-primary-hsl: 27 91% 37%;
  --bsui-primary-border: #92400e;
  --bsui-primary-hover: #92400e;
  --bsui-primary-action-hover: #92400e;
  --bsui-primary-bg: rgba(180, 83, 9, 0.12);
  --bsui-primary-focus-border: rgba(180, 83, 9, 0.5);
  --bsui-color-primary-foreground-hsl: 0 0% 100%;
  --bsui-color-focus-hsl: 27 91% 37%;
  --bsui-ai-button: #b45309;
  --bsui-ai-button-hover: #92400e;
  --bsui-ai-button-border: #92400e;
  --bsui-ai-button-text: #ffffff;
  --bsui-chart-button: #6d28d9;
  --bsui-chart-button-hover: #5b21b6;
  --bsui-chart-button-border: #5b21b6;
  --bsui-chart-button-text: #ffffff;
  --bsui-accent: #b45309;
  --bsui-color-accent-hsl: 27 91% 37%;
  --bsui-color-accent-foreground-hsl: 0 0% 100%;
  --bsui-auth-primary: #171717;
  --bsui-auth-primary-rgb: 23, 23, 23;
  --bsui-auth-primary-hsl: 0 0% 9%;
  --bsui-auth-primary-border: #171717;
  --bsui-auth-primary-hover: #333333;
  --bsui-auth-primary-bg: rgba(23, 23, 23, 0.08);
  --bsui-auth-primary-contrast: #ffffff;
  --bsui-auth-primary-foreground-hsl: 0 0% 100%;
  --bsui-auth-primary-focus-border: rgba(23, 23, 23, 0.5);
  --bsui-auth-link: #171717;
  --bsui-auth-border-hover: rgba(23, 23, 23, 0.34);
  --bsui-auth-focus: 0 0 0 3px rgba(23, 23, 23, 0.22);
  --bsui-success: #166534;
  --bsui-danger: #dc2626;
  --bsui-color-danger-hsl: 0 72% 51%;
  --bsui-warning: #a16207;
  --bsui-green: #15803d;
  --bsui-red: #dc2626;
  --bsui-yellow: #a16207;
  --bsui-info: #0284c7;
  --bsui-success-bg: rgba(21, 128, 61, 0.1);
  --bsui-danger-bg: rgba(220, 38, 38, 0.1);
  --bsui-warning-bg: rgba(161, 98, 7, 0.12);
  --bsui-info-bg: rgba(2, 132, 199, 0.1);
  --bsui-hover-bg: rgba(15, 23, 42, 0.07);
  --bsui-hover-bg-soft: rgba(15, 23, 42, 0.05);
  --bsui-alert-danger-bg: rgba(220, 38, 38, 0.1);
  --bsui-alert-success-bg: rgba(21, 128, 61, 0.1);
  --bsui-alert-warning-bg: rgba(161, 98, 7, 0.12);
  --bsui-danger-border: rgba(220, 38, 38, 0.26);
  --bsui-danger-border-soft: rgba(220, 38, 38, 0.2);
  --bsui-danger-border-strong: rgba(220, 38, 38, 0.28);
  --bsui-warning-border-soft: rgba(161, 98, 7, 0.22);
  --bsui-warning-border-strong: rgba(161, 98, 7, 0.3);
  --bsui-success-border-soft: rgba(21, 128, 61, 0.2);
  --bsui-success-border-strong: rgba(21, 128, 61, 0.28);
  --bsui-info-border-soft: rgba(2, 132, 199, 0.24);
  --bsui-danger-text: #991b1b;
  --bsui-danger-text-muted: #b91c1c;
  --bsui-success-text: #166534;
  --bsui-success-text-muted: #15803d;
  --bsui-warning-text-muted: #92400e;
  --bsui-info-text-muted: #0369a1;
  --bsui-neutral-text-muted: #475569;
  --bsui-spinner-track: rgba(71, 85, 105, 0.28);
  --bsui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --bsui-shadow-md: 0 12px 30px rgba(15, 23, 42, 0.12);
  --bsui-focus: 0 0 0 3px rgba(180, 83, 9, 0.22);
}

/* Scope the document palette to a rendered workspace. The signed-in sidebar
   also wraps public sales pages and must not recolor those pages. */
.account-library-page.bsui-scope,
.account-settings-page.bsui-scope,
.agents-page.bsui-scope,
.deploy-page.bsui-scope,
.ai-agent-page.bsui-scope,
.my-strategies-page.bsui-scope,
.bt-backtests-page.bsui-scope,
.my-deployments-page.bsui-scope,
.bot-details-page.bsui-scope,
.authenticated-dashboard-page.bsui-scope,
.auth-page.bsui-scope {
  --bsui-scoped-container: 1280px;
  --bsui-scoped-page-top: clamp(46px, 5.8vw, 72px);
  --bsui-scoped-page-top-mobile: 36px;
  --bsui-scoped-page-bottom: 52px;
  --bsui-scoped-title-block-gap: clamp(30px, 4vw, 44px);
  --bsui-scoped-title-tabs-gap: var(--bsui-title-tabs-gap);
  --bsui-scoped-tabs-content-gap: var(--bsui-tabs-content-gap);
  --bsui-scoped-subnav-link-gap: var(--bsui-subnav-link-gap);
  --bsui-scoped-header-gap: var(--bsui-scoped-title-block-gap);
  --bsui-scoped-title-size: var(--bsui-page-title-size);
  --bsui-scoped-title-line-height: var(--bsui-page-title-line-height);
  --bsui-scoped-title-meta-gap: var(--bsui-title-meta-gap);
  --bsui-scoped-title-copy-gap: var(--bsui-title-copy-gap);
  --bsui-scoped-section-title-size: var(--bsui-section-title-size);
  --bsui-scoped-section-title-line-height: var(--bsui-section-title-line-height);
  --bsui-scoped-section-title-copy-gap: var(--bsui-section-title-copy-gap);
  --bsui-scoped-section-title-block-gap: var(--bsui-section-title-block-gap);
  --bsui-scoped-section-block-y: clamp(32px, 5vw, 56px);
  --bsui-scoped-content-gap: var(--bsui-space-4);
  --bsui-scoped-list-gap: var(--bsui-row-gap);
  --bsui-scoped-split-gap: clamp(18px, 3vw, 34px);
  --bsui-scoped-panel-padding: clamp(22px, 3vw, 32px);
  --bsui-scoped-row-y: var(--bsui-row-padding-y);
}

.account-library-page.bsui-scope,
.account-settings-page.bsui-scope,
.agents-page.bsui-scope,
.deploy-page.bsui-scope,
.ai-agent-page.bsui-scope,
.my-strategies-page.bsui-scope,
.bt-backtests-page.bsui-scope,
.my-deployments-page.bsui-scope,
.bot-details-page.bsui-scope,
html[data-bs-theme='dark']:has(
    .App--authenticated-sidebar
      .app-main
      :is(
        .account-library-page,
        .account-settings-page,
        .agents-page,
        .deploy-page,
        .ai-agent-page,
        .my-strategies-page,
        .bt-backtests-page,
        .my-deployments-page,
        .bot-details-page,
        .authenticated-dashboard-page,
        .mp-page,
        .bs-social,
        .my-courses-page,
        .charts-view,
        .user-profile-page,
        .strategy-details-modern,
        .backtest-chart-page,
        .lal-watch-page,
        .video-page
      )
  ),
.authenticated-dashboard-page.bsui-scope,
.action-auth-window.bsui-scope[data-bs-theme='dark'] {
  --bsui-color-scheme: dark;
  --bsui-bg: #0b0e17;
  --bsui-color-canvas-hsl: 226 35% 7%;
  --bsui-bg-raised: #0c1118;
  --bsui-color-surface-elevated-hsl: 216 33% 7%;
  --bsui-page-background: var(--bsui-bg);
  --bsui-surface: #101722;
  --bsui-color-surface-hsl: 216 36% 10%;
  --bsui-surface-2: #141c29;
  --bsui-color-muted-hsl: 215 34% 12%;
  --bsui-surface-3: #1a2433;
  --bsui-library-card-bg: color-mix(in srgb, var(--bsui-surface) 72%, transparent);
  --bsui-library-card-hover-bg: color-mix(in srgb, var(--bsui-surface-2) 76%, transparent);
  --bsui-border: #253145;
  --bsui-color-border-hsl: 217 30% 21%;
  --bsui-border-strong: #3b4a63;
  --bsui-color-border-strong-hsl: 218 25% 31%;
  --bsui-border-hover: rgba(59, 130, 246, 0.42);
  --bsui-text: #f8fafc;
  --bsui-color-text-hsl: 210 40% 98%;
  --bsui-text-muted: #aab6c8;
  --bsui-color-text-muted-hsl: 217 23% 73%;
  --bsui-text-muted-rgb: 170, 182, 200;
  --bsui-text-subtle: #7f8da3;
  --bsui-text-inverse: #08111f;
  --bsui-primary-contrast: #ffffff;
  --bsui-primary: #2563eb;
  --bsui-color-primary-hsl: 221 83% 53%;
  --bsui-primary-border: #3b82f6;
  --bsui-primary-hover: #60a5fa;
  --bsui-primary-action-hover: #1d4ed8;
  --bsui-primary-bg: rgba(37, 99, 235, 0.16);
  --bsui-primary-focus-border: rgba(96, 165, 250, 0.72);
  --bsui-color-primary-foreground-hsl: 0 0% 100%;
  --bsui-accent: #60a5fa;
  --bsui-color-accent-hsl: 213 94% 68%;
  --bsui-color-accent-foreground-hsl: 222 59% 8%;
  --bsui-warning: #f59e0b;
  --bsui-yellow: #f59e0b;
  --bsui-warning-bg: rgba(245, 158, 11, 0.13);
  --bsui-alert-warning-bg: rgba(146, 64, 14, 0.22);
  --bsui-warning-border-soft: rgba(245, 158, 11, 0.28);
  --bsui-warning-border-strong: rgba(245, 158, 11, 0.36);
  --bsui-focus: 0 0 0 3px rgba(96, 165, 250, 0.28);
  --bsui-color-focus-hsl: 213 94% 68%;
}

html[data-bs-theme='light']:has(
    .App--authenticated-sidebar
      .app-main
      :is(
        .account-library-page,
        .account-settings-page,
        .agents-page,
        .deploy-page,
        .ai-agent-page,
        .my-strategies-page,
        .bt-backtests-page,
        .my-deployments-page,
        .bot-details-page,
        .authenticated-dashboard-page,
        .mp-page,
        .bs-social,
        .my-courses-page,
        .charts-view,
        .user-profile-page,
        .strategy-details-modern,
        .backtest-chart-page,
        .lal-watch-page,
        .video-page
      )
  ),
html[data-bs-theme='light']:has(
    .App--authenticated-sidebar
      .app-main
      :is(
        .account-library-page,
        .account-settings-page,
        .agents-page,
        .deploy-page,
        .ai-agent-page,
        .my-strategies-page,
        .bt-backtests-page,
        .my-deployments-page,
        .bot-details-page,
        .authenticated-dashboard-page,
        .mp-page,
        .bs-social,
        .my-courses-page,
        .charts-view,
        .user-profile-page,
        .strategy-details-modern,
        .backtest-chart-page,
        .lal-watch-page,
        .video-page
      )
  )
  .bsui-scope[data-bs-theme='light']:not(.auth-page),
.account-library-page.bsui-scope[data-bs-theme='light'],
.account-settings-page.bsui-scope[data-bs-theme='light'],
.agents-page.bsui-scope[data-bs-theme='light'],
.deploy-page.bsui-scope[data-bs-theme='light'],
.ai-agent-page.bsui-scope[data-bs-theme='light'],
.my-strategies-page.bsui-scope[data-bs-theme='light'],
.bt-backtests-page.bsui-scope[data-bs-theme='light'],
.my-deployments-page.bsui-scope[data-bs-theme='light'],
.bot-details-page.bsui-scope[data-bs-theme='light'],
.authenticated-dashboard-page.bsui-scope[data-bs-theme='light'] {
  --bsui-color-scheme: light;
  --bsui-bg: #f7f9fc;
  --bsui-color-canvas-hsl: 215 45% 98%;
  --bsui-bg-raised: #ffffff;
  --bsui-color-surface-elevated-hsl: 0 0% 100%;
  --bsui-page-background: var(--bsui-bg);
  --bsui-surface: #ffffff;
  --bsui-color-surface-hsl: 0 0% 100%;
  --bsui-surface-2: #f1f5f9;
  --bsui-color-muted-hsl: 210 40% 96%;
  --bsui-surface-3: #e6edf5;
  --bsui-library-card-bg: #ffffff;
  --bsui-library-card-hover-bg: #f8fafc;
  --bsui-border: #d6dfeb;
  --bsui-color-border-hsl: 214 31% 88%;
  --bsui-border-strong: #aebbd0;
  --bsui-color-border-strong-hsl: 218 26% 75%;
  --bsui-border-hover: rgba(37, 99, 235, 0.34);
  --bsui-text: #0f172a;
  --bsui-color-text-hsl: 222 47% 11%;
  --bsui-text-muted: #475569;
  --bsui-color-text-muted-hsl: 215 16% 47%;
  --bsui-text-muted-rgb: 71, 85, 105;
  --bsui-text-subtle: #596579;
  --bsui-text-inverse: #ffffff;
  --bsui-primary-contrast: #ffffff;
  --bsui-primary: #1d4ed8;
  --bsui-color-primary-hsl: 224 76% 48%;
  --bsui-primary-border: #1d4ed8;
  --bsui-primary-hover: #1e40af;
  --bsui-primary-action-hover: #1e40af;
  --bsui-primary-bg: rgba(37, 99, 235, 0.1);
  --bsui-primary-focus-border: rgba(37, 99, 235, 0.5);
  --bsui-color-primary-foreground-hsl: 0 0% 100%;
  --bsui-accent: var(--bsui-primary);
  --bsui-color-accent-hsl: var(--bsui-color-primary-hsl);
  --bsui-color-accent-foreground-hsl: 0 0% 100%;
  --bsui-success: #047857;
  --bsui-warning: #b45309;
  --bsui-green: #059669;
  --bsui-yellow: #b45309;
  --bsui-info: #1d4ed8;
  --bsui-success-bg: rgba(4, 120, 87, 0.1);
  --bsui-warning-bg: rgba(180, 83, 9, 0.11);
  --bsui-info-bg: rgba(37, 99, 235, 0.1);
  --bsui-alert-success-bg: rgba(4, 120, 87, 0.1);
  --bsui-alert-warning-bg: rgba(180, 83, 9, 0.11);
  --bsui-warning-border-soft: rgba(180, 83, 9, 0.22);
  --bsui-warning-border-strong: rgba(180, 83, 9, 0.3);
  --bsui-success-border-soft: rgba(4, 120, 87, 0.2);
  --bsui-success-border-strong: rgba(4, 120, 87, 0.28);
  --bsui-info-border-soft: rgba(37, 99, 235, 0.24);
  --bsui-success-text: #065f46;
  --bsui-success-text-muted: #047857;
  --bsui-info-text-muted: #1d4ed8;
  --bsui-focus: 0 0 0 3px rgba(37, 99, 235, 0.22);
  --bsui-color-focus-hsl: 221 83% 53%;
}

.bsui-scope[data-bs-theme='dark'] {
  --bsui-color-scheme: dark;
}

/* The authenticated shell and its body portals share the product palette. */
html[data-bs-theme]:has(.App--authenticated-sidebar) {
  --bsui-marketplace-page-background: var(--bsui-bg);
  --bsui-ai-action-background: var(--bsui-primary);
  --bsui-ai-action-background-hover: var(--bsui-primary-action-hover);
  --bsui-ai-action-border: 1px solid var(--bsui-primary-border);
  --bsui-ai-action-border-hover: 1px solid var(--bsui-primary-focus-border);
  --bsui-ai-action-shadow: none;
  --bsui-ai-action-shadow-hover: none;
  --bsui-ai-action-text: var(--bsui-primary-contrast);
  --bs-body-bg: var(--bsui-bg);
  --bs-body-color: var(--bsui-text);
  --theme-canvas: var(--bsui-bg);
  --theme-surface: var(--bsui-surface);
  --theme-surface-muted: var(--bsui-surface-2);
  --theme-text: var(--bsui-text);
  --theme-muted: var(--bsui-text-muted);
  --theme-subtle: var(--bsui-text-subtle);
  --theme-border: var(--bsui-border);
  --theme-rule: var(--bsui-border-subtle);
  --theme-hover: var(--bsui-hover-bg);
  --theme-action: var(--bsui-primary);
  --theme-action-ink: var(--bsui-primary-contrast);
  --theme-positive: var(--bsui-success-text-muted);
  --theme-negative: var(--bsui-danger-text-muted);
  --theme-warning: var(--bsui-warning-text-muted);
  --theme-info: var(--bsui-info-text-muted);
  --theme-brand: var(--bsui-primary-hover);
  background: var(--bsui-bg);
}

html[data-bs-theme]:has(.App--authenticated-sidebar)
  :is(body, #root, .App--authenticated-sidebar, .App--authenticated-sidebar .app-main) {
  background: var(--bsui-bg);
  color: var(--bsui-text);
}

html[data-bs-theme] .App--authenticated-sidebar .btn-primary {
  background: var(--bsui-primary);
  border-color: var(--bsui-primary-border);
  color: var(--bsui-primary-contrast);
}

html[data-bs-theme] .App--authenticated-sidebar .btn-primary:is(:hover, :active):not(:disabled) {
  background: var(--bsui-primary-action-hover);
  border-color: var(--bsui-primary-border);
}

html[data-bs-theme] .App--authenticated-sidebar .btn-primary:focus-visible {
  box-shadow: var(--bsui-focus);
}

/* Auth keeps one neutral interaction language across login and recovery surfaces. */
.auth-page.bsui-scope {
  --bsui-border-hover: var(--bsui-auth-border-hover);
  --bsui-primary: var(--bsui-auth-primary);
  --bsui-color-primary-hsl: var(--bsui-auth-primary-hsl);
  --bsui-primary-border: var(--bsui-auth-primary-border);
  --bsui-primary-hover: var(--bsui-auth-primary-hover);
  --bsui-primary-action-hover: var(--bsui-auth-primary-hover);
  --bsui-primary-bg: var(--bsui-auth-primary-bg);
  --bsui-primary-contrast: var(--bsui-auth-primary-contrast);
  --bsui-color-primary-foreground-hsl: var(--bsui-auth-primary-foreground-hsl);
  --bsui-primary-focus-border: var(--bsui-auth-primary-focus-border);
  --bsui-accent: var(--bsui-auth-primary);
  --bsui-color-accent-hsl: var(--bsui-auth-primary-hsl);
  --bsui-color-accent-foreground-hsl: var(--bsui-auth-primary-foreground-hsl);
  --bsui-info-text-muted: var(--bsui-auth-link);
  --bsui-focus: var(--bsui-auth-focus);
  --bsui-color-focus-hsl: var(--bsui-auth-primary-hsl);
}

.bsui-scope {
  color-scheme: var(--bsui-color-scheme);
  color: var(--bsui-text);
  font-family: var(--bsui-font-sans);
}

.account-library-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.account-settings-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.agents-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.deploy-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.ai-agent-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.my-strategies-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.bt-backtests-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.my-deployments-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.bot-details-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.authenticated-dashboard-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset),
.auth-page.bsui-scope
  :where(header, section, aside, article, nav, div, ol, ul, li, form, fieldset) {
  color: var(--bsui-text);
}

.account-library-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.account-settings-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.agents-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.deploy-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.ai-agent-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.my-strategies-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.bt-backtests-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.my-deployments-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.bot-details-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.authenticated-dashboard-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])),
.auth-page.bsui-scope
  :where(p:not([class]), span:not([class]), label:not([class]), li:not([class])) {
  color: inherit;
}

.bsui-scope .card,
.bsui-scope .dropdown-menu,
.bsui-scope .toast {
  background-color: var(--bsui-surface);
  border-color: var(--bsui-border);
  color: var(--bsui-text);
}

.bsui-scope .dropdown-menu {
  background: var(--bsui-surface) !important;
  background-color: var(--bsui-surface) !important;
  border-color: var(--bsui-border) !important;
  color: var(--bsui-text) !important;
  color-scheme: var(--bsui-color-scheme);
}

.bsui-scope .dropdown-item {
  background: transparent !important;
  color: var(--bsui-text) !important;
}

.bsui-scope .dropdown-item:hover,
.bsui-scope .dropdown-item:focus {
  background: var(--bsui-hover-bg) !important;
  color: var(--bsui-text) !important;
}

.bsui-scope .dropdown-item.active,
.bsui-scope .dropdown-item:active {
  background: var(--bsui-primary) !important;
  color: var(--bsui-primary-contrast) !important;
}

.bsui-scope .dropdown-divider {
  border-top-color: var(--bsui-border) !important;
}

.bsui-scope .toast-body {
  background-color: var(--bsui-surface);
  color: var(--bsui-text);
}

.bsui-scope .form-control,
.bsui-scope .form-select,
.bsui-scope .form-check-input,
.bsui-scope textarea.form-control {
  background-color: var(--bsui-bg-raised) !important;
  border-color: var(--bsui-border) !important;
  color: var(--bsui-text) !important;
  -webkit-text-fill-color: var(--bsui-text);
  color-scheme: var(--bsui-color-scheme);
}

.bsui-scope select,
.bsui-scope .bsui-select {
  background-color: var(--bsui-bg-raised) !important;
  border-color: var(--bsui-border) !important;
  color: var(--bsui-text) !important;
  -webkit-text-fill-color: var(--bsui-text);
  color-scheme: var(--bsui-color-scheme);
}

.bsui-scope select option {
  background-color: var(--bsui-bg-raised);
  color: var(--bsui-text);
}

.bsui-scope .form-control::placeholder,
.bsui-scope textarea.form-control::placeholder {
  color: var(--bsui-text-subtle);
}

.bsui-scope .form-control:focus,
.bsui-scope .form-select:focus,
.bsui-scope .form-check-input:focus {
  background-color: var(--bsui-bg-raised) !important;
  border-color: var(--bsui-primary) !important;
  box-shadow: var(--bsui-focus);
  color: var(--bsui-text) !important;
  -webkit-text-fill-color: var(--bsui-text);
}

.bsui-scope select:focus,
.bsui-scope .bsui-select:focus {
  border-color: var(--bsui-primary) !important;
  box-shadow: var(--bsui-focus);
  color: var(--bsui-text) !important;
  -webkit-text-fill-color: var(--bsui-text);
}

/* Selected-control aliases reset at each scope, so a dark dialog nested in
   a light surface retains its existing background and border. */
.bsui-scope {
  --bsui-checked-control-bg: var(--bsui-bg-raised);
  --bsui-checked-control-border: var(--bsui-border);
}

.bsui-scope[data-bs-theme='light'] {
  --bsui-checked-control-bg: var(--bsui-primary);
  --bsui-checked-control-border: var(--bsui-primary);
}

/* Bootstrap supplies a white check/dot/dash. Keep it visible in light mode. */
.bsui-scope[data-bs-theme='light'] .form-check-input:checked,
.bsui-scope[data-bs-theme='light'] .form-check-input:indeterminate {
  background-color: var(--bsui-checked-control-bg) !important;
  border-color: var(--bsui-checked-control-border) !important;
}

.bsui-scope[data-bs-theme='light'] .form-check-input:checked:focus,
.bsui-scope[data-bs-theme='light'] .form-check-input:indeterminate:focus {
  border-color: var(--bsui-primary) !important;
}

.bsui-scope .btn-primary,
.bsui-scope .btn-primary:disabled {
  background-color: var(--bsui-primary);
  border-color: var(--bsui-primary-border);
  color: var(--bsui-primary-contrast);
}

.bsui-scope .btn-primary:hover,
.bsui-scope .btn-primary:focus {
  background-color: var(--bsui-primary-action-hover);
  border-color: var(--bsui-primary);
  color: var(--bsui-primary-contrast);
}

.bsui-scope .btn-outline-primary {
  border-color: var(--bsui-border-hover);
  color: var(--bsui-primary-hover);
}

.bsui-scope .btn-outline-primary:hover,
.bsui-scope .btn-outline-primary:focus {
  background-color: var(--bsui-primary-bg);
  border-color: var(--bsui-primary);
  color: var(--bsui-primary-hover);
}

.bsui-scope .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--bsui-text);
  --bs-table-border-color: var(--bsui-border);
  --bs-table-striped-bg: var(--bsui-hover-bg-soft);
  --bs-table-hover-bg: var(--bsui-hover-bg-soft);
}

.bsui-scope .alert-info,
.bsui-scope .alert-secondary,
.bsui-scope .alert-dark {
  background-color: var(--bsui-surface);
  border-color: var(--bsui-border);
  color: var(--bsui-text);
}

.bsui-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--bsui-radius-md);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--bsui-font-sans);
  font-size: var(--bsui-type-small);
  font-weight: var(--bsui-weight-semibold);
  gap: 8px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: 38px;
  padding: 10px 14px;
  text-decoration: none;
  transition:
    background-color var(--bsui-transition),
    border-color var(--bsui-transition),
    color var(--bsui-transition),
    box-shadow var(--bsui-transition);
  white-space: nowrap;
}

.bsui-button:focus-visible,
.bsui-icon-button:focus-visible,
.bsui-segmented-control__option:focus-visible,
.bsui-choice:focus-visible,
.bsui-field__control:focus-visible {
  box-shadow: var(--bsui-focus);
  outline: none;
}

.bsui-button:disabled,
.bsui-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.bsui-button--primary {
  background: var(--bsui-primary);
  border-color: var(--bsui-primary-border);
  color: var(--bsui-primary-contrast);
}

.bsui-button--primary:hover:not(:disabled) {
  background: var(--bsui-primary-action-hover);
  border-color: var(--bsui-primary);
  color: var(--bsui-primary-contrast);
}

.bsui-button--chart {
  background: var(--bsui-chart-button);
  border-color: var(--bsui-chart-button-border);
  color: var(--bsui-chart-button-text);
}

.bsui-button--chart:hover:not(:disabled) {
  background: var(--bsui-chart-button-hover);
  border-color: var(--bsui-chart-button-border);
  color: var(--bsui-chart-button-text);
}

.bsui-button--secondary {
  background: var(--bsui-surface-2);
  border-color: var(--bsui-border);
  color: var(--bsui-text);
}

.bsui-button--secondary:hover:not(:disabled) {
  background: var(--bsui-surface-3);
  color: var(--bsui-text);
}

.bsui-button--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--bsui-text-muted);
}

.bsui-button--ghost:hover:not(:disabled) {
  background: var(--bsui-hover-bg);
  color: var(--bsui-text);
}

.bsui-button--danger {
  background: var(--bsui-danger-bg);
  border-color: var(--bsui-danger-border);
  color: var(--bsui-danger-text);
}

.bsui-button--warning {
  background: var(--bsui-warning-bg);
  border-color: var(--bsui-warning-border-strong);
  color: var(--bsui-warning-text-muted);
}

.bsui-button--success {
  background: var(--bsui-success-bg);
  border-color: var(--bsui-success-border-strong);
  color: var(--bsui-success-text);
}

.bsui-button--outline {
  background: transparent;
  border-color: var(--bsui-border);
  color: var(--bsui-text);
}

.bsui-button--outline:hover:not(:disabled) {
  background: var(--bsui-hover-bg);
  border-color: var(--bsui-border-hover);
  color: var(--bsui-text);
}

.bsui-button--outline-primary {
  background: transparent;
  border-color: var(--bsui-primary-border);
  color: var(--bsui-primary-hover);
}

.bsui-button--outline-primary:hover:not(:disabled) {
  background: var(--bsui-primary-bg);
  color: var(--bsui-text);
}

.bsui-button--outline-danger {
  background: transparent;
  border-color: var(--bsui-danger-border);
  color: var(--bsui-danger-text-muted);
}

.bsui-button--outline-danger:hover:not(:disabled) {
  background: var(--bsui-danger-bg);
  border-color: var(--bsui-danger-border-strong);
  color: var(--bsui-danger-text);
}

.bsui-button--link {
  min-height: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--bsui-info-text-muted);
}

.bsui-button--link:hover:not(:disabled) {
  color: var(--bsui-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bsui-button--sm {
  font-size: var(--bsui-type-caption);
  min-height: 36px;
  padding: 8px 11px;
}

.bsui-button--lg {
  font-size: 15px;
  min-height: 44px;
  padding: 12px 18px;
}

.bsui-button--full {
  width: 100%;
}

.bsui-icon-button {
  align-items: center;
  background: var(--bsui-surface-2);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  color: var(--bsui-text-muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  transition:
    background-color var(--bsui-transition),
    border-color var(--bsui-transition),
    color var(--bsui-transition);
  width: 36px;
}

.bsui-icon-button:hover:not(:disabled) {
  background: var(--bsui-surface-3);
  color: var(--bsui-text);
}

.bsui-badge {
  align-items: center;
  border: 1px solid var(--bsui-border-soft);
  border-radius: var(--bsui-radius-sm);
  display: inline-flex;
  font-size: var(--bsui-type-caption);
  font-weight: 700;
  gap: 6px;
  letter-spacing: 0;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.bsui-badge--neutral {
  background: var(--bsui-hover-bg);
  color: var(--bsui-neutral-text-muted);
}

.bsui-badge--success {
  background: var(--bsui-success-bg);
  border-color: var(--bsui-success-border-soft);
  color: var(--bsui-success-text-muted);
}

.bsui-badge--warning {
  background: var(--bsui-warning-bg);
  border-color: var(--bsui-warning-border-soft);
  color: var(--bsui-warning-text-muted);
}

.bsui-badge--danger {
  background: var(--bsui-danger-bg);
  border-color: var(--bsui-danger-border-soft);
  color: var(--bsui-danger-text-muted);
}

.bsui-badge--info {
  background: var(--bsui-info-bg);
  border-color: var(--bsui-info-border-soft);
  color: var(--bsui-info-text-muted);
}

.bsui-alert {
  background: var(--bsui-surface);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  color: var(--bsui-text);
  padding: 12px 14px;
}

.bsui-alert--closable {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.bsui-alert__body {
  flex: 1 1 auto;
  min-width: 0;
}

.bsui-alert__close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--bsui-radius-sm, 6px);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 24px;
  justify-content: center;
  margin: -3px -4px -3px 0;
  opacity: 0.75;
  padding: 0;
  width: 24px;
}

.bsui-alert__close:hover,
.bsui-alert__close:focus-visible {
  background: var(--bsui-surface-hover, rgba(127, 127, 127, 0.16));
  opacity: 1;
}

.bsui-alert--warning {
  background: var(--bsui-alert-warning-bg);
  border-color: var(--bsui-warning-border-strong);
}

.bsui-alert--danger {
  background: var(--bsui-alert-danger-bg);
  border-color: var(--bsui-danger-border-strong);
}

.bsui-alert--success {
  background: var(--bsui-alert-success-bg);
  border-color: var(--bsui-success-border-strong);
}

.bsui-field {
  color: var(--bsui-text);
  display: grid;
  gap: 6px;
}

.bsui-field__label {
  color: var(--bsui-text);
  font-size: var(--bsui-type-caption);
  font-weight: 700;
}

.bsui-field__hint,
.bsui-field__error {
  font-size: var(--bsui-type-caption);
  line-height: 1.45;
}

.bsui-field__hint {
  color: var(--bsui-text-subtle);
}

.bsui-field__error {
  color: var(--bsui-danger-text-muted);
}

.bsui-field__control {
  background: var(--bsui-bg-raised);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  color: var(--bsui-text);
  font-family: var(--bsui-font-sans);
  font-size: var(--bsui-type-small);
  min-height: 38px;
  padding: 9px 11px;
  transition:
    border-color var(--bsui-transition),
    box-shadow var(--bsui-transition);
  width: 100%;
}

.bsui-field__control::placeholder {
  color: var(--bsui-text-subtle);
}

.bsui-textarea {
  min-height: 94px;
  resize: vertical;
}

.bsui-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--bsui-text-muted) 50%),
    linear-gradient(135deg, var(--bsui-text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 16px) 50%;
  background-repeat: no-repeat;
  background-size:
    5px 5px,
    5px 5px;
  padding-right: 42px;
}

/*
 * One dropdown arrow for every single-choice <select> on the site.
 * The browser's own arrow sits about 4px from the right border no matter how
 * much padding a page adds, so it looked clipped on most dropdowns (Rob,
 * 2026-10-19). This draws the same chevron Bootstrap's .form-select uses, at the
 * same 12px inset, and reserves room for it so long labels never run under it.
 * The selector is deliberately specific enough to beat page rules that use the
 * `background:` or `padding:` shorthand on a select. Bootstrap .form-select
 * already does this. A select that draws its own icon opts out with
 * data-own-chevron.
 */
select:not([multiple]):not([size]):not(.form-select):not([data-own-chevron]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b949e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  padding-right: 2.25rem;
}

.bsui-panel {
  background: var(--bsui-surface);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  box-shadow: var(--bsui-shadow-sm);
  color: var(--bsui-text);
}

.bsui-panel--padded {
  padding: 18px;
}

.bsui-page {
  background: var(--bsui-page-background, var(--bsui-bg));
  color: var(--bsui-text);
  min-height: calc(100vh - 75px);
  padding: clamp(28px, 4vw, 56px) var(--bsui-page-gutter) 48px;
}

.bsui-page__inner {
  margin: 0 auto;
  max-width: var(--bsui-container);
  width: 100%;
}

.bsui-page-header {
  align-items: flex-end;
  display: flex;
  gap: var(--bsui-space-6);
  justify-content: space-between;
  margin-bottom: var(--bsui-scoped-title-block-gap, var(--bsui-title-block-gap));
}

.bsui-page-header__copy {
  min-width: 0;
}

.bsui-page-header__supporting {
  color: var(--bsui-text-subtle);
  font-size: var(--bsui-type-caption);
  font-weight: 500;
  line-height: 1.4;
  margin-top: var(--bsui-space-2);
}

.bsui-page-header h1 {
  color: var(--bsui-text);
  font-size: var(--bsui-type-page-title);
  font-weight: var(--bsui-weight-semibold);
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.bsui-page-header__description {
  color: var(--bsui-text-muted);
  font-size: 15px;
  line-height: 1.55;
  margin: var(--bsui-scoped-title-copy-gap, var(--bsui-title-copy-gap)) 0 0;
  max-width: 720px;
}

.bsui-page-header__actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: var(--bsui-space-3);
  justify-content: flex-end;
}

.bsui-toolbar {
  align-items: center;
  background: var(--bsui-surface);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
}

.bsui-search-field {
  align-items: center;
  background: var(--bsui-bg-raised);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  color: var(--bsui-text-muted);
  display: inline-flex;
  gap: 9px;
  min-height: 38px;
  min-width: min(100%, 280px);
  padding: 0 11px;
  transition:
    border-color var(--bsui-transition),
    box-shadow var(--bsui-transition);
}

.bsui-search-field:focus-within {
  border-color: var(--bsui-primary);
  box-shadow: var(--bsui-focus);
}

.bsui-search-field__icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.bsui-search-field__input {
  background: transparent;
  border: 0;
  color: var(--bsui-text);
  font-family: var(--bsui-font-sans);
  font-size: var(--bsui-type-small);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.bsui-search-field__input::placeholder {
  color: var(--bsui-text-subtle);
}

.bsui-data-surface {
  background: var(--bsui-surface);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  color: var(--bsui-text);
  overflow: hidden;
}

.bsui-data-surface--loading {
  opacity: 0.74;
  pointer-events: none;
}

.bsui-data-surface table {
  margin: 0;
}

.bsui-section {
  padding: clamp(48px, 8vw, 96px) var(--bsui-page-gutter);
}

.bsui-section__inner {
  margin: 0 auto;
  max-width: var(--bsui-container);
  width: 100%;
}

.bsui-skeleton {
  background: var(--bsui-surface-3);
  border-radius: var(--bsui-radius-sm);
  display: block;
}

.bsui-ledger-skeleton {
  display: grid;
  gap: var(--bsui-space-3);
}

.bsui-ledger-skeleton__row {
  align-items: center;
  background: var(--bsui-library-card-bg);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-lg);
  display: grid;
  gap: var(--bsui-space-4);
  grid-template-columns: minmax(240px, 1fr) minmax(270px, 0.8fr) auto;
  padding: clamp(16px, 1.8vw, 20px);
  pointer-events: none;
}

.bsui-ledger-skeleton__main {
  display: grid;
  gap: var(--bsui-space-2);
  min-width: 0;
}

.bsui-ledger-skeleton__proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bsui-space-3);
}

@media (max-width: 768px) {
  .bsui-ledger-skeleton__row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .bsui-ledger-skeleton__proof {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.bsui-spinner {
  animation: bsuiSpin 700ms linear infinite;
  border: 2px solid var(--bsui-spinner-track);
  border-radius: 999px;
  border-top-color: currentColor;
  color: var(--bsui-text);
  display: inline-block;
  height: 18px;
  width: 18px;
}

@keyframes bsuiSpin {
  to {
    transform: rotate(360deg);
  }
}

.bsui-empty-state {
  align-items: center;
  color: var(--bsui-text-muted);
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 0 auto;
  max-width: 520px;
  padding: 48px 18px;
  text-align: center;
}

.bsui-empty-state h2,
.bsui-empty-state h3 {
  color: var(--bsui-text);
  font-size: clamp(22px, 3vw, 28px);
  margin: 0;
}

.bsui-empty-state p {
  color: var(--bsui-text-muted);
  line-height: 1.55;
  margin: 0;
}

.bsui-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.bsui-segmented-control {
  align-items: center;
  background: var(--bsui-bg-raised);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  display: inline-flex;
  gap: 3px;
  padding: 3px;
}

.bsui-segmented-control__option {
  background: transparent;
  border: 0;
  border-radius: var(--bsui-radius-sm);
  color: var(--bsui-text-muted);
  cursor: pointer;
  font-family: var(--bsui-font-sans);
  font-size: var(--bsui-type-caption);
  font-weight: 700;
  min-height: 30px;
  padding: 6px 10px;
}

.bsui-segmented-control__option[aria-pressed='true'] {
  background: var(--bsui-surface-3);
  color: var(--bsui-text);
}

/* Link options (each option is its own page) look exactly like buttons. */
.bsui-segmented-control__option--link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.bsui-segmented-control__option--link:hover {
  color: var(--bsui-text);
}

html[data-bs-theme='light'] .bsui-segmented-control__option[aria-pressed='true'] {
  box-shadow: inset 0 0 0 1px var(--bsui-text-subtle);
  color: var(--bsui-primary);
}

.bsui-theme-toggle {
  width: 100%;
}

.bsui-theme-toggle .bsui-segmented-control__option {
  flex: 1 1 0;
}

@media (max-width: 768px) {
  .bsui-page {
    padding: 24px 16px 36px;
  }

  .bsui-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .bsui-page-header__actions,
  .bsui-toolbar,
  .bsui-search-field {
    width: 100%;
  }
}

/* Choice list: full-width radio rows (Deploy run mode, Share destination). */
.bsui-choice-list {
  display: grid;
  gap: var(--bsui-space-2);
}

.bsui-choice {
  align-items: flex-start;
  background: var(--bsui-bg-raised);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-md);
  color: var(--bsui-text);
  cursor: pointer;
  display: flex;
  font-family: var(--bsui-font-sans);
  gap: var(--bsui-space-3);
  padding: var(--bsui-space-3);
  text-align: left;
  width: 100%;
}

.bsui-choice:hover {
  border-color: var(--bsui-primary-border);
}

.bsui-choice:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.bsui-choice--selected {
  background: var(--bsui-primary-bg);
  border-color: var(--bsui-primary-border);
}

.bsui-choice__dot {
  border: 2px solid var(--bsui-border-strong, var(--bsui-border));
  border-radius: 50%;
  flex: 0 0 auto;
  height: 16px;
  margin-top: 2px;
  width: 16px;
}

.bsui-choice--selected .bsui-choice__dot {
  background: radial-gradient(circle, var(--bsui-primary-hover) 0 4px, transparent 5px);
  border-color: var(--bsui-primary-hover);
}

.bsui-choice__icon {
  color: var(--bsui-text-muted);
  flex: 0 0 auto;
  line-height: 20px;
  width: 18px;
}

.bsui-choice--selected .bsui-choice__icon {
  color: var(--bsui-primary-hover);
}

.bsui-choice__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bsui-choice__label {
  align-items: center;
  color: var(--bsui-text);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--bsui-font-size-2);
  font-weight: 760;
  gap: var(--bsui-space-2);
}

.bsui-choice__tag {
  background: var(--bsui-primary-bg);
  border: 1px solid var(--bsui-primary-border);
  border-radius: 999px;
  color: var(--bsui-primary-hover);
  font-size: var(--bsui-font-size-1);
  font-weight: 720;
  padding: 1px var(--bsui-space-2);
}

.bsui-choice__description {
  color: var(--bsui-text-muted);
  font-size: var(--bsui-font-size-1);
  line-height: 1.45;
}

/*
 * A disabled control always says why (Rob, 2026-11-18): red reason under it, the same words as a
 * tooltip on hover and focus, and a flash when the disabled control is clicked. See
 * DisabledReason in index.tsx. The disabled control lets pointer events through to its frame.
 */
.bsui-disabled-reason {
  display: inline-grid;
  gap: 6px;
  justify-items: center;
  max-width: 100%;
  vertical-align: top;
}

.bsui-disabled-reason--block {
  display: grid;
  justify-items: stretch;
  width: 100%;
}

.bsui-disabled-reason__control {
  border-radius: var(--bsui-radius-md);
  cursor: not-allowed;
  display: inline-flex;
  max-width: 100%;
  position: relative;
}

.bsui-disabled-reason--block .bsui-disabled-reason__control {
  display: flex;
  width: 100%;
}

.bsui-disabled-reason--block .bsui-disabled-reason__control > * {
  flex: 1 1 auto;
}

.bsui-disabled-reason--idle,
.bsui-disabled-reason--idle > .bsui-disabled-reason__control {
  display: contents;
}

.bsui-disabled-reason__control > :disabled {
  pointer-events: none;
}

/* A live blocked control keeps its normal look and pointer; the reason does the talking. */
.bsui-disabled-reason--live .bsui-disabled-reason__control {
  cursor: pointer;
}

.bsui-disabled-reason__control:focus-visible {
  box-shadow: var(--bsui-focus);
  outline: none;
}

.bsui-disabled-reason__text {
  border-radius: var(--bsui-radius-sm, 6px);
  color: var(--bsui-danger-text-muted);
  justify-self: center;
  max-width: 100%;
  padding: 2px 8px;
  font-size: var(--bsui-type-small, 13px);
  font-weight: var(--bsui-weight-semibold, 600);
  line-height: 1.35;
  text-align: center;
}

.bsui-disabled-reason__tip {
  background: var(--bsui-surface-3);
  border: 1px solid var(--bsui-border);
  border-radius: var(--bsui-radius-sm, 6px);
  bottom: calc(100% + 8px);
  box-shadow: var(--bsui-shadow-md);
  color: var(--bsui-text);
  font-size: var(--bsui-type-caption, 12px);
  font-weight: 500;
  left: 50%;
  line-height: 1.35;
  max-width: min(280px, 90vw);
  opacity: 0;
  padding: 6px 10px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  transform: translate(-50%, 4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  visibility: hidden;
  white-space: normal;
  width: max-content;
  z-index: 30;
}

.bsui-disabled-reason__tip::before {
  content: attr(data-tip);
}

.bsui-disabled-reason__control:hover .bsui-disabled-reason__tip,
.bsui-disabled-reason__control:focus-visible .bsui-disabled-reason__tip,
.bsui-disabled-reason--flash .bsui-disabled-reason__tip {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.bsui-disabled-reason--flash .bsui-disabled-reason__control {
  animation: bsui-disabled-reason-nudge 360ms ease-in-out;
  box-shadow: 0 0 0 2px var(--bsui-danger);
}

.bsui-disabled-reason--flash .bsui-disabled-reason__text {
  animation: bsui-disabled-reason-flash 900ms ease-out;
  color: var(--bsui-danger);
}

@keyframes bsui-disabled-reason-flash {
  0%,
  40% {
    background: var(--bsui-danger-bg);
  }
  100% {
    background: transparent;
  }
}

@keyframes bsui-disabled-reason-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* The field the person has to fix, highlighted after a click on a disabled button. */
.bsui-attention {
  animation: bsui-attention-pulse 1200ms ease-out;
  border-radius: var(--bsui-radius-md);
  box-shadow: 0 0 0 2px var(--bsui-danger);
}

@keyframes bsui-attention-pulse {
  0% {
    box-shadow: 0 0 0 6px var(--bsui-danger-bg);
  }
  100% {
    box-shadow: 0 0 0 2px var(--bsui-danger);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bsui-disabled-reason--flash .bsui-disabled-reason__control,
  .bsui-disabled-reason--flash .bsui-disabled-reason__text,
  .bsui-attention {
    animation: none;
  }

  .bsui-disabled-reason__tip {
    transition: none;
  }
}

/* Quiet: the reason stays for screen readers and in the tooltip, no red text in the row. */
.bsui-disabled-reason--quiet {
  display: inline-flex;
}

.bsui-disabled-reason--quiet > .bsui-disabled-reason__text {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.trust-page {
  min-height: 100vh;
  background: #07111f;
  color: #eef4ff;
}

/* Light mode: use theme canvas and text colors */
html[data-bs-theme='light'] .trust-page {
  background: var(--theme-canvas);
  color: var(--theme-text);
}

.trust-page__inner {
  width: min(100%, 880px);
  gap: 40px;
  padding-block: clamp(48px, 8vw, 88px);
}

.trust-page__header,
.trust-page__body,
.trust-page__resources {
  display: grid;
  gap: 16px;
}

.trust-page__eyebrow {
  color: #78d6c6;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html[data-bs-theme='light'] .trust-page__eyebrow {
  color: var(--theme-info);
}

.trust-page h1,
.trust-page h2,
.trust-page p {
  margin: 0;
}

.trust-page h1,
.trust-page h2 {
  color: var(--bsui-text, #eef4ff);
}

.trust-page h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.02;
}

.trust-page__header > p:last-child,
.trust-page__body p {
  color: #b8c5d8;
  font-size: 1.05rem;
  line-height: 1.75;
}

html[data-bs-theme='light'] .trust-page__header > p:last-child,
html[data-bs-theme='light'] .trust-page__body p {
  color: var(--theme-muted);
}

.trust-page__body {
  gap: 32px;
}

.trust-page__body section {
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(184, 197, 216, 0.2);
  padding-top: 28px;
}

html[data-bs-theme='light'] .trust-page__body section {
  border-top-color: var(--theme-rule);
}

.trust-page__resources {
  border-top: 1px solid rgba(184, 197, 216, 0.2);
  padding-top: 28px;
}

html[data-bs-theme='light'] .trust-page__resources {
  border-top-color: var(--theme-rule);
}

.trust-page__resources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-page a {
  color: #78d6c6;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

html[data-bs-theme='light'] .trust-page a {
  color: var(--theme-info);
}

.trust-page a:focus-visible {
  outline: 2px solid #78d6c6;
  outline-offset: 4px;
}

/* Rich public documents share this owner; screenshots retain their full frame. */
.trust-page figure {
  margin: 0;
}

.trust-page figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

.trust-page figcaption {
  color: var(--bsui-text-muted);
  font-size: var(--bsui-type-small);
  margin-top: 0.75rem;
}

.trust-page details > p {
  margin-top: 0.75rem;
}

@media (max-width: 600px) {
  .trust-page__inner {
    gap: 32px;
    padding-block: 40px 56px;
  }

  .trust-page__header > p:last-child,
  .trust-page__body p {
    font-size: 1rem;
  }
}

/* Release chronology stays beside the title; existing public document styles own the layout. */
.trust-page__release-header {
  display: grid;
  gap: var(--bsui-space-3, 12px);
  padding-block: var(--bsui-space-4, 16px);
  border-bottom: 1px solid var(--bsui-border);
}

.trust-page__release-header h2 {
  font-size: var(--bsui-type-section-title);
}

.trust-page__body h3 {
  margin: 0;
  color: var(--bsui-text);
  font-size: var(--bsui-type-section-title);
  line-height: 1.3;
}

.trust-page__body[id],
.trust-page__body section[id] {
  scroll-margin-top: 120px;
}

.trust-page__change-date {
  color: var(--bsui-text-muted);
  font-size: var(--bsui-type-body);
}

.trust-page__release-header + section {
  border-top: 0;
  padding-top: 0;
}

.trust-page__resources > p {
  color: var(--bsui-text-muted);
}

.trust-page__document {
  display: grid;
  gap: var(--bsui-space-6);
}

.trust-page__document .trust-page__resources ul {
  display: grid;
  gap: var(--bsui-space-3);
}

/* Script-free documents reuse the page owner without the app shell's global reset. */
body.trust-page {
  margin: 0;
}

.trust-page--standalone .trust-page__inner {
  padding-block: 0;
}
