
/* FAR-240 final authoritative overrides: loaded after all legacy styles. */

/* A. Utility controls: visual LEFT side of the top header. */
html body.v7-ui .main>header.top{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  direction:ltr!important;
  min-height:56px!important;
  padding-inline:18px!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  border:0!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html body.v7-ui .main>header.top .head-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  direction:rtl!important;
  width:auto!important;
  flex:0 0 auto!important;
  margin:0!important;
  gap:8px!important;
}

/* B. MARFA global price rail: six visually equal, accessible glass chips.
   One central visual law for every tab; market values and click handlers are owned
   by the existing feed engine, never transformed by this CSS. */
html body.v7-ui .main>.ticker.tick,
html body.v7-ui .main>.ticker.live-ticker{
  display:grid!important;
  grid-template-columns:minmax(160px,.84fr) repeat(5,minmax(0,1fr))!important;
  grid-template-rows:44px!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  gap:8px!important;
  width:100%!important;
  min-height:56px!important;
  height:56px!important;
  padding:6px 16px!important;
  margin:0!important;
  overflow:hidden!important;
  direction:ltr!important;
  box-sizing:border-box!important;
}
html body.v7-ui .main>.ticker>span{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:6px!important;
  min-width:0!important;
  min-height:44px!important;
  height:44px!important;
  padding:6px 9px!important;
  margin:0!important;
  border-radius:11px!important;
  box-sizing:border-box!important;
  white-space:nowrap!important;
  direction:ltr!important;
  background:var(--marfa-g3-inner)!important;
  border:1px solid var(--marfa-g3-border)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.17),inset 0 -1px 0 rgba(5,14,29,.27),0 3px 8px rgba(0,6,20,.14)!important;
}
html body.v7-ui .main>.ticker>.ticker-source{
  grid-column:1!important;grid-row:1!important;
  justify-content:center!important;
  font-size:10.5px!important;font-weight:800!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
  opacity:.92!important;
}
html body.v7-ui .main>.ticker>span:nth-child(1){grid-column:6!important;grid-row:1!important}
html body.v7-ui .main>.ticker>span:nth-child(2){grid-column:5!important;grid-row:1!important}
html body.v7-ui .main>.ticker>span:nth-child(3){grid-column:4!important;grid-row:1!important}
html body.v7-ui .main>.ticker>span:nth-child(4){grid-column:3!important;grid-row:1!important}
html body.v7-ui .main>.ticker>span:nth-child(5){grid-column:2!important;grid-row:1!important}
html body.v7-ui .main>.ticker>span :is(img,small,b,i){flex-shrink:0!important}
html body.v7-ui .main>.ticker span small{
  font-size:10.5px!important;font-weight:800!important;
  line-height:1!important;white-space:nowrap!important;
}
html body.v7-ui .main>.ticker span b{
  font-size:clamp(12px,.93vw,14px)!important;
  font-weight:850!important;
  font-variant-numeric:tabular-nums!important;
  line-height:1!important;white-space:nowrap!important;
}
html body.v7-ui .main>.ticker span i{
  font-size:10px!important;font-weight:800!important;
  line-height:1!important;white-space:nowrap!important;
  font-style:normal!important;
}
/* If the market feed is unavailable, the honest status occupies the full rail.
   Never paint an error into the BTC column or imply a sample/live quote. */
html body.v7-ui .main>.ticker>span.ticker-error{
  grid-column:1 / -1!important;grid-row:1!important;
  width:100%!important;flex:1 1 auto!important;order:0!important;
  justify-content:center!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
/* C. Market sessions left; user + local clock right. */
html body.v7-ui .market-clock{
  display:flex!important;
  align-items:center!important;
  direction:ltr!important;
  gap:10px!important;
  padding:10px 18px!important;
}
html body.v7-ui .market-list{
  order:1!important;
  flex:1 1 auto!important;
  display:flex!important;
  justify-content:flex-start!important;
  align-items:center!important;
  gap:7px!important;
  direction:rtl!important;
  min-width:0!important;
}
html body.v7-ui .market-user-cluster{
  order:2!important;
  margin-left:auto!important;
  margin-right:0!important;
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  direction:rtl!important;
}

/* D. Dashboard date under title is gone even during stale-script/cache transitions. */
html body.v7-ui #dashboard #dv2Hero .dv2-hero>div:first-child>p{display:none!important}

/* E. Chart type lives with chart toolbar icons, not in timeframe controls. */
html body.v7-ui #dashboard #dv3 .dv3-acts{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  flex-wrap:wrap!important;
}
html body.v7-ui #dashboard #dv3 .dv3-type-top{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  direction:ltr!important;
  margin:0!important;
}
html body.v7-ui #dashboard #dv3 .dv3-type-top button{
  min-height:36px!important;
  padding:0 12px!important;
  white-space:nowrap!important;
}

