/* UI-18: unified navy + cool-silver glass surfaces across Preview. Preserve market semantic colors and chart drawing. */
:root, html, html[data-theme], body.v7-ui {
  --bg:#0b1427 !important;
  --surface:rgba(18,31,53,.82) !important;
  --panel:rgba(22,38,64,.78) !important;
  --panel-2:rgba(29,48,77,.78) !important;
  --panel-3:rgba(36,57,88,.78) !important;
  --line:rgba(190,213,245,.24) !important;
  --text:#edf4ff !important;
  --muted:#b4c3da !important;
  --gold:#f0c96b !important;
  --gold2:#c9a84f !important;
}
html, body.v7-ui, body.v7-ui #app, body.v7-ui #app.shell,
body.v7-ui .main, body.v7-ui main, body.v7-ui .view,
body.v7-ui #dashboard {
  background-color:#0b1427 !important;
  background-image:radial-gradient(ellipse at 14% 0%,rgba(53,99,160,.22),transparent 43%),
                   radial-gradient(ellipse at 92% 18%,rgba(37,72,121,.18),transparent 38%),
                   linear-gradient(145deg,#0b1427 0%,#101e35 54%,#0b1427 100%) !important;
  color:#edf4ff !important;
}
/* One glass treatment for application cards, news, footer and account/preferences surfaces. */
body.v7-ui :is(
  article,.card,.panel,.tile,.widget,.module,.section-card,
  .dv2-sec,.dv2-card,.dv3-k,.sentiment-card,.analysis-hub-card,
  .connected-card,.bx-intel,.bx-priority,.bx-period,.multi-card,
  .portfolio-risk-card,.lifecy,.news-card,.news-item,.news-strip,
  .marfa-news-card,.marfa-auth-card,.settings-card,.preference-card,
  .account-card,.myspace-card,.tool-card,.glass-card
) {
  background-color:rgba(20,35,59,.70) !important;
  background-image:linear-gradient(135deg,rgba(220,235,255,.105),rgba(125,163,212,.035) 48%,rgba(5,14,29,.16)) !important;
  border-color:rgba(190,213,245,.27) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),inset 0 -1px 0 rgba(3,10,23,.22),0 10px 28px rgba(0,0,0,.19) !important;
  -webkit-backdrop-filter:blur(18px) saturate(135%) !important;
  backdrop-filter:blur(18px) saturate(135%) !important;
  color:#edf4ff;
}
body.v7-ui :is(.side,aside.side,.sidebar,.topbar,.header,.ticker,.market-ticker) {
  background-color:rgba(13,25,44,.84) !important;
  background-image:linear-gradient(145deg,rgba(180,208,245,.12),rgba(13,25,44,.42)) !important;
  border-color:rgba(190,213,245,.26) !important;
  -webkit-backdrop-filter:blur(22px) saturate(145%) !important;
  backdrop-filter:blur(22px) saturate(145%) !important;
}
/* Remove legacy brown/bronze from footer and its inner strips. */
body.v7-ui footer.marfa-site-footer,
body.v7-ui footer.marfa-site-footer.fs,
body.v7-ui .marfa-site-footer .fs-bottom,
body.v7-ui .marfa-site-footer .mf-brand,
body.v7-ui .marfa-site-footer .mf-links {
  background-color:rgba(16,29,49,.86) !important;
  background-image:linear-gradient(135deg,rgba(198,219,248,.10),rgba(8,18,33,.25)) !important;
  border-color:rgba(190,213,245,.24) !important;
  color:#c4d2e7 !important;
}
body.v7-ui :is(.marfa-auth-card,.auth-card,.login-card,.register-card) {
  background:linear-gradient(145deg,rgba(30,48,76,.88),rgba(13,25,44,.86)) !important;
  border:1px solid rgba(195,216,246,.34) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 22px 55px rgba(0,0,0,.34) !important;
  -webkit-backdrop-filter:blur(24px) saturate(140%) !important;
  backdrop-filter:blur(24px) saturate(140%) !important;
}
body.v7-ui :is(.marfa-auth-card .auth-tabs button.active,.marfa-auth-card .loginButton) {
  background:linear-gradient(135deg,#f6d77c,#c9a348) !important;
  border:1px solid rgba(255,235,166,.75) !important;
  color:#172238 !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 5px 15px rgba(201,163,72,.22) !important;
}
/* Shared interaction contract across views; preserves per-feature gradients and trade semantics. */
body.v7-ui :is(button,.btn,.nav-btn,.tab-btn,.chip,.pill):not(.up):not(.down):not(.buy):not(.sell) {
  border-color:var(--marfa-button-border,rgba(190,213,245,.27));
}
html[data-theme] body.v7-ui #app.app.marfa-converted :is(button,.btn,.nav-btn,.tab-btn):not(.up):not(.down):not(.buy):not(.sell):not(.danger):not(:disabled):hover {
  border-color:var(--marfa-button-hover-border,rgba(240,201,107,.68)) !important;
  box-shadow:var(--marfa-button-hover-shadow,0 5px 18px rgba(2,9,20,.22),inset 0 1px 0 rgba(255,255,255,.12));
}
/* Keep chart canvas/SVG rendering and green/red market semantics intact. */
body.v7-ui canvas,body.v7-ui svg,body.v7-ui iframe,
body.v7-ui .tv-lightweight-charts,body.v7-ui .tradingview-widget-container {
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
}
@media (prefers-reduced-transparency: reduce) {
  body.v7-ui :is(article,.card,.panel,.dv2-sec,.dv2-card,.dv3-k,.marfa-site-footer) {
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
  }
}

