/* ESFX V72 | Precision theme system: original light UI preserved.
   Dark intentionally uses soft graphite rather than black/white inversion.
   This file REPLACES (does not load after) theme-v71.css. */
:root{
 --esfx-safe-top:env(safe-area-inset-top,0px);
 --esfx-safe-right:env(safe-area-inset-right,0px);
 --esfx-safe-bottom:env(safe-area-inset-bottom,0px);
 --esfx-safe-left:env(safe-area-inset-left,0px);
}
.esfx-theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:40px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text-mid);font-size:.79rem;font-weight:750;cursor:pointer;touch-action:manipulation;white-space:nowrap;transition:background .16s,border-color .16s,color .16s}
.esfx-theme-toggle:hover{background:var(--surface-2);color:var(--ink);border-color:var(--line-strong)}
.esfx-theme-toggle:focus-visible,:is(.news-back,.market-back-link,.store-back,.chat-back):focus-visible{outline:3px solid #17c784;outline-offset:2px}
.esfx-theme-toggle .ui-icon{width:18px;height:18px;display:block}
.esfx-theme-icon-sun{display:none}
html[data-esfx-theme="dark"] .esfx-theme-icon-sun{display:block}
html[data-esfx-theme="dark"] .esfx-theme-icon-moon{display:none}
.esfx-theme-toggle-header{width:40px;min-width:40px;height:40px;padding:0;border-radius:12px}
.esfx-theme-toggle-header .esfx-theme-toggle-label{display:none}
.esfx-native-theme-row,.mobile-menu-theme{padding:10px 5px;border-top:1px solid var(--line-soft)}
.esfx-theme-toggle-menu{width:100%;justify-content:flex-start;padding:11px 13px;min-height:44px;background:var(--surface-2)}

/* No universal BACK button in the AppBar. Dedicated detail page back links keep their own navigation. */
body.esfx-native-app .esfx-native-header-inner{justify-content:flex-start;gap:8px}
body.esfx-native-app .esfx-native-header-actions{margin-left:auto;flex-shrink:1;min-width:0}
body.esfx-native-app .esfx-native-header{padding-top:var(--esfx-safe-top);height:calc(var(--esfx-native-header-h) + var(--esfx-safe-top))}
body.esfx-native-app .esfx-native-header-inner{padding-right:max(12px,var(--esfx-safe-right));padding-left:max(12px,var(--esfx-safe-left))}
body.esfx-native-app .esfx-native-shell>main{padding-top:calc(var(--esfx-native-header-h) + var(--esfx-safe-top))}
body.esfx-native-app .esfx-native-bottom-nav{padding-left:max(7px,var(--esfx-safe-left));padding-right:max(7px,var(--esfx-safe-right));padding-bottom:calc(4px + var(--esfx-safe-bottom));height:calc(var(--esfx-native-nav-h) + var(--esfx-safe-bottom))}
body.esfx-native-app .esfx-native-shell>main{padding-bottom:calc(var(--esfx-native-nav-h) + var(--esfx-safe-bottom) + 22px)!important}
body.esfx-native-app.esfx-chat-conversation .esfx-native-shell>main{padding:0!important}
body.esfx-native-app .esfx-native-menu-panel{top:calc(var(--esfx-native-header-h) + var(--esfx-safe-top) + 6px);max-height:calc(100dvh - var(--esfx-native-header-h) - var(--esfx-safe-top) - var(--esfx-safe-bottom) - 18px)}
body.esfx-native-app .esfx-native-menu-links a{min-height:44px}
body.esfx-native-app .esfx-theme-toggle-native{width:38px;min-width:38px;height:38px;border:0;background:transparent}
body.esfx-native-app .esfx-native-header .esfx-native-brand{display:none!important}
@media(max-width:350px){body.esfx-native-app .esfx-native-header-actions .esfx-native-icon-link:first-of-type{display:none}}
/* All device cutouts, including modal edges and landscape orientations. */
.esfx-dialog-root,.esfx-profile-photo-modal,.esfx-image-modal,.connections-modal,.ai-loading-overlay,.submit-loading-overlay{padding:max(16px,var(--esfx-safe-top)) max(14px,var(--esfx-safe-right)) max(16px,var(--esfx-safe-bottom)) max(14px,var(--esfx-safe-left))}
.chat-media-sheet-card{padding-bottom:max(16px,var(--esfx-safe-bottom))}
body.esfx-native-app .esfx-native-offline{top:calc(var(--esfx-safe-top) + 10px);left:max(12px,var(--esfx-safe-left));right:max(12px,var(--esfx-safe-right))}
body.esfx-native-app .chat-media-sheet-card{padding-bottom:max(18px,var(--esfx-safe-bottom))!important}
@media(max-width:860px){
 /* V70 used display:inline-flex!important to force logo in mobile WEB header. Override it explicitly. */
 body.esfx-product-body:not(.esfx-native-app) .site-header .brand.brand-logo-only{display:none!important}
 body.esfx-product-body:not(.esfx-native-app) .site-header .header-inner{gap:8px;padding-left:max(12px,var(--esfx-safe-left));padding-right:max(12px,var(--esfx-safe-right));min-width:0}
 body:not(.esfx-native-app) .site-header{padding-top:var(--esfx-safe-top)}
 body:not(.esfx-native-app) .mobile-bottom-nav{bottom:max(8px,var(--esfx-safe-bottom));left:max(8px,var(--esfx-safe-left));right:max(8px,var(--esfx-safe-right))}
 .mobile-menu-theme{padding:8px 7px}
 .mobile-menu{max-height:calc(100dvh - 64px - var(--esfx-safe-top) - var(--esfx-safe-bottom));overflow-y:auto;overscroll-behavior:contain}
 .header-actions{min-width:0}
}
/* Back control styling only where a page author has deliberately placed one. */
.news-back,.market-back-link,.store-back,.chat-back{
 display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:39px;
 padding:8px 12px;border:1px solid #cbeadd;background:#ecf9f3;color:#08794a;
 border-radius:12px;font-weight:750;text-decoration:none;transition:background .16s,border-color .16s,transform .16s;
}
.news-back:hover,.market-back-link:hover,.store-back:hover,.chat-back:hover{background:#d9f5e9;color:#075f3b;border-color:#90d9bb}
.news-back:active,.market-back-link:active,.store-back:active,.chat-back:active{transform:scale(.98)}
.chat-back{width:42px;min-width:42px;height:42px;padding:0}
.chat-back .ui-icon{width:22px;height:22px}

/* DESIGN TOKENS | Soft charcoal, not stark black. Keep white ESFX wordmark in natural colors. */
html[data-esfx-theme="dark"]{
 color-scheme:dark;
 --bg:#182128;--surface:#26313a;--surface-2:#2e3a44;--surface-3:#36434e;
 --text:#f2f5f5;--ink:#f2f5f5;--text-soft:#d5dfe1;--text-mid:#bac9ce;
 --muted:#b0bec4;--muted-2:#99aab2;--line:#42515b;--line-soft:#3a4852;--line-strong:#5a6b76;
 --accent:#32d493;--accent-2:#26bf84;--green:#3ad698;--green-bright:#41df9e;--green-dark:#74e8b4;
 --red-dark:#ff989d;--amber-dark:#ffd18a;--shadow:0 9px 32px rgba(6,13,20,.13);
 --esfx-page-bg:#182128;--esfx-card-bg:#26313a;
 background:var(--bg);
}
html[data-esfx-theme="dark"] body,html[data-esfx-theme="dark"] .site-shell{background:var(--bg);color:var(--text)}
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-shell{background:var(--bg)!important}
/* Brand bar is deliberately porcelain-light in Dark Mode, so the original ESFX
   ink-black wordmark stays crisp and is NOT inverted into white on black. */
html[data-esfx-theme="dark"] .site-header,
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header{
 background:#f6f8f7!important;color:#202b32!important;border-color:#dce8e2!important;
 box-shadow:0 2px 10px rgba(0,0,0,.05)!important;
}
html[data-esfx-theme="dark"] .site-header :is(.site-nav>a,.header-all-nav-toggle,.nav-toggle,.appbar-icon-link,.user-chip,.esfx-theme-toggle-header),
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header :is(.esfx-native-menu-toggle,.esfx-native-icon-link,.esfx-theme-toggle-native){color:#344653!important}
html[data-esfx-theme="dark"] .site-header :is(.nav-always.active,.site-nav a.active){background:#e0f4e8!important;color:#096d49!important}
html[data-esfx-theme="dark"] .site-header :is(.appbar-icon-link,.esfx-theme-toggle-header,.user-chip){background:#edf1ef!important;border-color:#dce6e0!important}
html[data-esfx-theme="dark"] .site-header .appbar-icon-link:hover,
html[data-esfx-theme="dark"] .site-header .esfx-theme-toggle-header:hover{background:#e0ede5!important}
html[data-esfx-theme="dark"] .site-header .header-all-nav-panel,
html[data-esfx-theme="dark"] .site-header .header-all-nav-grid{color:var(--text)}
html[data-esfx-theme="dark"] .site-header .brand.brand-logo-only{filter:none!important;mix-blend-mode:normal!important}
html[data-esfx-theme="dark"] .site-header .brand.brand-logo-only img{filter:none!important}
/* Full menu remains charcoal, with an elegant light brand area (not an image white square). */
html[data-esfx-theme="dark"] :is(.esfx-native-menu-panel,.mobile-menu,.header-all-nav-panel,.header-all-nav-menu){background:#26313a!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-esfx-theme="dark"] .esfx-native-menu-head{background:#f6f8f7!important;color:#283740!important;border-bottom:1px solid #e4ece8;border-radius:16px 16px 0 0}
html[data-esfx-theme="dark"] .esfx-native-menu-head :is(small,strong){color:#596b71!important}
html[data-esfx-theme="dark"] .esfx-native-menu-head img{filter:none!important}
html[data-esfx-theme="dark"] .esfx-native-menu-head .icon-button[data-esfx-native-menu-close]{background:#e9efec!important;color:#283740!important}
html[data-esfx-theme="dark"] :is(.esfx-native-menu-links a,.esfx-native-menu-language a,.esfx-native-logout-form button,.mobile-menu a,.header-all-nav-grid a){background:transparent;color:var(--text-soft)!important;border-color:var(--line-soft)}
html[data-esfx-theme="dark"] :is(.esfx-native-menu-links a,.mobile-menu>a,.header-all-nav-grid a):hover{background:#33453f!important;color:#baf6d7!important}
html[data-esfx-theme="dark"] :is(.esfx-native-menu-language a.active,.mobile-menu-language-options a.active){background:#c9f2db!important;color:#116644!important}
html[data-esfx-theme="dark"] .esfx-theme-toggle-menu{background:var(--surface-2)!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-esfx-theme="dark"] :is(.esfx-native-menu-toggle,.esfx-native-icon-link).active{background:#dff2e9!important;color:#087c53!important}
/* Global footer & navigation: quieter than the content cards. */
html[data-esfx-theme="dark"] .site-footer{background:#202b33!important;border-color:var(--line)!important;color:var(--text-soft)!important}
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-bottom-nav,
html[data-esfx-theme="dark"] body.esfx-product-body:not(.esfx-native-app) .mobile-bottom-nav{background:#26313a!important;color:var(--text-soft)!important;border:1px solid #43565c!important;box-shadow:0 -4px 22px rgba(7,15,20,.18)!important}
html[data-esfx-theme="dark"] :is(.esfx-native-bottom-nav,.mobile-bottom-nav) a{color:#b2c4c7!important}
html[data-esfx-theme="dark"] :is(.esfx-native-bottom-nav,.mobile-bottom-nav) a.active{color:#79e5b2!important;background:transparent!important}
html[data-esfx-theme="dark"] :is(.esfx-native-bottom-nav,.mobile-bottom-nav) a.active small{color:#79e5b2!important}
html[data-esfx-theme="dark"] :is(.esfx-native-create,.mobile-create) span{background:#1c986a!important;color:#fff!important;border-color:#40bd8d!important;box-shadow:0 5px 14px rgba(0,0,0,.15)!important}
/* Elevated SURFACES only: avoid painting entire layout shells, cover art and article imagery. */
html[data-esfx-theme="dark"] :where(.card,.panel,.hero-card,.rail-section,.right-card,.idea-card,.compose-card,
 .profile-card,.profile-panel,.profile-editor,.asset-card,.market-card,.market-picker-card,.market-panel,.market-detail-card,
 .news-card,.blog-card,.broker-card,.news-editorial-card,.store-card,.academy-card,.store-info-card,.store-detail-media,.course-lesson,.course-card,
 .notification-card,.notification-row,.messages-card,.messenger-sidebar,.messenger-main,.chat-head,.chat-compose,.chat-media-sheet-card,
 .ai-form,.ai-answer,.ai-panel,.ai-card,.ai-results-card,.ai-desk-card,.brain-card,.brain-panel,.market-brain-card,.tool-card,.tool-panel,.widget-card,
 .dropdown-menu,.popover,.modal-content,.dialog-content,.filter-bar,.table-wrap,.market-search-box,.admin-main,.esfx-admin-main,.support-card,.tv-widget-card,
 .right-stack>.card,.comment-card,.comment-compose,.section-card,.lesson-card,.info-card,.metric-card,.admin-v8-card,.admin-v8-panel,.admin-v8-box,
 .connections-panel,.connections-dialog,.esfx-profile-photo-panel,.esfx-profile-photo-content,.market-prices-card,.event-card,
 .market-ai-history-list details,.ai-desk-summary,.brain-summary-card,.course-content){
 background-color:var(--surface)!important;border-color:var(--line)!important;color:var(--text);
}
html[data-esfx-theme="dark"] :where(.kpi,.stat-box,.mini-card,.asset-mini-indicators span,.market-chart-badge,.market-type-tabs a,
 .idea-actions,.idea-card-footer,.course-chapter,.store-meta-grid span,.store-type-badge,.academy-access-badge,.store-payment-banner,
 .ai-fact,.feed-filter,.profile-details,.rail-profile,.auth-proof,.segmented,.event-countdown.is-past,
 .field-with-icon,.comment-compose,.admin-card,.admin-stat,.tab-pane,.message-bubble.theirs){
 background-color:var(--surface-2)!important;color:var(--text-soft);border-color:var(--line-soft)!important;
}
html[data-esfx-theme="dark"] :is(.profile-shell,.feed-grid,.product-shell,.detail-shell,.market-shell,.markets-shell,.ai-shell,.brain-shell,.news-shell,.article-shell,.store-shell,.academy-shell,.community-shell,.chat-thread,.search-shell){color:var(--text)}
/* Do NOT modify the actual brand/agent avatars, photos, banners or chart canvases. */
html[data-esfx-theme="dark"] :is(.profile-cover img,.article-content img,.idea-media img,.news-card img,.blog-card img,.avatar-img,.store-card img,.academy-card img){filter:none!important}
/* Typography: apply to text hierarchy, do not blanket override colored labels. */
html[data-esfx-theme="dark"] :is(.feed-topbar h1,.idea-author-name,.right-card h3,.section-head h1,.section-head h2,
 .profile-name,.page-title,.asset-price,.pulse-name,.market-title,.news-detail h1,.blog-detail h1,.ai-answer h2,
 .market-ai-history-list summary strong,.stat-box strong,.kpi-value){color:var(--text)!important}
html[data-esfx-theme="dark"] :is(.muted,.small-text,.eyebrow,.idea-author-sub,.pulse-meta,.feed-topbar p,.right-card p,
 .section-head p,.content-education-disclaimer,.market-chart-head p,.comment-time,.idea-time,.kpi-label,.rail-profile small){color:var(--muted)!important}
html[data-esfx-theme="dark"] :is(.rail-nav>a,.compose-action,.filter-group label,.field label){color:var(--text-soft)}
html[data-esfx-theme="dark"] :is(.rail-nav>a:hover,.rail-nav>a.active){background:#334c42!important;color:#b9efd7!important}
html[data-esfx-theme="dark"] :is(.segmented .active,.segmented button.active,.segmented a.active){background:#175f49!important;color:#e3fff2!important;box-shadow:none!important}
html[data-esfx-theme="dark"] :is(.pulse-row,.trend-row,.idea-actions,.message-row,.notification-row,.rail-profile-head){border-color:var(--line-soft)!important}
html[data-esfx-theme="dark"] .compose-trigger{background:var(--surface-2)!important;border-color:var(--line-strong)!important;color:var(--muted)!important}
/* Semantic accents retain BUY / SELL / AI distinction and avoid washed-out badges. */
html[data-esfx-theme="dark"] :is(.direction-bullish,.hot-positive,.hot-strong,.compose-action-bullish,.alert-success){background:#204c3b!important;border-color:#337354!important;color:#9ef2c8!important}
html[data-esfx-theme="dark"] :is(.direction-bearish,.hot-negative,.hot-strong-negative,.compose-action-bearish,.alert-error){background:#56343d!important;border-color:#8a535e!important;color:#ffbfc6!important}
html[data-esfx-theme="dark"] :is(.direction-neutral,.hot-neutral,.tf-chip,.confidence-chip,.compose-action-ai){background:#33465e!important;border-color:#50637b!important;color:#bcd8ff!important}
html[data-esfx-theme="dark"] .idea-action.active{background:#214d41!important;color:#a0f0c7!important}
html[data-esfx-theme="dark"] .moderation-card-pending{background:#4a3c29!important;border-color:#78633c!important;color:#ffe6a3!important}
html[data-esfx-theme="dark"] .moderation-card-pending span{color:#f0d39b!important}
html[data-esfx-theme="dark"] .content-education-disclaimer{background:#2c3a44!important;border-color:var(--line)!important;color:var(--muted)!important}
html[data-esfx-theme="dark"] :is(.article-content a,.idea-thesis .esfx-content-link){color:#a5deff!important}
html[data-esfx-theme="dark"] :is(.article-content a,.idea-thesis .esfx-content-link):hover{color:#c5eaff!important}
/* Forms and filters: controls visibly separate from their card. */
html[data-esfx-theme="dark"] :is(input:where(:not([type]),[type="text"],[type="search"],[type="email"],[type="password"],[type="number"],[type="tel"],[type="url"],[type="date"],[type="time"],[type="datetime-local"],[type="month"],[type="week"]),select,textarea,
 .form-control,.form-input,.search-input,.field input,.field select,.field textarea,.filter-group input,.filter-group select,.chat-compose textarea){
 background:#303e48!important;color:var(--text)!important;border-color:#52636d!important;caret-color:var(--accent);
}
html[data-esfx-theme="dark"] :is(input,textarea)::placeholder{color:#b4c1c6!important;opacity:1}
html[data-esfx-theme="dark"] :is(input,select,textarea):focus-visible{outline:2px solid #5acf9e!important;outline-offset:1px}
html[data-esfx-theme="dark"] :is(.btn-secondary,.btn-ghost,.user-chip,.icon-button){background:#33414b!important;border-color:var(--line)!important;color:var(--text-soft)!important}
html[data-esfx-theme="dark"] .btn:not(.btn-primary):not(.btn-accent):not(.btn-danger){background:#34414b;border-color:var(--line);color:var(--text-soft)}
html[data-esfx-theme="dark"] :is(.btn-primary,.btn-accent,.esfx-native-login-link){background:#198c61!important;border-color:#28a473!important;color:#fff!important}
html[data-esfx-theme="dark"] .btn-danger{background:#603640!important;color:#ffc9cf!important;border-color:#93565e!important}
html[data-esfx-theme="dark"] :is(.password-toggle-btn,.cal-date-btn,.market-type-tabs a){background:var(--surface-3)!important;color:var(--text-soft)!important}
/* Chat, dialogs, and scrollable overlays use local panels, not a universal black layer. */
html[data-esfx-theme="dark"] :is(.chat-thread,.messenger-shell,.messenger-empty,.messenger-conversation-empty,.message-list){background-color:#202a33!important;color:var(--text)}
html[data-esfx-theme="dark"] :is(.chat-head,.chat-compose,.messenger-main){background-color:var(--surface)!important}
html[data-esfx-theme="dark"] .message-bubble.theirs{background:#354752!important;color:var(--text)!important}
html[data-esfx-theme="dark"] .message-bubble.mine{background:#1a7959!important;color:#fff!important}
html[data-esfx-theme="dark"] .esfx-dialog-panel{background:#293640!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-esfx-theme="dark"] .esfx-dialog-backdrop{background:rgba(14,20,24,.62)}
html[data-esfx-theme="dark"] .chat-media-sheet-backdrop{background:rgba(14,20,24,.58)}
html[data-esfx-theme="dark"] :is(.esfx-dialog-brand,.esfx-dialog-message,.esfx-dialog-body,.esfx-dialog-panel p){color:var(--text-soft)}
html[data-esfx-theme="dark"] .esfx-profile-photo-modal .esfx-profile-photo-panel{background:#293640!important}
/* Data tables, accordions, history; protect labels and native system widgets. */
html[data-esfx-theme="dark"] :is(.table-wrap,.table,.table td,.table th,.market-ai-history-list summary){border-color:var(--line)!important}
html[data-esfx-theme="dark"] :is(.table th,.table thead th,.market-ai-history-list summary){background:var(--surface-2)!important;color:var(--text-soft)!important}
html[data-esfx-theme="dark"] .table td{background:transparent;color:var(--text-soft);border-bottom-color:var(--line)!important}
html[data-esfx-theme="dark"] .market-ai-history-list details>div{color:var(--text-soft);border-top-color:var(--line)!important}
html[data-esfx-theme="dark"] .market-ai-history-list summary time{color:var(--muted)!important}
html[data-esfx-theme="dark"] :is(.chart-fallback,.news-source-clean a){background:var(--surface-2)!important;border-color:var(--line)!important;color:var(--text-soft)!important}
html[data-esfx-theme="dark"] :is(.esfx-admin-body,.admin-layout,.esfx-admin-global-sidebar,.admin-sidebar){color:var(--text)}
html[data-esfx-theme="dark"] body.esfx-admin-body{background:var(--bg)!important}
html[data-esfx-theme="dark"] :is(.admin-sidebar,.esfx-admin-global-sidebar){background:#202b33!important;border-color:var(--line)!important}
html[data-esfx-theme="dark"] :is(.admin-sidebar a,.esfx-admin-nav-link){color:var(--text-soft)!important}
html[data-esfx-theme="dark"] :is(.esfx-admin-nav-link.active,.admin-sidebar a.active){background:#285a49!important;color:#f2fff8!important}
html[data-esfx-theme="dark"] .admin-main{background:var(--surface)!important;border-color:var(--line)!important}
html[data-esfx-theme="dark"] .community-hero{background:#23483c;color:#eafff5}
html[data-esfx-theme="dark"] .community-hero p{color:#c9ecdc}
html[data-esfx-theme="dark"] hr,html[data-esfx-theme="dark"] .divider{border-color:var(--line)}
html[data-esfx-theme="dark"] ::selection{background:#327b63;color:#fff}
/* Compact screens - controls never widen the viewport. */
@media(max-width:860px){
 html[data-esfx-theme="dark"] :is(.feed-main,.feed-grid,.market-card,.table-wrap,.ai-card,.profile-card,.esfx-native-menu-panel){min-width:0;max-width:100%}
 html[data-esfx-theme="dark"] .site-header .header-inner{min-width:0}
 html[data-esfx-theme="dark"] .mobile-menu{border-color:var(--line)!important}
}
@media(max-width:380px){
 body.esfx-native-app .esfx-native-header-actions{gap:0}
 body.esfx-native-app .esfx-native-header-inner{gap:3px}
}
@media(prefers-reduced-motion:reduce){.esfx-theme-toggle{transition:none}}
/* Brand-safe finishing touches for header chrome and user fallback avatars. */
html[data-esfx-theme="dark"] .site-header .nav-toggle.icon-button,
html[data-esfx-theme="dark"] .site-header .header-actions .icon-button{background:#edf1ef!important;border:1px solid #dce6e0!important;color:#344653!important}
html[data-esfx-theme="dark"] .site-header .nav-toggle.icon-button:hover{background:#e1ece5!important}
html[data-esfx-theme="dark"] .site-header .btn-ghost{background:#edf1ef!important;color:#31424c!important;border-color:#dce6e0!important}
html[data-esfx-theme="dark"] .site-header .user-chip{background:#edf1ef!important;color:#344653!important}
html[data-esfx-theme="dark"] .avatar:not(img),
html[data-esfx-theme="dark"] .profile-avatar-fallback{background-color:#23795a!important;color:#fff!important}
html[data-esfx-theme="dark"] .verified-dot{background-color:#17ad78!important;color:#fff!important}

/* MODULE ADAPTERS | AI Desk, Market Brain & Trader Tools have their own later-loaded CSS. */
html[data-esfx-theme="dark"] .ai-desk-purpose{
 background:linear-gradient(125deg,#28473f,#2b3a44)!important;border-color:#416b60!important;color:var(--text)!important;
}
html[data-esfx-theme="dark"] .ai-desk-purpose strong{color:var(--text)!important}
html[data-esfx-theme="dark"] .ai-desk-purpose p{color:#c8dcda!important}
html[data-esfx-theme="dark"] .ai-desk-purpose-icon{background:#315d4d!important;border-color:#49846c!important;color:#a5ffce!important}
html[data-esfx-theme="dark"] .ai-desk-purpose-chips span{background:#304a46!important;border-color:#517768!important;color:#d4f7e7!important}

html[data-esfx-theme="dark"]{
 --brain-blue:#9bbdff;--brain-indigo:#afa8ff;--brain-cyan:#75dcee;
 --brain-green:#7ce4b2;--brain-red:#ffa0ac;--brain-amber:#ffd18a;
 --brain-ink:#eef5f5;--brain-muted:#b8c9cf;--brain-line:#475963;
 --brain-soft:#303f49;--brain-card:#26343d;
}
html[data-esfx-theme="dark"] .brain-shell{background:radial-gradient(circle at 8% 0%,rgba(37,162,124,.08),transparent 26rem),radial-gradient(circle at 90% 0%,rgba(97,145,185,.06),transparent 26rem)!important}
html[data-esfx-theme="dark"] :is(.brain-market-card,.brain-login-card,.brain-empty,.brain-loading,.brain-inline-form,.brain-result,
 .brain-signal-card,.brain-upload-card,.brain-metric,.brain-alert-card,.brain-coach-card,.brain-tools-link){
 background:var(--surface)!important;border-color:var(--brain-line)!important;color:var(--text-soft)!important;
}
html[data-esfx-theme="dark"] :is(.brain-market-setup,.brain-result-box,.brain-level,.brain-dna-secondary,.brain-coach-row,
 .brain-market-actions a,.brain-market-actions button,.brain-alert-form,.brain-status,.brain-pill){
 background:var(--surface-2)!important;border-color:var(--line-soft)!important;color:var(--text-soft)!important;
}
html[data-esfx-theme="dark"] :is(.brain-hero h1,.brain-section-head h2,.brain-market-top strong,.brain-market-price strong,
 .brain-result h3,.brain-signal-name strong,.brain-metric strong,.brain-coach-card strong,.brain-market-setup strong,
 .brain-result-box strong,.brain-result-box span,.brain-level b){color:var(--text)!important}
html[data-esfx-theme="dark"] :is(.brain-hero p,.brain-section-head p,.brain-result p,.brain-driver-list li,.brain-note,
 .brain-privacy,.brain-market-setup small,.brain-upload-meta label,.brain-alert-form label,.brain-inline-form label,
 .brain-market-top span,.brain-metric small){color:var(--muted)!important}
html[data-esfx-theme="dark"] .brain-tabs a{color:var(--text-soft)!important}
html[data-esfx-theme="dark"] .brain-tabs a:hover{background:var(--surface-2)!important;border-color:var(--line)!important}
html[data-esfx-theme="dark"] .brain-tabs a.active{background:#1c8861!important;color:#fff!important;border-color:#1c8861!important}
html[data-esfx-theme="dark"] .brain-pill.bullish,html[data-esfx-theme="dark"] .brain-status.tp2{background:#235440!important;color:#acf5cf!important}
html[data-esfx-theme="dark"] .brain-pill.bearish,html[data-esfx-theme="dark"] .brain-status.stopped{background:#57353f!important;color:#ffc4ca!important}
html[data-esfx-theme="dark"] .brain-pill.risk-high,html[data-esfx-theme="dark"] .brain-status.review,
html[data-esfx-theme="dark"] .brain-review-note{background:#5a4831!important;color:#ffdfa1!important}
html[data-esfx-theme="dark"] .brain-dropzone{background:linear-gradient(135deg,#2f404a,#2a373f)!important;border-color:#607d83!important}
html[data-esfx-theme="dark"] .brain-dropzone>span,html[data-esfx-theme="dark"] .brain-dropzone small{color:var(--text-soft)!important}
html[data-esfx-theme="dark"] :is(.brain-inline-form select,.brain-upload-meta select,.brain-alert-form input,.brain-alert-form select){background:#33434e!important;color:var(--text)!important;border-color:var(--line-strong)!important}
html[data-esfx-theme="dark"] .brain-signal-progress{background:#43515c!important}

html[data-esfx-theme="dark"] :is(.tools-hero-copy,.tools-market-control,.tools-radar-wrap,.tools-sidebar,.tool-panel,.tools-disclaimer,
 .setup-radar-card,.bias-reason,.mtf-card,.session-card,.watch-card,.quality-card,.news-tool-card,
 .news-tool-analysis,.news-analysis-grid div,.tool-login-card,.tool-loading,.tool-empty,.journal-row){
 background:var(--surface)!important;border-color:var(--line)!important;color:var(--text)!important;
}
html[data-esfx-theme="dark"] :is(.tools-live-strip,.tool-metric-grid>div,.bias-score-card,.radar-score,
 .scenario-card,.entry-plan-card,.exposure-position,.exposure-bar,.journal-stat,.quality-breakdown i,
 .news-assets span,.tool-form-grid .field,.session-card.open,.session-card.closed){
 background:var(--surface-2)!important;border-color:var(--line-soft)!important;color:var(--text-soft)!important;
}
html[data-esfx-theme="dark"] :is(.tools-hero-copy h1,.tools-section-head h2,.tool-panel h2,
 .setup-radar-card strong,.tool-metric-grid strong,.journal-stat strong,.quality-score b){color:var(--text)!important}
html[data-esfx-theme="dark"] :is(.tools-hero-copy p,.tools-section-head p,.tool-panel header p,.tools-market-control>label,
 .tools-sidebar-title,.tools-live-strip small,.radar-setup,.tool-note,.tool-metric-grid small){color:var(--muted)!important}
html[data-esfx-theme="dark"] .tools-nav button{color:var(--text-soft)!important}
html[data-esfx-theme="dark"] .tools-nav button:hover{background:#354740!important;color:#b8f2d5!important}
html[data-esfx-theme="dark"] .tools-nav button.active{background:#23543f!important;color:#b8f2d5!important}
html[data-esfx-theme="dark"] :is(.tool-form-grid label span,.bias-reason span,.news-tool-card p){color:var(--text-soft)!important}
html[data-esfx-theme="dark"] :is(.tool-form-grid input,.tool-form-grid select,.journal-form input,.journal-form select,
 .journal-form textarea,.exposure-form input,.exposure-form select,.tools-market-select-row select){
 background:#303e48!important;color:var(--text)!important;border-color:var(--line-strong)!important;
}
html[data-esfx-theme="dark"] :is(.bias-pill.bias-bullish,.session-card.open .session-status){background:#25523f!important;color:#a8f5d0!important}
html[data-esfx-theme="dark"] :is(.bias-pill.bias-bearish){background:#613940!important;color:#ffc4c9!important}
html[data-esfx-theme="dark"] :is(.bias-pill.bias-neutral,.session-card.closed .session-status){background:#3a4a55!important;color:var(--text-soft)!important}
html[data-esfx-theme="dark"] .quality-score:after{background:var(--surface)!important}
html[data-esfx-theme="dark"] .journal-row button{background:#683840!important;color:#ffd0d3!important}
html[data-esfx-theme="dark"] .news-tool-analysis{background:var(--surface-2)!important}
html[data-esfx-theme="dark"] .news-assets span{color:#bfd9ff!important}
html[data-esfx-theme="dark"] .tool-panel:focus-within{border-color:#4b6b61!important}

/* ===== ESFX V73 dark-mode defect sweep =====
   Purpose: remove remaining light-mode islands that survived inside V72 dark theme.
   Scope: feed cards/read-more, header language pills, AI chips, Calendar, Signals,
   Market Brain ranking score, Markets search, and section intro blocks. */

/* Header micro-controls that still looked like light leftovers in Dark Mode. */
html[data-esfx-theme="dark"] .site-header .lang-compact{
 background:#33424c!important;
 border:1px solid #4b5c67!important;
 box-shadow:none!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact a{
 color:#d5e0e4!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact a:hover{
 background:#42525d!important;
 color:#f2f5f5!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact a.active{
 background:#dff3e7!important;
 color:#0d6f49!important;
 box-shadow:none!important;
}
html[data-esfx-theme="dark"] .ai-language-pill{
 background:#33465e!important;
 border-color:#50637b!important;
 color:#c2d9ff!important;
}

/* Feed/article cards: remove white "read more" strip and reinforce footers. */
html[data-esfx-theme="dark"] .idea-card-read-more-row{
 background:var(--surface)!important;
 border-top:1px solid var(--line)!important;
}
html[data-esfx-theme="dark"] .idea-read-more{
 color:#8be4b9!important;
}
html[data-esfx-theme="dark"] .idea-read-more:hover{
 color:#bcf6d8!important;
}
html[data-esfx-theme="dark"] .reaction-count{
 background:#33465e!important;
 color:#c7dbff!important;
}

/* Markets page search and pills. */
html[data-esfx-theme="dark"] .market-search-box,
html[data-esfx-theme="dark"] .field-with-icon{
 background:var(--surface)!important;
 border-color:var(--line)!important;
 box-shadow:none!important;
}
html[data-esfx-theme="dark"] .market-search-box input,
html[data-esfx-theme="dark"] .field-with-icon input{
 background:transparent!important;
 color:var(--text)!important;
}
html[data-esfx-theme="dark"] .market-search-icon{
 color:var(--muted)!important;
}
html[data-esfx-theme="dark"] .market-type-tabs a.active{
 background:#225641!important;
 border-color:#225641!important;
 color:#edfff6!important;
}
html[data-esfx-theme="dark"] .market-type-tabs a.active span{
 color:#cfe9dd!important;
}

/* Calendar page: active period tabs and impact pills should not become bright white chips. */
html[data-esfx-theme="dark"] .calendar-period-tabs a,
html[data-esfx-theme="dark"] .store-tabs a,
html[data-esfx-theme="dark"] .cal-date-btn{
 background:var(--surface-3)!important;
 color:var(--text-soft)!important;
 border-color:var(--line)!important;
}
html[data-esfx-theme="dark"] .calendar-period-tabs a:hover,
html[data-esfx-theme="dark"] .store-tabs a:hover,
html[data-esfx-theme="dark"] .cal-date-btn:hover{
 background:#3d4c56!important;
 color:var(--text)!important;
}
html[data-esfx-theme="dark"] .calendar-period-tabs a.active,
html[data-esfx-theme="dark"] .store-tabs a.active,
html[data-esfx-theme="dark"] .cal-date-btn.active{
 background:#215844!important;
 color:#ecfff5!important;
 border-color:#2b6d54!important;
}
html[data-esfx-theme="dark"] .calendar-impact-badge.impact-low{
 background:#274b3c!important;
 border-color:#3d7158!important;
 color:#bdf2d5!important;
}
html[data-esfx-theme="dark"] .calendar-impact-badge.impact-medium{
 background:#51412d!important;
 border-color:#7b6444!important;
 color:#ffdba1!important;
}
html[data-esfx-theme="dark"] .calendar-impact-badge.impact-high{
 background:#56353d!important;
 border-color:#865662!important;
 color:#ffc3ca!important;
}
html[data-esfx-theme="dark"] .calendar-live-countdown{
 background:#31404a!important;
 color:#d4dde1!important;
 box-shadow:none!important;
}
html[data-esfx-theme="dark"] .calendar-live-countdown.is-imminent{
 background:#5a492f!important;
 color:#ffe2a6!important;
 box-shadow:inset 0 0 0 1px rgba(245,158,11,.24)!important;
}
html[data-esfx-theme="dark"] .calendar-live-countdown.is-critical{
 background:#613740!important;
 color:#ffc7cd!important;
 box-shadow:inset 0 0 0 1px rgba(225,29,72,.24)!important;
}
html[data-esfx-theme="dark"] .calendar-live-countdown.is-past{
 background:#2f3b44!important;
 color:#95a5ae!important;
}
html[data-esfx-theme="dark"] .calendar-event-row.calendar-impact-high{
 background:rgba(127,48,64,.20)!important;
}

/* Signals page: generator and history rows were still rendering bright light cards. */
html[data-esfx-theme="dark"] .signal-generator-card{
 background:linear-gradient(180deg,#29363f,#26323b)!important;
 border-color:var(--line)!important;
 box-shadow:none!important;
}
html[data-esfx-theme="dark"] .signal-history-row,
html[data-esfx-theme="dark"] .signal-info-card,
html[data-esfx-theme="dark"] .signal-analysis-card,
html[data-esfx-theme="dark"] .signal-chart-card-live{
 background:var(--surface)!important;
 border-color:var(--line)!important;
 color:var(--text-soft)!important;
}
html[data-esfx-theme="dark"] .signal-history-row:hover{
 border-color:#4a6f62!important;
 box-shadow:0 10px 24px rgba(6,13,20,.18)!important;
}
html[data-esfx-theme="dark"] .signal-history-symbol strong,
html[data-esfx-theme="dark"] .signal-history-levels strong,
html[data-esfx-theme="dark"] .signal-card-head h1,
html[data-esfx-theme="dark"] .signal-card-head h2,
html[data-esfx-theme="dark"] .signal-analysis-title h2,
html[data-esfx-theme="dark"] .signal-trade-grid strong,
html[data-esfx-theme="dark"] .signal-risk-grid strong{
 color:var(--text)!important;
}
html[data-esfx-theme="dark"] .signal-history-main small,
html[data-esfx-theme="dark"] .signal-history-levels small,
html[data-esfx-theme="dark"] .signal-card-head time,
html[data-esfx-theme="dark"] .signal-analysis-card p{
 color:var(--muted)!important;
}
html[data-esfx-theme="dark"] .signal-history-symbol span{
 background:#354550!important;
 color:#d5dfe4!important;
}
html[data-esfx-theme="dark"] .signal-history-buy{
 background:#265340!important;
 color:#b6f3d4!important;
}
html[data-esfx-theme="dark"] .signal-history-sell{
 background:#5c3740!important;
 color:#ffc4ca!important;
}
html[data-esfx-theme="dark"] .signal-history-neutral{
 background:#394a55!important;
 color:#d1dae0!important;
}
html[data-esfx-theme="dark"] .signal-trade-grid>div,
html[data-esfx-theme="dark"] .signal-risk-grid>div{
 background:var(--surface-2)!important;
 border-color:var(--line-soft)!important;
}
html[data-esfx-theme="dark"] .signal-chart-symbol{
 background:#31404a!important;
 border-color:#4f616c!important;
 color:#dce7ec!important;
}
html[data-esfx-theme="dark"] .signal-chart-legend{
 color:var(--muted)!important;
}

/* Market Brain: score chip and section intro blocks. */
html[data-esfx-theme="dark"] .brain-score{
 background:#33465e!important;
 color:#b9d0ff!important;
 border:1px solid #51657d!important;
}
html[data-esfx-theme="dark"] .brain-section-head{
 padding:18px 20px!important;
 border:1px solid var(--line)!important;
 border-radius:18px!important;
 background:rgba(38,49,58,.72)!important;
 backdrop-filter:blur(8px);
}
html[data-esfx-theme="dark"] .brain-section-head p{
 color:var(--muted)!important;
}

/* Mobile / overlay language areas should also avoid hard white active chips. */
html[data-esfx-theme="dark"] :is(.mobile-menu-language-options a,.esfx-native-menu-language a){
 background:#33424c!important;
 color:#d4dfe3!important;
}
html[data-esfx-theme="dark"] :is(.mobile-menu-language-options a:hover,.esfx-native-menu-language a:hover){
 background:#43545f!important;
 color:#f2f5f5!important;
}
html[data-esfx-theme="dark"] :is(.mobile-menu-language-options a.active,.esfx-native-menu-language a.active){
 background:#dff3e7!important;
 color:#0d6f49!important;
 box-shadow:none!important;
}

/* ===== ESFX V74 dark-mode final polish =====
   1) Convert AppBar/header to true dark branded chrome.
   2) Fix signal detail hero that still renders as a bright/light island.
   3) Remove leftover white truncation gradient in expanded/feed cards.
   4) Keep original ESFX logo readable via a branded logo plate. */

/* True dark AppBar / header chrome for Dark Mode. */
html[data-esfx-theme="dark"] .site-header,
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header{
  background:rgba(21,29,35,.92)!important;
  color:#e7eef1!important;
  border-bottom:1px solid #2f4049!important;
  box-shadow:0 6px 24px rgba(4,10,15,.22)!important;
  backdrop-filter:saturate(150%) blur(16px)!important;
}
html[data-esfx-theme="dark"] .site-header .header-inner,
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header-inner{
  color:#e7eef1!important;
}
html[data-esfx-theme="dark"] .site-header :is(.site-nav>a,.header-all-nav-toggle,.nav-toggle,.appbar-icon-link,.user-chip,.esfx-theme-toggle-header),
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header :is(.esfx-native-menu-toggle,.esfx-native-icon-link,.esfx-theme-toggle-native){
  color:#d3dee3!important;
}
html[data-esfx-theme="dark"] .site-header :is(.site-nav>a:hover,.header-all-nav-toggle:hover,.nav-toggle:hover),
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header :is(.esfx-native-menu-toggle:hover,.esfx-native-icon-link:hover,.esfx-theme-toggle-native:hover){
  background:#273741!important;
  color:#f2f7f8!important;
}
html[data-esfx-theme="dark"] .site-header :is(.nav-always.active,.site-nav a.active),
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header :is(.esfx-native-menu-toggle.active,.esfx-native-icon-link.active){
  background:#1f5a46!important;
  color:#eafff3!important;
}
html[data-esfx-theme="dark"] .site-header :is(.appbar-icon-link,.esfx-theme-toggle-header,.user-chip,.header-all-nav-toggle,.nav-toggle.icon-button,.header-actions .icon-button,.btn-ghost),
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header :is(.esfx-native-menu-toggle,.esfx-native-icon-link,.esfx-theme-toggle-native){
  background:#22313a!important;
  border:1px solid #344752!important;
  color:#d9e4e8!important;
  box-shadow:none!important;
}
html[data-esfx-theme="dark"] .site-header .btn-ghost,
html[data-esfx-theme="dark"] .site-header .user-chip{color:#d9e4e8!important}
html[data-esfx-theme="dark"] .site-header .appbar-icon-link:hover,
html[data-esfx-theme="dark"] .site-header .esfx-theme-toggle-header:hover,
html[data-esfx-theme="dark"] .site-header .header-all-nav-toggle:hover,
html[data-esfx-theme="dark"] .site-header .nav-toggle.icon-button:hover,
html[data-esfx-theme="dark"] .site-header .btn-ghost:hover,
html[data-esfx-theme="dark"] .site-header .user-chip:hover,
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header :is(.esfx-native-menu-toggle:hover,.esfx-native-icon-link:hover,.esfx-theme-toggle-native:hover){
  background:#2a3a45!important;
  border-color:#415662!important;
}

/* Logo plate keeps the original black/green logo readable on dark chrome. */
html[data-esfx-theme="dark"] .site-header .brand.brand-logo-only,
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:6px 10px;
  border-radius:14px;
  background:linear-gradient(180deg,#f3f7f5,#e8eeeb)!important;
  border:1px solid #d6e0da!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 4px 10px rgba(0,0,0,.08)!important;
}
html[data-esfx-theme="dark"] .site-header .brand.brand-logo-only img,
html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-brand img{
  filter:none!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact{
  background:#22313a!important;
  border-color:#344752!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact a{
  color:#d4e0e4!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact a:hover{
  background:#2d3e49!important;
  color:#f3f7f8!important;
}
html[data-esfx-theme="dark"] .site-header .lang-compact a.active{
  background:#dff3e7!important;
  color:#0d6f49!important;
}
html[data-esfx-theme="dark"] .site-header .header-all-nav-panel,
html[data-esfx-theme="dark"] .site-header .header-all-nav-grid{color:var(--text)!important}

/* Signal detail page hero: force dark branded block. */
html[data-esfx-theme="dark"] .signal-hero{
  background:linear-gradient(135deg,#24323b 0%, #223847 58%, #29415a 100%)!important;
  border:1px solid #364954!important;
  color:#f4f7f8!important;
  box-shadow:0 10px 28px rgba(4,10,15,.18)!important;
}
html[data-esfx-theme="dark"] .signal-hero:before{
  background:radial-gradient(circle,rgba(45,117,255,.28),transparent 64%)!important;
}
html[data-esfx-theme="dark"] .signal-hero .signal-symbol,
html[data-esfx-theme="dark"] .signal-hero .signal-direction,
html[data-esfx-theme="dark"] .signal-hero strong,
html[data-esfx-theme="dark"] .signal-hero span{
  color:inherit!important;
}
html[data-esfx-theme="dark"] .signal-hero .signal-tf{
  background:rgba(255,255,255,.10)!important;
  border-color:rgba(255,255,255,.14)!important;
  color:#eef5f6!important;
}
html[data-esfx-theme="dark"] .signal-hero-buy .signal-direction{color:#63e2b0!important}
html[data-esfx-theme="dark"] .signal-hero-sell .signal-direction{color:#ff8f98!important}
html[data-esfx-theme="dark"] .signal-confidence-ring{
  background:conic-gradient(#3b82f6 calc(var(--confidence)*1%), rgba(255,255,255,.12) 0)!important;
}
html[data-esfx-theme="dark"] .signal-confidence-ring:after{
  background:#22313a!important;
}
html[data-esfx-theme="dark"] .signal-publish-row>span{color:#bfd0d6!important}

/* Leftover white gradient / read-more strip in feed and expanded cards. */
html[data-esfx-theme="dark"] .idea-card-feed.is-truncated .idea-card-body:after{
  background:linear-gradient(to bottom,rgba(38,49,58,0), var(--surface) 82%)!important;
}
html[data-esfx-theme="dark"] .idea-view-shell .idea-card-read-more-row,
html[data-esfx-theme="dark"] .idea-view-shell .idea-card-footer,
html[data-esfx-theme="dark"] .idea-view-shell .idea-card-body{
  background:var(--surface)!important;
}
html[data-esfx-theme="dark"] .idea-view-shell .idea-card-read-more-row{
  border-top:1px solid var(--line)!important;
}
html[data-esfx-theme="dark"] .idea-view-shell .idea-read-more{
  color:#7fe2b2!important;
}

/* AppBar post button refinement for dark chrome. */
html[data-esfx-theme="dark"] .site-header .create-idea-btn{
  background:#179d69!important;
  border-color:#179d69!important;
  color:#fff!important;
  box-shadow:none!important;
}
html[data-esfx-theme="dark"] .site-header .create-idea-btn:hover{
  background:#1aae74!important;
  border-color:#1aae74!important;
}
