/* Signed-in night palette, drawn from the login foundry's blue glass materials.
   Authentication, daylight, administrator pages and financial logic are untouched. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) {
  --bg: #0c1928;
  --surface: #182c41;
  --surface-2: #1e344b;
  --surface-3: #29445f;
  --card: #182c41;
  --card-soft: #172a3e;
  --border: rgba(164, 208, 240, .15);
  --text: #eff8ff;
  --text-secondary: #b8ccdc;
  --muted: #9fb5c9;
  --accent: #94d9ff;
  --accent-soft: rgba(126, 203, 251, .11);
  --blue: #86c7ff;
  --blue-soft: rgba(118, 183, 246, .12);
  --positive: #79dfba;
  --positive-soft: rgba(121, 223, 186, .10);
  --danger: #ff93aa;
  --danger-soft: rgba(255, 147, 170, .10);
  --warning: #f1cc8f;
  --amber: #f1cc8f;
  --forge-accent: #94d9ff;
  --forge-ink: #eff8ff;
  --forge-muted: #adc2d4;
  --forge-soft: rgba(130, 201, 248, .09);
  --forge-line: rgba(164, 208, 240, .15);
  --forge-line-strong: rgba(164, 216, 250, .29);
  --forge-panel: linear-gradient(138deg, rgba(40, 63, 90, .78), rgba(23, 45, 68, .82) 57%, rgba(19, 39, 61, .88));
  --forge-shadow: inset 0 1px 0 rgba(216, 240, 255, .09), 0 12px 30px rgba(0, 8, 21, .17);
  --ui-line: var(--forge-line);
  --ui-highlight: rgba(213, 237, 255, .10);
  --ui-shadow: 0 12px 30px rgba(0, 8, 21, .17);
  --ui-control-shadow: inset 0 1px 0 rgba(217, 242, 255, .08), 0 2px 5px rgba(0, 9, 24, .12);
  --ui-selected: rgba(129, 204, 250, .12);
  --ui-selected-line: rgba(150, 219, 255, .24);
  --ui-header: rgba(16, 32, 49, .90);
  --control-top: rgba(207, 237, 255, .10);
  --control-bottom: rgba(0, 8, 20, .13);
  --control-shadow: rgba(0, 8, 20, .11);
  --control-pressed: rgba(0, 8, 20, .18);
  --brand-watermark-opacity: .022;
  color: var(--text);
  background:
    radial-gradient(ellipse 85% 620px at 12% 0, rgba(80, 130, 176, .24), transparent 75%),
    radial-gradient(ellipse 85% 660px at 100% 58%, rgba(45, 107, 158, .10), transparent 80%),
    linear-gradient(150deg, #102033, #0c1928 58%, #112438);
  color-scheme: dark;
}

/* Glass is concentrated on the surrounding chrome, not every scrolling row. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .topbar {
  background: rgba(17, 34, 52, .88);
  border-color: var(--forge-line);
  box-shadow: 0 6px 26px rgba(0, 8, 21, .10);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .topbar :is(.icon-button, .theme-toggle) {
  color: #bed7e9;
  background: linear-gradient(145deg, rgba(71, 106, 139, .23), rgba(26, 48, 71, .30));
  border-color: var(--forge-line-strong);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .topbar .platform-brand .platform-symbol {
  color: #b1e1ff;
  background: linear-gradient(145deg, #315a87, #1a3655);
  border-color: rgba(160, 210, 250, .3);
  box-shadow: inset 0 1px 0 #cceeff24, 0 5px 14px #030f202b;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .topbar .platform-wordmark b { color: #eff8ff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .topbar :is(.platform-tagline, .platform-wordmark small) { color: #a1bace; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.mode-pill, .paper-badge, .demo-label, .bt-badge) {
  color: #bedff4; border-color: var(--forge-line-strong); background: rgba(111, 174, 224, .08);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .home-user-avatar {
  background: #263f59; border-color: var(--forge-line-strong); color: var(--accent);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bottom-nav {
  background: linear-gradient(140deg, rgba(34, 55, 78, .93), rgba(16, 33, 52, .95));
  border-color: rgba(174, 217, 247, .21);
  box-shadow: inset 0 1px 0 #daefff12, 0 12px 36px #000e2566;
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bottom-nav button { color: #91abc0; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bottom-nav button.active { color: #b3e5ff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bottom-nav button.active .nav-icon {
  background: linear-gradient(145deg, #689dc42b, #5187b118);
  border-color: #aedfff24; box-shadow: inset 0 1px 0 #daefff12;
}

/* Main surfaces: soft blue reflections, quiet edges, consistent nested depth. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.panel, .portfolio-card, .wallet-card, .market-insight-card, .strategy-running-card, .copy-card, .ai-brief-card, .settings-group, .profile-menu, .strategy-hub-hero) {
  background: var(--forge-panel); border-color: var(--forge-line); box-shadow: var(--forge-shadow);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.home-assets, .wallet-card) {
  background: radial-gradient(ellipse at 95% 0, #83c9ff13, transparent 62%), linear-gradient(135deg, #2b425de8, #19334cdf 56%, #152b43eb);
  border-color: rgba(170, 220, 255, .24);
  box-shadow: inset 0 1px 0 #d8efff17, 0 15px 35px #000d242b;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .portfolio-card::after {
  border-color: #abdfff0b; box-shadow: 0 0 0 25px #9ad7ff04, 0 0 0 50px #9ad7ff02;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.running-strategy, .home-running, .recommend-card, .strategy-detail-actions button, .compact-position, .strategy-hub-plan-card, .strategy-hub-empty) {
  background: linear-gradient(145deg, rgba(36, 58, 83, .67), rgba(17, 36, 56, .55));
  border-color: var(--forge-line); color: var(--text);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .polished-profile { background: transparent; border: 0; box-shadow: none; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.wallet-card, .exchange-sheet) {
  --wallet-ink: #eff8ff; --wallet-muted: #a5bcd0; --wallet-line: rgba(164, 208, 240, .15);
  --wallet-soft: rgba(130, 201, 248, .07); --wallet-accent: #94d9ff;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .profile-sheet {
  --profile-ink: #eff8ff; --profile-muted: #a5bcd0; --profile-line: rgba(164, 208, 240, .15);
  --profile-field: #172d44; --profile-accent: #94d9ff;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .profile-portrait .avatar { background: linear-gradient(145deg, #3e668c, #254565); color: #d4efff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .portrait-camera { background: #a5dcfc; color: #153651; border-color: #203a54; }

/* Primary actions repeat the login button's ice-blue material. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.app-shell, #modal, .account-drawer) :is(.live-button, .primary-action) {
  color: #12354f; background: linear-gradient(112deg, #b4e8ff, #8bd3fa 58%, #7cc2ef);
  border: 1px solid rgba(182, 230, 255, .7);
  box-shadow: inset 0 1px 0 #f0fbff80, 0 5px 16px #4699d51a !important;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.app-shell, #modal, .account-drawer) :is(.live-button.secondary, .secondary-action, .pause-action) {
  background: linear-gradient(145deg, #35506b70, #203b5655); color: #d6ebfa;
  border: 1px solid var(--forge-line-strong); box-shadow: var(--ui-control-shadow) !important;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.app-shell, #modal, .account-drawer) :is(.live-button.danger, .auth-logout) {
  color: #ffabc0; background: rgba(156, 63, 89, .16); border: 1px solid rgba(255, 147, 170, .21);
  box-shadow: inset 0 1px 0 #ffcede0a !important;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.text-action, .recommend-link, .news-entry a>small, .strategy-detail-actions button>span, .text-button) { color: var(--accent); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.strategy-back, .profile-sheet-back, .bt-back) {
  color: #c1e6ff !important; background: linear-gradient(145deg, #29435ec7, #1c344dcc);
  border-color: var(--forge-line-strong); box-shadow: var(--ui-control-shadow) !important;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.app-shell, #modal) :is(.live-form input, .live-form select, .live-form textarea, .compact-config-grid input, .compact-config-grid select, .bt-controls select, .bt-interval select, .home-assets select) {
  color: var(--text); background: rgba(11, 29, 48, .47); border-color: var(--forge-line-strong);
  box-shadow: inset 0 1px 3px #000b1a12;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.app-shell, #modal) :is(input, textarea)::placeholder { color: #88a4bc; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.app-shell, #modal) :is(input, select, textarea):focus-visible { outline-color: #94d9ff; }

/* A single segmented-control family across home, markets and strategies. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.plaza-tabs, .news-tabs-five, .square-tabs, .home-strategy-tabs, .market-board-tabs) {
  background: rgba(10, 27, 45, .36); border-color: var(--forge-line);
  box-shadow: inset 0 1px 2px #010a150f;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.plaza-tabs, .news-tabs-five, .square-tabs, .home-strategy-tabs, .market-board-tabs) button.active {
  color: #c2eaff; background: linear-gradient(135deg, #52789b42, #41698e24);
  border-color: #a1d7fb2b; box-shadow: inset 0 1px 0 #d5edff0d, 0 2px 5px #000b1614 !important;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.period-buttons>button, .more-period>summary, .bt-periods button, .strategy-filters button, .market-filters button, .copy-filters button) {
  background: rgba(19, 40, 62, .6); color: var(--muted); border-color: var(--forge-line);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.period-buttons>button.active, .more-period>summary.active, .bt-periods button.active, .strategy-filters button.active, .market-filters button.active, .copy-filters button.active) {
  background: rgba(127, 204, 252, .14); color: #c2eaff; border-color: var(--forge-line-strong);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .home-assets .period-menu { background: #21394f; border-color: var(--forge-line-strong); box-shadow: 0 10px 28px #000a1f60; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .home-assets .period-menu button { background: transparent; color: #c5e3f7; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.home-assets .equity-curve, .home-assets .asset-spark-button, .strategy-example-svg) { color: #94d9ff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .equity-grid { stroke: #b7d7ee; stroke-opacity: .09; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .curve-point-label { background: #203b54; color: #d9efff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) #bt-equity-chart polyline { stroke: var(--accent); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .liquidation-chart>rect:first-child { fill: #10243b; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .strategy-type-icon.adaptive { background: #7bcdf015; color: #9edfff; border-color: #9bdbff2b; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .copy-card { --copy-accent: #94d9ff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .copy-card.blue { --copy-accent: #99bbff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .copy-card.violet { --copy-accent: #c3b3ef; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .copy-card footer button { background: #7fcaf612; color: #b6e6ff; border-color: var(--forge-line-strong); }

/* Trading and notification meaning stays distinct from the brand accent. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .positive { color: var(--positive) !important; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .negative { color: var(--danger) !important; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .market-change-up { color: var(--positive); background: var(--positive-soft); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .market-row .positive { background: var(--positive-soft); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .market-row .negative { background: var(--danger-soft); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.live-pill, .running-badge, .status-banner) { color: #afe5d2; background: #79dfba0b; border-color: #79dfba25; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.live-pill i, .running-badge i) { background: var(--positive); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .fear-value strong { color: var(--accent); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .ratio-values span { color: var(--positive); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .ratio-values span:last-child { color: var(--danger); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .ratio-scale { background: #db819d; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .ratio-scale span { background: #6dc9af; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .sentiment-scale { background: linear-gradient(90deg, #d7879f, #d6bd90, #81c9b0); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .sentiment-scale i { background: #d0eaff; box-shadow: 0 0 0 2px #233b53; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.bt-progress i, .bt-dot) { background: #94d9ff; }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bt-dot.close { background: var(--warning); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bt-event-icon { background: var(--accent-soft); color: var(--accent); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bt-event-icon.exit { background: #f1cc8f12; color: var(--warning); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .bt-error { background: #c7627b17; border-color: #ff93aa26; color: #ffb3c6; }

/* Sheets and the account drawer share the same glass hierarchy. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(dialog#modal, .account-drawer) {
  color: var(--text); background: linear-gradient(145deg, #263d56f5, #152d46fa);
  border-color: var(--forge-line-strong); box-shadow: inset 0 1px 0 #d9efff15, 0 26px 80px #000a2066;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) dialog::backdrop { background: #030c1a8c; -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(dialog#modal #modal-close, .drawer-close) { background: #a4d8ff0d; color: #c1dcee; border-color: var(--forge-line-strong); }
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) dialog.account-hub-drawer {
  --hub-bg: #14283d; --hub-card: #223b54; --hub-soft: #29445d;
  --hub-line: rgba(164, 208, 240, .15); --hub-text: #eff8ff; --hub-muted: #a5bcd0;
  --hub-accent: #94d9ff; --hub-tint: rgba(130, 201, 248, .10);
  background: linear-gradient(160deg, #29405b, #14283d 40%, #112338);
  box-shadow: 18px 0 65px #000a203b;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) #toast { color: #e2f3ff; background: #294760f5; border: 1px solid var(--forge-line-strong); box-shadow: 0 12px 35px #000c2559; }
@media(hover:hover) {
  :root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.strategy-market-row, .home-strategy-row, .wallet-fold>summary, .profile-menu>button, .profile-menu>a):hover { background: #94d9ff08; }
  :root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.live-button, .primary-action):not(:disabled):hover { filter: brightness(1.045); }
}
