/**
 * Chat light/dark theme tokens
 * Apply via html[data-chat-theme="dark"|"light"]
 * Default: dark (matches :root when attribute unset on non-chat pages)
 */

:root {
    --chat-theme-transition-duration: 0.85s;
    --chat-theme-surface-transition-duration: 1.05s;
    --chat-theme-transition-ease: ease-in-out;
    --chat-theme-surface-transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --welcome-theme-sun-spin-duration: 0.85s;
    --welcome-theme-sun-spin-ease: ease-in-out;
    --welcome-theme-toggle-icon-fade: 0.28s;
}

/* Surfaces that ease when data-chat-theme toggles */
.chat-theme-surface {
    transition:
        background-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        background var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        border-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        box-shadow var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease);
}

@media (prefers-reduced-motion: reduce) {
    .chat-theme-surface,
    .suggestion-card,
    .welcome-skill-tile--skill,
    .welcome-skill-tile--placeholder,
    .welcome-skill-tile__icon-skel,
    .welcome-skill-tile__line,
    .prompt-bar-toolbar-btn,
    .prompt-bar-toolbar-group,
    .prompt-bar-field,
    .prompt-bar-meta-strip,
    .prompt-bar-input .context-chips-strip,
    html:has(#chat-app-root),
    html:has(#chat-app-root) body,
    #chat-app-root.chat-app-root-bg,
    .welcome-hero-logo__img,
    .welcome-hero-lead-stack__layer {
        transition-duration: 0.01ms !important;
    }

    .welcome-theme-toggle__sun-spin--cw,
    .welcome-theme-toggle__sun-spin--ccw {
        animation: none !important;
    }
}

:root,
[data-chat-theme="dark"] {
    color-scheme: dark;

    /* hurra.ai CI v2 — black surfaces, white primary text, grey secondary */
    --ci-red: #e4002b;
    --ci-black: #171417;
    --ci-sand: #f8f7f6;
    --ci-dark-grey: #363131;
    --ci-grey: #767478;
    --ci-white: #ffffff;
    --ci-light-grey: #e0dfde;
    --ci-green: #81c784;
    --ci-dark-red: #9e001e;
    --ci-red-mid-2: #ef6680;
    --ci-blue: #0468cb;
    --ci-light-blue: #6ed4e1;
    --ci-orange: #ff9900;
    --ci-yellow: #ffd54f;
    --ci-purple: #ce93d8;

    --chat-bg-page: #171417;
    --chat-bg-page-mid: #171417;
    --chat-bg-shell: #171417;
    --chat-bg-card: #1f1d20;
    --chat-bg-user-bubble: #1a181b;
    --chat-bg-user-bubble-fade: #141214;
    --chat-bg-inset: #171417;
    --chat-bg-tab: #363131;
    --chat-bg-input: #1f1d20;
    --chat-bg-elevated: #363131;

    --chat-fg-rgb: 255 255 255;
    --chat-fg-muted-rgb: 118 116 120;

    --chat-border: rgba(54, 49, 49, 0.72);
    --chat-border-strong: #363131;
    --chat-border-hover: rgba(54, 49, 49, 0.92);
    --chat-overlay: rgba(0, 0, 0, 0.55);
    --chat-brand-wash: rgba(228, 0, 43, 0.04);
    --chat-brand-wash-mid: rgba(228, 0, 43, 0.015);

    --chat-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --chat-shadow-message-bubble:
        inset 0 1px 2px rgba(0, 0, 0, 0.38),
        inset 0 0 0 1px rgba(54, 49, 49, 0.55);
    --chat-shadow-user-bubble: var(--chat-shadow-message-bubble);
    --chat-shadow-prompt: 0 14px 36px -22px rgba(0, 0, 0, 0.55), 0 4px 12px -8px rgba(0, 0, 0, 0.35);

    --hurra-toast-accent-info: var(--ci-red);
    --hurra-toast-accent-success: var(--ci-green);
    --hurra-toast-accent-error: var(--ci-red);
    --hurra-toast-progress-info: linear-gradient(90deg, rgb(228 0 43 / 0.75), rgb(228 0 43 / 0.12));
    --hurra-toast-progress-success: linear-gradient(90deg, rgb(129 199 132 / 0.8), rgb(129 199 132 / 0.12));
    --hurra-toast-progress-error: linear-gradient(90deg, rgb(228 0 43 / 0.75), rgb(228 0 43 / 0.12));

    --chat-surface-hover: rgba(255, 255, 255, 0.055);
    --chat-surface-muted: rgba(54, 49, 49, 0.45);
    --chat-surface-subtle: rgba(54, 49, 49, 0.28);

    --chat-driver-bg: #1f1d20;
    --chat-driver-border: #363131;
    --chat-driver-fg: #767478;
    --chat-driver-title: #ffffff;

    --chat-thinking-panel-bg: rgba(23, 20, 23, 0.98);
    --chat-thinking-panel-header-bg: rgba(31, 29, 32, 0.96);
    --chat-thinking-panel-border: #363131;
    --chat-thinking-panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

    /* Legacy aliases (chat.css BEM) */
    --chat-bg-primary: #171417;
    --chat-bg-secondary: #1f1d20;
    --chat-bg-surface: #363131;
    --chat-bg-input-legacy: #1f1d20;
    --chat-text-primary: #ffffff;
    --chat-text-secondary: #767478;
    --chat-text-muted: #767478;
    --chat-accent: #767478;
    --chat-accent-hover: #ffffff;

    --chat-connection-pulse-border: rgba(4, 104, 203, 0.88);
    --chat-connection-pulse-ring: rgba(4, 104, 203, 0.32);
    --chat-connection-pulse-mid: rgba(4, 104, 203, 0.58);
    --chat-connection-pulse-ring-mid: rgba(4, 104, 203, 0.14);

    /* Inline enablement notice chips + capability coach (assistant / prompt bar) */
    --chat-enablement-btn-bg: rgb(var(--chat-fg-rgb) / 0.035);
    --chat-enablement-btn-border: var(--chat-border);
    --chat-enablement-btn-fg: rgb(var(--chat-fg-muted-rgb) / 0.82);
    --chat-enablement-btn-hover-bg: rgb(var(--chat-fg-rgb) / 0.07);
    --chat-enablement-btn-hover-border: var(--chat-border-strong);
    --chat-enablement-btn-hover-fg: rgb(var(--chat-fg-rgb) / 0.88);
    --chat-enablement-btn-oauth-bg: rgb(var(--chat-fg-rgb) / 0.05);
    --chat-enablement-btn-oauth-border: var(--chat-border-strong);
    --chat-enablement-btn-action-fg: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --chat-enablement-action-row-bg: rgb(var(--chat-fg-rgb) / 0.03);
    --chat-enablement-action-row-border: var(--chat-border);
    --chat-brand-icon-confluence: var(--ci-blue);
    --chat-brand-icon-jira: var(--ci-blue);
    --chat-capability-coach-bg: var(--chat-brand-wash);
    --chat-capability-coach-border: var(--profile-modal-accent-border);
    --chat-capability-coach-title: rgb(var(--chat-fg-rgb) / 0.92);
    --chat-capability-coach-body: rgb(var(--chat-fg-muted-rgb) / 0.78);
    --chat-capability-coach-btn-bg: var(--chat-enablement-btn-bg);
    --chat-capability-coach-btn-border: var(--chat-enablement-btn-border);
    --chat-capability-coach-btn-fg: var(--chat-enablement-btn-fg);
    --chat-capability-coach-btn-hover-bg: var(--chat-enablement-btn-hover-bg);
    --chat-capability-coach-btn-hover-fg: var(--chat-enablement-btn-hover-fg);
    --chat-capability-coach-btn-primary-border: var(--profile-modal-accent-border);
    --chat-capability-coach-btn-primary-bg: var(--profile-modal-accent-soft);
    --chat-capability-coach-btn-primary-fg: var(--ci-red);
    --chat-capability-coach-btn-primary-hover-bg: rgba(228, 0, 43, 0.14);

    --chat-capability-typing-accent: rgba(245, 158, 11, 0.92);
    --chat-capability-typing-border: rgba(245, 158, 11, 0.42);
    --chat-capability-typing-border-mid: rgba(245, 158, 11, 0.58);
    --chat-capability-typing-ring: rgba(245, 158, 11, 0.16);
    --chat-capability-typing-ring-mid: rgba(245, 158, 11, 0.24);
    --chat-capability-typing-surface-bg: rgba(245, 158, 11, 0.06);
    --chat-capability-typing-chip-bg: rgb(var(--chat-fg-rgb) / 0.04);
    --chat-capability-typing-chip-hover-bg: rgb(var(--chat-fg-rgb) / 0.07);
    --chat-capability-typing-chip-border: var(--chat-border-strong);
    --chat-capability-typing-connect-border: rgba(4, 104, 203, 0.38);
    --chat-capability-typing-connect-bg: rgba(4, 104, 203, 0.08);

    --chat-enablement-btn-ready-border: rgba(129, 199, 132, 0.45);
    --chat-enablement-btn-ready-bg: rgba(129, 199, 132, 0.1);
    --chat-enablement-btn-ready-fg: var(--ci-green);
    --chat-enablement-li-ready-border: rgba(129, 199, 132, 0.35);

    /* Tools modal — platform zones, counts, tool icon wells */
    --capability-modal-status-on: var(--ci-green);
    --capability-modal-zone-count-all-border: color-mix(in srgb, var(--ci-green) 28%, transparent);
    --capability-modal-zone-count-all-bg: color-mix(in srgb, var(--ci-green) 10%, transparent);
    --capability-modal-zone-count-all-fg: var(--ci-green);
    --capability-modal-zone-count-some-border: color-mix(in srgb, var(--ci-blue) 24%, transparent);
    --capability-modal-zone-count-some-bg: color-mix(in srgb, var(--ci-blue) 8%, transparent);
    --capability-modal-zone-count-some-fg: var(--ci-light-blue);
    --capability-modal-zone-internal-border: color-mix(in srgb, var(--ci-green) 14%, transparent);
    --capability-modal-zone-internal-mark-fg: var(--ci-green);
    --capability-modal-zone-internal-mark-bg: color-mix(in srgb, var(--ci-green) 10%, transparent);
    --capability-modal-zone-external-border: color-mix(in srgb, var(--ci-purple) 14%, transparent);
    --capability-modal-zone-external-mark-fg: var(--ci-purple);
    --capability-modal-zone-external-mark-bg: color-mix(in srgb, var(--ci-purple) 10%, transparent);
    --capability-modal-tool-icon-wash: rgb(var(--chat-fg-rgb) / 0.05);
    --capability-modal-action-disconnect-hover: color-mix(in srgb, var(--ci-red) 90%, transparent);

    --chat-profile-modal-overlay: rgba(0, 0, 0, 0.45);
    --chat-profile-modal-blur: 3px;
    --chat-profile-hero-bg: #363131;
    --chat-profile-hero-fg: #ffffff;
    --chat-profile-hero-close: #767478;
    --chat-profile-hero-close-hover-bg: rgba(255, 255, 255, 0.1);

    /* Profile modal body — Sand panel + CI typography (theme-independent) */
    --profile-modal-body-bg: #f8f7f6;
    --profile-modal-panel-bg: #ffffff;
    --profile-modal-body-fg: #363131;
    --profile-modal-body-muted: #767478;
    --profile-modal-body-border: #e0dfde;
    --profile-modal-accent: #e4002b;
    --profile-modal-accent-hover: #9e001e;
    --profile-modal-accent-soft: rgba(228, 0, 43, 0.08);
    --profile-modal-accent-border: rgba(228, 0, 43, 0.18);
    --profile-modal-input-focus-ring: rgba(228, 0, 43, 0.12);

    --chat-font: Arial, Helvetica, sans-serif;

    /* Calculator activity panel */
    --chat-math-bg: var(--chat-bg-card);
    --chat-math-border: var(--chat-border-strong);
    --chat-math-title: var(--chat-text-primary);
    --chat-math-icon: var(--ci-red);
    --chat-math-label: var(--chat-text-primary);
    --chat-math-result: var(--ci-white);
    --chat-math-muted: var(--ci-grey);
    --chat-math-row-bg: rgba(255, 255, 255, 0.03);
    --chat-math-row-border: rgba(255, 255, 255, 0.1);
    --chat-math-row-running-bg: rgba(228, 0, 43, 0.1);
    --chat-math-grid-bg: rgba(255, 255, 255, 0.02);
    --chat-math-error: var(--ci-red);
    --chat-math-error-bg: rgba(158, 0, 30, 0.18);
    --chat-math-pulse: var(--ci-red);
    --chat-math-stat-fg: var(--ci-red);
    --chat-math-stat-border: rgba(228, 0, 43, 0.35);
    --chat-math-stat-bg: rgba(228, 0, 43, 0.1);
    --chat-activity-search-stat-fg: var(--ci-light-blue);
    --chat-activity-search-stat-border: color-mix(in srgb, var(--ci-blue) 28%, transparent);
    --chat-activity-search-stat-bg: color-mix(in srgb, var(--ci-blue) 10%, transparent);
    --chat-activity-hitl-stat-fg: var(--ci-green);
    --chat-activity-hitl-stat-border: color-mix(in srgb, var(--ci-green) 35%, transparent);
    --chat-activity-hitl-stat-bg: color-mix(in srgb, var(--ci-green) 10%, transparent);

    /* Semantic emoji callout lines in chat prose (💡 ⚠️ ✅ ❌) */
    --chat-callout-tip-bg: color-mix(in srgb, var(--ci-yellow) 8%, transparent);
    --chat-callout-tip-border: color-mix(in srgb, var(--ci-yellow) 35%, transparent);
    --chat-callout-tip-fg: var(--ci-yellow);
    --chat-callout-warning-bg: color-mix(in srgb, var(--ci-orange) 8%, transparent);
    --chat-callout-warning-border: color-mix(in srgb, var(--ci-orange) 35%, transparent);
    --chat-callout-warning-fg: var(--ci-orange);
    --chat-callout-success-bg: color-mix(in srgb, var(--ci-green) 8%, transparent);
    --chat-callout-success-border: color-mix(in srgb, var(--ci-green) 35%, transparent);
    --chat-callout-success-fg: var(--ci-green);
    --chat-callout-error-bg: color-mix(in srgb, var(--ci-red) 8%, transparent);
    --chat-callout-error-border: color-mix(in srgb, var(--ci-red) 35%, transparent);
    --chat-callout-error-fg: color-mix(in srgb, var(--ci-red) 85%, #ff6b6b);

    /* Chart embed panels (message_ai + stream_activity) */
    --chat-chart-card-bg: rgb(var(--chat-fg-rgb) / 0.02);
    --chat-chart-card-title: rgb(var(--chat-fg-muted-rgb) / 0.85);
    --chat-chart-card-muted: rgb(var(--chat-fg-muted-rgb) / 0.55);
    --chat-chart-card-demo-track: rgb(var(--chat-fg-rgb) / 0.1);
    --chat-chart-card-demo-fill: rgb(var(--ci-red) / 0.8);

    /* Content Humanizer card (```email fence) — slightly elevated vs message surface */
    --chat-humanizer-card-bg: #252326;
    --chat-humanizer-card-body-bg: rgb(var(--chat-fg-rgb) / 0.035);
    --chat-humanizer-card-header-bg: rgb(var(--chat-fg-rgb) / 0.06);
    --chat-humanizer-card-actions-bg: rgb(var(--chat-fg-rgb) / 0.025);
    --chat-humanizer-card-border: var(--chat-border-strong);
    --chat-humanizer-card-accent: rgb(var(--ci-red) / 0.55);
    --chat-humanizer-card-shadow:
        0 4px 18px -10px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgb(var(--chat-fg-rgb) / 0.06);
    --chat-humanizer-card-title-fg: rgb(var(--chat-fg-rgb) / 0.88);
    --chat-humanizer-card-icon-fg: rgb(var(--ci-red) / 0.75);

    /* HITL integration embed cards (message_ai + stream) */
    --hitl-embed-bg: var(--chat-bg-card);
    --hitl-embed-border: var(--chat-border-strong);
    --hitl-embed-divider: rgb(var(--chat-fg-rgb) / 0.1);
    --hitl-embed-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgb(var(--chat-fg-rgb) / 0.05);
    --hitl-embed-accent: var(--ci-red);
    --hitl-embed-accent-jira: var(--ci-blue);
    --hitl-embed-accent-confluence: var(--ci-blue);
    --hitl-embed-accent-gmail: var(--ci-red);
    --hitl-embed-accent-gcalendar: var(--ci-green);
    --hitl-embed-meta-bg: rgb(var(--chat-fg-rgb) / 0.035);
    --hitl-embed-meta-border: rgb(var(--chat-fg-rgb) / 0.07);
    --hitl-embed-icon-inset-highlight: rgb(var(--chat-fg-rgb) / 0.05);
    --hitl-embed-status-approved-fg: var(--ci-green);
    --hitl-embed-status-approved-border: color-mix(in srgb, var(--ci-green) 35%, transparent);
    --hitl-embed-status-approved-bg: color-mix(in srgb, var(--ci-green) 12%, transparent);

    /* Prompt bar meta strip + queue chips (CI v2) */
    --prompt-bar-meta-strip-bg: var(--chat-brand-wash);
    --prompt-bar-meta-strip-border: var(--ci-dark-grey);
    --prompt-bar-meta-strip-fg: var(--ci-white);
    --prompt-bar-meta-strip-fg-muted: var(--ci-grey);
    --prompt-bar-meta-strip-skill-icon-bg: rgba(228, 0, 43, 0.14);
    --prompt-bar-meta-strip-skill-icon-fg: var(--ci-red);
    --prompt-bar-meta-strip-skill-hover: rgba(54, 49, 49, 0.45);
    --prompt-bar-meta-strip-divider: var(--ci-dark-grey);
    --prompt-bar-meta-strip-inset-highlight: rgba(255, 255, 255, 0.04);
    --prompt-bar-meta-strip-accent: rgba(228, 0, 43, 0.32);

    --queue-chip-border: rgba(255, 153, 0, 0.28);
    --queue-chip-bg: rgba(255, 153, 0, 0.1);
    --queue-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --queue-chip-label: var(--ci-orange);
    --queue-chip-label-bg: rgba(255, 153, 0, 0.18);
    --queue-chip-text: rgba(255, 213, 79, 0.92);
    --queue-chip-muted: rgba(255, 153, 0, 0.55);
    --queue-chip-dot: var(--ci-orange);

    --queue-chip-hint-border: var(--ci-dark-grey);
    --queue-chip-hint-bg: rgba(54, 49, 49, 0.35);
    --queue-chip-hint-fg: var(--ci-grey);
    --queue-chip-hint-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);

    /* Prompt bar — deep think, docs, warnings (CI v2) */
    --prompt-bar-deep-think-border: rgba(255, 153, 0, 0.16);
    --prompt-bar-deep-think-border-hover: rgba(255, 153, 0, 0.22);
    --prompt-bar-deep-think-border-open: rgba(255, 153, 0, 0.24);
    --prompt-bar-deep-think-bg: rgba(255, 153, 0, 0.05);
    --prompt-bar-deep-think-bg-hover: rgba(255, 153, 0, 0.08);
    --prompt-bar-deep-think-bg-open: rgba(255, 153, 0, 0.09);
    --prompt-bar-deep-think-badge-fg: rgba(255, 213, 79, 0.82);
    --prompt-bar-deep-think-badge-bg: rgba(255, 153, 0, 0.08);
    --prompt-bar-deep-think-badge-border: rgba(255, 153, 0, 0.2);
    --prompt-bar-deep-think-icon: rgba(255, 213, 79, 0.7);
    --prompt-bar-deep-think-check: rgba(255, 213, 79, 0.5);
    --prompt-bar-deep-think-menu-bg: rgba(255, 153, 0, 0.04);
    --prompt-bar-deep-think-menu-bg-hover: rgba(255, 153, 0, 0.06);
    --prompt-bar-deep-think-on-badge-fg: rgba(255, 213, 79, 0.75);
    --prompt-bar-deep-think-on-badge-bg: rgba(255, 153, 0, 0.08);
    --prompt-bar-deep-think-on-badge-border: rgba(255, 153, 0, 0.2);
    /* Prompt bar AI orchestration uses brand accent, not status colors. */
    --prompt-bar-ai-orchestration-fg: var(--ci-red);
    --prompt-bar-ai-orchestration-bg: color-mix(in srgb, var(--ci-red) 10%, transparent);
    --prompt-bar-ai-orchestration-border: color-mix(in srgb, var(--ci-red) 28%, transparent);
    --prompt-bar-ai-orchestration-toggle-on: var(--ci-red);
    --prompt-bar-ai-orchestration-toggle-off: rgb(var(--chat-fg-rgb) / 0.2);
    --prompt-bar-ai-orchestration-toggle-knob: var(--ci-white);

    /* Stream activity — deep thinking progress panel */
    --stream-deep-thinking-border: rgba(255, 153, 0, 0.14);
    --stream-deep-thinking-bg: rgba(54, 49, 49, 0.35);
    --stream-deep-thinking-label: rgb(var(--chat-fg-rgb) / 0.92);
    --stream-deep-thinking-icon: rgba(255, 213, 79, 0.65);
    --stream-deep-thinking-track: rgba(54, 49, 49, 0.72);
    --stream-deep-thinking-fill: var(--ci-orange);
    --stream-activity-status-divider: var(--chat-border-strong);
    --stream-activity-meta-title-fg: rgb(var(--chat-fg-rgb) / 0.8);
    --stream-activity-meta-title-stale-fg: rgb(var(--chat-fg-rgb) / 0.55);
    --stream-activity-meta-secondary-fg: rgb(var(--chat-fg-rgb) / 0.45);
    --stream-activity-meta-sep-fg: rgb(var(--chat-fg-rgb) / 0.28);
    --stream-activity-subline-fg: rgb(var(--chat-fg-rgb) / 0.42);
    --stream-activity-spinner-fg: rgba(228, 0, 43, 0.7);
    --stream-mcp-launch-badge-border: color-mix(in srgb, var(--ci-blue) 28%, transparent);
    --stream-mcp-launch-badge-bg: color-mix(in srgb, var(--ci-blue) 10%, transparent);
    --stream-mcp-launch-badge-fg: var(--ci-light-blue);
    --stream-tool-strip-spinner-track: rgb(var(--chat-fg-rgb) / 0.14);
    --stream-tool-strip-status-neutral: rgb(var(--chat-fg-rgb) / 0.34);
    --stream-tool-strip-status-complete: #81c784;
    --stream-tool-strip-deep-thinking-row-bg: rgba(255, 153, 0, 0.06);
    --stream-tool-strip-deep-thinking-icon: var(--stream-deep-thinking-icon);
    --stream-tool-strip-deep-thinking-label: rgba(255, 213, 79, 0.95);
    --stream-tool-strip-agent-recall-row-bg: rgba(250, 204, 21, 0.08);
    --stream-tool-strip-agent-recall-icon: rgba(253, 224, 71, 0.95);
    --stream-tool-strip-agent-recall-label: rgba(253, 224, 71, 0.95);
    --stream-tool-strip-protocol-index-row-bg: color-mix(in srgb, var(--ci-blue) 8%, transparent);
    --stream-tool-strip-protocol-index-icon: var(--ci-light-blue);
    --stream-tool-strip-protocol-index-label: rgba(96, 165, 250, 0.95);
    --stream-tool-strip-smart-search-row-bg: color-mix(in srgb, var(--ci-blue) 9%, transparent);
    --stream-tool-strip-smart-search-icon: var(--message-activity-search-icon-fg);
    --stream-tool-strip-smart-search-label: rgba(110, 212, 225, 0.98);
    --stream-tool-strip-web-search-row-bg: color-mix(in srgb, var(--ci-blue) 7%, transparent);
    --stream-tool-strip-web-search-icon: var(--ci-light-blue);
    --stream-tool-strip-web-search-label: rgba(96, 165, 250, 0.95);
    --stream-tool-strip-exa-agent-row-bg: color-mix(in srgb, var(--ci-blue) 10%, transparent);
    --stream-tool-strip-exa-agent-icon: var(--ci-light-blue);
    --stream-tool-strip-exa-agent-label: rgba(129, 140, 248, 0.98);
    --stream-tool-strip-fallback-icon: rgb(var(--chat-fg-rgb) / 0.42);
    --stream-tool-strip-check-fg: rgba(129, 199, 132, 0.92);

    /* Message activity — Smart Search citations */
    --message-activity-search-border: color-mix(in srgb, var(--ci-blue) 28%, transparent);
    --message-activity-search-bg: color-mix(in srgb, var(--ci-blue) 10%, transparent);
    --message-activity-search-hint-fg: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --message-activity-search-row-border: var(--chat-border);
    --message-activity-search-row-bg: rgb(var(--chat-fg-rgb) / 0.03);
    --message-activity-search-row-bg-open: rgb(var(--chat-fg-rgb) / 0.045);
    --message-activity-search-row-hover: var(--chat-surface-hover);
    --message-activity-search-title-fg: rgb(var(--chat-fg-rgb) / 0.88);
    --message-activity-search-meta-fg: rgb(var(--chat-fg-muted-rgb) / 0.78);
    --message-activity-search-icon-fg: var(--ci-light-blue);
    --message-activity-search-chevron-fg: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --message-activity-search-body-divider: rgb(var(--chat-fg-rgb) / 0.06);
    --message-activity-search-summary-fg: rgb(var(--chat-fg-muted-rgb) / 0.88);
    --message-activity-search-excerpt-fg: var(--chat-driver-fg);
    --message-activity-tools-panel-border: var(--ci-dark-grey);
    --message-activity-tools-panel-bg: rgba(54, 49, 49, 0.35);
    --message-activity-body-divider: var(--ci-dark-grey);
    --message-activity-section-divider: rgb(var(--chat-fg-rgb) / 0.08);

    --prompt-bar-docs-icon: rgba(255, 213, 79, 0.72);
    --prompt-bar-docs-active-border: rgba(255, 153, 0, 0.28);
    --prompt-bar-docs-active-bg: rgba(255, 153, 0, 0.04);
    --prompt-bar-input-deep-border: rgba(255, 153, 0, 0.15);
    --prompt-bar-input-brain-deep-border: rgba(228, 0, 43, 0.4);
    --prompt-bar-input-brain-deep-shadow: 0 0 12px rgba(228, 0, 43, 0.15);
    --prompt-bar-warning-icon: rgba(255, 213, 79, 0.8);
    --prompt-bar-connection-notice-fg: var(--ci-orange);
    --prompt-bar-context-warning-fg: rgba(255, 213, 79, 0.92);
    --prompt-bar-context-warning-bg: rgba(255, 153, 0, 0.1);
    --prompt-bar-context-warning-border: rgba(255, 153, 0, 0.3);
    --prompt-bar-context-disconnected-fg: rgba(255, 213, 79, 0.95);
    --prompt-bar-context-disconnected-hover-bg: rgba(255, 153, 0, 0.1);
    --prompt-bar-opus-dialog-border: rgba(255, 213, 79, 0.35);
    --prompt-bar-premium-overlay-border: rgba(255, 213, 79, 0.28);
    --prompt-bar-opus-icon-bg: rgba(255, 213, 79, 0.15);
    --prompt-bar-opus-icon-fg: var(--ci-yellow);
    --prompt-bar-opus-confirm-bg: var(--ci-yellow);
    --prompt-bar-opus-confirm-fg: var(--ci-dark-grey);
    --prompt-bar-opus-confirm-border: rgba(255, 153, 0, 0.55);
    --prompt-bar-opus-confirm-hover-bg: #f0c800;
    --prompt-bar-opus-confirm-shadow: 0 2px 10px rgba(255, 153, 0, 0.25);

    /* Skill info panel (CI v2) — compact popover along prompt bar */
    --skill-info-panel-bg: var(--chat-bg-card);
    --skill-info-panel-border: var(--chat-border-strong);
    --skill-info-panel-shadow: var(--chat-shadow-prompt);
    --skill-info-panel-inset-highlight: rgba(255, 255, 255, 0.04);
    --skill-info-panel-title-fg: rgb(var(--chat-fg-rgb) / 0.92);
    --skill-info-panel-badge-fg: var(--ci-red);
    --skill-info-panel-badge-bg: rgba(228, 0, 43, 0.1);
    --skill-info-panel-badge-border: rgba(228, 0, 43, 0.22);
    --skill-info-panel-body-fg: rgb(var(--chat-fg-rgb) / 0.72);
    --skill-info-panel-body-muted: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --skill-info-panel-icon-bg: rgba(228, 0, 43, 0.12);
    --skill-info-panel-icon-border: rgba(228, 0, 43, 0.2);
    --skill-info-panel-icon-fg: var(--ci-red);
    --skill-info-panel-close-fg: rgb(var(--chat-fg-muted-rgb) / 0.65);
    --skill-info-panel-close-hover-bg: var(--chat-surface-hover);
    --skill-info-panel-close-hover-fg: rgb(var(--chat-fg-rgb) / 0.88);
    --skill-info-panel-fact-fg: rgb(var(--chat-fg-muted-rgb) / 0.78);
    --skill-info-panel-sep-fg: rgb(var(--chat-fg-muted-rgb) / 0.35);
    --skill-info-panel-pill-bg: rgb(var(--chat-fg-rgb) / 0.05);
    --skill-info-panel-pill-border: var(--chat-border);
    --skill-info-panel-pill-fg: rgb(var(--chat-fg-muted-rgb) / 0.82);
    --skill-info-panel-pill-icon-fg: var(--ci-red);
    --skill-info-panel-status-enabled: var(--ci-green);
    --skill-info-panel-status-off: rgb(var(--chat-fg-muted-rgb) / 0.62);
    --skill-info-panel-leave-fg: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --skill-info-panel-leave-hover-fg: rgb(var(--chat-fg-rgb) / 0.88);
    --skill-info-panel-leave-hover-bg: var(--chat-surface-hover);
    --skill-info-self-edit-border: rgba(206, 147, 216, 0.28);
    --skill-info-self-edit-bg: rgba(206, 147, 216, 0.08);
    --skill-info-self-edit-icon: var(--ci-purple);
    --skill-info-self-edit-body: rgb(var(--chat-fg-muted-rgb) / 0.78);
    /* Legacy aliases — welcome hover preview */
    --skill-info-panel-header-bg: transparent;
    --skill-info-panel-header-border: var(--chat-border);
    --skill-info-panel-kicker-fg: var(--ci-red);
    --skill-info-panel-term-fg: rgb(var(--chat-fg-muted-rgb) / 0.62);
    --skill-info-panel-value-fg: rgb(var(--chat-fg-rgb) / 0.82);
    --skill-info-panel-section-border: var(--chat-border);
    --skill-info-panel-leave-border: var(--chat-border);
    --skill-info-panel-leave-bg: transparent;
    --skill-info-self-edit-title: var(--ci-purple);
}

[data-chat-theme="light"] {
    color-scheme: light;

    /* hurra.ai CI v2 — sand/white surfaces, dark grey primary, grey secondary */
    --ci-red: #e4002b;
    --ci-black: #171417;
    --ci-sand: #f8f7f6;
    --ci-dark-grey: #363131;
    --ci-grey: #767478;
    --ci-white: #ffffff;
    --ci-light-grey: #e0dfde;
    --ci-green: #81c784;
    --ci-dark-red: #9e001e;
    --ci-red-mid-2: #ef6680;
    --ci-blue: #0468cb;
    --ci-light-blue: #6ed4e1;
    --ci-orange: #ff9900;
    --ci-yellow: #ffd54f;
    --ci-purple: #ce93d8;

    --chat-bg-page: #f8f7f6;
    --chat-bg-page-mid: #f5f4f3;
    --chat-bg-shell: #ffffff;
    --chat-bg-card: #ffffff;
    --chat-bg-user-bubble: #e8e4e0;
    --chat-bg-user-bubble-fade: #e3dfdc;
    --chat-bg-inset: #f8f7f6;
    --chat-bg-tab: #f3f2f1;
    --chat-bg-input: #ffffff;
    --chat-bg-elevated: #ffffff;

    --chat-fg-rgb: 54 49 49;
    --chat-fg-muted-rgb: 118 116 120;

    --chat-border: #e0dfde;
    --chat-border-strong: #d5d4d3;
    --chat-border-hover: rgba(54, 49, 49, 0.18);
    --chat-overlay: rgba(23, 20, 23, 0.32);
    --chat-brand-wash: rgba(228, 0, 43, 0.05);
    --chat-brand-wash-mid: rgba(228, 0, 43, 0.025);

    --chat-shadow-card: 0 1px 2px rgba(54, 49, 49, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    --chat-shadow-message-bubble:
        inset 0 1px 2px rgba(54, 49, 49, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    --chat-shadow-user-bubble: var(--chat-shadow-message-bubble);
    --chat-shadow-prompt: 0 8px 24px -8px rgba(54, 49, 49, 0.1), 0 2px 6px -2px rgba(54, 49, 49, 0.06);

    --hurra-toast-accent-info: var(--ci-red);
    --hurra-toast-accent-success: var(--ci-green);
    --hurra-toast-accent-error: var(--ci-red);
    --hurra-toast-progress-info: linear-gradient(90deg, rgb(228 0 43 / 0.68), rgb(228 0 43 / 0.1));
    --hurra-toast-progress-success: linear-gradient(90deg, rgb(129 199 132 / 0.72), rgb(129 199 132 / 0.1));
    --hurra-toast-progress-error: linear-gradient(90deg, rgb(228 0 43 / 0.68), rgb(228 0 43 / 0.1));

    --chat-surface-hover: rgba(54, 49, 49, 0.04);
    --chat-surface-muted: rgba(54, 49, 49, 0.03);
    --chat-surface-subtle: rgba(54, 49, 49, 0.015);

    --chat-driver-bg: #ffffff;
    --chat-driver-border: #e0dfde;
    --chat-driver-fg: #767478;
    --chat-driver-title: #363131;

    --chat-thinking-panel-bg: rgba(255, 255, 255, 0.98);
    --chat-thinking-panel-header-bg: rgba(248, 247, 246, 0.96);
    --chat-thinking-panel-border: #e0dfde;
    --chat-thinking-panel-shadow: 0 8px 24px rgba(54, 49, 49, 0.08);

    --chat-bg-primary: #f8f7f6;
    --chat-bg-secondary: #ffffff;
    --chat-bg-surface: #f3f2f1;
    --chat-bg-input-legacy: #ffffff;
    --chat-text-primary: #363131;
    --chat-text-secondary: #767478;
    --chat-text-muted: #767478;
    --chat-accent: #767478;
    --chat-accent-hover: #363131;

    --chat-connection-pulse-border: rgba(37, 99, 235, 0.82);
    --chat-connection-pulse-ring: rgba(37, 99, 235, 0.28);
    --chat-connection-pulse-mid: rgba(37, 99, 235, 0.58);
    --chat-connection-pulse-ring-mid: rgba(37, 99, 235, 0.14);

    --chat-enablement-btn-bg: rgb(var(--chat-fg-rgb) / 0.035);
    --chat-enablement-btn-border: var(--chat-border);
    --chat-enablement-btn-fg: rgb(var(--chat-fg-muted-rgb) / 0.82);
    --chat-enablement-btn-hover-bg: rgb(var(--chat-fg-rgb) / 0.07);
    --chat-enablement-btn-hover-border: var(--chat-border-strong);
    --chat-enablement-btn-hover-fg: rgb(var(--chat-fg-rgb) / 0.88);
    --chat-enablement-btn-oauth-bg: rgb(var(--chat-fg-rgb) / 0.05);
    --chat-enablement-btn-oauth-border: var(--chat-border-strong);
    --chat-enablement-btn-action-fg: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --chat-enablement-action-row-bg: rgb(var(--chat-fg-rgb) / 0.02);
    --chat-enablement-action-row-border: var(--chat-border);
    /* Vendor Atlassian navy — light surfaces only */
    --chat-brand-icon-confluence: #172b4d;
    --chat-brand-icon-jira: #172b4d;
    --chat-capability-coach-bg: var(--chat-brand-wash);
    --chat-capability-coach-border: var(--ci-light-grey);
    --chat-capability-coach-title: var(--ci-dark-grey);
    --chat-capability-coach-body: var(--ci-grey);
    --chat-capability-coach-btn-bg: var(--chat-enablement-btn-bg);
    --chat-capability-coach-btn-border: var(--chat-enablement-btn-border);
    --chat-capability-coach-btn-fg: var(--chat-enablement-btn-fg);
    --chat-capability-coach-btn-hover-bg: var(--chat-enablement-btn-hover-bg);
    --chat-capability-coach-btn-hover-fg: var(--chat-enablement-btn-hover-fg);
    --chat-capability-coach-btn-primary-border: rgba(228, 0, 43, 0.22);
    --chat-capability-coach-btn-primary-bg: rgba(228, 0, 43, 0.05);
    --chat-capability-coach-btn-primary-fg: var(--ci-red);
    --chat-capability-coach-btn-primary-hover-bg: rgba(228, 0, 43, 0.1);

    --chat-capability-typing-accent: rgba(217, 119, 6, 0.92);
    --chat-capability-typing-border: rgba(217, 119, 6, 0.38);
    --chat-capability-typing-border-mid: rgba(217, 119, 6, 0.52);
    --chat-capability-typing-ring: rgba(217, 119, 6, 0.14);
    --chat-capability-typing-ring-mid: rgba(217, 119, 6, 0.22);
    --chat-capability-typing-surface-bg: rgba(217, 119, 6, 0.05);
    --chat-capability-typing-chip-bg: rgb(var(--chat-fg-rgb) / 0.03);
    --chat-capability-typing-chip-hover-bg: rgb(var(--chat-fg-rgb) / 0.06);
    --chat-capability-typing-chip-border: var(--chat-border-strong);
    --chat-capability-typing-connect-border: rgba(4, 104, 203, 0.32);
    --chat-capability-typing-connect-bg: rgba(4, 104, 203, 0.06);

    --chat-enablement-btn-ready-border: rgba(129, 199, 132, 0.42);
    --chat-enablement-btn-ready-bg: rgba(129, 199, 132, 0.08);
    --chat-enablement-btn-ready-fg: var(--ci-green);
    --chat-enablement-li-ready-border: rgba(129, 199, 132, 0.32);

    /* Tools modal — platform zones, counts, tool icon wells */
    --capability-modal-status-on: var(--ci-green);
    --capability-modal-zone-count-all-border: color-mix(in srgb, var(--ci-green) 28%, transparent);
    --capability-modal-zone-count-all-bg: color-mix(in srgb, var(--ci-green) 10%, transparent);
    --capability-modal-zone-count-all-fg: var(--ci-green);
    --capability-modal-zone-count-some-border: color-mix(in srgb, var(--ci-blue) 24%, transparent);
    --capability-modal-zone-count-some-bg: color-mix(in srgb, var(--ci-blue) 8%, transparent);
    --capability-modal-zone-count-some-fg: var(--ci-blue);
    --capability-modal-zone-internal-border: color-mix(in srgb, var(--ci-green) 14%, transparent);
    --capability-modal-zone-internal-mark-fg: var(--ci-green);
    --capability-modal-zone-internal-mark-bg: color-mix(in srgb, var(--ci-green) 10%, transparent);
    --capability-modal-zone-external-border: color-mix(in srgb, var(--ci-purple) 14%, transparent);
    --capability-modal-zone-external-mark-fg: var(--ci-purple);
    --capability-modal-zone-external-mark-bg: color-mix(in srgb, var(--ci-purple) 10%, transparent);
    --capability-modal-tool-icon-wash: rgb(var(--chat-fg-rgb) / 0.05);
    --capability-modal-action-disconnect-hover: color-mix(in srgb, var(--ci-red) 90%, transparent);

    --chat-profile-modal-overlay: rgba(32, 28, 30, 0.2);
    --chat-profile-modal-blur: 3px;
    --chat-profile-hero-bg: #f8f7f6;
    --chat-profile-hero-fg: #363131;
    --chat-profile-hero-close: #767478;
    --chat-profile-hero-close-hover-bg: rgba(54, 49, 49, 0.08);

    /* CI typography — Arial for all light-mode chat copy */
    --chat-font: Arial, Helvetica, sans-serif;

    /* Calculator activity panel */
    --chat-math-bg: var(--chat-bg-card);
    --chat-math-border: var(--ci-light-grey);
    --chat-math-title: var(--ci-dark-grey);
    --chat-math-icon: var(--ci-red);
    --chat-math-label: var(--ci-dark-grey);
    --chat-math-result: var(--ci-dark-grey);
    --chat-math-muted: var(--ci-grey);
    --chat-math-row-bg: var(--ci-sand);
    --chat-math-row-border: var(--ci-light-grey);
    --chat-math-row-running-bg: rgba(228, 0, 43, 0.05);
    --chat-math-grid-bg: #ffffff;
    --chat-math-error: var(--ci-dark-red);
    --chat-math-error-bg: rgba(158, 0, 30, 0.06);
    --chat-math-pulse: var(--ci-red);
    --chat-math-stat-fg: var(--ci-red);
    --chat-math-stat-border: rgba(228, 0, 43, 0.22);
    --chat-math-stat-bg: rgba(228, 0, 43, 0.05);
    --chat-activity-search-stat-fg: var(--ci-blue);
    --chat-activity-search-stat-border: color-mix(in srgb, var(--ci-blue) 22%, transparent);
    --chat-activity-search-stat-bg: color-mix(in srgb, var(--ci-blue) 6%, transparent);
    --chat-activity-hitl-stat-fg: var(--ci-green);
    --chat-activity-hitl-stat-border: color-mix(in srgb, var(--ci-green) 45%, transparent);
    --chat-activity-hitl-stat-bg: color-mix(in srgb, var(--ci-green) 12%, transparent);

    /* Semantic emoji callout lines in chat prose (💡 ⚠️ ✅ ❌) */
    --chat-callout-tip-bg: color-mix(in srgb, var(--ci-yellow) 10%, transparent);
    --chat-callout-tip-border: color-mix(in srgb, var(--ci-yellow) 40%, transparent);
    --chat-callout-tip-fg: color-mix(in srgb, var(--ci-yellow) 85%, #a07800);
    --chat-callout-warning-bg: color-mix(in srgb, var(--ci-orange) 10%, transparent);
    --chat-callout-warning-border: color-mix(in srgb, var(--ci-orange) 40%, transparent);
    --chat-callout-warning-fg: color-mix(in srgb, var(--ci-orange) 85%, #7a4500);
    --chat-callout-success-bg: color-mix(in srgb, var(--ci-green) 10%, transparent);
    --chat-callout-success-border: color-mix(in srgb, var(--ci-green) 40%, transparent);
    --chat-callout-success-fg: color-mix(in srgb, var(--ci-green) 85%, #1a5c1e);
    --chat-callout-error-bg: color-mix(in srgb, var(--ci-red) 8%, transparent);
    --chat-callout-error-border: color-mix(in srgb, var(--ci-red) 35%, transparent);
    --chat-callout-error-fg: color-mix(in srgb, var(--ci-red) 85%, #7a0000);

    /* Chart embed panels (message_ai + stream_activity) */
    --chat-chart-card-bg: rgb(var(--chat-fg-rgb) / 0.02);
    --chat-chart-card-title: rgb(var(--chat-fg-muted-rgb) / 0.85);
    --chat-chart-card-muted: rgb(var(--chat-fg-muted-rgb) / 0.55);
    --chat-chart-card-demo-track: rgb(var(--chat-fg-rgb) / 0.08);
    --chat-chart-card-demo-fill: rgb(var(--ci-red) / 0.85);

    /* Content Humanizer card (```email fence) — warm inset vs white message surface */
    --chat-humanizer-card-bg: var(--chat-bg-inset);
    --chat-humanizer-card-body-bg: var(--chat-bg-card);
    --chat-humanizer-card-header-bg: rgb(var(--chat-fg-rgb) / 0.03);
    --chat-humanizer-card-actions-bg: rgb(var(--chat-fg-rgb) / 0.02);
    --chat-humanizer-card-border: var(--ci-light-grey);
    --chat-humanizer-card-accent: rgb(var(--ci-red) / 0.42);
    --chat-humanizer-card-shadow:
        0 2px 10px -4px color-mix(in srgb, var(--ci-dark-grey) 14%, transparent),
        inset 0 1px 0 rgb(var(--chat-fg-rgb) / 0.04);
    --chat-humanizer-card-title-fg: var(--ci-dark-grey);
    --chat-humanizer-card-icon-fg: rgb(var(--ci-red) / 0.72);

    /* HITL integration embed cards (message_ai + stream) */
    --hitl-embed-bg: var(--chat-bg-card);
    --hitl-embed-border: var(--ci-light-grey);
    --hitl-embed-divider: var(--ci-light-grey);
    --hitl-embed-icon-inset-highlight: color-mix(in srgb, var(--ci-white) 75%, transparent);
    --hitl-embed-shadow: 0 12px 30px -24px color-mix(in srgb, var(--ci-dark-grey) 34%, transparent), inset 0 1px 0 var(--hitl-embed-icon-inset-highlight);
    --hitl-embed-accent: var(--ci-red);
    --hitl-embed-accent-jira: var(--ci-blue);
    --hitl-embed-accent-confluence: var(--ci-blue);
    --hitl-embed-accent-gmail: var(--ci-red);
    --hitl-embed-accent-gcalendar: var(--ci-green);
    --hitl-embed-meta-bg: var(--chat-bg-inset);
    --hitl-embed-meta-border: var(--ci-light-grey);
    --hitl-embed-status-approved-fg: color-mix(in srgb, var(--ci-green) 58%, var(--ci-dark-grey));
    --hitl-embed-status-approved-border: color-mix(in srgb, var(--ci-green) 45%, transparent);
    --hitl-embed-status-approved-bg: color-mix(in srgb, var(--ci-green) 12%, transparent);

    /* Prompt bar meta strip + queue chips (CI v2) */
    --prompt-bar-meta-strip-bg: var(--ci-sand);
    --prompt-bar-meta-strip-border: var(--ci-light-grey);
    --prompt-bar-meta-strip-fg: var(--ci-dark-grey);
    --prompt-bar-meta-strip-fg-muted: var(--ci-grey);
    --prompt-bar-meta-strip-skill-icon-bg: rgba(228, 0, 43, 0.1);
    --prompt-bar-meta-strip-skill-icon-fg: var(--ci-red);
    --prompt-bar-meta-strip-skill-hover: rgba(54, 49, 49, 0.06);
    --prompt-bar-meta-strip-divider: var(--ci-light-grey);
    --prompt-bar-meta-strip-inset-highlight: rgba(255, 255, 255, 0.65);
    --prompt-bar-meta-strip-accent: rgba(228, 0, 43, 0.22);

    --queue-chip-border: rgba(255, 153, 0, 0.35);
    --queue-chip-bg: rgba(255, 213, 79, 0.28);
    --queue-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    --queue-chip-label: #b45309;
    --queue-chip-label-bg: rgba(255, 213, 79, 0.45);
    --queue-chip-text: var(--ci-dark-grey);
    --queue-chip-muted: var(--ci-grey);
    --queue-chip-dot: var(--ci-orange);

    --queue-chip-hint-border: var(--ci-light-grey);
    --queue-chip-hint-bg: rgba(248, 247, 246, 0.92);
    --queue-chip-hint-fg: var(--ci-grey);
    --queue-chip-hint-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);

    /* Prompt bar — deep think, docs, warnings (CI v2) */
    --prompt-bar-deep-think-border: rgba(255, 153, 0, 0.34);
    --prompt-bar-deep-think-border-hover: rgba(255, 153, 0, 0.42);
    --prompt-bar-deep-think-border-open: rgba(255, 153, 0, 0.46);
    --prompt-bar-deep-think-bg: rgba(255, 153, 0, 0.12);
    --prompt-bar-deep-think-bg-hover: rgba(255, 153, 0, 0.16);
    --prompt-bar-deep-think-bg-open: rgba(255, 153, 0, 0.18);
    --prompt-bar-deep-think-badge-fg: var(--ci-dark-grey);
    --prompt-bar-deep-think-badge-bg: rgba(255, 213, 79, 0.28);
    --prompt-bar-deep-think-badge-border: rgba(255, 153, 0, 0.34);
    --prompt-bar-deep-think-icon: var(--ci-orange);
    --prompt-bar-deep-think-check: rgba(255, 153, 0, 0.55);
    --prompt-bar-deep-think-menu-bg: rgba(255, 153, 0, 0.08);
    --prompt-bar-deep-think-menu-bg-hover: rgba(255, 153, 0, 0.12);
    --prompt-bar-deep-think-on-badge-fg: var(--ci-dark-grey);
    --prompt-bar-deep-think-on-badge-bg: rgba(255, 213, 79, 0.28);
    --prompt-bar-deep-think-on-badge-border: rgba(255, 153, 0, 0.34);
    /* Prompt bar AI orchestration uses brand accent, not status colors. */
    --prompt-bar-ai-orchestration-fg: var(--ci-red);
    --prompt-bar-ai-orchestration-bg: color-mix(in srgb, var(--ci-red) 8%, transparent);
    --prompt-bar-ai-orchestration-border: color-mix(in srgb, var(--ci-red) 24%, transparent);
    --prompt-bar-ai-orchestration-toggle-on: var(--ci-red);
    --prompt-bar-ai-orchestration-toggle-off: rgb(var(--chat-fg-rgb) / 0.2);
    --prompt-bar-ai-orchestration-toggle-knob: var(--ci-white);

    /* Stream activity — deep thinking progress panel */
    --stream-deep-thinking-border: rgba(255, 153, 0, 0.34);
    --stream-deep-thinking-bg: rgba(255, 153, 0, 0.08);
    --stream-deep-thinking-label: var(--ci-dark-grey);
    --stream-deep-thinking-icon: var(--ci-orange);
    --stream-deep-thinking-track: rgba(54, 49, 49, 0.1);
    --stream-deep-thinking-fill: var(--ci-orange);
    --stream-activity-status-divider: var(--ci-light-grey);
    --stream-activity-meta-title-fg: var(--ci-dark-grey);
    --stream-activity-meta-title-stale-fg: var(--ci-grey);
    --stream-activity-meta-secondary-fg: var(--ci-grey);
    --stream-activity-meta-sep-fg: var(--ci-grey);
    --stream-activity-subline-fg: var(--ci-grey);
    --stream-activity-spinner-fg: var(--ci-red);
    --stream-mcp-launch-badge-border: color-mix(in srgb, var(--ci-blue) 22%, transparent);
    --stream-mcp-launch-badge-bg: color-mix(in srgb, var(--ci-blue) 6%, transparent);
    --stream-mcp-launch-badge-fg: var(--ci-dark-grey);
    --stream-tool-strip-spinner-track: rgb(var(--chat-fg-rgb) / 0.12);
    --stream-tool-strip-status-neutral: var(--ci-grey);
    --stream-tool-strip-status-complete: var(--ci-green);
    --stream-tool-strip-deep-thinking-row-bg: rgba(255, 153, 0, 0.08);
    --stream-tool-strip-deep-thinking-icon: var(--ci-orange);
    --stream-tool-strip-deep-thinking-label: color-mix(in srgb, var(--ci-orange) 88%, #7a4500);
    --stream-tool-strip-agent-recall-row-bg: color-mix(in srgb, var(--ci-orange) 10%, transparent);
    --stream-tool-strip-agent-recall-icon: var(--ci-orange);
    --stream-tool-strip-agent-recall-label: color-mix(in srgb, var(--ci-orange) 85%, #7a4500);
    --stream-tool-strip-protocol-index-row-bg: color-mix(in srgb, var(--ci-blue) 6%, transparent);
    --stream-tool-strip-protocol-index-icon: var(--ci-blue);
    --stream-tool-strip-protocol-index-label: var(--ci-blue);
    --stream-tool-strip-smart-search-row-bg: var(--message-activity-search-bg);
    --stream-tool-strip-smart-search-icon: var(--message-activity-search-icon-fg);
    --stream-tool-strip-smart-search-label: var(--ci-blue);
    --stream-tool-strip-web-search-row-bg: color-mix(in srgb, var(--ci-blue) 6%, transparent);
    --stream-tool-strip-web-search-icon: var(--ci-blue);
    --stream-tool-strip-web-search-label: var(--ci-blue);
    --stream-tool-strip-exa-agent-row-bg: color-mix(in srgb, var(--ci-blue) 8%, transparent);
    --stream-tool-strip-exa-agent-icon: var(--ci-blue);
    --stream-tool-strip-exa-agent-label: color-mix(in srgb, var(--ci-blue) 82%, #312e81);
    --stream-tool-strip-fallback-icon: rgb(var(--chat-fg-muted-rgb) / 0.72);
    --stream-tool-strip-check-fg: var(--ci-green);

    /* Message activity — Smart Search citations */
    --message-activity-search-border: color-mix(in srgb, var(--ci-blue) 22%, transparent);
    --message-activity-search-bg: color-mix(in srgb, var(--ci-blue) 6%, transparent);
    --message-activity-search-hint-fg: var(--ci-grey);
    --message-activity-search-row-border: var(--ci-light-grey);
    --message-activity-search-row-bg: color-mix(in srgb, var(--ci-white) 72%, transparent);
    --message-activity-search-row-bg-open: var(--ci-white);
    --message-activity-search-row-hover: var(--chat-surface-hover);
    --message-activity-search-title-fg: var(--ci-dark-grey);
    --message-activity-search-meta-fg: var(--ci-grey);
    --message-activity-search-icon-fg: var(--ci-blue);
    --message-activity-search-chevron-fg: var(--ci-grey);
    --message-activity-search-body-divider: var(--ci-light-grey);
    --message-activity-search-summary-fg: var(--ci-grey);
    --message-activity-search-excerpt-fg: var(--ci-dark-grey);
    --message-activity-tools-panel-border: var(--ci-light-grey);
    --message-activity-tools-panel-bg: color-mix(in srgb, var(--ci-white) 78%, transparent);
    --message-activity-body-divider: var(--ci-light-grey);
    --message-activity-section-divider: var(--ci-light-grey);

    --prompt-bar-docs-icon: var(--ci-orange);
    --prompt-bar-docs-active-border: rgba(255, 153, 0, 0.38);
    --prompt-bar-docs-active-bg: rgba(255, 213, 79, 0.16);
    --prompt-bar-input-deep-border: rgba(255, 153, 0, 0.28);
    --prompt-bar-input-brain-deep-border: rgba(228, 0, 43, 0.35);
    --prompt-bar-input-brain-deep-shadow: 0 0 12px rgba(228, 0, 43, 0.12);
    --prompt-bar-warning-icon: var(--ci-orange);
    --prompt-bar-connection-notice-fg: var(--ci-orange);
    --prompt-bar-context-warning-fg: var(--ci-dark-grey);
    --prompt-bar-context-warning-bg: rgba(255, 213, 79, 0.28);
    --prompt-bar-context-warning-border: rgba(255, 153, 0, 0.28);
    --prompt-bar-context-disconnected-fg: #b45309;
    --prompt-bar-context-disconnected-hover-bg: rgba(255, 213, 79, 0.22);
    --prompt-bar-opus-dialog-border: rgba(255, 153, 0, 0.38);
    --prompt-bar-premium-overlay-border: rgba(255, 153, 0, 0.32);
    --prompt-bar-opus-icon-bg: rgba(255, 213, 79, 0.28);
    --prompt-bar-opus-icon-fg: var(--ci-orange);
    --prompt-bar-opus-confirm-bg: var(--ci-yellow);
    --prompt-bar-opus-confirm-fg: var(--ci-dark-grey);
    --prompt-bar-opus-confirm-border: rgba(255, 153, 0, 0.55);
    --prompt-bar-opus-confirm-hover-bg: #f5c800;
    --prompt-bar-opus-confirm-shadow: 0 2px 10px rgba(255, 153, 0, 0.2);

    /* Skill info panel (CI v2) — compact popover along prompt bar */
    --skill-info-panel-bg: var(--chat-bg-card);
    --skill-info-panel-border: var(--chat-border);
    --skill-info-panel-shadow: var(--chat-shadow-prompt);
    --skill-info-panel-inset-highlight: rgba(255, 255, 255, 0.65);
    --skill-info-panel-title-fg: var(--ci-dark-grey);
    --skill-info-panel-badge-fg: var(--ci-red);
    --skill-info-panel-badge-bg: rgba(228, 0, 43, 0.08);
    --skill-info-panel-badge-border: rgba(228, 0, 43, 0.16);
    --skill-info-panel-body-fg: var(--ci-grey);
    --skill-info-panel-body-muted: var(--ci-grey);
    --skill-info-panel-icon-bg: rgba(228, 0, 43, 0.08);
    --skill-info-panel-icon-border: rgba(228, 0, 43, 0.14);
    --skill-info-panel-icon-fg: var(--ci-red);
    --skill-info-panel-close-fg: var(--ci-grey);
    --skill-info-panel-close-hover-bg: rgba(54, 49, 49, 0.06);
    --skill-info-panel-close-hover-fg: var(--ci-dark-grey);
    --skill-info-panel-fact-fg: var(--ci-grey);
    --skill-info-panel-sep-fg: rgba(118, 116, 120, 0.45);
    --skill-info-panel-pill-bg: var(--ci-sand);
    --skill-info-panel-pill-border: var(--chat-border);
    --skill-info-panel-pill-fg: var(--ci-grey);
    --skill-info-panel-pill-icon-fg: var(--ci-red);
    --skill-info-panel-status-enabled: var(--ci-green);
    --skill-info-panel-status-off: var(--ci-grey);
    --skill-info-panel-leave-fg: var(--ci-grey);
    --skill-info-panel-leave-hover-fg: var(--ci-dark-grey);
    --skill-info-panel-leave-hover-bg: rgba(54, 49, 49, 0.05);
    --skill-info-self-edit-border: rgba(206, 147, 216, 0.32);
    --skill-info-self-edit-bg: rgba(206, 147, 216, 0.1);
    --skill-info-self-edit-icon: var(--ci-purple);
    --skill-info-self-edit-body: var(--ci-grey);
    /* Legacy aliases — welcome hover preview */
    --skill-info-panel-header-bg: transparent;
    --skill-info-panel-header-border: var(--chat-border);
    --skill-info-panel-kicker-fg: var(--ci-red);
    --skill-info-panel-term-fg: var(--ci-grey);
    --skill-info-panel-value-fg: var(--ci-dark-grey);
    --skill-info-panel-section-border: var(--chat-border);
    --skill-info-panel-leave-border: var(--chat-border);
    --skill-info-panel-leave-bg: transparent;
    --skill-info-self-edit-title: var(--ci-purple);
}

html:has(#chat-app-root) {
    background-color: var(--chat-bg-page);
    transition: background-color var(--chat-theme-transition-duration) var(--chat-theme-transition-ease);
}

html:has(#chat-app-root) body {
    transition: background-color var(--chat-theme-transition-duration) var(--chat-theme-transition-ease);
}

#chat-app-root.chat-app-root-bg {
    transition:
        background-color var(--chat-theme-transition-duration) var(--chat-theme-transition-ease),
        background var(--chat-theme-transition-duration) var(--chat-theme-transition-ease);
    background:
        radial-gradient(
            ellipse 120% 80% at 50% -20%,
            var(--chat-brand-wash),
            var(--chat-brand-wash-mid) 30%,
            transparent 70%
        ),
        linear-gradient(
            180deg,
            var(--chat-bg-page) 0%,
            var(--chat-bg-page-mid) 50%,
            var(--chat-bg-page) 100%
        );
}

/* Light theme: override hardcoded dark-mode rules in chat_page_styles / chat.css */
[data-chat-theme="light"] .prompt-bar-field {
    color: rgb(var(--chat-fg-rgb) / 0.92);
}

[data-chat-theme="light"] .prompt-bar-field::placeholder {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
}

[data-chat-theme="light"] .workflow-pills-strip {
    border-top-color: rgba(32, 28, 30, 0.08);
}

[data-chat-theme="light"] .prompt-bar-input .context-chips-strip {
    border-bottom-color: rgba(32, 28, 30, 0.08) !important;
}

[data-chat-theme="light"] .prompt-bar-input .context-chips-strip + .workflow-pills-strip {
    border-top: none;
}

[data-chat-theme="light"] .workflow-pill {
    background: rgb(var(--chat-fg-rgb) / 0.04);
    border-color: var(--chat-border);
    color: rgb(var(--chat-fg-muted-rgb) / 0.85);
}

[data-chat-theme="light"] .workflow-pill:hover:not(:disabled) {
    background: rgb(var(--chat-fg-rgb) / 0.07);
    color: rgb(var(--chat-fg-rgb) / 0.9);
}

.welcome-hero-logo {
    width: fit-content;
    display: grid;
    place-items: center;
}
.welcome-hero-logo__img {
    grid-area: 1 / 1;
    transition: opacity var(--chat-theme-transition-duration) var(--chat-theme-transition-ease);
}
.welcome-hero-logo__img--light {
    opacity: 0;
}
[data-chat-theme="light"] .welcome-hero-logo__img--dark {
    opacity: 0;
}
[data-chat-theme="light"] .welcome-hero-logo__img--light {
    opacity: 1;
}

[data-chat-theme="light"] .chat-sidebar-search {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    box-shadow: inset 0 1px 2px rgba(32, 28, 30, 0.06);
}

[data-chat-theme="light"] .chat-sidebar-shine-top {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent);
}
[data-chat-theme="light"] .chat-sidebar-shine-corner {
    background: radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--ci-red) 5%, transparent), transparent 58%);
}

[data-chat-theme="light"] .chat-sidebar-new-chat {
    border-color: color-mix(in srgb, var(--ci-red) 30%, transparent);
    background: color-mix(in srgb, var(--ci-red) 9%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

[data-chat-theme="light"] .chat-floating-sidebar-panel .text-chat-fg\/58,
[data-chat-theme="light"] .chat-floating-sidebar-panel .text-chat-fg\/55,
[data-chat-theme="light"] .chat-floating-sidebar-panel .text-chat-fg\/52 {
    color: rgb(var(--chat-fg-muted-rgb) / 0.78) !important;
}

[data-chat-theme="light"] .chat-floating-sidebar-panel .text-chat-fg\/62,
[data-chat-theme="light"] .chat-floating-sidebar-panel .text-chat-fg\/68 {
    color: rgb(var(--chat-fg-muted-rgb) / 0.88) !important;
}

[data-chat-theme="light"] .chat-floating-sidebar-panel .text-chat-fg\/72 {
    color: rgb(var(--chat-fg-rgb) / 0.82) !important;
}

.chat-sidebar-popover {
    position: fixed;
    z-index: 10050;
    max-width: calc(100vw - 1rem);
    border: 1px solid var(--chat-border);
    border-radius: 0.75rem;
    background: var(--chat-bg-tab);
    box-shadow: var(--chat-shadow-prompt);
}

.chat-sidebar-delete-popover {
    width: 16rem;
    padding: 1rem;
}

.chat-sidebar-session-menu {
    width: 11rem;
    max-height: min(24rem, calc(100vh - 1rem));
    overflow-y: auto;
    padding-block: 0.25rem;
}

.chat-sidebar-popover__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.chat-sidebar-popover__icon {
    display: flex;
    height: 2.5rem;
    width: 2.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--ci-red) 15%, transparent);
    color: var(--ci-red);
}

.chat-sidebar-popover__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(var(--chat-fg-rgb));
}

.chat-sidebar-popover__subtitle {
    font-size: 0.75rem;
    color: rgb(var(--chat-fg-muted-rgb) / 0.78);
}

.chat-sidebar-popover__body {
    margin-bottom: 1rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgb(var(--chat-fg-muted-rgb) / 0.88);
}

.chat-sidebar-popover__actions {
    display: flex;
    gap: 0.5rem;
}

.chat-sidebar-popover__btn {
    flex: 1 1 0%;
    border-radius: 0.375rem;
    border: 1px solid var(--chat-border);
    background: color-mix(in srgb, var(--chat-bg-inset) 55%, transparent);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(var(--chat-fg-muted-rgb) / 0.88);
    transition:
        color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        background-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease);
}

.chat-sidebar-popover__btn:hover {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
}

.chat-sidebar-popover__btn--confirm {
    border-color: transparent;
    border-radius: 0.5rem;
    background: var(--ci-red);
    color: #ffffff;
}

.chat-sidebar-popover__btn--confirm:hover {
    color: #ffffff;
    background: color-mix(in srgb, var(--ci-red) 90%, #000 10%);
}

.chat-sidebar-toolbar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--chat-fg-rgb) / 0.82);
}

.chat-sidebar-toolbar-count {
    flex-shrink: 0;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
}

.chat-sidebar-archived-note {
    border-radius: 0.5rem;
    background: var(--prompt-bar-context-warning-bg);
    padding: 0.5rem 0.75rem;
}

.chat-sidebar-archived-note__text {
    font-size: 11px;
    line-height: 1.35;
    color: var(--prompt-bar-context-warning-fg);
}

.chat-sidebar-archived-note__emphasis {
    font-weight: 600;
    color: rgb(var(--chat-fg-rgb) / 0.82);
}

.chat-sidebar-project-action-btn {
    border-radius: 0.25rem;
    padding: 0.25rem;
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.chat-sidebar-project-action-btn:hover {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
}

.chat-sidebar-project-action-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ci-red) 40%, transparent);
    outline-offset: 1px;
}

