/*
 * Shared dark appearance.
 *
 * This file is loaded last by the public shell so the appearance setting has
 * one authoritative palette even when an older feature stylesheet contains
 * literal light colours. Keep light mode in the page styles; dark mode lives
 * here and is shared by the home, feature, research and safety surfaces.
 */

html[data-ui-theme="dark"] {
    color-scheme: dark;
    --fuuvo-dark-bg: #0f141d;
    --fuuvo-dark-sidebar: #151b25;
    --fuuvo-dark-topbar: rgba(15, 20, 29, .93);
    --fuuvo-dark-surface: #1a222e;
    --fuuvo-dark-surface-raised: #202a38;
    --fuuvo-dark-surface-soft: #182332;
    --fuuvo-dark-input: #161e29;
    --fuuvo-dark-line: rgba(226, 232, 240, .11);
    --fuuvo-dark-line-strong: rgba(226, 232, 240, .18);
    --fuuvo-dark-text: #f8fafc;
    --fuuvo-dark-text-soft: #eef2f7;
    --fuuvo-dark-muted: #d1d9e5;
    --fuuvo-dark-blue: #6ba8ff;
    --fuuvo-dark-blue-soft: rgba(77, 145, 255, .13);
    --fuuvo-dark-blue-line: rgba(107, 168, 255, .42);
    --fuuvo-dark-warning: #f3bd65;
    --fuuvo-dark-warning-bg: #2a241a;
    --fuuvo-dark-warning-line: rgba(243, 189, 101, .34);
    --fuuvo-dark-danger: #ff8d98;
    --fuuvo-dark-danger-bg: #2b1d22;
    --fuuvo-dark-success: #62d6a7;

    --bg: var(--fuuvo-dark-bg);
    --panel: rgba(26, 34, 46, .94);
    --panel-strong: var(--fuuvo-dark-surface);
    --line: var(--fuuvo-dark-line);
    --line-strong: var(--fuuvo-dark-line-strong);
    --text: var(--fuuvo-dark-text);
    --ink: var(--fuuvo-dark-text);
    --muted: var(--fuuvo-dark-muted);
    --brand: var(--fuuvo-dark-blue);
    --brand-strong: #b8d4ff;
    --brand-soft: var(--fuuvo-dark-blue-soft);

    --creation-ink: var(--fuuvo-dark-text);
    --creation-muted: var(--fuuvo-dark-muted);
    --creation-line: var(--fuuvo-dark-line);
    --creation-blue: var(--fuuvo-dark-blue);
    --creation-soft: var(--fuuvo-dark-blue-soft);
    --analysis-ink: var(--fuuvo-dark-text);
    --analysis-text: var(--fuuvo-dark-text-soft);
    --analysis-muted: var(--fuuvo-dark-muted);
    --analysis-line: var(--fuuvo-dark-line);
    --analysis-soft: var(--fuuvo-dark-surface-soft);
    --analysis-blue: var(--fuuvo-dark-blue);
    --analysis-blue-dark: #84b7ff;
    --detail-ink: var(--fuuvo-dark-text);
    --detail-muted: var(--fuuvo-dark-muted);
    --detail-line: var(--fuuvo-dark-line);
    --detail-blue: var(--fuuvo-dark-blue);
    --food-ink: var(--fuuvo-dark-text);
    --food-muted: var(--fuuvo-dark-muted);
    --food-line: var(--fuuvo-dark-line);
    --food-blue: var(--fuuvo-dark-blue);
    --food-soft: var(--fuuvo-dark-blue-soft);
    --fortune-ink: var(--fuuvo-dark-text);
    --fortune-muted: var(--fuuvo-dark-muted);
    --fortune-line: var(--fuuvo-dark-line);
    --fortune-blue: var(--fuuvo-dark-blue);
    --fortune-soft: var(--fuuvo-dark-blue-soft);
    --office-ink: var(--fuuvo-dark-text);
    --office-muted: var(--fuuvo-dark-muted);
    --office-line: var(--fuuvo-dark-line);
    --office-blue: var(--fuuvo-dark-blue);
    --sr-ink: var(--fuuvo-dark-text);
    --sr-text: var(--fuuvo-dark-text-soft);
    --sr-muted: var(--fuuvo-dark-muted);
    --sr-line: var(--fuuvo-dark-line);
    --sr-soft: var(--fuuvo-dark-surface-soft);
    --sr-blue: var(--fuuvo-dark-blue);
    --ss-deep: var(--fuuvo-dark-text);
    --ss-text: var(--fuuvo-dark-text-soft);
    --ss-muted: var(--fuuvo-dark-muted);
    --ss-line: var(--fuuvo-dark-line);
    --ss-pale: var(--fuuvo-dark-surface-soft);
    --ss-blue: var(--fuuvo-dark-blue);
    --ac-deep: var(--fuuvo-dark-text);
    --ac-text: var(--fuuvo-dark-text-soft);
    --ac-muted: var(--fuuvo-dark-muted);
    --ac-line: var(--fuuvo-dark-line);
    --ac-soft: var(--fuuvo-dark-surface-soft);
    --ac-blue: var(--fuuvo-dark-blue);
}