/* F. One coherent light theme. This deliberately overrides dark legacy shell/card declarations. */
html[data-theme=light],
html[data-theme=light] body,
html[data-theme=light] body.v7-ui{
  background:#f6f1e7!important;
  color:#29231a!important;
  color-scheme:light!important;
}
html[data-theme=light] body.v7-ui #app,
html[data-theme=light] body.v7-ui #app.shell,
html[data-theme=light] body.v7-ui #app.app.marfa-converted,
html[data-theme=light] body.v7-ui #app.shell>main,
html[data-theme=light] body.v7-ui #app.app.marfa-converted>.main,
html[data-theme=light] body.v7-ui .main,
html[data-theme=light] body.v7-ui .view,
html[data-theme=light] body.v7-ui #dashboard.mockup-dashboard{
  background:#f6f1e7!important;
  color:#29231a!important;
}
html[data-theme=light] body.v7-ui #app.shell>aside,
html[data-theme=light] body.v7-ui #app.app.marfa-converted>.side,
html[data-theme=light] body.v7-ui aside.side{
  background:#fffaf1!important;
  color:#29231a!important;
  border-color:#d8c7a8!important;
}
html[data-theme=light] body.v7-ui :is(
  article,.card,.panel,.mcc-card,.workspace-card,.ua-card,.connected-card,
  .dv2-sec,.dv2-card,.dv3-k,.news-strip,.marfa-site-footer,
  .analysis-hub-card,.multi-card,.portfolio-risk-card,.lifecycle-ledger,
  .bb-card,.bb-col,.bb-score,.bb-verdict,.oi-card,.mi-card
){
  background:#fffaf1!important;
  color:#29231a!important;
  border-color:#ddd0b8!important;
  box-shadow:none!important;
}
html[data-theme=light] body.v7-ui .main>header.top,
html[data-theme=light] body.v7-ui .main>.ticker,
html[data-theme=light] body.v7-ui .market-clock{
  background:#eee3cf!important;
  color:#332817!important;
  border-color:#d3bd91!important;
}
html[data-theme=light] body.v7-ui .main>.ticker>span,
html[data-theme=light] body.v7-ui .market-choice,
html[data-theme=light] body.v7-ui .market-profile,
html[data-theme=light] body.v7-ui .market-user-clock,
html[data-theme=light] body.v7-ui .theme-btn,
html[data-theme=light] body.v7-ui .header-alert,
html[data-theme=light] body.v7-ui .header-language,
html[data-theme=light] body.v7-ui input,
html[data-theme=light] body.v7-ui select{
  background:#fffaf1!important;
  color:#332817!important;
  border-color:#cfb98f!important;
}
html[data-theme=light] body.v7-ui .marfa-site-footer{
  background:#efe5d4!important;
  color:#5d5448!important;
  border-color:#d7c39e!important;
}
html[data-theme=light] body.v7-ui .marfa-site-footer :is(a,b,strong,h3,h4,button){color:#332817!important}

/* The ticker has ONE layout regardless of desktop sidebar state.
   Fixed visual bounds prevent excessive stretch; horizontal scrolling preserves
   full price cards when the available main width is insufficient. */
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker){
 display:flex!important;direction:rtl!important;flex-flow:row nowrap!important;
 align-items:center!important;justify-content:safe center!important;
 gap:8px!important;width:100%!important;height:52px!important;min-height:52px!important;
 padding:5px 12px!important;margin:0!important;box-sizing:border-box!important;
 overflow-x:auto!important;overflow-y:hidden!important;
 scrollbar-width:thin!important;scrollbar-color:rgba(175,197,222,.3) transparent!important;
 scroll-snap-type:x proximity!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol]{
 grid-column:auto!important;grid-row:auto!important;order:0!important;
 flex:0 1 198px!important;width:198px!important;min-width:168px!important;max-width:205px!important;
 height:42px!important;min-height:42px!important;scroll-snap-align:start!important;
}
/* Consistent compact card internals, including 3D coin icons added at runtime. */
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol]:has(>img.mci,>img.marfa-coin-icon){
 flex:0 1 198px!important;width:198px!important;min-width:168px!important;max-width:205px!important;
 justify-content:space-between!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol]{
 gap:5px!important;padding:5px 9px!important;border-radius:10px!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol] > img:is(.mci,.marfa-coin-icon){
 width:23px!important;height:24px!important;min-width:23px!important;flex:0 0 23px!important;margin:0!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol] > small{
 font-size:10px!important;min-width:0!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol] > b{
 font-size:clamp(12px,.85vw,14px)!important;text-align:center!important;min-width:0!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span[data-ticker-symbol] > i{
 font-size:10px!important;text-align:left!important;min-width:0!important;
}
/* Provider attribution is not a price card. Hide ONLY its visual label;
   keep the existing price-fetch engine, provider metadata and error state. */
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > .ticker-source{
 display:none!important;
}
html body.v7-ui #app.app.marfa-converted > main.main > .ticker:is(.tick,.live-ticker) > span.ticker-error{
 flex:1 0 100%!important;width:100%!important;min-width:0!important;max-width:none!important;
}
@media(max-width:760px){
  html body.v7-ui .main>header.top{padding-inline:12px!important}
  html body.v7-ui .main>header.top .head-actions{gap:6px!important}
  html body.v7-ui .market-clock{flex-wrap:wrap!important;padding-inline:12px!important}
  html body.v7-ui .market-list{flex:1 0 100%!important;overflow-x:auto!important}
}


