/* Stage 394 — layout width and button text fit fix, based on Stage 391. */
:root{
  --s394-sidebar-w: 320px;
  --s394-main-pad-x: 8px;
  --s394-button-h: 50px;
}

/* Keep the broker terminal as two independent workspaces, but use the screen width better. */
body.stage391-layout-fix .shell{
  grid-template-columns: var(--s394-sidebar-w) minmax(0, 1fr) !important;
  column-gap: 0 !important;
}
body.stage391-layout-fix .main{
  padding: 8px var(--s394-main-pad-x) 18px 10px !important;
  overflow-x: hidden !important;
}
body.stage391-layout-fix .tv-hero-shell,
body.stage391-layout-fix .topbar,
body.stage391-layout-fix .panel,
body.stage391-layout-fix .design-banner:not(.sidebar .design-banner){
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.stage391-layout-fix .tv-hero-shell{
  border-radius: 22px !important;
}
body.stage391-layout-fix .tv-hero-copy-panel{
  padding: 14px 18px 18px !important;
  gap: 14px !important;
}

/* Manual contract sidebar: full-width action buttons so Russian labels do not get clipped. */
body.stage391-layout-fix .sidebar-surface--manual .action-grid--sidebar,
body.stage391-layout-fix .sidebar-surface--manual .action-grid{
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}
body.stage391-layout-fix #manualQuoteBtn,
body.stage391-layout-fix #manualBuyBtn{
  width: 100% !important;
  min-height: 50px !important;
  padding: 0 16px !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
}
body.stage391-layout-fix #manualQuoteBtn::before,
body.stage391-layout-fix #manualBuyBtn::before{
  margin-right: 8px !important;
  flex: 0 0 auto !important;
}

/* General button text: do not break words into vertical fragments. */
body.stage391-layout-fix button,
body.stage391-layout-fix .secondary,
body.stage391-layout-fix .hero-media-cta,
body.stage391-layout-fix .hero-media-cta *{
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

/* Hero CTA row: readable compact broker CTA buttons. */
body.stage391-layout-fix .hero-cta-cluster{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 16px !important;
}
body.stage391-layout-fix .hero-media-cta{
  min-width: 0 !important;
  min-height: 72px !important;
  grid-template-columns: 44px minmax(0, 1fr) minmax(64px, auto) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 13px !important;
  overflow: hidden !important;
}
body.stage391-layout-fix .hero-media-cta__copy{
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}
body.stage391-layout-fix .hero-media-cta__copy strong,
body.stage391-layout-fix .hero-media-cta__copy small{
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.18 !important;
}
body.stage391-layout-fix .hero-media-cta__copy strong{
  font-size: 13px !important;
  letter-spacing: -0.01em !important;
}
body.stage391-layout-fix .hero-media-cta__copy small{
  font-size: 10px !important;
  color: rgba(220, 231, 249, .78) !important;
}
body.stage391-layout-fix .hero-media-cta__tail{
  min-width: 64px !important;
  max-width: 82px !important;
  padding: 8px 10px !important;
  text-align: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 11px !important;
  letter-spacing: .03em !important;
}

/* Right operator card should not waste horizontal space. */
body.stage391-layout-fix .tv-hero-copy-aside,
body.stage391-layout-fix .hero-control-surface,
body.stage391-layout-fix .operator-controls{
  min-width: 0 !important;
}

@media (max-width: 1380px){
  :root{ --s394-sidebar-w: 310px; --s394-main-pad-x: 6px; }
  body.stage391-layout-fix .hero-cta-cluster{
    gap: 8px !important;
  }
  body.stage391-layout-fix .hero-media-cta{
    grid-template-columns: 40px minmax(0, 1fr) minmax(58px, auto) !important;
    padding: 11px 11px !important;
  }
  body.stage391-layout-fix .hero-media-cta__tail{
    min-width: 58px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 1180px){
  body.stage391-layout-fix .shell{
    grid-template-columns: 1fr !important;
  }
  body.stage391-layout-fix .main{
    padding: 10px !important;
  }
  body.stage391-layout-fix .hero-cta-cluster{
    grid-template-columns: 1fr !important;
  }
  body.stage391-layout-fix .hero-media-cta{
    grid-template-columns: 44px minmax(0, 1fr) minmax(70px, auto) !important;
  }
}