html[data-ui-theme="dark"],
body[data-ui-theme="dark"] {
    background: var(--fuuvo-dark-bg) !important;
    color: var(--fuuvo-dark-text-soft);
}

body[data-ui-theme="dark"] ::selection {
    background: rgba(107, 168, 255, .32);
    color: #fff;
}

body[data-ui-theme="dark"] :is(input, textarea, select) {
    caret-color: var(--fuuvo-dark-blue);
}

body[data-ui-theme="dark"] :is(input, textarea)::placeholder {
    color: var(--fuuvo-dark-muted) !important;
    opacity: 1;
}

body[data-ui-theme="dark"] :is([data-fuuvo-app-shell="1"], .creation-app, .portal-shell, .feature-shell, .app) {
    background: var(--fuuvo-dark-bg) !important;
    color: var(--fuuvo-dark-text-soft);
}

body[data-ui-theme="dark"] :is([data-fuuvo-app-workspace="1"], .creation-workspace, .portal-content, .feature-content, .workspace) {
    background: var(--fuuvo-dark-bg) !important;
}

body[data-ui-theme="dark"] [data-fuuvo-app-scroll="1"] {
    color: var(--fuuvo-dark-text-soft);
    scrollbar-color: #3a485c transparent;
}

body[data-ui-theme="dark"] [data-fuuvo-app-scroll="1"]::-webkit-scrollbar,
body[data-ui-theme="dark"] .conversation-list::-webkit-scrollbar,
body[data-ui-theme="dark"] .portal-recent-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body[data-ui-theme="dark"] [data-fuuvo-app-scroll="1"]::-webkit-scrollbar-thumb,
body[data-ui-theme="dark"] .conversation-list::-webkit-scrollbar-thumb,
body[data-ui-theme="dark"] .portal-recent-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #3a485c;
    background-clip: padding-box;
}