.chat-sidebar-project-action-btn--danger:hover {
    color: var(--ci-red);
    background: color-mix(in srgb, var(--ci-red) 10%, transparent);
}

.chat-sidebar-connection-notice {
    color: var(--prompt-bar-connection-notice-fg);
}

.chat-sidebar-connection-notice__icon {
    color: var(--prompt-bar-warning-icon);
}

.chat-sidebar-connection-notice__dot {
    background: var(--ci-orange);
}

.chat-sidebar-logout-btn {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.chat-sidebar-logout-btn:hover {
    color: color-mix(in srgb, var(--ci-red) 85%, #fff 15%);
    background: color-mix(in srgb, var(--ci-red) 8%, transparent);
}

.chat-sidebar-logout-btn__icon {
    color: rgb(var(--chat-fg-muted-rgb) / 0.62);
    transition: color 0.15s ease;
}

.chat-sidebar-logout-btn:hover .chat-sidebar-logout-btn__icon {
    color: color-mix(in srgb, var(--ci-red) 80%, transparent);
}

.chat-sidebar-brain-tip {
    box-shadow: var(--chat-shadow-card);
}

.chat-sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
}

.chat-sidebar-notify-toggle {
    border: 1px solid var(--chat-border-strong);
    transition:
        background-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        border-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease);
}

