/* Huatai Securities final cross-page standardization — 2026-08-13
   One mobile composition on phones and a centered 390px app shell on desktop.
   This file must be loaded last. */
:root{
  --ig-shell-width:390px;
  --ig-page:#f4f7fb;
  --ig-card:#ffffff;
  --ig-text:#182230;
  --ig-muted:#8290a6;
  --ig-line:#e2e8f0;
  --ig-blue:#1473e6;
  --ig-soft-blue:#edf5ff;
  --ig-nav-height:78px;
}

html{
  width:100%!important;
  min-width:0!important;
  min-height:100%!important;
  overflow-x:hidden!important;
  background:var(--ig-page)!important;
  background-image:none!important;
  color-scheme:light!important;
}
html body.broker-theme{
  min-width:0!important;
  min-height:100vh!important;
  min-height:100dvh!important;
  overflow-x:hidden!important;
  background:var(--ig-page)!important;
  background-image:none!important;
  color:var(--ig-text)!important;
}
html body.broker-theme::before,
html body.broker-theme::after{background-image:none!important;}

/* Keep Bootstrap fullscreen dialogs/forms inside the app instead of 100vw. */
body.broker-theme .modal-dialog,
body.broker-theme .modal-dialog.modal-fullscreen,
body.broker-theme .modal-fullscreen,
body.broker-theme .modal-content,
body.broker-theme .modal-body{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
}
body.broker-theme .modal-dialog.modal-fullscreen,
body.broker-theme .modal-fullscreen{height:auto!important;min-height:100dvh!important;}
body.broker-theme .modal-content{min-height:100dvh!important;background:var(--ig-page)!important;background-image:none!important;}

/* Shared light surface. */
body.broker-theme .header,
body.broker-theme .language-header,
body.broker-theme .staking-header,
body.broker-theme .top-header,
body.broker-theme .page-header,
body.broker-theme .profile-header,
body.broker-theme:not(.has-bottom-nav) > .trading-header{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  background:#fff!important;
  background-image:none!important;
  border-bottom:1px solid var(--ig-line)!important;
  box-shadow:none!important;
}

/* Deposit / withdrawal must use the same light theme. */
body.page-money.broker-theme,
body.page-money.broker-theme #depositSelection,
body.page-money.broker-theme #withdrawalSelection,
body.page-money.broker-theme .deposit-form,
body.page-money.broker-theme #usdtCryptoForm,
body.page-money.broker-theme #btcCryptoForm,
body.page-money.broker-theme #ethCryptoForm,
body.page-money.broker-theme #solCryptoForm,
body.page-money.broker-theme #usdcCryptoForm,
body.page-money.broker-theme #usdtWithdrawalForm,
body.page-money.broker-theme #bankWithdrawalForm{
  background:var(--ig-page)!important;
  background-image:none!important;
  color:var(--ig-text)!important;
}
body.page-money.broker-theme .crypto-option,
body.page-money.broker-theme .deposit-option,
body.page-money.broker-theme .channel-item,
body.page-money.broker-theme .form-section,
body.page-money.broker-theme .balance-info,
body.page-money.broker-theme .instructions,
body.page-money.broker-theme .important-notice,
body.page-money.broker-theme .deposit-instructions,
body.page-money.broker-theme .qr-container,
body.page-money.broker-theme .money-hero{
  background:#fff!important;
  background-image:none!important;
  color:var(--ig-text)!important;
  border:1px solid var(--ig-line)!important;
  box-shadow:0 3px 12px rgba(15,23,42,.05)!important;
}
body.page-money.broker-theme .form-control,
body.page-money.broker-theme input,
body.page-money.broker-theme textarea,
body.page-money.broker-theme select{
  background:#fff!important;
  color:var(--ig-text)!important;
  border-color:#cbd5e1!important;
  box-shadow:none!important;
}
body.page-money.broker-theme .form-label,
body.page-money.broker-theme .network-label,
body.page-money.broker-theme .balance-value,
body.page-money.broker-theme h1,
body.page-money.broker-theme h2,
body.page-money.broker-theme h3,
body.page-money.broker-theme h4,
body.page-money.broker-theme h5,
body.page-money.broker-theme h6{color:var(--ig-text)!important;}
body.page-money.broker-theme .instruction-text,
body.page-money.broker-theme .balance-label,
body.page-money.broker-theme .money-hero p{color:var(--ig-muted)!important;}
body.page-money.broker-theme .network-option{
  background:#fff!important;color:var(--ig-text)!important;border:1px solid #cbd5e1!important;
}
body.page-money.broker-theme .network-option.selected{
  background:var(--ig-soft-blue)!important;border-color:#7fb1ef!important;
}

