/* Hide dashboard slider on mobile */
@media (max-width: 768px) {
  .onn-dashboard-slider {
    display: none !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
  }
}

/* ===== Mobile cards + TradingView fix ===== */
@media (max-width: 768px) {

  /* Last card bottom nav ke neeche na chhupe */
  html, body, #root {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #root > div:last-child,
  .zx-section:last-of-type,
  .zx-bottom-grid {
    margin-bottom: 120px !important;
  }

  /* 2 equal cards per row, same size */
  .zx-kpi-grid.zx-financial-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  .zx-kpi-grid.zx-financial-compact > * {
    min-width: 0 !important;
    min-height: 120px !important;
    box-sizing: border-box !important;
  }

  /* TradingView ticker poora dikhe, cut na ho */
  .tradingview-widget-container,
  .tradingview-widget-container__widget,
  .tradingview-widget-container iframe {
    min-height: 78px !important;
    height: 78px !important;
    max-width: 100% !important;
  }
}

/* ===== Market Data ticker: full height, no cut ===== */
@media (max-width: 768px) {

  .ot-market-strip,
  .ot-live-market-strip {
    height: auto !important;
    min-height: 92px !important;
    max-height: none !important;
    overflow: visible !important;
    padding-top: 22px !important;      /* MARKET DATA label ke liye jagah */
    padding-bottom: 8px !important;
    margin-bottom: 14px !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  .ot-market-label {
    top: 4px !important;
    z-index: 3 !important;
  }

  .ot-tradingview-ticker {
    display: block !important;
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    overflow: hidden !important;
  }

  .ot-tradingview-ticker .tradingview-widget-container,
  .ot-tradingview-ticker .tradingview-widget-container__widget,
  .ot-tradingview-ticker iframe {
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
  }
}

/* ===== Ticker fix v5 (high specificity) ===== */
@media (max-width: 800px) {
  html body #root .ot-market-strip,
  html body #root .ot-live-market-strip,
  html body .ot-market-strip.ot-live-market-strip {
    display: block !important;
    height: 104px !important;
    min-height: 104px !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 24px 8px 6px !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  html body #root .ot-live-market-strip .ot-market-label {
    position: absolute !important;
    top: 6px !important;
    left: 12px !important;
    z-index: 3 !important;
  }

  html body #root .ot-tradingview-ticker {
    display: block !important;
    width: 100% !important;
    height: 74px !important;
    min-height: 74px !important;
    overflow: hidden !important;
  }

  html body #root .ot-tradingview-ticker > div,
  html body #root .ot-tradingview-ticker .tradingview-widget-container,
  html body #root .ot-tradingview-ticker .tradingview-widget-container__widget,
  html body #root .ot-tradingview-ticker iframe {
    height: 74px !important;
    min-height: 74px !important;
    max-width: 100% !important;
  }
}

/* ticker visibility fix */
html body #root .ot-tradingview-ticker {
  display: block;
  width: 100%;
  min-height: 46px;
  overflow: hidden;
}
html body #root .ot-tradingview-ticker iframe {
  width: 100% !important;
  min-height: 46px;
}
/* v7 dashboard ticker */
html body #root .zx-tradingview-mini{display:block!important;position:relative!important;width:100%!important;height:82px!important;min-height:82px!important;max-height:none!important;overflow:hidden!important;margin:8px 0 12px!important;box-sizing:border-box!important}
html body #root .zx-tradingview-mini .tradingview-widget-container,html body #root .zx-tradingview-mini .tradingview-widget-container__widget,html body #root .zx-tradingview-mini iframe{width:100%!important;height:78px!important;min-height:78px!important;max-width:100%!important}
html body #root .zx-tradingview-label{position:absolute!important;top:4px!important;left:10px!important;z-index:3!important}
/* v8 dashboard cards */
@media (max-width:800px){
html body #root .zx-financial-compact{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
html body #root .zx-financial-compact>*{min-width:0!important;min-height:0!important;height:auto!important;padding:12px!important;box-sizing:border-box!important}
html body #root .zx-financial-compact .zx-kpi-top{gap:8px!important;margin-bottom:6px!important;align-items:center!important;line-height:1.2!important}
html body #root .zx-dashboard{padding-bottom:120px!important}
}
/* v9 dashboard full layout */
@media (max-width:800px){
html body #root .zx-wrap,html body #root .zx-dashboard{width:100%!important;max-width:100%!important;margin:0!important;padding-left:8px!important;padding-right:8px!important;box-sizing:border-box!important;min-height:0!important}
html body #root .zx-dashboard{padding-top:8px!important;padding-bottom:84px!important}
html body #root .zx-section,html body #root .zx-panel{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;margin-bottom:12px!important;padding:12px!important;box-sizing:border-box!important}
html body #root .zx-section:last-child,html body #root .zx-dashboard>*:last-child{margin-bottom:0!important}
html body #root .zx-tradingview-mini{margin:4px 0 10px!important}
html body #root .zx-financial-compact>*:last-child:nth-child(odd),html body #root .zx-referral-grid>*:last-child:nth-child(odd),html body #root .zx-info-grid>*:last-child:nth-child(odd){grid-column:1/-1!important}
html body #root .zx-info-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
html body #root .zx-info-row{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:4px!important;padding:10px!important;min-width:0!important}
html body #root .zx-info-row *{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;max-width:100%!important;word-break:break-word!important}
html body #root .zx-referral-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
html body #root .zx-ref-card{padding:10px!important;min-width:0!important;height:auto!important}
html body #root .zx-income{padding:10px!important;gap:8px!important}
html body #root .zx-income-amount{white-space:nowrap!important;font-size:14px!important}
html body #root .zx-link-row{flex-wrap:wrap!important;gap:8px!important}
html body #root .zx-link-value{white-space:normal!important;word-break:break-all!important;min-width:0!important}
}
/* v10 mt5 connect: remove VT option + mobile */
html body #root .onn-premium-tabs{display:none!important}
html body #root .onn-vt-premium-section{display:none!important}
#onntrade-mt5-vt-premium-slider{display:none!important}
@media (max-width:800px){
html body #root .onn-mt5-premium-section{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;padding:12px!important;box-sizing:border-box!important}
html body #root div:has(>.onn-mt5-premium-section){display:flex!important;flex-direction:column!important;grid-template-columns:1fr!important;gap:12px!important}
html body #root .onn-mt5-premium-section input,html body #root .onn-mt5-premium-section select,html body #root .onn-mt5-premium-section textarea{width:100%!important;max-width:100%!important;min-height:44px!important;font-size:16px!important;box-sizing:border-box!important}
html body #root .onn-mt5-premium-section button{min-height:44px!important;max-width:100%!important}
}