.chat-sidebar-notify-toggle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ci-red) 40%, transparent);
    outline-offset: 2px;
}

.chat-sidebar-notify-toggle--off {
    background: color-mix(in srgb, rgb(var(--chat-fg-rgb)) 10%, transparent);
}

.chat-sidebar-notify-toggle--on {
    background: color-mix(in srgb, var(--ci-red) 60%, transparent);
}

.chat-sidebar-notify-toggle__thumb {
    pointer-events: none;
    display: inline-block;
    height: 1rem;
    width: 1rem;
    margin-top: 0.125rem;
    margin-left: 0.125rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.chat-sidebar-notify-toggle__thumb--on {
    transform: translateX(1rem);
}

.chat-sidebar-pagination__btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ci-red) 35%, transparent);
    outline-offset: 1px;
}

[data-chat-theme="light"] .chat-sidebar-popover,
[data-chat-theme="light"] .chat-sidebar-delete-popover {
    background: var(--chat-bg-elevated);
    border-color: var(--chat-border-strong);
    box-shadow: var(--chat-shadow-card);
}

[data-chat-theme="light"] .chat-sidebar-archived-note__emphasis {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-sidebar-control-btn {
    background: var(--chat-bg-elevated);
    box-shadow: 0 1px 3px rgba(32, 28, 30, 0.08);
}

/* Sidebar session pagination — theme-aware meta strip */
.chat-sidebar-pagination {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-top: 1px solid var(--chat-border);
    background: color-mix(in srgb, var(--chat-bg-tab) 92%, transparent);
    backdrop-filter: blur(8px);
    padding: 0.5rem 0.75rem 0.625rem;
}

.chat-sidebar-pagination__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.chat-sidebar-pagination__label {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.chat-sidebar-pagination__page {
    min-width: 2.75rem;
    text-align: center;
    color: rgb(var(--chat-fg-muted-rgb) / 0.95);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.chat-sidebar-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--chat-border);
    background: color-mix(in srgb, var(--chat-bg-inset) 55%, transparent);
    color: rgb(var(--chat-fg-muted-rgb) / 0.78);
    transition:
        color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        background-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        border-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease);
}