/* Funding page had an old dark-blue skin embedded after the main CSS. Reset it. */
body.broker-theme.has-bottom-nav .content{background:transparent!important;}
body.broker-theme.has-bottom-nav .balance-section,
body.broker-theme.has-bottom-nav .history-section,
body.broker-theme.has-bottom-nav .history-item{
  background:#fff!important;
  background-image:none!important;
  border:1px solid var(--ig-line)!important;
  box-shadow:0 3px 12px rgba(15,23,42,.05)!important;
}
body.broker-theme.has-bottom-nav .action-btn{
  background:#fff!important;
  background-image:none!important;
  color:var(--ig-text)!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}
body.broker-theme.has-bottom-nav .action-btn i{color:var(--ig-blue)!important;text-shadow:none!important;}
body.broker-theme.has-bottom-nav .total-assets-label,
body.broker-theme.has-bottom-nav .info-label,
body.broker-theme.has-bottom-nav .info-usd,
body.broker-theme.has-bottom-nav .history-date{color:var(--ig-muted)!important;}
body.broker-theme.has-bottom-nav .info-value,
body.broker-theme.has-bottom-nav .history-title,
body.broker-theme.has-bottom-nav .history-type{color:var(--ig-text)!important;}
body.broker-theme.has-bottom-nav .balance-amount{color:var(--ig-blue)!important;text-shadow:none!important;}

/* Bottom navigation: always five equal items, always attached to the app bottom. */
body.broker-theme > iframe[src="nav.html"],
body.broker-theme > iframe[src*="/nav.html"]{
  display:block!important;
  position:fixed!important;
  bottom:0!important;
  top:auto!important;
  height:var(--ig-nav-height)!important;
  border:0!important;
  margin:0!important;
  padding:0!important;
  z-index:99999!important;
  background:#fff!important;
  box-shadow:0 -2px 12px rgba(15,23,42,.08)!important;
}
body.broker-theme:has(> iframe[src="nav.html"]),
body.broker-theme.has-bottom-nav{
  padding-bottom:calc(var(--ig-nav-height) + 14px + env(safe-area-inset-bottom))!important;
}
body.nav-page{
  width:100%!important;max-width:100%!important;min-width:0!important;height:var(--ig-nav-height)!important;
  margin:0!important;padding:0!important;overflow:hidden!important;background:#fff!important;
}
body.nav-page .bottom-nav{
  position:fixed!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;
  width:100%!important;max-width:100%!important;height:var(--ig-nav-height)!important;
  margin:0!important;transform:none!important;background:#fff!important;
  border-top:1px solid var(--ig-line)!important;box-shadow:none!important;
}
body.nav-page .bottom-nav > .container-fluid{width:100%!important;max-width:100%!important;padding:0!important;}
body.nav-page .bottom-nav > .container-fluid > .row{
  display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
  width:100%!important;max-width:100%!important;height:100%!important;margin:0!important;
}
body.nav-page .bottom-nav > .container-fluid > .row > .col{
  display:block!important;width:100%!important;min-width:0!important;max-width:none!important;padding:0!important;
}
body.nav-page .nav-item{width:100%!important;height:100%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;}

/* Phone/tablet: navigation follows the device viewport. */
@media (max-width:600px){
  html body.broker-theme{width:100%!important;max-width:100%!important;margin:0!important;}
  body.broker-theme > iframe[src="nav.html"],
  body.broker-theme > iframe[src*="/nav.html"]{
    width:100%!important;max-width:100%!important;min-width:0!important;
    left:0!important;right:0!important;transform:none!important;
  }
}

/* Desktop: the WHOLE application is the same 390px mobile composition, centered. */
@media (min-width:601px){
  html body.broker-theme:not(.nav-page){
    width:var(--ig-shell-width)!important;
    max-width:var(--ig-shell-width)!important;
    min-width:var(--ig-shell-width)!important;
    margin:0 auto!important;
    position:relative!important;
  }
  html body.broker-theme:not(.nav-page) > *{
    box-sizing:border-box!important;
    max-width:100%!important;
  }
  body.broker-theme .container,
  body.broker-theme .container-fluid,
  body.broker-theme main,
  body.broker-theme .main-container,
  body.broker-theme .page-container,
  body.broker-theme .profile-container,
  body.broker-theme .fund-container,
  body.broker-theme .language-container,
  body.broker-theme .staking-page,
  body.broker-theme .help-container,
  body.broker-theme .question-details,
  body.broker-theme #cryptos-view,
  body.broker-theme .header-section,
  body.broker-theme .ig-header,
  body.broker-theme .notice-bar-section,
  body.broker-theme .trading-functions,
  body.broker-theme .featured-markets,
  body.broker-theme .market-tabs,
  body.broker-theme .trading-header,
  body.broker-theme .trading-pairs{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
  }
  /* Neutralize all old 100vw breakout rules on the centered shell. */
  body.broker-theme .header,
  body.broker-theme .language-header,
  body.broker-theme .trading-header,
  body.broker-theme .staking-header,
  body.broker-theme .profile-header,
  body.broker-theme .top-header,
  body.broker-theme .page-header,
  body.broker-theme.has-bottom-nav .trading-pairs,
  body.broker-theme.has-bottom-nav .trading-header{
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin-left:0!important;margin-right:0!important;left:auto!important;right:auto!important;
  }
  body.broker-theme .staking-my-overlay,
  body.broker-theme .modal,
  body.broker-theme .deposit-form,
  body.broker-theme #usdtCryptoForm,
  body.broker-theme #btcCryptoForm,
  body.broker-theme #ethCryptoForm,
  body.broker-theme #solCryptoForm,
  body.broker-theme #usdcCryptoForm{
    width:var(--ig-shell-width)!important;
    max-width:var(--ig-shell-width)!important;
    min-width:0!important;
    left:calc(50% - (var(--ig-shell-width) / 2))!important;
    right:auto!important;
  }
  body.broker-theme > iframe[src="nav.html"],
  body.broker-theme > iframe[src*="/nav.html"]{
    width:var(--ig-shell-width)!important;
    max-width:var(--ig-shell-width)!important;
    min-width:var(--ig-shell-width)!important;
    left:calc(50% - (var(--ig-shell-width) / 2))!important;
    right:auto!important;
    transform:none!important;
  }
  body.ig-binary-page .buy-sell-buttons,
  body.ig-binary-page .ig-floating-trade-wrap,
  body.ig-future-page .buy-sell-buttons{
    width:var(--ig-shell-width)!important;max-width:var(--ig-shell-width)!important;
    left:calc(50% - (var(--ig-shell-width) / 2))!important;right:auto!important;transform:none!important;
  }
  body.broker-theme .featured-market-grid{max-width:100%!important;}
  body.broker-theme .market-highlight{flex:0 0 116px!important;min-width:116px!important;max-width:116px!important;}
}