/* Shared sidebar, top bar and global dialogs. */
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"],
body[data-ui-theme="dark"] :is(.creation-app, .portal-shell, .feature-shell) > aside[data-fuuvo-shared-sidebar="1"] {
    border-right-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-sidebar) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-search-trigger {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-input) !important;
    color: var(--fuuvo-dark-muted) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .15) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-search-trigger-shortcut {
    background: rgba(255, 255, 255, .06) !important;
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(
    .sidebar-search-trigger-label, .viewer-meta, .settings-inline-help,
    .auth-legal-check, .auth-legal-note, .conversation-empty-state,
    .status-text, .workspace-disclaimer
) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-brand-logo img, .brand-logo img) {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-nav, .portal-nav) {
    border-color: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-nav-btn, .portal-nav a, .conversation-item, .portal-recent-list a, .portal-recent-empty, .sidebar-safety-link, .portal-safety-link) {
    border-color: transparent !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-section-label, .portal-recent h2, .conversation-time, .portal-recent-time) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.history-main, .portal-recent, .history-account, .sidebar-safety-link, .portal-safety-link) {
    border-color: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-nav-btn:not(#sidebar-new-chat):hover, .sidebar-nav-btn:not(#sidebar-new-chat).active, .portal-nav a:hover, .portal-nav a.active, .conversation-item:hover, .conversation-item.active, .portal-recent-list a:hover) {
    background: var(--fuuvo-dark-blue-soft) !important;
    color: #8bbcff !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: transparent !important;
    color: #7fb4ff !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat):hover {
    background: var(--fuuvo-dark-blue-soft) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-toggle, .sidebar-account-menu.is-open .sidebar-account-toggle) {
    background: #202a38 !important;
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-settings, .sidebar-account-name, .sidebar-account-chevron) {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-account-settings.is-active {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
    box-shadow: 0 0 0 3px rgba(107, 168, 255, .08) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .workspace-header-user-fallback.guest-avatar {
    border-color: var(--fuuvo-dark-line) !important;
    background: #202a38 !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.workspace-header-user-fallback.guest-avatar img, .sidebar-account-settings img) {
    filter: brightness(0) saturate(100%) invert(69%) sepia(68%) saturate(2347%) hue-rotate(189deg) brightness(103%) contrast(102%);
}

body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-account-settings:hover {
    background: rgba(255, 255, 255, .07) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"],
body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace-chat-header {
    border-bottom-color: var(--fuuvo-dark-line) !important;
    background: linear-gradient(180deg, rgba(15, 20, 29, .98) 0%, rgba(15, 20, 29, .92) 84%, rgba(15, 20, 29, 0) 100%) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(#feature-shell-title, .portal-topbar-title, .workspace-chat-header-center strong, .shell-topbar-suffix, .shell-topbar-middle),
body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace-chat-header-center strong {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .portal-top-safety-link, .ui-language-switch-btn, .portal-sidebar-toggle, .creation-sidebar-toggle, .desktop-history-toggle, .chat-detail-back) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(.creation-language, .portal-language) a {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(.creation-language, .portal-language) a.active {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(.ui-language-switch-btn.active, .workspace-header-link:hover, .portal-top-safety-link:hover, .portal-sidebar-toggle:hover, .creation-sidebar-toggle:hover, .desktop-history-toggle:hover, .chat-detail-back:hover) {
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"][data-mode="chat"] .chat-detail-back-mobile {
    background: transparent !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"][data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"][data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch-btn {
    background: transparent !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"][data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch-btn.active {
    background: transparent !important;
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"][data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch-btn:not(.active) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"][data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch-btn + .ui-language-switch-btn {
    border-left-color: var(--fuuvo-dark-line-strong) !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-login, .creation-login, .portal-login) {
    background: #d9e8fb !important;
    color: #142236 !important;
}

body[data-ui-theme="dark"] .fuuvo-shell-search {
    background: rgba(3, 7, 14, .62);
}

body[data-ui-theme="dark"] .fuuvo-shell-search-dialog,
body[data-ui-theme="dark"] .topbar-explore-menu,
body[data-ui-theme="dark"] .topbar-settings-drawer,
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-dropdown, .sidebar-quick-settings),
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-quick-settings::before,
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-quick-settings::after {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: #18212d !important;
    color: var(--fuuvo-dark-text) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42) !important;
}

body[data-ui-theme="dark"] .fuuvo-shell-search-head,
body[data-ui-theme="dark"] :is(.topbar-explore-menu section + section, .topbar-explore-powered, .topbar-settings-drawer-head, .topbar-settings-group, .topbar-settings-panel-back),
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-links, .sidebar-quick-settings-divider, .sidebar-quick-settings-footer, .sidebar-quick-settings-back) {
    border-color: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"] .fuuvo-shell-search-input-wrap {
    background: var(--fuuvo-dark-input) !important;
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .fuuvo-shell-search-input-wrap input,
body[data-ui-theme="dark"] .fuuvo-shell-search-close,
body[data-ui-theme="dark"] .fuuvo-shell-search-create,
body[data-ui-theme="dark"] .fuuvo-shell-search-results a,
body[data-ui-theme="dark"] .topbar-explore-menu a,
body[data-ui-theme="dark"] .topbar-settings-drawer :is(h2, button, a),
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-dropdown strong, .sidebar-account-links > a, .sidebar-quick-settings-title, .sidebar-quick-settings-row, .sidebar-quick-settings-back, .sidebar-quick-settings-option) {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.fuuvo-shell-search-create, .fuuvo-shell-search-results a, .fuuvo-shell-search-close, .topbar-explore-menu a, .topbar-settings-row, .topbar-settings-option):hover,
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-links > a, .sidebar-account-guest, .sidebar-account-logout, .sidebar-quick-settings-row, .sidebar-quick-settings-option):hover {
    background: rgba(255, 255, 255, .06) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .fuuvo-shell-search-section-title,
body[data-ui-theme="dark"] .fuuvo-shell-search-results p,
body[data-ui-theme="dark"] .fuuvo-shell-search-create small,
body[data-ui-theme="dark"] .topbar-explore-menu h2,
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.sidebar-account-dropdown p, .sidebar-quick-settings-value, .sidebar-quick-settings-footer) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .fuuvo-ai-disclaimer {
    border-top-color: var(--fuuvo-dark-line);
    color: var(--fuuvo-dark-muted);
}

body[data-ui-theme="dark"] .fuuvo-ai-disclaimer a {
    color: var(--fuuvo-dark-blue) !important;
}

/* Chat home and conversation workspace. */
body[data-ui-theme="dark"].chat-landing[data-mode="chat"],
body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.app, .workspace) {
    background: var(--fuuvo-dark-bg) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .history {
    border-right-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-sidebar) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.sidebar-nav-btn, .conversation-title, .conversation-item-icon, .workspace-account-toggle, .sidebar-account-name, .sidebar-account-chevron) {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.sidebar-section-label, .conversation-time) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.history-main, .history-account) {
    border-color: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.sidebar-nav-btn:not(#sidebar-new-chat):hover, .sidebar-nav-btn:not(#sidebar-new-chat).active, .conversation-item:hover, .conversation-item.active) {
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] #sidebar-new-chat {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: transparent !important;
    color: #7fb4ff !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] aside[data-fuuvo-shared-sidebar="1"] #sidebar-new-chat.active,
body[data-ui-theme="dark"].chat-landing[data-mode="chat"] aside[data-fuuvo-shared-sidebar="1"] #sidebar-new-chat:hover {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: #8bbcff !important;
}

body[data-ui-theme="dark"] #sidebar-new-chat.sidebar-nav-btn {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: transparent !important;
    color: #7fb4ff !important;
}

body[data-ui-theme="dark"] #sidebar-new-chat.sidebar-nav-btn.active,
body[data-ui-theme="dark"] #sidebar-new-chat.sidebar-nav-btn:hover {
    background: var(--fuuvo-dark-blue-soft) !important;
    color: #8bbcff !important;
}

body[data-ui-theme="dark"] .workspace-account-toggle.sidebar-account-toggle,
body[data-ui-theme="dark"] .workspace-account-menu.is-open .workspace-account-toggle.sidebar-account-toggle {
    border-color: transparent !important;
    background: var(--fuuvo-dark-surface-raised) !important;
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.composer-title, .workspace-chat-header-center strong) {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.composer-desc, .chat-input-hint, .workspace-disclaimer) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface-raised) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .24) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap textarea {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-tool-btn {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: #18212d !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .composer-capability-btn {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .composer-capability-btn:hover,
body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .composer-capability-btn.active {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: #8bbcff !important;
}

body[data-ui-theme="dark"] .core-feature-btn {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] .core-feature-btn:hover {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] :is(.message-bubble, .assistant-message, .chat-message, .card, .guest-hero-main, .composer):not(.hero) {
    border-color: var(--fuuvo-dark-line);
}

body[data-ui-theme="dark"] .chat-bubble.assistant {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] .chat-bubble.assistant :is(p, div, span):not(.message-action-label) {
    color: inherit;
}

body[data-ui-theme="dark"] :is(.mobile-sheet, .mobile-account-sheet, .mobile-composer-sheet, .mobile-chat-more-sheet) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface-raised) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.mobile-sheet, .mobile-account-sheet, .mobile-composer-sheet, .mobile-chat-more-sheet) :is(.btn.secondary, button.secondary) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-input) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