.chat-sidebar-pagination__btn:disabled {
    pointer-events: none;
    opacity: 0.35;
}

.chat-sidebar-pagination__btn:hover:not(:disabled) {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
}

[data-chat-theme="light"] .chat-sidebar-pagination {
    background: color-mix(in srgb, var(--chat-bg-tab) 96%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chat-sidebar-session-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--chat-border);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--chat-bg-tab) 35%, transparent);
}

.chat-sidebar-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--chat-border);
    background: color-mix(in srgb, var(--chat-bg-inset) 55%, transparent);
    color: rgb(var(--chat-fg-muted-rgb) / 0.78);
    transition:
        color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        background-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        border-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease);
}

.chat-sidebar-toolbar-btn:hover {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
    border-color: var(--chat-border-strong);
}

.chat-sidebar-toolbar-btn--danger:hover {
    color: var(--ci-red);
    background: color-mix(in srgb, var(--ci-red) 10%, transparent);
    border-color: color-mix(in srgb, var(--ci-red) 25%, transparent);
}

.chat-sidebar-session-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    gap: 0.125rem;
    padding: 0.25rem 0;
}

/* Alpine x-for requires one root per iteration; contents keeps rows as flex children */
.chat-sidebar-session-entry {
    display: contents;
}

.chat-sidebar-session-row {
    min-height: 0;
}

.chat-sidebar-session-row__btn {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    border: 0;
    background: transparent;
}

.chat-sidebar-session-row__title {
    color: rgb(var(--chat-fg-rgb) / 0.88);
}

.chat-sidebar-session-row__btn--active .chat-sidebar-session-row__title {
    color: rgb(var(--chat-fg-rgb) / 0.94);
}

.chat-sidebar-session-row__btn--active {
    background: color-mix(in srgb, rgb(var(--chat-fg-rgb)) 7%, transparent);
    box-shadow: inset 2px 0 0 color-mix(in srgb, var(--ci-red) 32%, transparent);
}

.chat-sidebar-session-actions {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.chat-sidebar-session-row:hover .chat-sidebar-session-actions,
.chat-sidebar-session-row:focus-within .chat-sidebar-session-actions,
.chat-sidebar-session-row:has([aria-expanded="true"]) .chat-sidebar-session-actions {
    opacity: 1;
    pointer-events: auto;
}

.chat-sidebar-session-row:hover .chat-sidebar-session-action-btn,
.chat-sidebar-session-row:focus-within .chat-sidebar-session-action-btn,
.chat-sidebar-session-row:has([aria-expanded="true"]) .chat-sidebar-session-action-btn {
    background: color-mix(in srgb, var(--chat-bg-tab) 88%, transparent);
    box-shadow: -8px 0 10px color-mix(in srgb, var(--chat-bg-tab) 88%, transparent);
}

.chat-sidebar-session-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.375rem;
    border: 0;
    background: transparent;
    color: rgb(var(--chat-fg-muted-rgb) / 0.78);
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.chat-sidebar-session-action-btn:hover {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
}

.chat-sidebar-session-action-btn--danger:hover {
    color: var(--ci-red);
    background: color-mix(in srgb, var(--ci-red) 10%, transparent);
}

.chat-sidebar-session-menu__item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.25rem;
    color: rgb(var(--chat-fg-muted-rgb) / 0.92);
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.chat-sidebar-session-menu__item:hover {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
}

.chat-sidebar-session-menu__item--sub {
    padding-left: 1.75rem;
}

.chat-sidebar-session-menu__item--danger {
    color: rgb(var(--chat-fg-muted-rgb) / 0.88);
}

.chat-sidebar-session-menu__item--danger:hover {
    color: var(--ci-red);
    background: color-mix(in srgb, var(--ci-red) 10%, transparent);
}

.chat-sidebar-session-rename {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    background: color-mix(in srgb, var(--chat-bg-inset) 55%, transparent);
}

.chat-sidebar-session-rename__input,
.chat-sidebar-field {
    width: 100%;
    min-width: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--chat-border);
    background: var(--chat-bg-tab);
    color: rgb(var(--chat-fg-rgb) / 0.9);
    transition:
        border-color var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease),
        box-shadow var(--chat-theme-surface-transition-duration) var(--chat-theme-surface-transition-ease);
}

.chat-sidebar-session-rename__input {
    flex: 1 1 0%;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
}

.chat-sidebar-field {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.35;
}

.chat-sidebar-field::placeholder {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
}

textarea.chat-sidebar-field {
    resize: none;
    font-size: 0.75rem;
    line-height: 1.4;
}

.chat-sidebar-session-rename__input::placeholder {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
}

.chat-sidebar-session-rename__input:focus,
.chat-sidebar-field:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--ci-red) 30%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ci-red) 40%, transparent);
}

.chat-sidebar-session-rename__btn {
    flex-shrink: 0;
    border-radius: 0.375rem;
    border: 1px solid var(--chat-border);
    background: color-mix(in srgb, var(--chat-bg-inset) 55%, transparent);
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25;
    color: rgb(var(--chat-fg-muted-rgb) / 0.88);
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.chat-sidebar-session-rename__btn:hover {
    color: rgb(var(--chat-fg-rgb));
    background: var(--chat-surface-hover);
}

.chat-sidebar-session-rename__btn--save {
    border-color: transparent;
    background: var(--ci-red);
    color: #ffffff;
}

.chat-sidebar-session-rename__btn--save:hover {
    color: #ffffff;
    background: color-mix(in srgb, var(--ci-red) 90%, #000 10%);
}

.chat-sidebar-session-rename__btn:focus-visible,
.chat-sidebar-toolbar-btn:focus-visible,
.chat-sidebar-session-action-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ci-red) 40%, transparent);
    outline-offset: 1px;
}

[data-chat-theme="light"] .chat-sidebar-session-rename__input,
[data-chat-theme="light"] .chat-sidebar-field {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    box-shadow: inset 0 1px 2px rgba(32, 28, 30, 0.06);
}