/* Huatai Securities shared branded-header standard */
body.broker-theme .ig-brand.huatai-brand{display:flex!important;align-items:center!important;min-width:0!important;text-decoration:none!important;}
body.broker-theme .ig-brand.huatai-brand .huatai-header-logo{display:block!important;width:152px!important;max-width:46vw!important;height:auto!important;object-fit:contain!important;}
body.broker-theme .ig-profile-action .ig-profile-icon{display:flex!important;align-items:center!important;justify-content:center!important;width:30px!important;height:30px!important;border:1px solid #d7dee8!important;border-radius:50%!important;background:#fff!important;color:#2f80ed!important;}
body.broker-theme .ig-profile-action .ig-profile-icon i{font-size:13px!important;color:#2f80ed!important;filter:none!important;}
@media(max-width:390px){body.broker-theme .ig-brand.huatai-brand .huatai-header-logo{width:138px!important;max-width:44vw!important;}}

/* 2026-08-13 language list vertical alignment final fix */
body.page-language .language-item {
  display:flex !important;
  align-items:center !important;
}
body.page-language .language-flag,
body.page-language .language-name,
body.page-language .language-check {
  align-self:center !important;
}
body.page-language .language-name {
  display:flex !important;
  align-items:center !important;
  min-height:46px !important;
  line-height:1.15 !important;
  margin:0 !important;
  padding:0 !important;
}
body.page-language .language-flag {
  display:grid !important;
  place-items:center !important;
  line-height:1 !important;
}
body.page-language .language-check {
  display:grid !important;
  place-items:center !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* 2026-08-13 language row icon-column centering fix */
body.broker-theme.page-language .language-item {
  display:grid !important;
  grid-template-columns:64px minmax(0,1fr) 44px !important;
  align-items:center !important;
  column-gap:8px !important;
  min-height:58px !important;
  padding:0 10px !important;
}
body.broker-theme.page-language .language-flag {
  grid-column:1 !important;
  justify-self:center !important;
  align-self:center !important;
  margin:0 !important;
  width:46px !important;
  height:46px !important;
  display:grid !important;
  place-items:center !important;
}
body.broker-theme.page-language .language-name {
  grid-column:2 !important;
  justify-self:start !important;
  align-self:center !important;
  min-height:0 !important;
  display:flex !important;
  align-items:center !important;
  margin:0 !important;
}
body.broker-theme.page-language .language-check {
  grid-column:3 !important;
  justify-self:center !important;
  align-self:center !important;
  margin:0 !important;
  width:36px !important;
  height:36px !important;
  padding:0 !important;
  display:grid !important;
  place-items:center !important;
}

/* 2026-08-13 language flag true optical centering fix
   The flag element still contains the original emoji text plus a ::after label.
   Hide the text line box completely and pin the generated TW/CN/US label to
   the exact center so there is no top gap/baseline offset. */
body.broker-theme.page-language .language-flag {
  position:relative !important;
  font-size:0 !important;
  line-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  overflow:hidden !important;
  display:block !important;
}
body.broker-theme.page-language .language-flag::after {
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  line-height:1 !important;
  transform:none !important;
  vertical-align:middle !important;
}

/* v20260818 six-item nav */
body.nav-page .bottom-nav > .container-fluid > .row{grid-template-columns:repeat(6,minmax(0,1fr))!important;}