/* Shared surfaces used by creation, research, analysis, food, fortune and office. */
body[data-ui-theme="dark"] :is(.creation-main, .analysis-main, .food-main, .fortune-main, .office-main, .portal-main, .feature-shell .main) {
    color: var(--fuuvo-dark-text-soft);
}

body[data-ui-theme="dark"] .pricing-main {
    color: var(--fuuvo-dark-text-soft);
}

body[data-ui-theme="dark"] .pricing-heading :is(h1, p) {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] .pricing-heading p {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .pricing-card {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] .pricing-card.featured {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: linear-gradient(145deg, #1b2737, #1a222e) !important;
}

body[data-ui-theme="dark"] .pricing-card :is(h2, p, li) {
    color: inherit !important;
}

body[data-ui-theme="dark"] .pricing-card :is(a, span.action) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: transparent !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .pricing-card.featured a {
    background: #2d78e8 !important;
    color: #fff !important;
}

body[data-ui-theme="dark"] :is(.creation-heading, .research-home-heading, .research-detail-title, .analysis-heading, .food-heading, .fortune-hero, .office-heading) h1,
body[data-ui-theme="dark"] :is(.creation-main, .analysis-main, .food-main, .fortune-main, .office-main) :is(h2, h3, strong) {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] :is(.creation-heading, .research-home-heading, .research-detail-title, .analysis-heading, .food-heading, .fortune-hero, .office-heading) p,
body[data-ui-theme="dark"] :is(.creation-main, .analysis-main, .food-main, .fortune-main, .office-main) :is(small, .muted) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(.creation-main, .analysis-main, .food-main, .fortune-main, .office-main) :is(input, textarea, select) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-input) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(
    .creation-visual-card, .work-card, .voice-card, .writing-card, .reference-card, .setting-option,
    .project-asset, .brand-panel, .team-panel, .result-variant, .creation-detail-card, .detail-option,
    .poster-option, .poster-style, .edit-tool-row button, .compare-handle,
    .research-tool-card, .research-panel, .research-detail-card, .detail-chip-row button, .detail-option-row button,
    .transcription-guide, .translation-selected-file, .translation-file-icon,
    .analysis-upload-drop, .analysis-prompt, .analysis-quick-pills button, .analysis-panel, .analysis-card,
    .food-location-panel, .food-location-current, .food-location-input, .food-filter, .food-quick-card,
    .food-method-panel, .food-method-panel button, .food-refine-panel, .food-refine-panel > button,
    .food-before-panel, .food-suggestion, .food-info-panel, .food-restaurant-card, .food-continue-card,
    .fortune-entry, .fortune-methods, .fortune-explain, .fortune-panel, .fortune-choice, .fortune-topic-grid button,
    .fortune-keywords, .fortune-reading-grid article, .fortune-question-strip, .fortune-action-strip,
    .fortune-continue, .inspiration-card, .fortune-inspiration-side > a,
    .office-workflow-card, .office-recent-card, .office-outline-button, .office-search-dialog
) {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] :is(
    .learning-panel, .learning-help-card, .learning-tool, .learning-mode,
    .analysis-side, .analysis-method, .analysis-file, .analysis-finding,
    .conclusion-panel, .research-result-card, .source-panel, .operation-panel, .source-item
) {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] :is(.analysis-method.active, .learning-mode.active, .research-variant.active) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .fortune-depth-options button {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] .fortune-depth-options button.active {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue) !important;
    color: #fff !important;
}