/* MARFA unified header: move the same live session controls beside search. */
html body.v7-ui .main>header.top.marfa-top-market-unified{
 background:transparent!important;background-image:none!important;
 box-shadow:none!important;border:0!important;
 backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
 display:flex!important;align-items:center!important;justify-content:flex-start!important;
 flex-wrap:nowrap!important;column-gap:10px!important;min-width:0!important;
 padding-block:5px!important;min-height:60px!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified>.head-actions{
 flex:0 1 auto!important;min-width:0!important;display:flex!important;align-items:center!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{
 display:flex!important;align-items:center!important;justify-content:flex-start!important;
 flex:1 1 auto!important;min-width:0!important;width:auto!important;
 max-width:none!important;min-height:0!important;height:auto!important;
 margin:0!important;padding:0!important;border:0!important;
 border-radius:0!important;background:transparent!important;box-shadow:none!important;
 gap:8px!important;overflow:visible!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-list{
 order:1!important;display:flex!important;flex:1 1 auto!important;min-width:0!important;
 max-width:100%!important;width:auto!important;margin:0!important;
 gap:6px!important;justify-content:center!important;overflow-x:auto!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-choice{
 min-width:69px!important;height:40px!important;min-height:40px!important;padding:5px 8px!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-choice.active{min-width:112px!important}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-cluster{
 order:2!important;display:flex!important;flex:0 0 auto!important;min-width:0!important;
 margin:0 0 0 auto!important;gap:0!important;align-items:center!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-profile{
 min-width:110px!important;max-width:160px!important;padding:4px 8px!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-clock{
 min-width:100px!important;min-height:36px!important;padding:4px 7px!important;
}
/* Desktop shell owns one invariant header row across sidebar widths.
   Narrow the market-list viewport instead of wrapping the header itself. */
@media(min-width:1181px){
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified{
  display:grid!important;direction:ltr!important;
  grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,280px)!important;
  grid-template-rows:60px!important;
  align-items:center!important;justify-content:stretch!important;
  column-gap:8px!important;row-gap:0!important;
  height:60px!important;min-height:60px!important;max-height:60px!important;
  padding:0 12px!important;box-sizing:border-box!important;
  flex-wrap:nowrap!important;overflow:visible!important;
 }
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified > .head-actions{
  grid-column:1!important;grid-row:1!important;min-width:0!important;
  width:max-content!important;max-width:100%!important;justify-self:start!important;
 }
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified > .market-clock{
  display:contents!important;
 }
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified .market-list{
  grid-column:2!important;grid-row:1!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  display:flex!important;flex-wrap:nowrap!important;
  justify-content:flex-start!important;align-items:center!important;
  overflow-x:auto!important;overflow-y:hidden!important;
  gap:6px!important;white-space:nowrap!important;
  scrollbar-width:none!important;
 }
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified .market-list::-webkit-scrollbar{display:none!important}
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified .market-choice{
  flex:0 0 auto!important;
 }
 html body.v7-ui #app.app.marfa-converted > main.main > header.top.marfa-top-market-unified .market-user-cluster{
  grid-column:3!important;grid-row:1!important;
  width:100%!important;min-width:0!important;max-width:280px!important;
  justify-self:end!important;justify-content:flex-end!important;
  margin:0!important;
 }
}

@media(max-width:650px){
 html body.v7-ui .main>header.top.marfa-top-market-unified{padding-inline:9px!important}
 html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{flex-wrap:wrap!important;gap:5px!important}
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-list{order:2!important;flex:1 0 100%!important;max-width:100%!important;overflow-x:auto!important}
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-cluster{order:1!important;flex:1 1 auto!important}
}


/* Three equal-height functional zones on wide desktop. Keep legacy two-row mobile fallback. */
@media (min-width:1300px) and (max-width:1650px){
 html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions #msxTrig{
   width:clamp(166px,13vw,220px)!important;min-width:145px!important;max-width:220px!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-list{justify-content:center!important}
}
html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions,
html body.v7-ui .main>header.top.marfa-top-market-unified .market-list,
html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-cluster{align-items:center!important}
/* Header control baseline and balanced desktop center. Visual-only shared shell.
   On wide layouts use three grid columns so sessions center to the header,
   not to the space left after the search controls. */
html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions>.msx-trig,
html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions>.header-alert,
html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions>.header-language,
html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions>.mdh-toggle{
 height:44px!important;min-height:44px!important;box-sizing:border-box!important;
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .head-actions>.header-language button{
 height:42px!important;min-height:42px!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-choice{
 height:44px!important;min-height:44px!important;
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
}
@media(min-width:1600px){
 html body.v7-ui .main>header.top.marfa-top-market-unified{
   display:grid!important;grid-template-columns:minmax(max-content,1fr) minmax(400px,520px) minmax(0,1fr)!important;
   grid-template-rows:44px!important;align-items:center!important;gap:12px!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified>.head-actions{
   grid-column:1!important;grid-row:1!important;justify-self:center!important;
   align-self:center!important;width:max-content!important;max-width:100%!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{
   display:contents!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-list{
   grid-column:2!important;grid-row:1!important;justify-self:center!important;
   align-self:center!important;flex:none!important;max-width:520px!important;
   width:100%!important;height:44px!important;min-height:44px!important;
   justify-content:space-evenly!important;gap:6px!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-cluster{
   grid-column:3!important;grid-row:1!important;justify-self:center!important;
   align-self:center!important;margin:0!important;
 }
}
/* Primary Add Tool action stays accent-colored on mobile, where the desktop
   personalization rules are intentionally not active. */
html body.v7-ui #app.app.marfa-converted #myspace button.ms-btn.pri{
  background:radial-gradient(circle at 26% 0%,rgba(212,175,110,.19),transparent 58%),linear-gradient(145deg,#554427 0%,#352b1e 57%,#48381f 100%)!important;
  border-color:rgba(207,169,103,.87)!important;
  color:#f6e7c8!important;
  box-shadow:inset 0 2px 1px rgba(255,234,188,.25),inset 0 -3px 0 rgba(25,18,10,.43),0 3px 0 rgba(33,22,12,.60),0 8px 18px rgba(0,5,16,.34)!important;
}
/* Preserve the existing wallet route's hidden clock when its DOM parent moves. */
/* Superseded: a view may not hide controls inside the shared header. */


/* Header clock + responsive spacing, preview, visual-only.
   Reuse existing session/time/profile controls, no duplicated DOM or timers. */
html body.v7-ui .main>header.top.marfa-top-market-unified{
  height:auto!important;min-height:60px!important;max-height:none!important;
  flex-basis:auto!important;align-content:center!important;
  box-sizing:border-box!important;
}
html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .local-clock.market-user-clock{
  display:flex!important;align-items:center!important;justify-content:center!important;
  flex-direction:row!important;gap:7px!important;
  min-width:158px!important;height:44px!important;min-height:44px!important;
  padding:5px 11px!important;border-radius:12px!important;
  background:var(--marfa-g3-inner)!important;
  border:1px solid var(--marfa-g3-border)!important;
  box-shadow:var(--marfa-g3-depth)!important;
  color:var(--marfa-field-text)!important;
  direction:ltr!important;white-space:nowrap!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-clock b{
  font-size:13px!important;line-height:1.2!important;
  color:var(--marfa-field-text)!important;font-variant-numeric:tabular-nums!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-clock small{
  display:inline!important;font-size:10px!important;line-height:1.2!important;
  color:var(--marfa-text-muted,#afc4df)!important;opacity:.92!important;
}
html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{
  background:transparent!important;box-shadow:none!important;
  align-self:stretch!important;
}
@media(max-width:1299px){
 html body.v7-ui .main>header.top.marfa-top-market-unified{
   min-height:0!important;height:auto!important;max-height:none!important;
   flex-basis:auto!important;flex-wrap:wrap!important;row-gap:6px!important;
   padding:7px 12px!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified>.head-actions{order:1!important;min-height:38px!important}
 html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{
   order:2!important;flex:1 0 100%!important;min-height:44px!important;
   margin:0!important;padding:0!important;
 }
}
@media (min-width:651px) and (max-width:1299px){
 html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{
   flex-wrap:nowrap!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-list{
   flex:1 1 0!important;min-width:0!important;max-width:100%!important;
   overflow-x:auto!important;white-space:nowrap!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-cluster{
   flex:0 0 auto!important;max-width:270px!important;
 }
}
@media(max-width:650px){
 html body.v7-ui .main>header.top.marfa-top-market-unified{
   height:auto!important;min-height:0!important;max-height:none!important;
   align-items:flex-start!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified>.market-clock{
   flex-wrap:wrap!important;align-self:auto!important;row-gap:6px!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-cluster{
   width:auto!important;max-width:100%!important;flex:0 1 auto!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-clock{
   min-width:100px!important;height:38px!important;min-height:38px!important;padding:3px 8px!important;
 }
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-user-clock small{font-size:9px!important}
 html body.v7-ui .main>header.top.marfa-top-market-unified .market-list{
   min-width:0!important;flex:1 1 100%!important;margin:0!important;
 }
}


/* One coherent glass capsule for local time + profile (the same two live controls). */
html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  gap:0!important;min-height:44px!important;height:44px!important;
  padding:0 3px!important;border-radius:13px!important;
  background:var(--marfa-g3-inner)!important;
  border:1px solid var(--marfa-g3-border)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.20),0 3px 0 rgba(7,14,28,.28),0 8px 18px rgba(5,12,27,.20)!important;
  overflow:hidden!important;box-sizing:border-box!important;
}
html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .local-clock.market-user-clock{
  height:40px!important;min-height:40px!important;min-width:0!important;width:153px!important;flex:0 1 153px!important;
  padding:0 8px!important;gap:6px!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;
  direction:ltr!important;
}
html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .market-user-clock b{
  font-family:Vazirmatn,Inter,sans-serif!important;
  font-size:13px!important;font-weight:700!important;letter-spacing:0!important;
  font-variant-numeric:normal!important;
}
html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .market-profile{
  display:flex!important;align-items:center!important;justify-content:center!important;
  min-height:40px!important;height:40px!important;min-width:0!important;width:116px!important;flex:0 1 116px!important;
  margin:0!important;padding:3px 7px!important;box-sizing:border-box!important;
  border:0!important;border-radius:0!important;
  border-inline-end:1px solid var(--marfa-g3-border)!important;
  background:transparent!important;box-shadow:none!important;
}
html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .market-profile:hover{
  background:rgba(147,179,224,.12)!important;
}
html[data-theme="light"] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster{
  background:var(--marfa-g3-inner)!important;
}
@media(max-width:650px){
 html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster{
   min-height:40px!important;height:40px!important;
 }
 html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .local-clock.market-user-clock{
   height:36px!important;min-height:36px!important;min-width:107px!important;padding:0 7px!important;
 }
 html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster .market-profile{
   height:36px!important;min-height:36px!important;min-width:91px!important;padding:2px 6px!important;
 }
}


/* Visual close-action contract for the current approved work area.
   Targets only explicit close controls; move/resize/other buttons untouched. */
html[data-theme] body.v7-ui #app.app.marfa-converted #myspace :is(.ms-ch button[data-a="x"],.ms-box button[data-a="close"]),
html[data-theme] body.v7-ui:has(#myspace.view.active) #marfaAsst .aw-x{
  color:#ffb5bc!important;
  background:linear-gradient(145deg,rgba(250,132,151,.22),rgba(108,34,56,.26))!important;
  border:1px solid rgba(255,136,155,.62)!important;
  border-radius:10px!important;
  box-shadow:inset 0 1px rgba(255,230,238,.25),0 4px 12px rgba(20,4,13,.21)!important;
  text-shadow:0 1px 5px rgba(255,140,160,.18)!important;
}
html[data-theme] body.v7-ui #app.app.marfa-converted #myspace :is(.ms-ch button[data-a="x"],.ms-box button[data-a="close"]):hover,
html[data-theme] body.v7-ui:has(#myspace.view.active) #marfaAsst .aw-x:hover{
  color:#fff1f3!important;
  background:linear-gradient(145deg,rgba(239,97,122,.48),rgba(145,36,62,.60))!important;
  border-color:rgba(255,171,186,.92)!important;
  box-shadow:inset 0 1px rgba(255,237,241,.36),0 5px 17px rgba(168,28,60,.24)!important;
}
html[data-theme="light"] body.v7-ui #app.app.marfa-converted #myspace :is(.ms-ch button[data-a="x"],.ms-box button[data-a="close"]){
  color:#a51f39!important;background:linear-gradient(145deg,rgba(255,210,219,.80),rgba(248,172,190,.55))!important;
  border-color:rgba(181,66,89,.57)!important;
}


/* Viewport-safe global language popup: anchor away from the screen edge.
   Overrides only the JS-injected menu positioning; selection logic unchanged. */
@media(min-width:701px){
 html body.v7-ui .main>header.top .lang-wrap>.lang-menu{
   left:0!important;right:auto!important;
   inset-inline-start:0!important;inset-inline-end:auto!important;
   max-width:min(220px,calc(100vw - 22px))!important;
 }
}
@media(max-width:700px){
 html body.v7-ui .main>header.top .lang-wrap>.lang-menu{
   left:auto!important;right:0!important;
   inset-inline-start:auto!important;inset-inline-end:0!important;
   max-width:min(220px,calc(100vw - 22px))!important;
 }
}


@media(min-width:768px){
/* The search shortcut and label share a single text baseline. */
html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified #msxTrig{
 white-space:nowrap!important;min-height:44px!important;max-height:44px!important;
 overflow:hidden!important;
}
html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified #msxTrig .tx{
 display:block!important;flex:1 1 auto!important;min-width:0!important;
 overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}
html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified #msxTrig .msx-kbd{
 flex:0 0 auto!important;white-space:nowrap!important;
}
}

/* GLOBAL HEADER REGRESSION GUARD | exact same shell on all tab transitions.
   The legacy head-actions flex-wrap:wrap caused 96px controls inside a 60px
   header while viewport/sidebar constraints were recalculated. Let the grid
   reserve intrinsic control width, never allow a second invisible control row. */
@media(min-width:768px){
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified>.head-actions{
   display:flex!important;
   flex-flow:row nowrap!important;
   align-items:center!important;
   height:44px!important;min-height:44px!important;max-height:44px!important;
   white-space:nowrap!important;
 }
}

/* TASK05_HEADER_BALANCED_RESPONSIVE | shared header geometry only.
   Three genuinely balanced zones where they fit. At narrower widths, two
   readable rows replace squeezed/uneven session controls. No DOM changes. */
@media(min-width:1300px) and (max-width:1599px){
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified{
  display:grid!important;
  grid-template-columns:minmax(max-content,1fr) auto minmax(0,1fr)!important;
  grid-template-rows:44px!important;
  gap:10px!important;
  align-items:center!important;
  padding-inline:18px!important;
  flex-wrap:nowrap!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified>.market-clock{
  display:contents!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified>.head-actions{
  grid-column:1!important;grid-row:1!important;
  justify-self:start!important;align-self:center!important;
  width:max-content!important;max-width:100%!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-list{
  grid-column:2!important;grid-row:1!important;
  justify-self:center!important;align-self:center!important;
  width:max-content!important;max-width:100%!important;
  height:44px!important;min-height:44px!important;
  display:flex!important;align-items:center!important;
  flex:none!important;gap:6px!important;
  justify-content:center!important;overflow:hidden!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster{
  grid-column:3!important;grid-row:1!important;
  justify-self:end!important;align-self:center!important;
  margin:0!important;
 }
}
/* HEADER REGRESSION FIX: open sidebar + browser zoom must not turn the
   three fitting groups into two rows. At 1300-1499 viewport pixels, the
   compact three-zone shell has enough measured space for all controls, but
   unequal left/right groups require content-aware columns, not 1fr/1fr.
   Visual-only; do not touch clocks, market data or navigation behavior. */
@media(min-width:1300px) and (max-width:1499px){
 html body.v7-ui #app.app.marfa-converted:not(.marfa-side-compact) .main>header.top.marfa-top-market-unified{
  display:grid!important;
  grid-template-columns:max-content minmax(0,1fr) max-content!important;
  grid-template-rows:44px!important;
  align-items:center!important;
  column-gap:9px!important;
  row-gap:0!important;
 }
 html body.v7-ui #app.app.marfa-converted:not(.marfa-side-compact) .main>header.top.marfa-top-market-unified>.head-actions{
  grid-column:1!important;grid-row:1!important;
  width:max-content!important;max-width:100%!important;
  justify-self:start!important;
 }
 html body.v7-ui #app.app.marfa-converted:not(.marfa-side-compact) .main>header.top.marfa-top-market-unified .market-user-cluster{
  grid-column:3!important;grid-row:1!important;
  justify-self:end!important;
 }
 html body.v7-ui #app.app.marfa-converted:not(.marfa-side-compact) .main>header.top.marfa-top-market-unified .market-list{
  grid-column:2!important;grid-row:1!important;
  width:max-content!important;max-width:100%!important;
  justify-self:center!important;
  overflow:hidden!important;
 }
}
/* Tablet: put search and profile on the top lane, sessions on the second.
   The legacy wrap remains below 768px, where the available app area is tiny. */
@media(min-width:768px) and (max-width:1299px){
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:44px 44px!important;gap:6px 10px!important;
  align-items:center!important;
  padding:7px 12px!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified>.market-clock{
  display:contents!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified>.head-actions{
  grid-column:1!important;grid-row:1!important;
  justify-self:start!important;align-self:center!important;
  width:max-content!important;max-width:100%!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster{
  grid-column:2!important;grid-row:1!important;
  justify-self:end!important;align-self:center!important;
  flex:none!important;max-width:270px!important;
  margin:0!important;
 }
 html body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-list{
  grid-column:1 / -1!important;grid-row:2!important;
  justify-self:center!important;align-self:center!important;
  flex:none!important;order:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:max-content!important;max-width:100%!important;
  height:44px!important;min-height:44px!important;
  gap:6px!important;overflow:hidden!important;
 }
}

/* MARFA DISPLAY NUMERALS | TASK07 | VISUAL ONLY, NO DATA MUTATION */
/* One visual rule across pages and subpages. Local clock is already rendered
   by local-clock.js in the document language; reuse it, never create a timer. */
@media (min-width:768px){
 html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified .market-user-cluster #localClock b{
  display:inline-block!important;
  min-inline-size:62px!important;
  text-align:center!important;
  font-family:var(--marfa-numeral-display-font)!important;
  font-size:13px!important;font-weight:700!important;
  font-variant-numeric:var(--marfa-numeral-display-features)!important;
  font-feature-settings:'tnum' 1!important;
  line-height:1.2!important;letter-spacing:0!important;
  direction:ltr!important;unicode-bidi:isolate!important;
  white-space:nowrap!important;
 }
 html[data-theme] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified #marketList .market-live-mini time{
  font-family:var(--marfa-numeral-display-font)!important;
  font-variant-numeric:var(--marfa-numeral-display-features)!important;
  font-feature-settings:'tnum' 1!important;
  white-space:nowrap!important;direction:ltr!important;
  unicode-bidi:isolate!important;letter-spacing:0!important;
 }
 html[data-theme] body.v7-ui #app.app.marfa-converted .main>.ticker :is(span[data-ticker-symbol] b,span[data-ticker-symbol] i){
  font-family:var(--marfa-numeral-display-font)!important;
  font-variant-numeric:var(--marfa-numeral-display-features)!important;
  font-feature-settings:'tnum' 1!important;
  white-space:nowrap!important;direction:ltr!important;
  unicode-bidi:isolate!important;letter-spacing:0!important;
 }
 /* The repeated numerical UI pattern below applies only to regular content
    views. Four protected reference pages remain outside this change. */
 html[data-theme] body.v7-ui #app.app.marfa-converted .view:not(#dashboard):not(#backtest):not(#strategy-lab):not(#analysis) :is(
  time,output,[data-marfa-display-number],.nc-cd,.metric-value,.stat-value,.kpi-value,
  .tb-metric b,.tb-hour span,.connected-kpi b,.connected-kpi strong,
  .j-kpi b,.paper-kpi b,.ms-kpi b,.bi-premium-kpi-value
 ){
  font-family:var(--marfa-numeral-display-font)!important;
  font-variant-numeric:var(--marfa-numeral-display-features)!important;
  font-feature-settings:'tnum' 1!important;
  letter-spacing:0!important;
 }
}

/* MARFA HEADER SHELL STABILITY CONTRACT v1 | all desktop/tablet views */
/* Shared header owns its position in the shell. Tab-specific layouts can style
   their content, but not suppress the main header or its clock. */
@media(min-width:768px){
 html[dir] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified{
  display:grid!important;
  visibility:visible!important;
  opacity:1!important;
  position:relative!important;
  transform:none!important;
  top:auto!important;
  flex-shrink:0!important;
  width:100%!important;
  box-sizing:border-box!important;
 }
 html[dir] body.v7-ui #app.app.marfa-converted .main>header.top.marfa-top-market-unified>.market-clock{
  display:contents!important;
  visibility:visible!important;
 }
}
/* SHARED SHELL: retire wallet-only header width override in compact desktop */
/* The legacy wallet workspace used `#app{display:block}` and `main{width:auto}`,
   letting the shared header run underneath the 70px compact sidebar.
   Restore the same available-width geometry as every other compact view.
   All wallet contents remain in their original main; no wallet logic touched. */
@media(min-width:1300px){
 html[dir] body.v7-ui:has(#wallets.active) #app.app.marfa-converted.marfa-side-compact>.main{
  width:calc(100% - 70px)!important;
  max-width:calc(100% - 70px)!important;
  min-width:0!important;
  margin:0!important;
  box-sizing:border-box!important;
  padding-top:0!important;
 }
}

/* SHARED LANGUAGE MENU MATERIAL | GLOBAL G3 | viewport-safe */
/* Exactly one semantic popup shared by all tabs; positioning stays anchored
   to the top-bar globe. Styling only, no extra language handlers or DOM. */
html body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu{
  z-index:2005!important;
  box-sizing:border-box!important;
  min-width:168px!important;
  width:max-content!important;
  max-width:min(212px,calc(100vw - 22px))!important;
  padding:7px!important;
  gap:0!important;
  overflow:hidden!important;
  border-radius:16px!important;
  border:1px solid var(--marfa-g3-border,rgba(158,200,230,.38))!important;
  border-top-color:rgba(212,244,255,.52)!important;
  background:linear-gradient(143deg,rgba(69,101,139,.82),rgba(24,43,72,.94) 52%,rgba(8,23,44,.96))!important;
  box-shadow:inset 0 1px 0 rgba(245,252,255,.25),inset 0 -1px 0 rgba(4,15,33,.28),
             0 4px 0 rgba(5,17,34,.28),0 15px 34px rgba(0,9,26,.41)!important;
  backdrop-filter:blur(18px) saturate(1.18)!important;
  -webkit-backdrop-filter:blur(18px) saturate(1.18)!important;
}
html body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  min-height:40px!important;
  width:100%!important;
  border-radius:9px!important;
  margin:0!important;
  padding:7px 11px!important;
  background:transparent!important;
  border:1px solid transparent!important;
  color:var(--marfa-text,#ebf2fa)!important;
  font:600 12px/1.45 inherit!important;
  text-align:start!important;
  box-shadow:none!important;
  white-space:nowrap!important;
  cursor:pointer!important;
  transition:background-color .15s ease,border-color .15s ease,color .15s ease!important;
}
html body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button+button{
  border-top:1px solid rgba(159,190,217,.09)!important;
}
html body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button:is(:hover,:focus-visible){
  background:rgba(119,172,209,.17)!important;
  border-color:rgba(154,201,234,.29)!important;
  color:#fff!important;
}
html body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button.active{
  background:rgba(206,163,81,.12)!important;
  border-inline-start:2px solid rgba(221,179,103,.9)!important;
  color:#f8d698!important;
}
html[data-theme="light"] body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu{
  background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(222,236,252,.96))!important;
  border-top-color:rgba(255,255,255,.95)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.95),0 4px 0 rgba(50,84,128,.12),0 15px 34px rgba(26,55,95,.18)!important;
}
html[data-theme="light"] body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button{color:#203750!important}
html[data-theme="light"] body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button:is(:hover,:focus-visible){color:#0b284b!important;background:rgba(98,149,209,.16)!important}
html[data-theme="light"] body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button.active{color:#77521c!important}
@media(prefers-reduced-motion:reduce){
 html body.v7-ui #app.app.marfa-converted .main>header.top .lang-wrap>.lang-menu>button{transition:none!important}
}

/* GLOBAL VIEW TOP ALIGN | shared shell content geometry | task09 */
/* Root cause: legacy v3.css sets .view { margin:auto } while the global
   .main is flex-column. Short sections therefore receive large resolved
   auto block margins and appear vertically centered, leaving 70-190px
   blank space below the price rail. New sections inherit the same defect.
   Keep inline margins, all JS, data, inputs and global shell unchanged.
   Approved reference tabs are deliberately excluded. */
@media (min-width:768px){
 html[dir] body.v7-ui #app.app.marfa-converted>.main>section.view.active:not(:is(#dashboard,#backtest,#strategy-lab,#analysis)){
  margin-block-start:0!important;
  margin-block-end:0!important;
 }
}