/* =========================================================
   ONNTRADE UNIVERSAL CLIENT MOBILE RESPONSIVE FIX
   Mobile only — Desktop unchanged
   ========================================================= */

@media (max-width: 768px) {

  /* Prevent viewport overflow */
  html,
  body,
  #root,
  #root .app-shell,
  #root .main-content,
  #root .main,
  #root .main-area,
  #root .content,
  #root .page-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: clip !important;
  }

  /* Universal box sizing */
  #root *,
  #root *::before,
  #root *::after {
    box-sizing: border-box !important;
  }

  /* Responsive page containers */
  #root .page-content,
  #root .page,
  #root .dashboard-page,
  #root .dashboard-container,
  #root .client-main,
  #root .app-main,
  #root .placeholder-page {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Mobile page spacing */
  #root .page-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 16px !important;
    padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
  }

  /* Text must wrap instead of expanding page */
  #root h1,
  #root h2,
  #root h3,
  #root h4,
  #root h5,
  #root p,
  #root span,
  #root label,
  #root strong,
  #root small {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  /* Responsive headings */
  #root h1 {
    font-size: clamp(22px, 6vw, 30px) !important;
    line-height: 1.2 !important;
  }

  #root h2 {
    font-size: clamp(19px, 5vw, 25px) !important;
    line-height: 1.25 !important;
  }

  #root h3 {
    font-size: clamp(16px, 4.4vw, 21px) !important;
    line-height: 1.3 !important;
  }

  /* Common cards and panels */
  #root .card,
  #root .dashboard-card,
  #root .stat-card,
  #root .panel,
  #root .section-card,
  #root .zx-panel,
  #root .zx-section,
  #root .zx-kpi,
  #root .account-card,
  #root .account-row,
  #root .crypto-ex-account,
  #root .crypto-ex-panel {
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  /* Grid safety */
  #root .grid,
  #root .stat-grid,
  #root .card-grid,
  #root .dashboard-grid,
  #root .account-grid,
  #root .crypto-ex-kpis,
  #root .crypto-ex-wallet-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #root .grid > *,
  #root .stat-grid > *,
  #root .card-grid > *,
  #root .dashboard-grid > *,
  #root .account-grid > *,
  #root .crypto-ex-kpis > *,
  #root .crypto-ex-wallet-kpis > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Flex layouts should wrap */
  #root .flex,
  #root .row,
  #root .toolbar,
  #root .header-row,
  #root .section-header,
  #root .card-header,
  #root .actions,
  #root .button-group {
    min-width: 0 !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }

  /* Buttons */
  #root button,
  #root .btn,
  #root [role="button"] {
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* Inputs */
  #root input,
  #root select,
  #root textarea,
  #root form {
    width: 100%;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #root input,
  #root select,
  #root textarea {
    font-size: 16px !important;
  }

  /* Images, videos and embedded content */
  #root img,
  #root video,
  #root iframe,
  #root canvas,
  #root svg {
    max-width: 100%;
  }

  /* Tables: scroll inside container instead of page */
  #root table {
    width: max-content;
    min-width: 100%;
    max-width: none !important;
  }

  #root .table-wrapper,
  #root .table-responsive,
  #root .responsive-table,
  #root .table-wrap,
  #root .overflow-x-auto,
  #root .crypto-ex-table-wrap,
  #root .crypto-ex-detail-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Long IDs, addresses and links */
  #root .wallet-address,
  #root .account-id,
  #root .referral-link,
  #root .link-value,
  #root code,
  #root pre {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  #root pre {
    overflow-x: auto !important;
  }

  /* Account and exchange layouts */
  #root .account-main,
  #root .account-list,
  #root .crypto-ex-shell,
  #root .crypto-ex-accounts,
  #root .crypto-ex-accounts-grid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Bottom navigation clearance */
  #root .page-content,
  #root .main-content,
  #root .main,
  #root .main-area {
    padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
  }

}