body[data-ui-theme="dark"] .fortune-depth-options button.is-premium-locked:disabled {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface-soft) !important;
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .fortune-depth-note {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(.analysis-side, .conclusion-panel, .source-panel, .operation-panel, .research-result-card) :is(h2, h3, strong, p, li, span) {
    color: inherit !important;
}

body[data-ui-theme="dark"] .research-result-card.inference {
    border-color: rgba(167, 139, 250, .35) !important;
    background: #211f31 !important;
}

body[data-ui-theme="dark"] .research-result-card.verify {
    border-color: var(--fuuvo-dark-warning-line) !important;
    background: var(--fuuvo-dark-warning-bg) !important;
}

body[data-ui-theme="dark"] :is(.creation-outline, .creation-pill, .research-outline, .food-location-current, .office-outline-button) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: transparent !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .learning-answer-input img {
    filter: brightness(0) invert(1);
    opacity: .75;
}

body[data-ui-theme="dark"] img[src$="fuuvo-exam-practice.svg"] {
    filter: brightness(0) invert(1);
    opacity: .75;
}

body[data-ui-theme="dark"] .creation-category-tabs a {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] .quota-box {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] .creation-category-tabs a:hover,
body[data-ui-theme="dark"] .creation-category-tabs a.active {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .creation-app-entry {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] .creation-app-entry:hover {
    background: var(--fuuvo-dark-surface-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] :is(.creation-visual-card, .work-card, .writing-card, .research-tool-card, .food-filter, .food-quick-card, .fortune-entry, .office-workflow-card):hover {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-surface-soft) !important;
}

body[data-ui-theme="dark"] :is(.creation-search-dialog, .office-search-dialog) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface-raised) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42) !important;
}

body[data-ui-theme="dark"] :is(.creation-search-results, #creation-search-results, .office-search-results) a:hover {
    background: rgba(255, 255, 255, .06) !important;
}

body[data-ui-theme="dark"] :is(
    .creation-primary, .detail-submit, .analysis-primary, .research-primary,
    .office-primary-button, .food-prompt-box button, .fortune-primary,
    .portal-button.primary, .rr-primary, .ac-primary-button, .dc-primary-button
) {
    border-color: #2d78e8 !important;
    background: #2d78e8 !important;
    color: #fff !important;
}

body[data-ui-theme="dark"] :is(
    .creation-primary, .detail-submit, .analysis-primary, .research-primary,
    .office-primary-button, .food-prompt-box button, .fortune-primary,
    .portal-button.primary, .rr-primary, .ac-primary-button, .dc-primary-button
):hover {
    border-color: #3c86f2 !important;
    background: #3c86f2 !important;
}

body[data-ui-theme="dark"] :is(.office-start-panel, .voice-notice, .result-media-stage) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: linear-gradient(120deg, #172333, #1b2634) !important;
}

body[data-ui-theme="dark"] .food-prompt-box {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface-raised) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .2) !important;
}

body[data-ui-theme="dark"] .food-prompt-box input {
    background: transparent !important;
}

body[data-ui-theme="dark"] .analysis-upload-drop:hover,
body[data-ui-theme="dark"] .analysis-upload-drop.dragging {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
}

body[data-ui-theme="dark"] :is(.analysis-selected-files, .learning-question-upload) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-surface-soft) !important;
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .learning-question-upload > [data-upload-preview] {
    background: var(--fuuvo-dark-surface) !important;
}