/* Final high-specificity cleanup for legacy !important bronze rules loaded by older modules. */
html body.v7-ui #app main,
html body.v7-ui #app .main,
html body.v7-ui #app .view,
html body.v7-ui #app #dashboard,
html body.v7-ui main,
html body.v7-ui .main {
  background-color:rgba(12,24,43,.26) !important;
  background-image:linear-gradient(145deg,rgba(25,43,69,.30),rgba(7,17,32,.22)) !important;
}
html body.v7-ui #app footer.marfa-site-footer,
html body.v7-ui footer.marfa-site-footer,
html body.v7-ui footer.marfa-site-footer.fs {
  background:linear-gradient(145deg,rgba(29,47,74,.88),rgba(10,22,39,.94)) !important;
  border:1px solid rgba(190,213,245,.28) !important;
  color:#c4d2e7 !important;
}
html body.v7-ui #app footer.marfa-site-footer * {
  border-color:rgba(190,213,245,.23);
}
html body.v7-ui #app .marfa-auth-card,
html body.v7-ui .marfa-auth-card {
  background:linear-gradient(145deg,rgba(30,48,76,.92),rgba(13,25,44,.94)) !important;
  border:1px solid rgba(195,216,246,.34) !important;
}
html body.v7-ui #app :is(.dv2-hero,.dv2-hnote,.dv2-kpi,.dv3-hero,.news-card,.news-item,.news-strip) {
  background-color:rgba(20,35,59,.76) !important;
  background-image:linear-gradient(135deg,rgba(220,235,255,.10),rgba(8,18,33,.24)) !important;
  border-color:rgba(190,213,245,.27) !important;
}

/* UI-18 fix 2: neutralize legacy brown radial gradients with higher-specificity surface rules. */
html body.v7-ui.v7-dark,
html body.v7-ui.v7-dark #app,
html body.v7-ui.v7-dark #app .main,
html body.v7-ui.v7-dark #app main,
html body.v7-ui.v7-dark #app .view,
html body.v7-ui.v7-dark #app #dashboard {
 background-image:
  radial-gradient(ellipse at 12% 0%,rgba(65,112,177,.17),transparent 43%),
  radial-gradient(ellipse at 90% 20%,rgba(47,84,143,.13),transparent 40%),
  linear-gradient(145deg,#0b1427 0%,#101e35 54%,#0b1427 100%) !important;
 background-color:#0b1427 !important;
}
html body.v7-ui.v7-dark #app :is(.news-strip,.news-card,.news-item,.dv2-hero,.dv2-hnote,.dv2-kpi,.dv3-hero) {
 background-color:rgba(20,35,59,.78) !important;
 background-image:linear-gradient(135deg,rgba(220,235,255,.09),rgba(8,18,33,.25)) !important;
 border-color:rgba(190,213,245,.27) !important;
}
html body.v7-ui.v7-dark #app footer.marfa-site-footer,
html body.v7-ui.v7-dark footer.marfa-site-footer {
 background-color:rgba(13,26,45,.94) !important;
 background-image:linear-gradient(145deg,rgba(32,53,82,.88),rgba(10,22,39,.96)) !important;
 border-color:rgba(190,213,245,.28) !important;
}

/* UI-18 fix 3: enforce cool navy base independent of theme-class naming. */
html body.v7-ui,
html body.v7-ui #app,
html body.v7-ui #app.shell {
  background-color:#0b1427 !important;
  background-image:
    radial-gradient(ellipse at 12% 0%,rgba(65,112,177,.17),transparent 43%),
    radial-gradient(ellipse at 90% 20%,rgba(47,84,143,.13),transparent 40%),
    linear-gradient(145deg,#0b1427 0%,#101e35 54%,#0b1427 100%) !important;
  color:#edf4ff !important;
}
html body.v7-ui #app :is(main,.main,.view,#dashboard) {
  background-color:rgba(12,24,43,.20) !important;
  background-image:linear-gradient(145deg,rgba(25,43,69,.22),rgba(7,17,32,.18)) !important;
}
html body.v7-ui #app :is(.news-strip,.news-card,.news-item,.dv2-hero,.dv2-hnote,.dv2-kpi,.dv3-hero) {
  background-color:rgba(20,35,59,.78) !important;
  background-image:linear-gradient(135deg,rgba(220,235,255,.10),rgba(8,18,33,.24)) !important;
  border-color:rgba(190,213,245,.27) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 10px 28px rgba(0,0,0,.19) !important;
  -webkit-backdrop-filter:blur(18px) saturate(135%) !important;
  backdrop-filter:blur(18px) saturate(135%) !important;
}