/* Extra-small phones */
@media (max-width: 380px) {

  #root .page-content {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  #root h1 {
    font-size: 22px !important;
  }

  #root .grid,
  #root .stat-grid,
  #root .card-grid,
  #root .dashboard-grid,
  #root .account-grid {
    gap: 8px !important;
  }

}


/* =========================================================
   EXCHANGE HISTORY / TRADES TABS - MOBILE TARGETED FIX
   ========================================================= */
@media (max-width: 768px) {
  #root .crypto-ex-detail-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #root .crypto-ex-detail-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #root .crypto-ex-detail-tabs::-webkit-scrollbar {
    display: none;
  }

  #root .crypto-ex-detail-tab {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 12px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  #root .crypto-ex-detail-tab span,
  #root .crypto-ex-detail-tab b {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
  }
}

@media (max-width: 380px) {
  #root .crypto-ex-detail-tab {
    padding: 9px 10px !important;
    font-size: 10px !important;
  }
}


/* Referral Empire income cards: one card per row on mobile */
@media (max-width: 768px) {
  .referral-income-cards-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
  }
  .referral-income-cards-grid > * {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* ONNTRADE MOBILE DASHBOARD - READABILITY & COLOR ENHANCEMENT */
@media (max-width: 768px) {
  html body #root .zx-dashboard {
    color: #edf7f5 !important;
  }

  html body #root .zx-dashboard .zx-hero,
  html body #root .zx-dashboard .zx-kpi,
  html body #root .zx-dashboard .zx-panel {
    background-color: #10201f !important;
    border-color: rgba(76, 211, 174, .24) !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .20) !important;
  }

  html body #root .zx-dashboard .zx-section-title,
  html body #root .zx-dashboard .zx-hero h1,
  html body #root .zx-dashboard .zx-hero-title,
  html body #root .zx-dashboard .zx-kpi strong {
    color: #f2fbf8 !important;
  }

  html body #root .zx-dashboard .zx-section-sub,
  html body #root .zx-dashboard .zx-hero-source,
  html body #root .zx-dashboard .zx-kpi span {
    color: #b1c8c1 !important;
  }

  html body #root .zx-dashboard .zx-kicker {
    color: #53dfb4 !important;
  }

  html body #root .zx-dashboard .zx-section-tag {
    color: #8cebd0 !important;
    background: rgba(32, 190, 145, .13) !important;
    border-color: rgba(76, 211, 174, .25) !important;
  }
}

/* ===== ONNTRADE MOBILE HOMEPAGE HERO TEXT VISIBILITY ===== */
@media (max-width: 800px) {

  html body #root .ot-hero .ot-slide-content h1 {
    color: #f8fbff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #f8fbff !important;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .65) !important;
  }

  html body #root .ot-hero .ot-slide-content h1 span {
    color: #27e6ff !important;
    -webkit-text-fill-color: #27e6ff !important;
  }

  html body #root .ot-hero .ot-slide-content p {
    color: #e2edf8 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #e2edf8 !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .75) !important;
  }

  html body #root .ot-hero .ot-slider-top,
  html body #root .ot-hero .ot-eyebrow {
    color: #b9f5e8 !important;
    opacity: 1 !important;
  }
}
/* ===== END MOBILE HERO TEXT FIX ===== */

/* ===== ONNTRADE MOBILE HERO TOP LABEL VISIBILITY ===== */
@media (max-width: 800px) {

  html body #root .ot-hero .ot-slider-top,
  html body #root .ot-hero .ot-slider-top *,
  html body #root .ot-hero .ot-eyebrow,
  html body #root .ot-hero .ot-eyebrow * {
    color: #42f5d0 !important;
    -webkit-text-fill-color: #42f5d0 !important;
    opacity: 1 !important;
    text-shadow: 0 0 9px rgba(35, 245, 208, .55) !important;
    font-weight: 800 !important;
  }

  html body #root .ot-hero .ot-slider-top {
    font-size: 10px !important;
    letter-spacing: .12em !important;
  }

  html body #root .ot-hero .ot-eyebrow {
    font-size: 11px !important;
  }
}
/* ===== END TOP LABEL FIX ===== */