body[data-ui-theme="dark"] .learning-upload-empty strong {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] .learning-upload-file {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(
    .analysis-process-panel, .analysis-process-panel article, .analysis-uploaded-file, .analysis-add-file,
    .analysis-method-option, .analysis-output-row button, .analysis-settings-side, .analysis-conclusion,
    .analysis-result-three article, .analysis-data-panel, .analysis-result-side, .analysis-outline,
    .analysis-followup
) {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] .analysis-method-option.active {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
}

body[data-ui-theme="dark"] .analysis-loading-placeholder,
body[data-ui-theme="dark"] .analysis-loading-copy {
    background: var(--fuuvo-dark-surface-soft) !important;
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(.analysis-process-panel, .analysis-settings-side, .analysis-conclusion, .analysis-result-three article, .analysis-data-panel, .analysis-result-side) :is(h2, h3, strong, p) {
    color: inherit !important;
}

body[data-ui-theme="dark"] .analysis-settings-side hr {
    background: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"] .fortune-entry > img {
    mix-blend-mode: normal;
}

/* Safety, transparency, AI information and account/data controls. */
body[data-ui-theme="dark"] :is(.portal-main, .safety-redesign-page, .safety-safe-page, .safety-report-page, .safety-account-page, .data-control-page, .ai-card-redesign) {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.portal-main, .safety-redesign-page, .safety-safe-page, .safety-report-page, .safety-account-page, .data-control-page, .ai-card-redesign) :is(h1, h2, h3, strong),
body[data-ui-theme="dark"] :is(.portal-hero, .portal-heading, .sr-heading, .ss-hero, .rr-heading, .ac-heading, .dc-heading, .ai-card-heading) h1 {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] :is(.portal-main, .safety-redesign-page, .safety-safe-page, .safety-report-page, .safety-account-page, .data-control-page, .ai-card-redesign) :is(p, small, .muted) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .ai-card-capabilities > p a,
body[data-ui-theme="dark"] .ai-card-legal a,
body[data-ui-theme="dark"] :is(.portal-main, .safety-redesign-page, .safety-safe-page, .safety-report-page, .safety-account-page, .data-control-page, .ai-card-redesign) a.portal-link {
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .ai-card-heading > span {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(
    .portal-featured, .portal-help-card, .portal-action-card, .portal-feature-card, .portal-control-card,
    .portal-contact-card, .capability-card, .capabilities-card, .capabilities-toc, .ai-info-toc,
    .community-rules-toc, .community-standard-card, .community-report-box, .community-contact-box,
    .safety-page-toc, .safety-inline-card, .safety-link-card, .sr-feature-card, .sr-wide-card,
    .sr-content-grid article, .ss-entry-grid > a, .ss-decision-grid article, .ss-safety-steps,
    .ss-list-panel, .ss-minor-grid article, .ss-research-card, .ss-feedback-card,
    .rr-panel, .rr-record-list > button, .rr-appeal-link, .rr-before-panel article,
    .ac-panel, .ac-home-grid > a, .ac-contact-cards article, .ac-policy-timeline article,
    .ac-chat-list, .ac-chat-row, .dc-panel, .ai-card-toc, .ai-card-panel
) {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: none !important;
}

body[data-ui-theme="dark"] :is(
    .portal-featured, .sr-feature-card, .sr-banner, .sr-process, .sr-login-banner,
    .ss-warning-banner, .ss-report-callout, .ss-minor-banner, .ss-verify-steps,
    .rr-record-box, .rr-notice, .rr-sensitive-note,
    .ac-training-banner, .ac-info-strip, .ac-support-strip,
    .dc-training-banner, .dc-login-banner, .dc-support-strip, .dc-login-inline,
    .ai-card-glance, .ai-info-overview, .community-responsible-list, .community-enforcement-flow > div
) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: linear-gradient(120deg, #172333, #1b2634) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.portal-risk-list, .safe-use-risk-list, .ai-info-risk-list, .ai-card-risks, .community-prohibited-list, .safety-info-callout.warn, .ss-warning-banner, .ac-emergency, .dc-warning-banner) {
    border-color: var(--fuuvo-dark-warning-line) !important;
    background: var(--fuuvo-dark-warning-bg) !important;
    color: #e8cfaa !important;
}

body[data-ui-theme="dark"] :is(.portal-risk-list, .safe-use-risk-list, .ai-info-risk-list, .ai-card-risks, .community-prohibited-list, .safety-info-callout.warn, .ss-warning-banner, .ac-emergency, .dc-warning-banner) :is(strong, span, p, small) {
    color: #e8cfaa !important;
}

body[data-ui-theme="dark"] :is(.ac-danger-button, .ac-danger-outline, .dc-danger-button, .dc-danger-outline, .result-status.failed, .result-media-state.failed) {
    border-color: rgba(255, 141, 152, .42) !important;
    background: var(--fuuvo-dark-danger-bg) !important;
    color: var(--fuuvo-dark-danger) !important;
}

body[data-ui-theme="dark"] :is(.portal-main, .safety-redesign-page, .safety-safe-page, .safety-report-page, .safety-account-page, .data-control-page, .ai-card-redesign) :is(input, textarea, select),
body[data-ui-theme="dark"] :is(.rr-input, .rr-textarea textarea, .ac-policy-tabs button, .ac-current-policy button, .ac-export-email input, .ac-chat-search, .ac-chat-search input, .ac-support-form input, .ac-support-form select, .ac-support-form textarea) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-input) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] .rr-field-title,
body[data-ui-theme="dark"] .rr-category-grid label {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] .rr-category-grid label:has(input:checked) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] .rr-record-box > span {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-featured-actions > a, .ai-card-report-grid > a, .ai-card-controls > div > a, .ss-action-grid > a, .rr-record-box a, .rr-record-button, .ac-contact-cards a) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: transparent !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-featured-actions > a, .ai-card-report-grid > a, .ai-card-controls > div > a, .ss-action-grid > a, .rr-record-box a, .rr-record-button):hover {
    background: var(--fuuvo-dark-blue-soft) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-glance-grid > a, .ai-card-data-grid > a, .ac-more-links a, .ss-list-panel > a, .safety-page-tabs a + a, .community-policy-tabs, .account-policy-links, .ac-chat-row, .rr-record-tabs button) {
    border-color: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-toc a, .ai-info-toc a, .capabilities-toc a, .community-rules-toc a, .safety-page-toc a, .ac-policy-tabs button, .rr-record-tabs button) {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-glance-grid > a, .ai-card-data-grid > a) {
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-glance-grid > a, .ai-card-data-grid > a) :is(strong, span) {
    color: inherit !important;
}