[data-chat-theme="light"] .chat-sidebar-session-panel {
    background: color-mix(in srgb, var(--chat-bg-tab) 55%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

[data-chat-theme="light"] .chat-sidebar-session-row__title {
    color: rgb(var(--chat-fg-rgb) / 0.9);
}

[data-chat-theme="light"] .chat-sidebar-session-row__btn--active .chat-sidebar-session-row__title {
    color: rgb(var(--chat-fg-rgb) / 0.96);
}

/* Model picker — light mode contrast */
[data-chat-theme="light"] .model-menu-dropdown,
[data-chat-theme="light"] .document-context-popover {
    background: var(--chat-bg-elevated) !important;
    border-color: var(--chat-border-strong) !important;
    box-shadow: var(--chat-shadow-prompt) !important;
}

[data-chat-theme="light"] .model-menu-icon-box {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Kimi / xAI icons use currentColor — tuned per theme (SVGs were light gray for dark UI only) */
.model-vendor-icon--kimi {
    color: #e5e7eb;
}
.model-vendor-icon--xai {
    color: #f3f4f6;
}
[data-chat-theme="light"] .model-vendor-icon--kimi {
    color: #374151;
}
[data-chat-theme="light"] .model-vendor-icon--xai {
    color: #171717;
}

[data-chat-theme="dark"] .model-menu-icon-box,
[data-chat-theme="dark"] .prompt-bar-mcp-icon-box,
[data-chat-theme="dark"] .prompt-bar-docs-icon-box {
    background: rgb(var(--chat-fg-rgb) / 0.06);
    border-color: var(--chat-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

[data-chat-theme="dark"] .prompt-bar-model-btn {
    border-color: transparent;
}

[data-chat-theme="dark"] .prompt-bar-model-btn:hover:not(:disabled):not(.is-disabled),
[data-chat-theme="dark"] .prompt-bar-model-btn.is-open {
    background-color: rgb(var(--chat-fg-rgb) / 0.06);
    border-color: var(--chat-border-strong);
}

[data-chat-theme="dark"] .prompt-bar-model-btn--collections,
[data-chat-theme="dark"] .prompt-bar-model-btn--docs {
    border-color: var(--chat-border);
}

[data-chat-theme="dark"] .prompt-bar-model-btn--collections:hover:not(:disabled),
[data-chat-theme="dark"] .prompt-bar-model-btn--docs:hover:not(:disabled) {
    background-color: rgb(var(--chat-fg-rgb) / 0.06);
    border-color: var(--chat-border-strong);
}

[data-chat-theme="dark"] .prompt-bar-model-btn--docs.is-active:not(.is-open):not(:disabled) {
    background: rgba(251, 191, 36, 0.06);
    border-color: rgba(251, 191, 36, 0.22);
}

[data-chat-theme="dark"] .prompt-bar-docs-icon {
    color: var(--prompt-bar-docs-icon);
}

[data-chat-theme="light"] .prompt-bar-docs-icon {
    color: var(--prompt-bar-docs-icon);
}

[data-chat-theme="light"] .prompt-bar-mcp-icon-box,
[data-chat-theme="light"] .prompt-bar-docs-icon-box {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

[data-chat-theme="light"] .chat-notification-banner {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    box-shadow: var(--chat-shadow-card);
}

[data-chat-theme="light"] .chat-notification-banner__cta {
    background: rgb(var(--chat-fg-rgb) / 0.9);
    color: var(--chat-bg-page);
}

[data-chat-theme="light"] .chat-notification-banner__cta:hover {
    background: rgb(var(--chat-fg-rgb) / 0.82);
}

[data-chat-theme="light"] .chat-notification-banner__dismiss {
    color: rgb(var(--chat-fg-muted-rgb) / 0.65);
}

[data-chat-theme="light"] .chat-notification-banner__dismiss:hover {
    color: rgb(var(--chat-fg-rgb) / 0.78);
    background: rgb(var(--chat-fg-rgb) / 0.05);
}

[data-chat-theme="light"] .model-menu-dropdown .text-chat-fg\/50,
[data-chat-theme="light"] .document-context-popover .text-chat-fg\/50 {
    color: rgb(var(--chat-fg-muted-rgb) / 0.82) !important;
}

[data-chat-theme="light"] .model-menu-dropdown .text-chat-fg\/45,
[data-chat-theme="light"] .document-context-popover .text-chat-fg\/45 {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72) !important;
}

[data-chat-theme="light"] .model-menu-dropdown .text-chat-fg\/92,
[data-chat-theme="light"] .document-context-popover .text-chat-fg\/92 {
    color: rgb(var(--chat-fg-rgb) / 0.92) !important;
}

[data-chat-theme="light"] .model-menu-dropdown .bg-chat-fg\/3,
[data-chat-theme="light"] .document-context-popover .bg-chat-fg\/3 {
    background-color: rgb(var(--chat-fg-rgb) / 0.045) !important;
}

[data-chat-theme="light"] .model-menu-dropdown .bg-chat-fg\/5,
[data-chat-theme="light"] .document-context-popover .bg-chat-fg\/5 {
    background-color: rgb(var(--chat-fg-rgb) / 0.07) !important;
}

[data-chat-theme="light"] .model-menu-dropdown button:hover,
[data-chat-theme="light"] .document-context-popover button:hover,
[data-chat-theme="light"] .document-context-popover label:hover {
    background-color: rgb(var(--chat-fg-rgb) / 0.06) !important;
}

[data-chat-theme="light"] .prompt-bar-model-btn {
    border-color: var(--chat-border);
    background-color: var(--chat-bg-card);
    color: rgb(var(--chat-fg-rgb) / 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-chat-theme="light"] .prompt-bar-model-btn:hover:not(:disabled):not(.is-disabled) {
    background-color: var(--chat-bg-elevated);
    border-color: var(--chat-border-strong);
    color: rgb(var(--chat-fg-rgb) / 0.92);
}

[data-chat-theme="light"] .prompt-bar-model-btn.is-open {
    background-color: var(--chat-bg-elevated);
    border-color: var(--chat-border-strong);
    color: rgb(var(--chat-fg-rgb) / 0.94);
    box-shadow: var(--chat-shadow-card);
}

[data-chat-theme="light"] .prompt-bar-model-btn.is-connection-added {
    animation: prompt-bar-connections-overflow-highlight 2s ease-out forwards;
}

[data-chat-theme="light"] .prompt-bar-model-btn__chevron {
    opacity: 0.72;
    color: rgb(var(--chat-fg-muted-rgb) / 0.9);
}

[data-chat-theme="light"] .prompt-bar-model-btn.is-open .prompt-bar-model-btn__chevron {
    opacity: 0.92;
}

[data-chat-theme="light"] .prompt-bar-mcp-icon {
    opacity: 1;
    filter: saturate(1.12) contrast(1.1);
}

[data-chat-theme="light"] .prompt-bar-mcp-icon--empty {
    opacity: 0.78;
    filter: saturate(0.85) contrast(1.05);
}

[data-chat-theme="light"] .prompt-bar-mcp-icon--notice {
    filter: saturate(1.2) contrast(1.12) drop-shadow(0 0 2px var(--prompt-bar-context-warning-border));
}

[data-chat-theme="light"] .prompt-bar-model-btn.is-deep-think.is-open:not(:disabled):not(.is-disabled) {
    box-shadow: 0 0 0 1px rgba(255, 153, 0, 0.12);
}

[data-chat-theme="light"] .prompt-bar-model-btn__deep-badge-icon {
    opacity: 0.92;
}

[data-chat-theme="light"] .prompt-bar-send-btn:disabled {
    background-color: rgb(var(--chat-fg-rgb) / 0.05);
    color: rgb(var(--chat-fg-muted-rgb) / 0.55);
}

[data-chat-theme="light"] .prompt-bar-send-btn--ready:not(:disabled) {
    background-color: rgb(var(--chat-fg-rgb) / 0.1);
    border-color: var(--chat-border-strong);
    color: rgb(var(--chat-fg-rgb) / 0.88);
}

[data-chat-theme="light"] .prompt-bar-send-btn--ready:not(:disabled):hover {
    background-color: rgb(var(--chat-fg-rgb) / 0.14);
    color: var(--chat-driver-title);
}

[data-chat-theme="light"] .prompt-bar-queue-chip__dismiss:focus-visible {
    outline-color: rgba(255, 153, 0, 0.35);
}

[data-chat-theme="light"] .hurra-toast-panel {
    box-shadow:
        var(--chat-shadow-prompt),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

[data-chat-theme="light"] .hurra-toast-message {
    color: rgb(var(--chat-fg-rgb) / 0.9);
}

[data-chat-theme="light"] .hurra-toast-dismiss {
    color: rgb(var(--chat-fg-muted-rgb) / 0.55);
}

[data-chat-theme="light"] .hurra-toast-dismiss:hover {
    background: rgb(var(--chat-fg-rgb) / 0.06);
    color: rgb(var(--chat-fg-rgb) / 0.72);
}

[data-chat-theme="light"] .hurra-toast-panel--info .hurra-toast-icon__glyph {
    background: rgb(228 0 43 / 0.08);
    border-color: rgb(228 0 43 / 0.16);
    color: var(--ci-dark-red);
}

[data-chat-theme="light"] .hurra-toast-panel--success .hurra-toast-icon__glyph {
    background: rgb(129 199 132 / 0.14);
    border-color: rgb(129 199 132 / 0.22);
    color: rgb(54 49 49 / 0.82);
}

[data-chat-theme="light"] .hurra-toast-panel--error .hurra-toast-icon__glyph {
    background: rgb(228 0 43 / 0.08);
    border-color: rgb(228 0 43 / 0.18);
    color: var(--ci-dark-red);
}

[data-chat-theme="light"] .workflow-pills-strip__nav {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    color: rgb(var(--chat-fg-muted-rgb) / 0.85);
    box-shadow: 0 1px 4px rgba(32, 28, 30, 0.08);
}

[data-chat-theme="light"] .prompt-bar-input {
    border-color: var(--chat-border);
    box-shadow: var(--chat-shadow-prompt);
}

[data-chat-theme="light"] .prompt-bar-input::after {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(32, 28, 30, 0.03) 80%,
        rgba(32, 28, 30, 0.06) 100%
    );
}

[data-chat-theme="light"] .prompt-bar-toolbar-group {
    border-color: var(--chat-border);
    background: rgb(var(--chat-fg-rgb) / 0.035);
}

[data-chat-theme="light"] .prompt-bar-toolbar-btn {
    color: rgb(var(--chat-fg-muted-rgb) / 0.82);
}

[data-chat-theme="light"] .prompt-bar-toolbar-btn:hover:not(:disabled) {
    color: rgb(var(--chat-fg-rgb) / 0.88);
    background-color: rgb(var(--chat-fg-rgb) / 0.05);
    border-color: var(--chat-border);
}

[data-chat-theme="light"] .prompt-bar-toolbar-btn--active {
    background-color: rgb(var(--chat-fg-rgb) / 0.07);
    border-color: var(--chat-border-strong);
    color: rgb(var(--chat-fg-rgb) / 0.92);
}

[data-chat-theme="light"] .prompt-bar-attach-btn {
    color: rgb(var(--chat-fg-muted-rgb) / 0.75);
}

[data-chat-theme="light"] .prompt-bar-attach-btn:hover:not(:disabled) {
    color: rgb(var(--chat-fg-rgb) / 0.85);
    background-color: rgb(var(--chat-fg-rgb) / 0.05);
}

[data-chat-theme="light"] .prompt-bar-model-btn--docs.is-active:not(.is-open):not(:disabled) {
    background: var(--prompt-bar-docs-active-bg);
    border-color: var(--prompt-bar-docs-active-border);
}

[data-chat-theme="light"] .prompt-bar-docs-inline-badge {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
}

[data-chat-theme="light"] .prompt-bar-toolbar-inline-badge {
    background: rgb(var(--chat-fg-rgb) / 0.1);
    color: rgb(var(--chat-fg-rgb) / 0.88);
    box-shadow: none;
}

[data-chat-theme="light"] .prompt-bar-toolbar-inline-badge--complete {
    background: color-mix(in srgb, var(--ci-green) 12%, transparent);
    color: var(--ci-green);
}

[data-chat-theme="light"] .prompt-bar-docs-inline-dot {
    background: var(--prompt-bar-docs-icon);
    box-shadow: 0 0 0 2px var(--prompt-bar-docs-active-bg);
}

[data-chat-theme="light"] .welcome-hero-sub,
[data-chat-theme="light"] .welcome-hero-skill-hint,
[data-chat-theme="light"] .welcome-hero-context,
[data-chat-theme="light"] .welcome-skills-eyebrow {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72);
}

[data-chat-theme="light"] .welcome-hero-skill,
[data-chat-theme="light"] .welcome-skills-title {
    color: rgb(var(--chat-fg-rgb) / 0.88);
}

[data-chat-theme="light"] .suggestion-desc {
    color: rgb(var(--chat-fg-muted-rgb) / 0.68);
}

[data-chat-theme="light"] .suggestion-card {
    background: rgb(var(--chat-fg-rgb) / 0.035);
    border-color: var(--chat-border);
}

[data-chat-theme="light"] .suggestion-card:hover {
    background: rgb(var(--chat-fg-rgb) / 0.06);
    border-color: var(--chat-border-strong);
    box-shadow:
        inset 3px 0 0 0 var(--suggestion-accent, var(--ci-red)),
        0 8px 20px -10px rgba(32, 28, 30, 0.16);
}

[data-chat-theme="light"] .suggestion-card--starter {
    background: rgb(var(--chat-fg-rgb) / 0.05);
    border-color: var(--chat-border-strong);
    box-shadow:
        inset 3px 0 0 0 color-mix(in srgb, var(--suggestion-accent, var(--ci-red)) 55%, transparent),
        0 1px 4px rgba(32, 28, 30, 0.07);
}

[data-chat-theme="light"] .suggestion-card--starter:hover {
    background: rgb(var(--chat-fg-rgb) / 0.08);
    box-shadow:
        inset 3px 0 0 0 var(--suggestion-accent, var(--ci-red)),
        0 8px 20px -10px rgba(32, 28, 30, 0.14);
}

[data-chat-theme="light"] .suggestion-card__title--starter {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .suggestion-card--starter:hover .suggestion-card__title--starter {
    color: var(--ci-dark-grey);
}

/* Welcome skills carousel nav — theme-aware (avoid dark fg fallback on light) */
[data-chat-theme="light"] .welcome-skills-carousel__nav {
    background: rgb(255 255 255 / 0.94);
    border-color: rgb(var(--chat-fg-rgb) / 0.1);
    color: rgb(var(--chat-fg-rgb) / 0.48);
    box-shadow:
        0 1px 2px rgb(0 0 0 / 0.04),
        inset 0 1px 0 rgb(255 255 255 / 0.85);
}
[data-chat-theme="light"] .welcome-skills-carousel__nav:hover {
    background: rgb(255 255 255 / 1);
    border-color: rgb(var(--chat-fg-rgb) / 0.16);
    color: rgb(var(--chat-fg-rgb) / 0.72);
}
[data-chat-theme="dark"] .welcome-skills-carousel__nav {
    background: rgb(var(--chat-card-rgb, 32 32 32) / 0.9);
    border-color: var(--chat-border-strong);
    color: rgb(var(--chat-fg-rgb) / 0.72);
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.28);
}
[data-chat-theme="dark"] .welcome-skills-carousel__nav:hover {
    background: rgb(var(--chat-card-rgb, 32 32 32) / 0.98);
    color: rgb(var(--chat-fg-rgb) / 0.92);
}

/* Welcome skill directory cards — subtle lift in dark mode */
[data-chat-theme="dark"] .welcome-skill-tile--skill {
    background: var(--chat-bg-card);
    border-color: var(--chat-border-strong);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
[data-chat-theme="dark"] .welcome-skill-tile--skill:hover {
    background: rgb(var(--chat-fg-rgb) / 0.055);
    border-color: var(--chat-border-hover);
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-chat-theme="dark"] .welcome-skill-tile--skill:active {
    box-shadow:
        0 1px 6px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
[data-chat-theme="dark"] .welcome-skill-tile__icon {
    background: rgb(var(--chat-fg-rgb) / 0.06);
    border-color: var(--chat-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
[data-chat-theme="dark"] .welcome-skill-tile--placeholder {
    background: rgb(var(--chat-fg-rgb) / 0.035);
    border-color: var(--chat-border-strong);
    box-shadow:
        0 1px 6px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Skill info panel — light mode semantic colors */
[data-chat-theme="light"] .welcome-skills-carousel .welcome-skill-tile--skill:hover,
[data-chat-theme="light"] .welcome-skills-carousel .welcome-skill-tile--skill.welcome-skill-tile--preview-active {
    box-shadow:
        0 10px 24px rgb(15 23 42 / 0.08),
        0 2px 6px rgb(15 23 42 / 0.04);
}

[data-chat-theme="light"] .welcome-skill-preview {
    box-shadow:
        0 16px 40px -14px rgba(32, 28, 30, 0.18),
        0 0 0 1px rgb(var(--chat-fg-rgb) / 0.04);
}

[data-chat-theme="dark"] .welcome-skill-preview {
    box-shadow:
        0 18px 44px -16px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Context pins overflow — light mode warning + badge rows */
[data-chat-theme="light"] .context-pins-mcp-warning {
    background: var(--prompt-bar-context-warning-bg);
    border-radius: 0.375rem;
    padding-top: 0.375rem;
    margin-left: 0.125rem;
    margin-right: 0.125rem;
}

[data-chat-theme="light"] .context-pins-badge-row--notice {
    box-shadow: inset 0 0 0 1px var(--prompt-bar-context-warning-border);
}

[data-chat-theme="light"] .context-pins-badge-row--disconnected:hover {
    background: var(--prompt-bar-context-disconnected-hover-bg);
}

[data-chat-theme="light"] .hitl-action-btn--approve {
    color: #363131;
    background: #ffffff;
    border-color: rgba(129, 199, 132, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-chat-theme="light"] .hitl-action-btn--approve:hover:not(:disabled) {
    background: rgba(129, 199, 132, 0.1);
    border-color: #81c784;
}

[data-chat-theme="light"] .hitl-action-btn--reject {
    color: #363131;
    background: #ffffff;
    border-color: rgba(158, 0, 30, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-chat-theme="light"] .hitl-action-btn--reject:hover:not(:disabled) {
    background: rgba(158, 0, 30, 0.06);
    border-color: rgba(158, 0, 30, 0.45);
}

/* HITL approval intro banner */
.hitl-approval-intro {
    border-bottom: 1px solid #363131;
    background: rgba(23, 20, 23, 0.96);
}
.hitl-approval-intro__icon {
    border: 1px solid rgba(228, 0, 43, 0.28);
    background: rgba(228, 0, 43, 0.1);
    color: #e4002b;
}
.hitl-approval-intro__title {
    color: #ffffff;
}
.hitl-approval-intro__body {
    color: #767478;
}
.hitl-approval-intro__dismiss {
    border: 1px solid #363131;
    background: rgba(54, 49, 49, 0.45);
    color: #ffffff;
}
.hitl-approval-intro__dismiss:hover {
    background: rgba(54, 49, 49, 0.72);
    border-color: rgba(228, 0, 43, 0.28);
}

[data-chat-theme="light"] .hitl-approval-intro {
    border-bottom-color: #e0dfde;
    background: #f8f7f6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
[data-chat-theme="light"] .hitl-approval-intro__icon {
    border-color: rgba(228, 0, 43, 0.22);
    background: rgba(228, 0, 43, 0.06);
    color: #e4002b;
}
[data-chat-theme="light"] .hitl-approval-intro__title {
    color: #363131;
}
[data-chat-theme="light"] .hitl-approval-intro__body {
    color: #767478;
}
[data-chat-theme="light"] .hitl-approval-intro__dismiss {
    border-color: #e0dfde;
    background: #ffffff;
    color: #363131;
}
[data-chat-theme="light"] .hitl-approval-intro__dismiss:hover {
    background: #f8f7f6;
    border-color: rgba(228, 0, 43, 0.22);
}

/* Org 2FA enrollment banner */
.org-2fa-banner {
    border: 1px solid rgba(255, 153, 0, 0.28);
    background: rgba(255, 153, 0, 0.08);
}
.org-2fa-banner__title {
    color: #ffffff;
}
.org-2fa-banner__body {
    color: #767478;
}
.org-2fa-banner__action {
    border: 1px solid rgba(255, 153, 0, 0.32);
    background: rgba(255, 153, 0, 0.12);
    color: #ffd54f;
}
.org-2fa-banner__action:hover {
    background: rgba(255, 153, 0, 0.2);
}

[data-chat-theme="light"] .org-2fa-banner {
    border-color: rgba(217, 119, 6, 0.28);
    background: rgba(251, 191, 36, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
[data-chat-theme="light"] .org-2fa-banner__title {
    color: #92400e;
}
[data-chat-theme="light"] .org-2fa-banner__body {
    color: rgba(146, 64, 14, 0.82);
}
[data-chat-theme="light"] .org-2fa-banner__action {
    border-color: rgba(217, 119, 6, 0.32);
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
}
[data-chat-theme="light"] .org-2fa-banner__action:hover {
    background: rgba(251, 191, 36, 0.28);
}

/* System message banners — CI v2 tokens (dark default) */
.system-message-banner-card {
    --system-message-bg: var(--chat-bg-card);
    --system-message-border: var(--ci-dark-grey);
    --system-message-accent: var(--ci-grey);
    --system-message-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 10px rgba(0, 0, 0, 0.28);
    --system-message-title-fg: var(--ci-white);
    --system-message-body-fg: var(--ci-grey);
    --system-message-body-muted-fg: rgba(118, 116, 120, 0.88);
    --system-message-icon-fg: var(--ci-grey);
    --system-message-badge-border: rgba(118, 116, 120, 0.35);
    --system-message-badge-bg: rgba(54, 49, 49, 0.55);
    --system-message-badge-fg: var(--ci-white);
    --system-message-dismiss-fg: rgba(118, 116, 120, 0.85);
    --system-message-dismiss-hover-fg: var(--ci-white);
    --system-message-link-fg: var(--ci-light-blue);
    --system-message-link-hover-fg: var(--ci-white);
    --system-message-code-bg: rgba(54, 49, 49, 0.45);
}
.system-message-banner-card--warning {
    --system-message-accent: var(--ci-red);
    --system-message-bg: rgba(228, 0, 43, 0.07);
    --system-message-border: rgba(228, 0, 43, 0.28);
    --system-message-icon-fg: #ef6680;
    --system-message-badge-border: rgba(228, 0, 43, 0.45);
    --system-message-badge-bg: var(--ci-red);
    --system-message-badge-fg: var(--ci-white);
    --system-message-link-fg: #f499aa;
    --system-message-link-hover-fg: var(--ci-white);
}
.system-message-banner-card--info {
    --system-message-accent: var(--ci-blue);
    --system-message-bg: rgba(4, 104, 203, 0.1);
    --system-message-border: rgba(4, 104, 203, 0.28);
    --system-message-icon-fg: var(--ci-light-blue);
    --system-message-badge-border: rgba(4, 104, 203, 0.45);
    --system-message-badge-bg: var(--ci-blue);
    --system-message-badge-fg: var(--ci-white);
    --system-message-link-fg: var(--ci-light-blue);
    --system-message-link-hover-fg: var(--ci-white);
}
.system-message-banner-card--release {
    --system-message-accent: var(--ci-light-blue);
    --system-message-bg: rgba(110, 212, 225, 0.08);
    --system-message-border: rgba(110, 212, 225, 0.24);
    --system-message-icon-fg: var(--ci-light-blue);
    --system-message-badge-border: rgba(23, 20, 23, 0.55);
    --system-message-badge-bg: var(--ci-black);
    --system-message-badge-fg: var(--ci-white);
    --system-message-link-fg: var(--ci-light-blue);
    --system-message-link-hover-fg: var(--ci-white);
}
.system-message-banner-card--neutral {
    --system-message-accent: var(--ci-grey);
    --system-message-bg: var(--chat-bg-card);
    --system-message-border: var(--ci-dark-grey);
    --system-message-badge-border: var(--ci-dark-grey);
    --system-message-badge-bg: rgba(54, 49, 49, 0.72);
    --system-message-badge-fg: var(--ci-white);
}

[data-chat-theme="light"] .system-message-banner-card {
    --system-message-bg: var(--ci-white);
    --system-message-border: var(--ci-light-grey);
    --system-message-accent: var(--ci-grey);
    --system-message-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 4px rgba(54, 49, 49, 0.08);
    --system-message-title-fg: var(--ci-dark-grey);
    --system-message-body-fg: var(--ci-grey);
    --system-message-body-muted-fg: var(--ci-grey);
    --system-message-icon-fg: var(--ci-grey);
    --system-message-badge-border: var(--ci-light-grey);
    --system-message-badge-bg: var(--ci-sand);
    --system-message-badge-fg: var(--ci-dark-grey);
    --system-message-dismiss-fg: var(--ci-grey);
    --system-message-dismiss-hover-fg: var(--ci-dark-grey);
    --system-message-link-fg: var(--ci-red);
    --system-message-link-hover-fg: var(--ci-dark-red);
    --system-message-code-bg: var(--ci-sand);
}
[data-chat-theme="light"] .system-message-banner-card--warning {
    --system-message-accent: var(--ci-red);
    --system-message-bg: rgba(228, 0, 43, 0.05);
    --system-message-border: rgba(228, 0, 43, 0.2);
    --system-message-icon-fg: var(--ci-red);
    --system-message-badge-border: var(--ci-red);
    --system-message-badge-bg: var(--ci-red);
    --system-message-badge-fg: var(--ci-white);
    --system-message-link-fg: var(--ci-red);
    --system-message-link-hover-fg: var(--ci-dark-red);
}
[data-chat-theme="light"] .system-message-banner-card--info {
    --system-message-accent: var(--ci-blue);
    --system-message-bg: rgba(4, 104, 203, 0.06);
    --system-message-border: rgba(4, 104, 203, 0.2);
    --system-message-icon-fg: var(--ci-blue);
    --system-message-badge-border: var(--ci-blue);
    --system-message-badge-bg: var(--ci-blue);
    --system-message-badge-fg: var(--ci-white);
    --system-message-link-fg: var(--ci-blue);
    --system-message-link-hover-fg: #0356a8;
}
[data-chat-theme="light"] .system-message-banner-card--release {
    --system-message-accent: var(--ci-blue);
    --system-message-bg: var(--ci-sand);
    --system-message-border: var(--ci-light-grey);
    --system-message-icon-fg: var(--ci-blue);
    --system-message-badge-border: var(--ci-black);
    --system-message-badge-bg: var(--ci-black);
    --system-message-badge-fg: var(--ci-white);
    --system-message-link-fg: var(--ci-blue);
    --system-message-link-hover-fg: #0356a8;
}
[data-chat-theme="light"] .system-message-banner-card--neutral {
    --system-message-accent: var(--ci-dark-grey);
    --system-message-bg: var(--ci-sand);
    --system-message-border: var(--ci-light-grey);
    --system-message-badge-border: var(--ci-light-grey);
    --system-message-badge-bg: var(--ci-white);
    --system-message-badge-fg: var(--ci-dark-grey);
}

/* Thread gap placeholders — CI v2 tokens (dark default) */
.thread-gap--assistant {
    --thread-gap-icon-border: rgba(255, 153, 0, 0.25);
    --thread-gap-icon-bg: rgba(255, 153, 0, 0.08);
    --thread-gap-icon-fg: rgba(255, 213, 79, 0.8);
    --thread-gap-card-border: rgba(255, 153, 0, 0.3);
    --thread-gap-card-bg: rgba(255, 153, 0, 0.04);
    --thread-gap-title-fg: rgba(255, 213, 79, 0.92);
    --thread-gap-body-fg: rgb(var(--chat-fg-muted-rgb) / 0.55);
    --thread-gap-report-fg: rgba(255, 213, 79, 0.88);
    --thread-gap-report-hover-fg: rgba(255, 255, 255, 0.95);
    --thread-gap-report-focus-ring: rgba(255, 153, 0, 0.45);
}
.thread-gap--user {
    --thread-gap-card-border: rgba(4, 104, 203, 0.3);
    --thread-gap-card-bg: rgba(4, 104, 203, 0.04);
    --thread-gap-title-fg: rgba(110, 212, 225, 0.9);
    --thread-gap-body-fg: rgb(var(--chat-fg-muted-rgb) / 0.55);
}
[data-chat-theme="light"] .thread-gap--assistant {
    --thread-gap-icon-border: rgba(255, 153, 0, 0.28);
    --thread-gap-icon-bg: rgba(255, 213, 79, 0.22);
    --thread-gap-icon-fg: var(--ci-orange);
    --thread-gap-card-border: rgba(255, 153, 0, 0.28);
    --thread-gap-card-bg: rgba(255, 213, 79, 0.12);
    --thread-gap-title-fg: #b45309;
    --thread-gap-body-fg: var(--ci-grey);
    --thread-gap-report-fg: var(--ci-orange);
    --thread-gap-report-hover-fg: #92400e;
    --thread-gap-report-focus-ring: rgba(255, 153, 0, 0.35);
}
[data-chat-theme="light"] .thread-gap--user {
    --thread-gap-card-border: rgba(4, 104, 203, 0.2);
    --thread-gap-card-bg: rgba(4, 104, 203, 0.06);
    --thread-gap-title-fg: var(--ci-blue);
    --thread-gap-body-fg: var(--ci-grey);
}

/* HITL countdown */
.hitl-countdown-value {
    color: #767478;
}
.hitl-countdown-value--warn {
    color: #ffffff;
}
.hitl-countdown-value--urgent {
    color: #e4002b;
}

[data-chat-theme="light"] .hitl-countdown-value {
    color: #767478;
}
[data-chat-theme="light"] .hitl-countdown-value--warn {
    color: #363131;
}
[data-chat-theme="light"] .hitl-countdown-value--urgent {
    color: #e4002b;
}

/* HITL pending banner — skeleton + live approval card (light mode) */
[data-chat-theme="light"] [data-testid="hitl-pending-banner"] {
    border-color: #e0dfde;
    background: #f8f7f6;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 1px 2px rgba(54, 49, 49, 0.04);
}

[data-chat-theme="light"] .hitl-pending-banner__step-label {
    color: #e4002b;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

[data-chat-theme="light"] .hitl-pending-banner__phase-label {
    color: #363131;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

[data-chat-theme="light"] .hitl-pending-banner__subtitle {
    color: #767478;
    font-weight: 400;
}

[data-chat-theme="light"] .hitl-pending-banner__inner-panel {
    border-color: #e0dfde;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(54, 49, 49, 0.03);
}

[data-chat-theme="light"] .hitl-pending-banner[data-hitl-mode="skeleton"] .hitl-skel-bar {
    background: linear-gradient(
        90deg,
        #e0dfde 0%,
        rgba(118, 116, 120, 0.22) 50%,
        #e0dfde 100%
    );
    background-size: 200% 100%;
    animation: hitl-skel-shimmer 1.5s ease-in-out infinite;
}

[data-chat-theme="light"] [data-testid="hitl-pending-banner"] [data-testid="hitl-countdown"] {
    opacity: 1;
    color: #767478;
}

[data-chat-theme="light"] [data-testid="hitl-pending-banner"] [data-testid="hitl-countdown"] .text-chat-fg\/50,
[data-chat-theme="light"] [data-testid="hitl-pending-banner"] [data-testid="hitl-countdown"] .text-chat-fg\/40 {
    color: #767478;
}

[data-chat-theme="light"] [data-testid="hitl-completed-rail"] {
    border-color: #e0dfde;
    background: #ffffff;
}

[data-chat-theme="light"] [data-testid="hitl-completed-rail"] > p,
[data-chat-theme="light"] .hitl-completed-rail__heading {
    color: #767478;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

[data-chat-theme="light"] .hitl-completed-rail__label {
    color: #363131;
}

[data-chat-theme="light"] .hitl-completed-rail__icon--approved {
    color: #81c784;
}

[data-chat-theme="light"] .hitl-completed-rail__icon--rejected {
    color: #9e001e;
}

[data-chat-theme="light"] .hitl-completed-rail__icon--expired,
[data-chat-theme="light"] .hitl-completed-rail__icon--pending,
[data-chat-theme="light"] .hitl-completed-rail__icon--neutral {
    color: #767478;
}

[data-chat-theme="light"] .hitl-action-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
}

[data-chat-theme="light"] .hitl-action-btn--approve:disabled {
    color: #767478;
    background: #f8f7f6;
    border-color: #e0dfde;
    box-shadow: none;
}

[data-chat-theme="light"] .hitl-action-btn--reject:disabled {
    color: #767478;
    background: #f8f7f6;
    border-color: #e0dfde;
    box-shadow: none;
}

[data-chat-theme="dark"] .chat-message-feedback__btn--up {
    color: rgba(129, 199, 132, 0.72);
}
[data-chat-theme="dark"] .chat-message-feedback__btn--up:hover {
    color: var(--ci-green);
    background: rgba(129, 199, 132, 0.12);
}
[data-chat-theme="dark"] .chat-message-feedback__btn--down {
    color: rgba(158, 0, 30, 0.72);
}
[data-chat-theme="dark"] .chat-message-feedback__btn--down:hover {
    color: var(--ci-red-mid-2);
    background: rgba(158, 0, 30, 0.12);
}

[data-chat-theme="dark"] .hitl-action-btn--approve {
    color: #ffffff;
    background: var(--chat-bg-card);
    border-color: rgba(129, 199, 132, 0.45);
}
[data-chat-theme="dark"] .hitl-action-btn--approve:hover:not(:disabled) {
    background: rgba(129, 199, 132, 0.12);
    border-color: #81c784;
}
[data-chat-theme="dark"] .hitl-action-btn--reject {
    color: #ffffff;
    background: var(--chat-bg-card);
    border-color: rgba(158, 0, 30, 0.35);
}
[data-chat-theme="dark"] .hitl-action-btn--reject:hover:not(:disabled) {
    background: rgba(158, 0, 30, 0.12);
    border-color: #9e001e;
}
[data-chat-theme="dark"] .hitl-completed-rail__icon--approved {
    color: #81c784;
}
[data-chat-theme="dark"] .hitl-completed-rail__icon--rejected {
    color: #9e001e;
}
[data-chat-theme="dark"] .hitl-thinking-badge {
    color: #ffffff;
}
[data-chat-theme="dark"] .hitl-countdown-value {
    color: #767478;
}
[data-chat-theme="dark"] .hitl-countdown-value--warn {
    color: #ffffff;
}
[data-chat-theme="dark"] .hitl-countdown-value--urgent {
    color: #e4002b;
}

/* HITL rich content preview — sand inset (light), prose-scoped typography */
.hitl-editable-content-field__preview-wrap {
    isolation: isolate;
}
.hitl-content-fade-mask {
    height: 4rem;
    background: linear-gradient(to bottom, transparent 0%, var(--chat-inset-bg, rgb(var(--chat-bg-rgb) / 0.92)) 75%);
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}
.hitl-expand-panel {
    background: var(--chat-surface-bg, rgb(var(--chat-bg-rgb) / 0.98));
}
[data-chat-theme="light"] .hitl-content-fade-mask {
    background: linear-gradient(to bottom, transparent 0%, rgba(248,247,246,0.96) 75%);
}
[data-chat-theme="light"] .hitl-expand-panel {
    background: #ffffff;
}
.hitl-expand-overlay {
    /* rendered via x-teleport into body, above all modals */
}
.hitl-content-preview {
    color: rgb(var(--chat-fg-rgb) / 0.88);
    word-break: break-word;
}

.hitl-content-preview.chat-prose {
    font-size: 11px;
    line-height: 1.625;
}

.hitl-content-preview.chat-prose > :first-child,
.hitl-content-preview.chat-prose .chat-markdown-body > :first-child {
    margin-top: 0;
}

.hitl-content-preview.chat-prose > :last-child,
.hitl-content-preview.chat-prose .chat-markdown-body > :last-child {
    margin-bottom: 0;
}

[data-chat-theme="light"] .hitl-content-preview:not(.hitl-content-preview--proposed) {
    background-color: #f8f7f6;
    border-color: #e0dfde;
    color: #363131;
}

[data-chat-theme="light"] .hitl-content-preview.chat-prose h1,
[data-chat-theme="light"] .hitl-content-preview.chat-prose h2,
[data-chat-theme="light"] .hitl-content-preview.chat-prose h3,
[data-chat-theme="light"] .hitl-content-preview.chat-prose h4 {
    color: #363131;
}

[data-chat-theme="light"] .hitl-content-preview.chat-prose p,
[data-chat-theme="light"] .hitl-content-preview.chat-prose li {
    color: #363131;
}

[data-chat-theme="light"] .hitl-preview-truncated-hint {
    color: #767478;
}

.hitl-editable-content-field__preview:empty {
    min-height: 2.5rem;
}

.hitl-editable-content-field__preview:empty::before {
    content: '—';
    color: rgb(var(--chat-fg-rgb) / 0.35);
}

[data-chat-theme="light"] .hitl-editable-content-field__toggle {
    background: #ffffff;
    border-color: #e0dfde;
    color: #363131;
}

[data-chat-theme="light"] .hitl-editable-content-field__toggle:hover {
    background: #f8f7f6;
    color: #363131;
}

[data-chat-theme="light"] .hitl-payload-card {
    border-color: #e0dfde !important;
    background: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(54, 49, 49, 0.03);
}

[data-chat-theme="light"] .hitl-payload-section-label {
    color: #767478;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

[data-chat-theme="light"] .hitl-completed-rail__heading,
[data-chat-theme="light"] .hitl-thread-filter__label {
    color: #767478;
    text-transform: none;
    letter-spacing: 0.01em;
}

[data-chat-theme="light"] .hitl-thread-filter__select:focus {
    --tw-ring-color: rgba(228, 0, 43, 0.22);
}

[data-chat-theme="light"] .hitl-thinking-badge--preparing,
[data-chat-theme="light"] .hitl-thinking-badge--active {
    border-color: rgba(228, 0, 43, 0.22);
    background: rgba(228, 0, 43, 0.06);
    color: #363131;
}

[data-chat-theme="light"] .hitl-thinking-badge--preparing .hitl-thinking-badge__dot,
[data-chat-theme="light"] .hitl-thinking-badge--active .hitl-thinking-badge__dot {
    background: #e4002b;
}

[data-chat-theme="light"] .hitl-thinking-badge--preparing .hitl-thinking-badge__dot-ping,
[data-chat-theme="light"] .hitl-thinking-badge--active .hitl-thinking-badge__dot-ping {
    background: #e4002b;
}

[data-chat-theme="light"] .hitl-thinking-badge--between {
    border-color: #e0dfde;
    background: #ffffff;
    color: #363131;
}

[data-chat-theme="light"] .hitl-thinking-badge--between .hitl-thinking-badge__dot,
[data-chat-theme="light"] .hitl-thinking-badge--between .hitl-thinking-badge__dot-ping {
    background: #767478;
}

[data-chat-theme="light"] .hitl-thinking-badge--done {
    border-color: rgba(129, 199, 132, 0.45);
    background: rgba(129, 199, 132, 0.12);
    color: #363131;
}

[data-chat-theme="dark"] .hitl-thinking-badge--preparing,
[data-chat-theme="dark"] .hitl-thinking-badge--active {
    border-color: rgba(228, 0, 43, 0.28);
    background: rgba(228, 0, 43, 0.1);
    color: #ffffff;
}

[data-chat-theme="dark"] .hitl-thinking-badge--preparing .hitl-thinking-badge__dot,
[data-chat-theme="dark"] .hitl-thinking-badge--active .hitl-thinking-badge__dot,
[data-chat-theme="dark"] .hitl-thinking-badge--preparing .hitl-thinking-badge__dot-ping,
[data-chat-theme="dark"] .hitl-thinking-badge--active .hitl-thinking-badge__dot-ping {
    background: #e4002b;
}

[data-chat-theme="dark"] .hitl-thinking-badge--between {
    border-color: #363131;
    background: rgba(54, 49, 49, 0.45);
    color: #ffffff;
}

[data-chat-theme="dark"] .hitl-thinking-badge--between .hitl-thinking-badge__dot,
[data-chat-theme="dark"] .hitl-thinking-badge--between .hitl-thinking-badge__dot-ping {
    background: #767478;
}

[data-chat-theme="dark"] .hitl-thinking-badge--done {
    border-color: rgba(129, 199, 132, 0.35);
    background: rgba(129, 199, 132, 0.1);
    color: #ffffff;
}

[data-chat-theme="light"] .brain-setup-badge {
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.25);
    background: rgba(251, 191, 36, 0.14);
}

/* AI message — fallback model notice + chip; prompt bar skill setup alert */
[data-chat-theme="light"] .chat-fallback-notice,
[data-chat-theme="light"] .chat-skill-setup-alert {
    color: #92400e;
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(217, 119, 6, 0.28);
}
[data-chat-theme="light"] .chat-fallback-notice__icon,
[data-chat-theme="light"] .chat-skill-setup-alert__icon {
    color: #d97706;
}
[data-chat-theme="light"] .chat-skill-setup-alert--info {
    color: rgb(var(--chat-fg-rgb) / 0.72);
    background: rgb(var(--chat-fg-rgb) / 0.04);
    border-color: var(--chat-border);
}
[data-chat-theme="light"] .chat-skill-setup-alert--info .chat-skill-setup-alert__icon--info {
    color: rgb(var(--chat-fg-rgb) / 0.45);
}
[data-chat-theme="light"] .chat-ai-message-model--fallback {
    color: #b45309;
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(217, 119, 6, 0.28);
}

/* Batch write results collapsible block */
[data-chat-theme="light"] .chat-batch-write-results__details {
    background: var(--chat-bg-card);
    box-shadow: var(--chat-shadow-card);
}
[data-chat-theme="light"] .chat-batch-write-results__title {
    color: rgb(var(--chat-fg-rgb) / 0.78);
}
[data-chat-theme="light"] .chat-batch-write-results__item {
    background: rgb(var(--chat-fg-rgb) / 0.02);
    border-color: var(--chat-border-strong);
}
[data-chat-theme="light"] .chat-batch-write-results__section--completed {
    color: var(--ci-green);
}
[data-chat-theme="light"] .chat-batch-write-results__section--failed {
    color: var(--ci-dark-red);
}
[data-chat-theme="light"] .chat-batch-write-results__item-link {
    color: var(--ci-blue) !important;
    border-color: rgba(4, 104, 203, 0.28);
    background: rgba(4, 104, 203, 0.08);
}
[data-chat-theme="light"] .chat-batch-follow-up-chip {
    background: rgb(var(--chat-fg-rgb) / 0.03);
    border-color: var(--chat-border-strong);
    color: var(--ci-dark-grey);
}
[data-chat-theme="light"] .chat-batch-follow-up-chip--primary {
    color: var(--ci-blue);
    border-color: rgba(4, 104, 203, 0.32);
    background: rgba(4, 104, 203, 0.08);
}
[data-chat-theme="light"] .chat-follow-up-suggestion-chip {
    background: rgb(var(--chat-fg-rgb) / 0.03);
    border-color: var(--chat-border-strong);
    color: var(--ci-dark-grey);
}
[data-chat-theme="light"] .chat-follow-up-suggestion-chip:hover:not(:disabled) {
    border-color: rgba(228, 0, 43, 0.35);
    color: var(--ci-dark-grey);
}

/* Message activity accordion — HITL-aligned chips (panel chrome below) */
[data-chat-theme="light"] .message-activity-chip--approved {
    border-color: rgba(129, 199, 132, 0.45);
    background: rgba(129, 199, 132, 0.12);
    color: var(--ci-dark-grey);
}
[data-chat-theme="light"] .message-activity-chip--approved .message-activity-chip__dot {
    background: var(--ci-green);
}
[data-chat-theme="light"] .message-activity-chip--approved .message-activity-chip__status {
    background: rgba(129, 199, 132, 0.2);
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .message-activity-chip--rejected {
    border-color: rgba(158, 0, 30, 0.28);
    background: rgba(158, 0, 30, 0.08);
    color: var(--ci-dark-grey);
}
[data-chat-theme="light"] .message-activity-chip--rejected .message-activity-chip__dot {
    background: var(--ci-dark-red);
}
[data-chat-theme="light"] .message-activity-chip--rejected .message-activity-chip__status {
    background: rgba(158, 0, 30, 0.14);
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .message-activity-chip--expired,
[data-chat-theme="light"] .message-activity-chip--pending {
    border-color: var(--ci-light-grey);
    background: var(--ci-sand);
    color: var(--ci-dark-grey);
}
[data-chat-theme="light"] .message-activity-chip--expired .message-activity-chip__dot,
[data-chat-theme="light"] .message-activity-chip--pending .message-activity-chip__dot {
    background: var(--ci-grey);
}
[data-chat-theme="light"] .message-activity-chip--expired .message-activity-chip__status,
[data-chat-theme="light"] .message-activity-chip--pending .message-activity-chip__status {
    background: rgba(118, 116, 120, 0.12);
    color: var(--ci-grey);
}

[data-chat-theme="light"] .message-activity-chip--tool .message-activity-chip__dot {
    background: var(--ci-green);
}

[data-chat-theme="light"] .gads-picker-tab--active {
    background: rgba(251, 188, 5, 0.24);
    color: #92400e;
}
[data-chat-theme="light"] .gads-picker-row--selected {
    background: rgba(251, 188, 5, 0.16);
}
[data-chat-theme="light"] .gads-picker-radio--active {
    border-color: #b45309;
}
[data-chat-theme="light"] .gads-picker-radio-dot {
    background: #b45309;
}
[data-chat-theme="light"] .gads-picker-icon-badge {
    background: rgba(251, 188, 5, 0.2);
    color: #b45309;
}
[data-chat-theme="light"] .gads-picker-star--active {
    color: #b45309;
}
[data-chat-theme="light"] .gads-picker-status--enabled {
    color: #047857;
}
[data-chat-theme="light"] .gads-picker-status--amber {
    color: #b45309;
}
[data-chat-theme="light"] .gads-picker-error {
    color: #b45309;
}

[data-chat-theme="light"] .release-modal-prose .text-sky-300 {
    color: #0369a1;
}
[data-chat-theme="light"] .release-modal-prose .hover\:text-sky-200:hover {
    color: #0284c7;
}

/* ── Light mode: crisp AI message & stream typography ──
   Antialiased smoothing reads soft/muddy on warm mid-tones; subpixel + higher
   contrast avoids the generic “AI markdown” look without changing dark mode. */
[data-chat-theme="light"] .chat-prose,
[data-chat-theme="light"] .chat-ai-message-bubble .chat-message-content,
[data-chat-theme="light"] .stream-answer-content .chat-prose {
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: auto;
    font-variant-ligatures: no-common-ligatures;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ci-dark-grey);
    letter-spacing: -0.008em;
    line-height: 1.6;
}

[data-chat-theme="light"] .chat-prose > p:first-child,
[data-chat-theme="light"] .chat-prose .chat-markdown-body > p:first-child {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-prose h1,
[data-chat-theme="light"] .chat-prose h2,
[data-chat-theme="light"] .chat-prose h3,
[data-chat-theme="light"] .chat-prose h4,
[data-chat-theme="light"] .chat-prose h5,
[data-chat-theme="light"] .chat-prose h6 {
    color: var(--ci-dark-grey);
    letter-spacing: -0.014em;
}

[data-chat-theme="light"] .chat-prose strong {
    color: var(--ci-dark-grey);
    font-weight: 600;
}

[data-chat-theme="light"] .chat-prose em {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-prose ul > li,
[data-chat-theme="light"] .chat-prose ol > li {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-prose ul > li::marker {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-prose blockquote {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-prose hr {
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--ci-light-grey) 12%,
        var(--ci-light-grey) 88%,
        transparent 100%
    );
}

/* Tables — stronger header/body separation on beige cards */
[data-chat-theme="light"] .chat-prose thead,
[data-chat-theme="light"] .chat-table-wrapper thead {
    background: rgb(var(--chat-fg-rgb) / 0.07);
}

[data-chat-theme="light"] .chat-prose thead th,
[data-chat-theme="light"] .chat-table-wrapper thead th {
    color: var(--ci-grey);
    letter-spacing: 0.045em;
    font-weight: 600;
}

[data-chat-theme="light"] .chat-prose tbody td,
[data-chat-theme="light"] .chat-table-wrapper tbody td {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-prose tbody tr:nth-child(even) td,
[data-chat-theme="light"] .chat-table-wrapper tbody tr:nth-child(even) td {
    background: rgb(var(--chat-fg-rgb) / 0.035);
}

[data-chat-theme="light"] .chat-table-wrapper tbody td:first-child {
    background: var(--chat-bg-card);
}

[data-chat-theme="light"] .chat-table-wrapper tbody tr:nth-child(even) td:first-child {
    background: var(--chat-bg-tab);
}

/* Stream activity panel — same rendering + lift muted inline opacity utilities */
[data-chat-theme="light"] .stream-activity {
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: auto;
}

[data-chat-theme="light"] .stream-activity .text-chat-fg\/80 {
    color: var(--ci-dark-grey) !important;
}

[data-chat-theme="light"] .stream-activity .text-chat-fg\/55,
[data-chat-theme="light"] .stream-activity .text-chat-fg\/60 {
    color: var(--ci-grey) !important;
}

[data-chat-theme="light"] .stream-activity .text-chat-fg\/40,
[data-chat-theme="light"] .stream-activity .text-chat-fg\/45 {
    color: var(--ci-grey) !important;
}

[data-chat-theme="light"] .stream-activity .text-chat-fg\/35 {
    color: rgb(var(--chat-fg-muted-rgb) / 0.72) !important;
}

[data-chat-theme="light"] .stream-activity .text-chat-fg\/30 {
    color: var(--ci-grey) !important;
}

/* ── AI message bubble + header (message_ai.html) ── */
[data-chat-theme="light"] .chat-ai-message-meta time {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-ai-message-meta .chat-ai-message-meta__sep {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-ai-message-meta .text-chat-fg\/60 {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-ai-message-bubble {
    border-color: var(--ci-light-grey);
    background: var(--ci-white);
    box-shadow: var(--chat-shadow-message-bubble);
}

[data-chat-theme="light"] .chat-user-message-bubble {
    border-color: var(--ci-light-grey);
    background: var(--chat-bg-user-bubble);
    box-shadow: var(--chat-shadow-message-bubble);
}

[data-chat-theme="light"] .chat-prose-user,
[data-chat-theme="light"] .chat-user-message-bubble .chat-message-content {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-ai-message-model {
    color: var(--ci-grey);
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .chat-ai-message-copy:hover {
    background: var(--ci-sand);
}

[data-chat-theme="light"] .chat-answer-now-notice {
    border: 1px solid rgba(4, 104, 203, 0.22);
    background: rgba(4, 104, 203, 0.06);
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-answer-now-notice__icon {
    color: var(--ci-blue);
}

[data-chat-theme="light"] .chat-message-action-btn {
    color: var(--ci-grey);
    background: var(--ci-white);
    border-color: var(--ci-light-grey);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-chat-theme="light"] .chat-message-action-btn:hover {
    color: var(--ci-dark-grey);
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .chat-message-feedback {
    background: var(--ci-white);
    border-color: var(--ci-light-grey);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-chat-theme="light"] .chat-message-feedback__btn--up {
    color: rgba(129, 199, 132, 0.88);
}

[data-chat-theme="light"] .chat-message-feedback__btn--up:hover {
    color: var(--ci-green);
    background: rgba(129, 199, 132, 0.12);
}

[data-chat-theme="light"] .chat-message-feedback__btn--down {
    color: rgba(158, 0, 30, 0.72);
}

[data-chat-theme="light"] .chat-message-feedback__btn--down:hover {
    color: var(--ci-dark-red);
    background: rgba(158, 0, 30, 0.08);
}

[data-chat-theme="light"] .chat-message-feedback__btn.is-active.is-positive {
    color: var(--ci-green);
    background: rgba(129, 199, 132, 0.16);
}

[data-chat-theme="light"] .chat-message-feedback__btn.is-active.is-negative,
[data-chat-theme="light"] .chat-message-feedback__btn.is-pending.is-negative {
    color: var(--ci-dark-red);
    background: rgba(158, 0, 30, 0.1);
}

[data-chat-theme="light"] .message-activity-panel {
    border-color: var(--ci-light-grey);
    background: var(--ci-white);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 1px 2px rgba(54, 49, 49, 0.04);
}

[data-chat-theme="light"] .message-activity-panel__chevron {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .message-activity-panel__title {
    color: var(--ci-grey);
    font-weight: 600;
}

[data-chat-theme="light"] .message-activity-panel__toggle:hover .message-activity-panel__title {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .message-activity-stat {
    color: var(--ci-grey);
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .message-activity-stat--hitl {
    color: var(--chat-activity-hitl-stat-fg);
    border-color: var(--chat-activity-hitl-stat-border);
    background: var(--chat-activity-hitl-stat-bg);
}

[data-chat-theme="light"] .message-activity-stat--hitl .message-activity-stat__icon {
    color: var(--chat-activity-hitl-stat-fg);
}

[data-chat-theme="light"] .message-activity-stat--search {
    color: var(--chat-activity-search-stat-fg);
    border-color: var(--chat-activity-search-stat-border);
    background: var(--chat-activity-search-stat-bg);
}

[data-chat-theme="light"] .message-activity-stat--search .message-activity-stat__icon {
    color: var(--chat-activity-search-stat-fg);
    opacity: 0.92;
}

[data-chat-theme="light"] .message-activity-stat--math {
    color: var(--chat-math-stat-fg);
    border-color: var(--chat-math-stat-border);
    background: var(--chat-math-stat-bg);
}

[data-chat-theme="light"] .message-activity-section__label {
    color: var(--ci-grey);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

[data-chat-theme="light"] .message-activity-tools__label {
    color: var(--ci-dark-grey);
    font-size: 12px;
}

[data-chat-theme="light"] .message-activity-chip {
    color: var(--ci-dark-grey);
    background: var(--ci-white);
    border-color: var(--ci-light-grey);
    box-shadow: 0 1px 0 rgba(54, 49, 49, 0.03);
}

[data-chat-theme="light"] .message-activity-chip--vendor .message-activity-chip__label {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .message-activity-chip--vendor-web_search {
    border-color: rgba(4, 104, 203, 0.28);
    background: rgba(4, 104, 203, 0.07);
}

[data-chat-theme="light"] .message-activity-chip--vendor-built_in_tools {
    border-color: rgba(228, 0, 43, 0.2);
    background: rgba(228, 0, 43, 0.05);
}

[data-chat-theme="light"] .message-activity-chip--vendor-built_in_tools .message-activity-chip__icon {
    color: var(--ci-red);
}

[data-chat-theme="light"] .message-activity-chip--vendor-google_ads {
    border-color: rgba(66, 133, 244, 0.28);
    background: rgba(66, 133, 244, 0.08);
}

[data-chat-theme="light"] .message-activity-chip--vendor-fellow .message-activity-chip__icon {
    color: #4338ca;
}

[data-chat-theme="light"] .message-activity-knowledge-tabs__tab {
    border-color: var(--ci-light-grey);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ci-grey);
}

[data-chat-theme="light"] .message-activity-knowledge-tabs__tab.is-active {
    border-color: var(--message-activity-search-border);
    background: var(--message-activity-search-bg);
    color: var(--ci-dark-grey);
}

/* ── Stream activity panel (stream_activity.html) ── */
[data-chat-theme="light"] .stream-activity__card {
    border-color: var(--ci-light-grey);
    background: var(--ci-white);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 1px 2px rgba(54, 49, 49, 0.04);
}

[data-chat-theme="light"] .chat-stream-thought-panel {
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .chat-stream-thought-panel p {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-stream-thought-panel .bg-hurra-red\/60,
[data-chat-theme="light"] .chat-stream-thought-panel [class*="bg-hurra-red"] {
    background-color: rgba(228, 0, 43, 0.55);
}

[data-chat-theme="light"] .stream-tool-strip {
    border-color: var(--ci-light-grey);
    background: var(--ci-sand);
}

[data-chat-theme="light"] .stream-tool-strip__row {
    border-top-color: var(--ci-light-grey) !important;
}

[data-chat-theme="light"] .stream-tool-status--running {
    color: var(--ci-red);
}

[data-chat-theme="light"] .stream-tool-status--complete {
    color: var(--ci-green);
}

[data-chat-theme="light"] .stream-tool-status--stopped {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .stream-tool-status--error {
    color: var(--ci-dark-red);
}

[data-chat-theme="light"] .stream-tool-spinner {
    color: var(--ci-red);
}

[data-chat-theme="light"] .stream-tool-dot--complete {
    background: var(--ci-green);
}

[data-chat-theme="light"] .stream-tool-dot--error {
    background: var(--ci-dark-red);
}

[data-chat-theme="light"] .stream-tool-dot--stopped {
    background: var(--ci-grey);
}

[data-chat-theme="light"] .stream-dot {
    background: var(--ci-grey);
}

[data-chat-theme="light"] .stream-skel {
    background: var(--ci-light-grey) !important;
}

[data-chat-theme="light"] .stream-count-badge-pulse {
    animation-name: stream-count-pulse-ci;
}

@keyframes stream-count-pulse-ci {
    0%, 100% {
        transform: scale(1);
        background: var(--ci-sand);
        color: var(--ci-grey);
        border-color: var(--ci-light-grey);
    }
    50% {
        transform: scale(1.15);
        background: rgba(228, 0, 43, 0.1);
        border-color: rgba(228, 0, 43, 0.28);
        color: var(--ci-red);
    }
}

[data-chat-theme="light"] .chat-ai-message-bubble .border-chat-border.bg-chat-fg\/\[0\.02\] {
    border-color: var(--ci-light-grey);
    background: var(--ci-sand);
}

[data-chat-theme="light"] .chat-ai-message-bubble .chat-code-copy,
[data-chat-theme="light"] .chat-ai-message-bubble button[class*="hover:bg-white"] {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-ai-message-bubble button[class*="hover:bg-white"]:hover {
    color: var(--ci-dark-grey);
    background: var(--ci-sand);
}

[data-chat-theme="light"] .stream-activity .text-[11px].leading-snug.text-chat-fg\/50 {
    color: var(--ci-grey) !important;
}

/* ── Brain selector modal (brain_selector_modal_body.html) ── */
[data-chat-theme="light"] .brain-selector-modal-card {
    border-color: var(--ci-light-grey);
    background: var(--ci-white);
    box-shadow:
        0 16px 40px -14px rgba(54, 49, 49, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[data-chat-theme="light"] .brain-selector-modal-body {
    font-family: Arial, Helvetica, sans-serif;
}

[data-chat-theme="light"] .brain-selector-modal__title {
    color: var(--ci-dark-grey);
    font-weight: 600;
}

[data-chat-theme="light"] .brain-selector-modal__subtitle,
[data-chat-theme="light"] .brain-selector-modal__loading-hint,
[data-chat-theme="light"] .brain-selector-modal__empty,
[data-chat-theme="light"] .brain-selector-modal__footer-hint {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .brain-selector-modal-body .capability-modal__header {
    border-bottom-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .brain-selector-modal-body .capability-modal__header-icon {
    background: var(--ci-sand);
    border: 1px solid var(--ci-light-grey);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

[data-chat-theme="light"] .brain-selector-modal__close {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .brain-selector-modal__close:hover {
    color: var(--ci-dark-grey);
    background: var(--ci-sand);
}

[data-chat-theme="light"] .brain-selector-modal__search {
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
    color: var(--ci-dark-grey);
    box-shadow: inset 0 1px 2px rgba(54, 49, 49, 0.04);
}

[data-chat-theme="light"] .brain-selector-modal__search::placeholder {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .brain-selector-modal__search:focus {
    border-color: rgba(228, 0, 43, 0.28);
    background: var(--ci-white);
    box-shadow: inset 0 1px 2px rgba(54, 49, 49, 0.04), 0 0 0 1px rgba(228, 0, 43, 0.08);
}

[data-chat-theme="light"] .brain-selector-modal__search-icon {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .brain-selector-modal-body .capability-modal__filter-tabs {
    border-top-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .brain-selector-modal-body .capability-modal__filter-tab {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .brain-selector-modal-body .capability-modal__filter-tab:hover {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .brain-selector-modal-body .capability-modal__filter-tab--active {
    color: var(--ci-dark-grey);
    border-bottom-color: var(--ci-red);
    font-weight: 600;
}

[data-chat-theme="light"] .brain-selector-modal__error {
    border-color: rgba(158, 0, 30, 0.22);
    background: rgba(158, 0, 30, 0.06);
    color: var(--ci-dark-red);
}

[data-chat-theme="light"] .brain-selector-skeleton-row__bar {
    background: linear-gradient(
        90deg,
        var(--ci-light-grey) 0%,
        rgba(118, 116, 120, 0.22) 50%,
        var(--ci-light-grey) 100%
    );
    background-size: 200% 100%;
    animation: brain-selector-skel-shimmer 1.5s ease-in-out infinite;
}

@keyframes brain-selector-skel-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

[data-chat-theme="light"] .brain-selector-row--active-quick,
[data-chat-theme="light"] .brain-selector-row--confluence {
    background: rgba(4, 104, 203, 0.05);
}

[data-chat-theme="light"] .brain-selector-row--active-quick .brain-selector-row__btn:hover:not(:disabled),
[data-chat-theme="light"] .brain-selector-row--confluence .brain-selector-row__btn:hover:not(:disabled) {
    background: rgba(4, 104, 203, 0.08);
}

[data-chat-theme="light"] .brain-selector-row--active-skill {
    background: rgba(228, 0, 43, 0.05);
}

[data-chat-theme="light"] .brain-selector-row--active-skill .brain-selector-row__btn:hover:not(:disabled) {
    background: rgba(228, 0, 43, 0.08);
}

[data-chat-theme="light"] .brain-selector-row--disabled {
    background: var(--ci-sand);
}

[data-chat-theme="light"] .brain-selector-row__btn:hover:not(:disabled) {
    background: rgba(54, 49, 49, 0.03);
}

[data-chat-theme="light"] .brain-selector-row__name {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .brain-selector-row--disabled .brain-selector-row__name {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .brain-selector-row--confluence .brain-selector-row__name {
    color: var(--ci-blue);
}

[data-chat-theme="light"] .brain-selector-badge--new-chat {
    color: var(--ci-grey);
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
    text-transform: none;
    letter-spacing: 0.01em;
}

[data-chat-theme="light"] .brain-selector-badge--locked {
    color: var(--ci-dark-grey);
    background: rgba(255, 153, 0, 0.12);
    border-color: rgba(255, 153, 0, 0.28);
    text-transform: none;
    letter-spacing: 0.01em;
}

[data-chat-theme="light"] .brain-selector-badge--confluence {
    color: var(--ci-dark-grey);
    background: rgba(4, 104, 203, 0.08);
    border-color: rgba(4, 104, 203, 0.22);
    text-transform: none;
    letter-spacing: 0.01em;
}

[data-chat-theme="light"] .brain-selector-modal__footer {
    border-top-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .brain-selector-builder-cta {
    color: var(--ci-red);
    background: rgba(228, 0, 43, 0.06);
    border-color: rgba(228, 0, 43, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-chat-theme="light"] .brain-selector-builder-cta:hover {
    background: rgba(228, 0, 43, 0.1);
    border-color: rgba(228, 0, 43, 0.32);
    color: var(--ci-red);
}

[data-chat-theme="light"] .brain-selector-builder-cta__badge {
    color: var(--ci-dark-grey);
    background: rgba(228, 0, 43, 0.1);
    border-color: rgba(228, 0, 43, 0.22);
}

[data-chat-theme="light"] .brain-selector-modal__footer-link {
    color: var(--ci-red);
    font-weight: 600;
}

[data-chat-theme="light"] .brain-selector-modal__footer-link:hover {
    color: var(--ci-dark-red);
}

/* ── Dark mode: CI-aligned chat components ── */
[data-chat-theme="dark"] .chat-prose,
[data-chat-theme="dark"] .chat-ai-message-bubble .chat-message-content,
[data-chat-theme="dark"] .stream-answer-content .chat-prose {
    font-family: Arial, Helvetica, sans-serif;
    color: #ffffff;
}

[data-chat-theme="dark"] .chat-prose em,
[data-chat-theme="dark"] .chat-prose blockquote {
    color: #767478;
}

[data-chat-theme="dark"] .chat-prose ul > li::marker {
    color: #767478;
}

[data-chat-theme="dark"] .chat-ai-message-bubble {
    border-color: #363131;
    background: var(--chat-bg-card);
    box-shadow: var(--chat-shadow-message-bubble);
}

[data-chat-theme="dark"] .chat-user-message-bubble {
    border-color: #363131;
    background: var(--chat-bg-user-bubble);
    box-shadow: var(--chat-shadow-message-bubble);
}

[data-chat-theme="dark"] .chat-prose-user,
[data-chat-theme="dark"] .chat-user-message-bubble .chat-message-content {
    font-family: Arial, Helvetica, sans-serif;
    color: #ffffff;
}

[data-chat-theme="dark"] .chat-ai-message-meta time,
[data-chat-theme="dark"] .chat-ai-message-meta .chat-ai-message-meta__sep,
[data-chat-theme="dark"] .chat-ai-message-meta .text-chat-fg\/60 {
    color: #767478;
}

[data-chat-theme="dark"] .chat-ai-message-model {
    color: #767478;
    background: rgba(54, 49, 49, 0.55);
    border-color: #363131;
}

[data-chat-theme="dark"] .message-activity-panel {
    border-color: var(--ci-dark-grey);
    background: var(--chat-bg-card);
}

[data-chat-theme="dark"] .message-activity-panel__title {
    color: var(--ci-grey);
    font-weight: 600;
}

[data-chat-theme="dark"] .message-activity-panel__toggle:hover .message-activity-panel__title {
    color: var(--ci-white);
}

[data-chat-theme="dark"] .message-activity-panel__chevron {
    color: var(--ci-grey);
}

[data-chat-theme="dark"] .message-activity-stat {
    color: var(--ci-grey);
    background: var(--chat-surface-muted);
    border-color: var(--ci-dark-grey);
}

[data-chat-theme="dark"] .message-activity-section__label {
    color: var(--ci-grey);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

[data-chat-theme="dark"] .message-activity-chip {
    color: var(--ci-white);
    background: rgba(54, 49, 49, 0.45);
    border-color: var(--ci-dark-grey);
}

[data-chat-theme="dark"] .message-activity-stat--hitl {
    color: var(--chat-activity-hitl-stat-fg);
    border-color: var(--chat-activity-hitl-stat-border);
    background: var(--chat-activity-hitl-stat-bg);
}

[data-chat-theme="dark"] .message-activity-stat--hitl .message-activity-stat__icon {
    color: var(--chat-activity-hitl-stat-fg);
    opacity: 0.92;
}

[data-chat-theme="dark"] .message-activity-stat--search {
    color: var(--chat-activity-search-stat-fg);
    border-color: var(--chat-activity-search-stat-border);
    background: var(--chat-activity-search-stat-bg);
}

[data-chat-theme="dark"] .message-activity-stat--search .message-activity-stat__icon {
    color: var(--chat-activity-search-stat-fg);
    opacity: 0.92;
}

[data-chat-theme="dark"] .message-activity-stat--math {
    color: var(--chat-math-stat-fg);
    border-color: var(--chat-math-stat-border);
    background: var(--chat-math-stat-bg);
}

[data-chat-theme="dark"] .message-activity-tools__label {
    color: var(--ci-white);
    font-size: 12px;
}

[data-chat-theme="dark"] .message-activity-chip--vendor-web_search {
    border-color: color-mix(in srgb, var(--ci-blue) 28%, transparent);
    background: color-mix(in srgb, var(--ci-blue) 8%, transparent);
}

[data-chat-theme="dark"] .message-activity-chip--vendor-built_in_tools {
    border-color: color-mix(in srgb, var(--ci-red) 24%, transparent);
    background: color-mix(in srgb, var(--ci-red) 8%, transparent);
}

[data-chat-theme="dark"] .message-activity-chip--vendor-built_in_tools .message-activity-chip__icon {
    color: var(--ci-red);
}

[data-chat-theme="dark"] .message-activity-chip--vendor-built_in_tools .message-activity-chip__label {
    color: rgb(var(--chat-fg-rgb) / 0.88);
}

[data-chat-theme="dark"] .message-activity-chip--vendor-google_ads {
    border-color: color-mix(in srgb, var(--ci-blue) 28%, transparent);
    background: color-mix(in srgb, var(--ci-blue) 10%, transparent);
}

[data-chat-theme="dark"] .message-activity-chip--vendor-fellow .message-activity-chip__icon {
    color: #a5b4fc;
}

[data-chat-theme="dark"] .message-activity-chip--tool .message-activity-chip__dot {
    background: var(--ci-green);
}

[data-chat-theme="dark"] .message-activity-chip__count {
    color: var(--ci-grey);
}

[data-chat-theme="dark"] .message-activity-chip--approved {
    border-color: rgba(129, 199, 132, 0.35);
    background: rgba(129, 199, 132, 0.1);
    color: var(--ci-white);
}

[data-chat-theme="dark"] .message-activity-chip--approved .message-activity-chip__dot {
    background: var(--ci-green);
}

[data-chat-theme="dark"] .message-activity-chip--approved .message-activity-chip__status {
    background: rgba(129, 199, 132, 0.16);
    color: var(--ci-green);
}

[data-chat-theme="dark"] .message-activity-chip--rejected {
    border-color: rgba(158, 0, 30, 0.32);
    background: rgba(158, 0, 30, 0.1);
    color: var(--ci-white);
}

[data-chat-theme="dark"] .message-activity-chip--rejected .message-activity-chip__dot {
    background: var(--ci-dark-red);
}

[data-chat-theme="dark"] .message-activity-chip--rejected .message-activity-chip__status {
    background: rgba(158, 0, 30, 0.16);
    color: var(--ci-red-mid-2);
}

[data-chat-theme="dark"] .message-activity-chip--expired,
[data-chat-theme="dark"] .message-activity-chip--pending {
    border-color: var(--ci-dark-grey);
    background: var(--chat-surface-muted);
    color: var(--ci-grey);
}

[data-chat-theme="dark"] .message-activity-chip--expired .message-activity-chip__dot,
[data-chat-theme="dark"] .message-activity-chip--pending .message-activity-chip__dot {
    background: var(--ci-grey);
}

[data-chat-theme="dark"] .message-activity-chip--expired .message-activity-chip__status,
[data-chat-theme="dark"] .message-activity-chip--pending .message-activity-chip__status {
    background: rgba(118, 116, 120, 0.16);
    color: var(--ci-grey);
}

[data-chat-theme="dark"] .message-activity-knowledge-tabs__tab {
    border-color: var(--ci-dark-grey);
    background: rgba(54, 49, 49, 0.45);
    color: var(--ci-grey);
}

[data-chat-theme="dark"] .message-activity-knowledge-tabs__tab:hover {
    background: var(--chat-surface-hover);
    color: var(--ci-white);
}

[data-chat-theme="dark"] .message-activity-knowledge-tabs__tab.is-active {
    border-color: var(--message-activity-search-border);
    background: var(--message-activity-search-bg);
    color: var(--ci-white);
}

[data-chat-theme="dark"] .stream-activity__card {
    border-color: #363131;
    background: var(--chat-bg-card);
}

[data-chat-theme="dark"] .chat-stream-thought-panel {
    background: #171417;
    border-color: #363131;
}

[data-chat-theme="dark"] .chat-stream-thought-panel p {
    color: #ffffff;
}

[data-chat-theme="dark"] .stream-tool-strip {
    border-color: #363131;
    background: rgba(54, 49, 49, 0.35);
}

[data-chat-theme="dark"] .stream-tool-strip__row {
    border-top-color: #363131 !important;
}

[data-chat-theme="dark"] .stream-dot {
    background: #767478;
}

[data-chat-theme="dark"] .stream-skel {
    background: rgba(54, 49, 49, 0.72) !important;
}

[data-chat-theme="dark"] .stream-activity .text-chat-fg\/80 {
    color: #ffffff !important;
}

[data-chat-theme="dark"] .stream-activity .text-chat-fg\/55,
[data-chat-theme="dark"] .stream-activity .text-chat-fg\/60,
[data-chat-theme="dark"] .stream-activity .text-chat-fg\/40,
[data-chat-theme="dark"] .stream-activity .text-chat-fg\/45,
[data-chat-theme="dark"] .stream-activity .text-chat-fg\/35,
[data-chat-theme="dark"] .stream-activity .text-chat-fg\/30 {
    color: #767478 !important;
}

[data-chat-theme="dark"] .brain-selector-modal-card {
    border-color: #363131;
    background: var(--chat-bg-card);
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.55);
}

[data-chat-theme="dark"] .brain-selector-modal__title {
    color: #ffffff;
    font-weight: 600;
}

[data-chat-theme="dark"] .brain-selector-modal__subtitle,
[data-chat-theme="dark"] .brain-selector-modal__loading-hint,
[data-chat-theme="dark"] .brain-selector-modal__empty,
[data-chat-theme="dark"] .brain-selector-modal__footer-hint {
    color: #767478;
}

[data-chat-theme="dark"] .brain-selector-modal-body .capability-modal__header {
    border-bottom-color: #363131;
}

[data-chat-theme="dark"] .brain-selector-modal-body .capability-modal__header-icon {
    background: rgba(54, 49, 49, 0.55);
    border: 1px solid #363131;
}

[data-chat-theme="dark"] .brain-selector-modal__close {
    color: #767478;
}

[data-chat-theme="dark"] .brain-selector-modal__close:hover {
    color: #ffffff;
    background: rgba(54, 49, 49, 0.55);
}

[data-chat-theme="dark"] .brain-selector-modal__search {
    background: #171417;
    border-color: #363131;
    color: #ffffff;
}

[data-chat-theme="dark"] .brain-selector-modal__search::placeholder {
    color: #767478;
}

[data-chat-theme="dark"] .brain-selector-modal__search:focus {
    border-color: rgba(228, 0, 43, 0.35);
    background: var(--chat-bg-card);
}

[data-chat-theme="dark"] .brain-selector-modal__search-icon {
    color: #767478;
}

[data-chat-theme="dark"] .brain-selector-modal-body .capability-modal__filter-tabs {
    border-top-color: #363131;
}

[data-chat-theme="dark"] .brain-selector-modal-body .capability-modal__filter-tab {
    color: #767478;
}

[data-chat-theme="dark"] .brain-selector-modal-body .capability-modal__filter-tab:hover {
    color: #ffffff;
}

[data-chat-theme="dark"] .brain-selector-modal-body .capability-modal__filter-tab--active {
    color: #ffffff;
    border-bottom-color: #e4002b;
    font-weight: 600;
}

[data-chat-theme="dark"] .brain-selector-modal__footer {
    border-top-color: #363131;
}

[data-chat-theme="dark"] .brain-selector-skeleton-row__bar {
    background: linear-gradient(
        90deg,
        rgba(54, 49, 49, 0.55) 0%,
        rgba(118, 116, 120, 0.35) 50%,
        rgba(54, 49, 49, 0.55) 100%
    );
    background-size: 200% 100%;
    animation: brain-selector-skel-shimmer 1.5s ease-in-out infinite;
}

/* ── Integration picker modals (chat-picker-modal) ── */
[data-chat-theme="light"] .chat-picker-modal {
    background: var(--ci-white);
    border-color: var(--ci-light-grey);
    box-shadow:
        0 16px 40px -14px rgba(54, 49, 49, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[data-chat-theme="light"] .chat-picker-modal__footer {
    background: var(--ci-white);
    border-top-color: var(--ci-light-grey);
}

[data-chat-theme="dark"] .chat-picker-modal {
    background: var(--chat-bg-card);
    border-color: #363131;
}

[data-chat-theme="dark"] .chat-picker-modal__footer {
    background: var(--chat-bg-card);
    border-top-color: #363131;
}

[data-chat-theme="light"] .chat-picker-modal__title {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .chat-picker-modal__subtitle,
[data-chat-theme="light"] .chat-picker-modal__section-label,
[data-chat-theme="light"] .chat-picker-modal__hint,
[data-chat-theme="light"] .chat-picker-modal__empty,
[data-chat-theme="light"] .chat-picker-modal__row-muted {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-picker-modal__input {
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
    color: var(--ci-dark-grey);
    box-shadow: inset 0 1px 2px rgba(54, 49, 49, 0.04);
}

[data-chat-theme="light"] .chat-picker-modal__input:focus {
    background: var(--ci-white);
    border-color: rgba(var(--picker-accent-rgb), 0.38);
}

[data-chat-theme="light"] .chat-picker-modal__tabs {
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .chat-picker-modal__tab-bar {
    border-bottom-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .chat-picker-modal__list-shell,
[data-chat-theme="light"] .integration-picker-list-shell {
    border-color: var(--ci-light-grey);
    background: var(--ci-white);
}

[data-chat-theme="light"] .chat-picker-modal__panel {
    background: var(--ci-sand);
    border-color: var(--ci-light-grey);
}

[data-chat-theme="light"] .chat-picker-modal__tab--active {
    color: color-mix(in srgb, var(--picker-accent) 78%, #171417);
    background: rgba(var(--picker-accent-rgb), 0.1);
    border-color: rgba(var(--picker-accent-rgb), 0.24);
}

[data-chat-theme="dark"] .chat-picker-modal__tab--active {
    color: color-mix(in srgb, var(--picker-accent) 55%, #ffffff);
}

[data-chat-theme="light"] .chat-picker-modal__load-more-btn {
    background: var(--ci-white);
    border-color: var(--ci-light-grey);
    color: var(--ci-grey);
}

[data-chat-theme="light"] .chat-picker-modal__load-more-btn:hover {
    color: var(--ci-dark-grey);
    background: var(--ci-sand);
}

[data-chat-theme="light"] .integration-picker-skeleton,
[data-chat-theme="light"] .integration-picker-skeleton-root .integration-picker-skeleton.bg-chat-fg\/6,
[data-chat-theme="light"] .integration-picker-skeleton-root .integration-picker-skeleton.bg-chat-fg\/4 {
    background: linear-gradient(
        90deg,
        var(--ci-light-grey) 0%,
        rgba(118, 116, 120, 0.22) 50%,
        var(--ci-light-grey) 100%
    );
    background-size: 200% 100%;
    animation: integration-picker-skeleton-shimmer 1.5s ease-in-out infinite;
}

[data-chat-theme="dark"] .integration-picker-skeleton,
[data-chat-theme="dark"] .integration-picker-skeleton-root .integration-picker-skeleton.bg-chat-fg\/6,
[data-chat-theme="dark"] .integration-picker-skeleton-root .integration-picker-skeleton.bg-chat-fg\/4 {
    background: linear-gradient(
        90deg,
        rgba(54, 49, 49, 0.55) 0%,
        rgba(118, 116, 120, 0.35) 50%,
        rgba(54, 49, 49, 0.55) 100%
    );
    background-size: 200% 100%;
    animation: integration-picker-skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes integration-picker-skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

[data-chat-theme="light"] .gads-picker-tab--active {
    color: color-mix(in srgb, var(--picker-accent) 72%, #171417);
    background: rgba(var(--picker-accent-rgb), 0.14);
    border-color: rgba(var(--picker-accent-rgb), 0.28);
}

[data-chat-theme="light"] .gads-picker-status--enabled {
    color: var(--ci-green);
}

[data-chat-theme="light"] .gads-picker-status--amber,
[data-chat-theme="light"] .gads-picker-error {
    color: var(--ci-orange);
}

/* HITL integration embed cards (Slack-style unfurl) */
.hitl-embed-tabs {
    scrollbar-width: none;
}
.hitl-embed-tabs::-webkit-scrollbar {
    display: none;
}
.hitl-integration-embed-list__stack--message {
    margin-top: 0.375rem;
    padding-left: 0.125rem;
    contain: layout;
    position: relative;
    z-index: 0;
}

.hitl-integration-embed {
    --hitl-embed-vendor-accent: var(--hitl-embed-accent);
    position: relative;
    border: 1px solid var(--hitl-embed-border);
    border-radius: 0.875rem;
    background:
        radial-gradient(circle at 0 0, color-mix(in srgb, var(--hitl-embed-vendor-accent) 9%, transparent), transparent 9rem),
        var(--hitl-embed-bg);
    box-shadow: var(--hitl-embed-shadow);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hitl-integration-embed::before {
    content: "";
    position: absolute;
    left: 0.875rem;
    top: 0.5625rem;
    width: 2.25rem;
    height: 3px;
    border-radius: 9999px;
    background: var(--hitl-embed-vendor-accent);
}

.hitl-integration-embed:hover {
    border-color: color-mix(in srgb, var(--hitl-embed-vendor-accent) 24%, var(--hitl-embed-border));
    box-shadow: 0 16px 34px -25px rgb(var(--chat-fg-rgb) / 0.32), inset 0 1px 0 rgb(var(--chat-fg-rgb) / 0.06);
}

.hitl-integration-embed[data-vendor="jira"] {
    --hitl-embed-vendor-accent: var(--hitl-embed-accent-jira);
}

.hitl-integration-embed[data-vendor="confluence"] {
    --hitl-embed-vendor-accent: var(--hitl-embed-accent-confluence);
}

.hitl-integration-embed[data-vendor="gmail"] {
    --hitl-embed-vendor-accent: var(--hitl-embed-accent-gmail);
}

.hitl-integration-embed[data-vendor="gcalendar"] {
    --hitl-embed-vendor-accent: var(--hitl-embed-accent-gcalendar);
}

.hitl-integration-embed--compact {
    border-radius: 0.625rem;
}

.hitl-integration-embed--compact::before {
    left: 0.625rem;
    top: 0.4375rem;
    width: 1.5rem;
    height: 2px;
}

.hitl-integration-embed--muted {
    opacity: 0.78;
}

.hitl-integration-embed__header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.9375rem 0.875rem 0.6875rem;
}

.hitl-integration-embed--compact .hitl-integration-embed__header {
    padding: 0.75rem 0.625rem 0.5rem;
    gap: 0.5rem;
}

.hitl-integration-embed__icon {
    flex-shrink: 0;
    width: 2.125rem;
    height: 2.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    border: 1px solid color-mix(in srgb, var(--hitl-embed-vendor-accent) 22%, var(--hitl-embed-border));
    background: color-mix(in srgb, var(--hitl-embed-vendor-accent) 8%, var(--hitl-embed-bg));
    box-shadow: inset 0 1px 0 var(--hitl-embed-icon-inset-highlight);
}

.hitl-integration-embed__icon-inner--jira svg path {
    fill: var(--chat-brand-icon-jira);
}

.hitl-integration-embed__icon-inner--gmail svg path {
    fill: var(--ci-red);
}

.hitl-integration-embed--compact .hitl-integration-embed__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
}

.hitl-integration-embed__icon-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hitl-integration-embed__heading {
    flex: 1;
    min-width: 0;
}

.hitl-integration-embed__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--chat-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hitl-integration-embed__subtitle {
    margin: 0.125rem 0 0;
    font-size: 0.6875rem;
    line-height: 1.3;
    color: var(--chat-text-secondary, var(--ci-grey));
}

.hitl-integration-embed__status-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    padding: 0.1875rem 0.4375rem;
    border-radius: 9999px;
    border: 1px solid rgb(var(--chat-fg-rgb) / 0.12);
    color: rgb(var(--chat-fg-rgb) / 0.65);
    background: rgb(var(--chat-fg-rgb) / 0.05);
}

.hitl-integration-embed__status-badge--approved {
    color: var(--hitl-embed-status-approved-fg);
    border-color: var(--hitl-embed-status-approved-border);
    background: var(--hitl-embed-status-approved-bg);
}

.hitl-integration-embed__status-badge--rejected,
.hitl-integration-embed__status-badge--expired {
    color: var(--ci-orange);
    border-color: color-mix(in srgb, var(--ci-orange) 35%, transparent);
    background: color-mix(in srgb, var(--ci-orange) 10%, transparent);
}

.hitl-integration-embed__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.375rem;
    padding: 0 0.875rem 0.75rem;
}

.hitl-integration-embed--compact .hitl-integration-embed__meta {
    padding: 0 0.625rem 0.5rem;
    gap: 0.25rem;
}

.hitl-integration-embed__meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--hitl-embed-meta-border);
    border-radius: 0.625rem;
    background: var(--hitl-embed-meta-bg);
}

.hitl-integration-embed__meta-label {
    flex-shrink: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--chat-text-secondary, var(--ci-grey));
}

.hitl-integration-embed__meta-label::after {
    content: "";
}

.hitl-integration-embed__meta-value {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--chat-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hitl-integration-embed__meta-value--pill {
    display: inline-block;
    max-width: 100%;
    padding: 0 0.3125rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    background: color-mix(in srgb, var(--hitl-embed-vendor-accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--hitl-embed-vendor-accent) 18%, transparent);
}

.hitl-integration-embed__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    padding: 0 0.875rem 0.875rem;
}

.hitl-integration-embed--compact .hitl-integration-embed__footer {
    padding: 0 0.625rem 0.625rem;
}

.hitl-integration-embed__time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    color: var(--chat-text-secondary, var(--ci-grey));
}

.hitl-integration-embed__time-icon {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
}

.hitl-integration-embed__timestamp {
    font-size: 0.625rem;
    color: var(--chat-text-secondary, var(--ci-grey));
    text-transform: capitalize;
}

.hitl-integration-embed__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.4375rem 0.625rem;
    border-radius: 0.5rem;
    color: var(--ci-white);
    background: var(--ci-red);
    border: 1px solid var(--ci-red);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 5px 12px -8px color-mix(in srgb, var(--ci-red) 70%, transparent);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hitl-integration-embed__cta:hover {
    color: var(--ci-white);
    background: var(--ci-dark-red);
    border-color: var(--ci-dark-red);
    box-shadow: 0 7px 15px -8px color-mix(in srgb, var(--ci-red) 82%, transparent);
}

.hitl-integration-embed__cta:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ci-red) 42%, transparent);
    outline-offset: 2px;
}

.hitl-integration-embed__cta-icon {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
}

.hitl-integration-embed--muted .hitl-integration-embed__cta {
    display: none;
}

.hitl-integration-embed-overflow {
    font-size: 0.6875rem;
    line-height: 1.25;
    color: var(--ci-grey);
}

[data-chat-theme="light"] .hitl-integration-embed__title {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .hitl-integration-embed__subtitle {
    color: var(--ci-grey);
}

[data-chat-theme="light"] .hitl-integration-embed__meta-value {
    color: var(--ci-dark-grey);
}

[data-chat-theme="light"] .hitl-integration-embed__status-badge {
    color: var(--ci-grey);
    border-color: var(--ci-light-grey);
    background: var(--chat-bg-inset);
}

[data-chat-theme="light"] .hitl-integration-embed__status-badge--approved {
    color: var(--hitl-embed-status-approved-fg);
    border-color: var(--hitl-embed-status-approved-border);
    background: var(--hitl-embed-status-approved-bg);
}

[data-chat-theme="light"] .hitl-integration-embed__status-badge--rejected,
[data-chat-theme="light"] .hitl-integration-embed__status-badge--expired {
    color: color-mix(in srgb, var(--ci-orange) 58%, var(--ci-dark-grey));
}