body[data-ui-theme="dark"] :is(.ai-card-glance-grid > a, .ai-card-data-grid > a) small {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .ai-card-risks > a {
    border-color: var(--fuuvo-dark-warning-line) !important;
    color: #e8cfaa !important;
}

body[data-ui-theme="dark"] .ai-card-toc a span {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] .ai-card-toc a:hover span,
body[data-ui-theme="dark"] .ai-card-toc a.active span {
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] :is(.ai-card-toc a, .ai-info-toc a, .capabilities-toc a, .community-rules-toc a, .safety-page-toc a, .ac-policy-tabs button, .rr-record-tabs button):hover,
body[data-ui-theme="dark"] :is(.ai-card-toc a, .ai-info-toc a, .capabilities-toc a, .community-rules-toc a, .safety-page-toc a, .ac-policy-tabs button, .rr-record-tabs button).active {
    background: var(--fuuvo-dark-blue-soft) !important;
    color: var(--fuuvo-dark-blue) !important;
}

body[data-ui-theme="dark"] :is(.portal-icon-circle, .report-feature-icon, .report-process-icon, .account-data-number, .account-control-icon, .account-contact-icon, .community-report-icon, .ac-contact-cards i, .ac-process-panel i, .ac-policy-notice > svg, .ac-chat-delete h2 i, .ss-list-panel i, .rr-record-box > svg, .rr-before-panel article i) {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
}

body[data-ui-theme="dark"] :is(.ac-account-delete h2 i, .ss-list-panel.danger i) {
    border-color: rgba(255, 141, 152, .36) !important;
    background: var(--fuuvo-dark-danger-bg) !important;
}

body[data-ui-theme="dark"] :is(.result-status.success, .rr-status.success, .ac-status.success) {
    color: var(--fuuvo-dark-success) !important;
}

@media (max-width: 920px) {
    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"],
    body[data-ui-theme="dark"] [data-fuuvo-app-shell="1"] > aside[data-fuuvo-shared-sidebar="1"] {
        background: var(--fuuvo-dark-sidebar) !important;
        color: var(--fuuvo-dark-text-soft) !important;
        box-shadow: 18px 0 42px rgba(0, 0, 0, .36) !important;
    }

    body[data-ui-theme="dark"] .fuuvo-mobile-sidebar-auth {
        border-color: var(--fuuvo-dark-line) !important;
    }

    body[data-ui-theme="dark"] :is(.fuuvo-mobile-sidebar-auth p, .fuuvo-mobile-explore h2, .fuuvo-mobile-powered) {
        color: var(--fuuvo-dark-muted) !important;
    }

    body[data-ui-theme="dark"] .fuuvo-mobile-explore a,
    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(.conversation-title, .conversation-item-icon) {
        color: var(--fuuvo-dark-text-soft) !important;
    }

    body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] {
        background: rgba(15, 20, 29, .96) !important;
    }

    body[data-ui-theme="dark"] :is(.mobile-nav-pill, .mobile-chat-toolbar, .mobile-chat-toolbar-btn, .mobile-chat-more-item) {
        border-color: var(--fuuvo-dark-line-strong) !important;
        background: var(--fuuvo-dark-surface) !important;
        color: var(--fuuvo-dark-text-soft) !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"] :is(.mobile-nav-pill, .mobile-chat-toolbar-btn, .mobile-chat-more-item):hover,
    body[data-ui-theme="dark"] :is(.mobile-nav-pill, .mobile-chat-toolbar-btn, .mobile-chat-more-item).active {
        border-color: var(--fuuvo-dark-blue-line) !important;
        background: var(--fuuvo-dark-blue-soft) !important;
        color: var(--fuuvo-dark-blue) !important;
    }
}

/* Authentication and access pages keep the selected appearance too. */
body[data-ui-theme="dark"] :is(.auth-page, .auth-main) {
    background: var(--fuuvo-dark-bg) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.auth-header, .auth-footer) {
    border-color: var(--fuuvo-dark-line) !important;
    background: var(--fuuvo-dark-sidebar) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.auth-card, .legal-dialog, .shell, body > .card) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-surface) !important;
    color: var(--fuuvo-dark-text-soft) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34) !important;
}

body[data-ui-theme="dark"] :is(.auth-title, .auth-card label, .legal-head h3, .panel h2, body > .card h1) {
    color: var(--fuuvo-dark-text) !important;
}

body[data-ui-theme="dark"] :is(.auth-subtitle, .helper, .legal-check, .consent-note, .age-note, .legal-content, .panel p, .footer, body > .card p) {
    color: var(--fuuvo-dark-muted) !important;
}

body[data-ui-theme="dark"] :is(.auth-card input, .panel input, .social-btn, .btn.secondary) {
    border-color: var(--fuuvo-dark-line-strong) !important;
    background: var(--fuuvo-dark-input) !important;
    color: var(--fuuvo-dark-text-soft) !important;
}

body[data-ui-theme="dark"] :is(.social-btn, .btn.secondary):hover {
    border-color: var(--fuuvo-dark-blue-line) !important;
    background: var(--fuuvo-dark-blue-soft) !important;
}

body[data-ui-theme="dark"] .divider::before,
body[data-ui-theme="dark"] .divider::after {
    background: var(--fuuvo-dark-line) !important;
}

body[data-ui-theme="dark"] .legal-head {
    border-color: var(--fuuvo-dark-line) !important;
    background: transparent !important;
}

body[data-ui-theme="dark"]:has(.auth-page),
body[data-ui-theme="dark"]:has(> .shell),
body[data-ui-theme="dark"]:has(> .card) {
    background:
        radial-gradient(circle at top left, rgba(66, 119, 213, .16), transparent 28%),
        radial-gradient(circle at right bottom, rgba(42, 143, 151, .10), transparent 24%),
        var(--fuuvo-dark-bg) !important;
}

/* Final mobile dark-mode invariants. The landing page has intentionally
 * specific phone styles, so dark mode must match that specificity rather than
 * letting light mobile colours win. */
body[data-ui-theme="dark"] :is(
    .sidebar-brand-zh-logo,
    .sidebar-brand-en-symbol,
    .composer-title-logo,
    .mobile-chat-brand-zh,
    .mobile-chat-brand-en img,
    .auth-brand-zh,
    .auth-brand-en img
) {
    filter: brightness(1.18) saturate(1.12) drop-shadow(0 0 9px rgba(57, 204, 214, .14));
}

body[data-ui-theme="dark"] :is(.sidebar-brand-en-word, .auth-brand-en-word, .mobile-chat-brand-en) {
    color: #63d5df !important;
    -webkit-text-fill-color: currentColor !important;
}

body[data-ui-theme="dark"] header[data-fuuvo-shared-topbar="1"] :is(
    .fuuvo-topbar-menu-icon img,
    .shell-topbar-back img,
    .workspace-header-link img
),
body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .fuuvo-mobile-sidebar-close img {
    filter: brightness(0) saturate(100%) invert(82%) sepia(15%) saturate(719%) hue-rotate(181deg) brightness(104%) contrast(94%) !important;
}

body[data-ui-theme="dark"] .fortune-method-row > span {
    color: var(--fuuvo-dark-muted) !important;
}

@media (max-width: 920px) {
    html[data-ui-theme="dark"]:has(body.chat-landing[data-mode="chat"]),
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"],
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.app, .workspace, .composer) {
        background: var(--fuuvo-dark-bg) !important;
        color: var(--fuuvo-dark-text-soft) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-topbar {
        border-bottom-color: var(--fuuvo-dark-line) !important;
        background: rgba(15, 20, 29, .96) !important;
        color: var(--fuuvo-dark-text-soft) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.mobile-nav-pill, .mobile-nav-trigger) {
        border-color: var(--fuuvo-dark-line-strong) !important;
        background: transparent !important;
        color: var(--fuuvo-dark-text-soft) !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-nav-bars {
        color: var(--fuuvo-dark-text-soft) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-actions .ui-language-switch {
        border-color: transparent !important;
        background: transparent !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-actions .ui-language-switch-btn {
        background: transparent !important;
        color: var(--fuuvo-dark-muted) !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-actions .ui-language-switch-btn.active {
        color: var(--fuuvo-dark-text) !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-actions .ui-language-switch-btn + .ui-language-switch-btn::before {
        background: var(--fuuvo-dark-line-strong) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-btn {
        border-color: var(--fuuvo-dark-blue-line) !important;
        background: var(--fuuvo-dark-surface-raised) !important;
        color: var(--fuuvo-dark-text) !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.composer-title, .mobile-home-scenes-title) {
        color: var(--fuuvo-dark-text) !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.composer-desc, .chat-input-hint) {
        color: var(--fuuvo-dark-muted) !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap {
        border-color: var(--fuuvo-dark-line-strong) !important;
        background: var(--fuuvo-dark-surface-raised) !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, .24) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        color: var(--fuuvo-dark-text) !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.chat-tool-btn, .mobile-chat-toolbar-btn) {
        border-color: var(--fuuvo-dark-line-strong) !important;
        background: var(--fuuvo-dark-input) !important;
        color: var(--fuuvo-dark-text-soft) !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-home-capabilities > button,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-home-capabilities-menu,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-home-capabilities-menu button {
        border-color: var(--fuuvo-dark-line-strong) !important;
        background: var(--fuuvo-dark-surface) !important;
        color: var(--fuuvo-dark-text-soft) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .core-feature-btn {
        border-color: var(--fuuvo-dark-line-strong) !important;
        background: var(--fuuvo-dark-surface) !important;
        color: var(--fuuvo-dark-text-soft) !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer),
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace > .fuuvo-ai-disclaimer {
        border-top-color: var(--fuuvo-dark-line) !important;
        background: var(--fuuvo-dark-bg) !important;
        color: #b6c1d1 !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) > a,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace > .fuuvo-ai-disclaimer a {
        color: #8fbdff !important;
    }
}


/* Keep the mobile chat landing page matching the light reference mockup, even when dark mode is active. */
@media (max-width: 920px), (hover: none) and (pointer: coarse) and (max-width: 1366px) {
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"],
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.app, .workspace) {
        background: #fff !important;
        color: #10284c !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-topbar {
        background: rgba(255, 255, 255, .96) !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-nav-bars,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-actions .ui-language-switch-btn.active,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .composer-title,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .core-feature-btn {
        color: #10284c !important;
        -webkit-text-fill-color: #10284c !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-actions .ui-language-switch-btn:not(.active),
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] :is(.chat-input-hint, .workspace-disclaimer) {
        color: #71809a !important;
        -webkit-text-fill-color: #71809a !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .core-feature-btn,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-tool-btn,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-toolbar-btn {
        border-color: #d7e0eb !important;
        background: #fff !important;
        color: #10284c !important;
        -webkit-text-fill-color: #10284c !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap {
        box-shadow: 0 9px 20px rgba(23, 49, 84, .08) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        color: #10284c !important;
        -webkit-text-fill-color: #10284c !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap textarea::placeholder {
        color: #8290a6 !important;
        -webkit-text-fill-color: #8290a6 !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .send-btn {
        border-color: #0877f9 !important;
        background: #0877f9 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        box-shadow: 0 8px 17px rgba(8, 119, 249, .24) !important;
    }
}
