/* Google Translate chrome hidden — custom switcher only */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
#goog-gt-vt,
#gt-nvframe,
.goog-te-spinner-pos,
.goog-logo-link,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-menu-value span:first-child,
iframe.goog-te-menu-frame,
.goog-te-balloon-frame,
[class*="VIpgJd"],
[id*="goog-gt"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.skiptranslate,
#google_translate_element,
body > .skiptranslate {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

body {
  top: 0 !important;
  position: static !important;
}

html.translated-ltr,
html.translated-rtl {
  margin-top: 0 !important;
}

/* Hide empty alert boxes (top-right flash) */
.item-alert:not(:has(.alert-message:not(:empty))):not(:has(p:not(:empty))) {
  display: none !important;
}

.notranslate,
input,
textarea,
select,
option,
script,
code,
pre,
.crypto-symbol,
.ticker,
.tradingview-widget-container,
.wallet-address,
.copy-text,
.gain-asset,
.chart-info,
#tvchart,
.center-top-ghTgp,
.content-sw-mav,
.fees-content,
.fees-table,
iframe {
  translate: no;
}

.lang-data .item[data-lang] {
  cursor: pointer;
}

.lang-data .item[data-lang].active {
  opacity: 1;
}

/* Language trigger: show current flag instead of translate glyph */
.action-icon.lang-i,
.lang-i,
.lang-l-i,
.ds-lang.lang-l-i,
.item.ds-lang.lang-l-i,
.ds-lang .lang-i,
.ds-lang:hover > .lang-i,
.ds-lang.active > .lang-i,
.dark .ds-lang:hover > .lang-i,
.dark .ds-lang.active > .lang-i,
.light .ds-lang:hover > .lang-i,
.light .ds-lang.active > .lang-i,
.dark .lang-l-i,
.light .lang-l-i,
.head-auth-action .lang-l-i,
.head-auth-action .ds-lang {
  background-color: transparent !important;
  background-image: var(--lang-flag-url, url("/source/img/flags/lang/en.svg")) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 24px 18px !important;
  box-shadow: none;
  cursor: pointer;
}

.action-icon.lang-i,
.lang-i {
  width: 24px !important;
  height: 18px !important;
  border-radius: 3px !important;
  box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.35);
  flex: none !important;
}

/* Auth pages: button is the item itself (.lang-l-i) */
.head-auth-action .item.ds-lang.lang-l-i,
.head-auth-action .lang-l-i,
.item.ds-lang.lang-l-i {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  border-radius: 3px !important;
}

.ds-lang {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ========== Layout fixes after RU / Google Translate ========== */

/* GT wraps text in <font> — keep layout metrics stable */
font {
  vertical-align: inherit !important;
  font: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
}

/* Avoid horizontal page scroll from longer RU strings */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

/* Buttons / chips: grow with text instead of clipping */
html.translated-ltr a.btn,
html.translated-ltr button.btn,
html.translated-ltr .btn,
html.translated-ltr .button,
html.translated-ltr [class*="btn-"],
html.translated-ltr .header__btn-logIn,
html.translated-ltr .header__btn-signUp,
html.translated-ltr .home__btn,
html.translated-ltr .header__btn-logIn *,
html.translated-ltr .header__btn-signUp *,
html[lang="ru"] a.btn,
html[lang="ru"] button.btn,
html[lang="ru"] .btn,
html[lang="ru"] .header__btn-logIn,
html[lang="ru"] .header__btn-signUp,
html[lang="ru"] .home__btn {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100%;
  height: auto !important;
  min-height: 40px;
  padding: 10px 16px !important;
  white-space: normal !important;
  line-height: 1.25 !important;
  text-align: center;
  box-sizing: border-box;
}

/* Landing header CTAs */
.header__btn-logIn,
.header__btn-signUp {
  width: auto !important;
  min-width: 120px;
  height: auto !important;
  min-height: 44px;
  padding: 10px 18px !important;
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.25 !important;
}

.header__btn-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  column-gap: 12px;
  justify-content: flex-end;
}

.header__nav {
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: clamp(16px, 3vw, 62px) !important;
  max-width: min(920px, 100%);
  align-items: center;
}

.header__nav .header__btn-box {
  margin-left: auto;
}

.header__link {
  white-space: nowrap;
}

@media (min-width: 1051px) {
  .header__nav .header__btn-box {
    width: auto !important;
    flex-direction: row !important;
    margin: 0 0 0 auto !important;
    gap: 12px !important;
  }

  .header__nav .header__btn-logIn,
  .header__nav .header__btn-signUp {
    width: auto !important;
  }
}

/* Auth / exchange chrome */
html.translated-ltr .head-auth-action,
html[lang="ru"] .head-auth-action,
html.translated-ltr .nav-h,
html[lang="ru"] .nav-h {
  flex-wrap: wrap;
  gap: 8px;
}

html.translated-ltr .nav-h .item,
html[lang="ru"] .nav-h .item,
html.translated-ltr .profile-navigation .item,
html[lang="ru"] .profile-navigation .item,
html.translated-ltr .footer-nav-items .item,
html[lang="ru"] .footer-nav-items .item {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  line-height: 1.3;
}

html.translated-ltr .profile-navigation .item p,
html[lang="ru"] .profile-navigation .item p,
html.translated-ltr .nav-h p,
html[lang="ru"] .nav-h p,
html[lang="ru"] .menu-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Left menu labels must stay horizontal; never wrap letter-by-letter */
.responsive-navigation .nav-navigate .item p,
.responsive-navigation .nav-h p {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

/* Disable collapsed left nav (96px) — vertical labels mode */
.responsive-navigation.hidden-nav {
  max-width: 260px !important;
}
.responsive-navigation.hidden-nav > .nav-content > .nav-header > .logo {
  display: block !important;
}
.responsive-navigation.hidden-nav > .nav-content > .nav-navigate-action > .nav-navigate .item p,
.responsive-navigation.hidden-nav .nav-navigate .item p,
.responsive-navigation.hidden-nav .item p {
  display: block !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
}
/* Hide collapse toggle (nav-type-a); keep theme/settings (nav-type-b) */
.nav-action .nav-type-a,
.nav-types.nav-type-a,
div.nav-type-a {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Desktop: sidebar is always open, so the collapse control stays hidden.
   Phones: the same control is the only way to open profile and exchange nav. */
.nav-header > .nav-action,
.nav-content > .nav-header > .nav-action,
.responsive-navigation .nav-header .nav-action {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

@media (max-width: 1144px) {
  .nav-header > .nav-action,
  .nav-content > .nav-header > .nav-action,
  .responsive-navigation .nav-header .nav-action {
    display: flex !important;
    visibility: visible !important;
    width: 44px !important;
    height: 44px !important;
    overflow: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    position: relative;
    z-index: 30;
  }

  .nav-types.nav-type-b {
    display: flex !important;
    width: 44px !important;
    height: 44px !important;
  }
}

/* Admin/worker Metronic sidebar: no minimize with cramped vertical text */
#kt_app_sidebar_toggle,
.app-sidebar-toggle[data-kt-toggle-name="app-sidebar-minimize"] {
  display: none !important;
}
[data-kt-app-sidebar-minimize="on"] {
  --kt-app-sidebar-width: var(--kt-app-sidebar-width-actual, 265px) !important;
}
[data-kt-app-sidebar-minimize="on"] .app-sidebar-menu .menu-title,
[data-kt-app-sidebar-minimize="on"] .app-sidebar-menu .menu-content {
  opacity: 1 !important;
  writing-mode: horizontal-tb !important;
  white-space: nowrap !important;
}

/* Tables / trading labels */
html.translated-ltr th,
html.translated-ltr td,
html[lang="ru"] th,
html[lang="ru"] td {
  word-break: normal;
  overflow-wrap: break-word;
}

/* Emails via data-email — no text node for GT to swap with coin names */
.exchange-email,
.header-menu__user-mail.exchange-email {
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.exchange-email::after,
.header-menu__user-mail.exchange-email::after {
  content: attr(data-email);
}

/* Coin selectors: keep GT/i18n from scrambling labels */
.select,
.step-form-coins-deposit,
.step-form-coins-network,
#coinOptionsDep,
#coinOptions,
.item.coin,
.step__populars-btn {
  isolation: isolate;
}
.select__menu {
  z-index: 40 !important;
}

/* Deposit/Withdraw: coin dropdown must paint ABOVE "Choose network" */
#modalDep .secondary-select,
#modalWith .secondary-select,
.modal .secondary-select {
  position: relative;
  z-index: 2;
}
#modalDep .secondary-select.active,
#modalWith .secondary-select.active,
.modal .secondary-select.active {
  z-index: 100 !important;
}
#modalDep .secondary-select-body,
#modalWith .secondary-select-body,
.modal .secondary-select-body,
.secondary-select.active > .secondary-select-body {
  z-index: 120 !important;
  position: absolute !important;
}
#modalDep .network-choose,
#modalWith .network-choose,
.modal .network-choose {
  position: relative;
  z-index: 1;
}

.select .select__name,
.secondary-select .secondary-body-info,
.secondary-select .secondary-head-info,
.item.coin,
#coinOptionsDep .item,
#coinOptions .item,
.step__populars-btn {
  writing-mode: horizontal-tb !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Admin/worker panel language switcher */
.exchange-panel-lang {
  position: relative;
}
.exchange-panel-lang-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}
.exchange-panel-lang-btn img,
.exchange-panel-lang-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.35);
}
.exchange-panel-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1100;
  min-width: 180px;
  padding: 8px 0;
  background: var(--bs-body-bg, #1e1e2d);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.exchange-panel-lang.open .exchange-panel-lang-dropdown {
  display: block;
}
.exchange-panel-lang-dropdown .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}
.exchange-panel-lang-dropdown .item:hover,
.exchange-panel-lang-dropdown .item.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}
.exchange-panel-lang-dropdown .icon-lang img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}
.exchange-panel-lang-dropdown .item p {
  margin: 0;
  font-size: 13px;
}
.exchange-panel-lang-menu .menu-link.active {
  background: rgba(0, 158, 247, 0.08);
}

html.translated-ltr .order__buy button,
html.translated-ltr .order__sell button,
html.translated-ltr .center-bottom-ghTgp button,
html[lang="ru"] .order__buy button,
html[lang="ru"] .order__sell button {
  width: 100% !important;
  min-height: 42px;
  white-space: normal !important;
  line-height: 1.2;
  padding: 10px 12px !important;
}

/* Modals / forms */
html.translated-ltr label,
html[lang="ru"] label,
html.translated-ltr .form-label,
html[lang="ru"] .form-label {
  white-space: normal !important;
  line-height: 1.35;
}

html.translated-ltr .modal-title,
html[lang="ru"] .modal-title,
html.translated-ltr h1,
html.translated-ltr h2,
html.translated-ltr h3,
html[lang="ru"] h1,
html[lang="ru"] h2,
html[lang="ru"] h3 {
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
}

/* Keep flex rows from exploding on mobile when RU strings grow */
.head-auth-content h1 span {
  text-transform: uppercase;
}

@media (max-width: 1050px) {
  .header__container,
  .home__btn-box,
  .footer__box {
    flex-wrap: wrap;
  }

  .header__box {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .header__nav-mobile-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
  }

  .header__nav {
    width: min(340px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    padding: 12px 16px !important;
    box-sizing: border-box;
    z-index: 100;
  }

  .header__nav .header__link {
    width: 100%;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: normal !important;
    line-height: 1.35;
  }

  .header__nav .header__link:last-of-type {
    border-bottom: none;
  }

  /* Buttons stay in the top bar, next to the menu icon */
  .header__nav-mobile-box .header__btn-box {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }

  .header__nav-mobile-box .header__btn-logIn,
  .header__nav-mobile-box .header__btn-signUp {
    width: auto !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    text-align: center;
    border-radius: 10px !important;
    flex: none !important;
  }

  .home__btn {
    width: auto !important;
    flex: 1 1 auto;
  }
}

@media (max-width: 830px) {
  .home__title,
  .home__des {
    overflow-wrap: anywhere;
  }

  .trade__box-ghTgp,
  .center-bottom-ghTgp,
  .orders-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.translated-ltr .nav-h,
  html[lang="ru"] .nav-h,
  html.translated-ltr .head-auth-action,
  html[lang="ru"] .head-auth-action {
    justify-content: flex-start;
  }

  /* Exchange sidebar auth buttons */
  .nav-theme > .auth-theme,
  .auth-theme {
    width: 100% !important;
    gap: 12px !important;
  }

  .nav-theme > .auth-theme > .default-button,
  .auth-theme > .default-button,
  .auth-header > .default-button {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    white-space: normal !important;
    padding: 12px 16px !important;
    justify-content: center;
  }

  .nav-theme > .auth-theme > .default-button > p,
  .auth-theme > .default-button > p,
  .auth-header > .default-button > p {
    white-space: normal !important;
    text-align: center;
    line-height: 1.25;
    margin: 0;
  }

  .nav-header > .default-button {
    display: none !important;
  }

  .default-button {
    height: auto !important;
    min-height: 44px;
    white-space: normal !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

@media (max-width: 550px) {
  .header__nav {
    top: 72px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 14px 16px !important;
  }

  .header__nav-mobile-box .header__btn-box {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .home__btn {
    font-size: 15px !important;
  }
}

@media (max-width: 480px) {
  .header__btn-logIn,
  .header__btn-signUp,
  .home__btn,
  html.translated-ltr .btn,
  html[lang="ru"] .btn {
    font-size: 14px !important;
    padding: 12px 14px !important;
  }

  .header__logo-text {
    font-size: 18px !important;
  }

  .signin .default-button,
  .signup .default-button,
  form .default-button,
  .button-a,
  .button-b,
  .button-c {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
  }
}

/* iOS safe areas + tap targets */
@supports (padding: max(0px)) {
  .header {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }
}

.header__btn-logIn,
.header__btn-signUp,
.header__mobile-btn,
.home__btn,
.default-button,
.auth-theme > .default-button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* One mobile chrome: avatar + white menu button, on the landing and inside the exchange */
@media (max-width: 1144px) {
  .nav-header {
    display: flex !important;
    align-items: center !important;
  }

  .nav-header > .nav-action,
  .dark .nav-header > .nav-action,
  .light .nav-header > .nav-action {
    margin-left: auto !important;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-width='2' d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") !important;
  }

  .mobile-profile-slot {
    width: 36px;
    height: 36px;
    margin-left: auto;
    margin-right: 4px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    overflow: hidden;
    background: #2a2c33;
    flex: none;
    cursor: pointer;
  }

  .mobile-profile-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .nav-header > .mobile-profile-slot + .nav-action {
    margin-left: 0 !important;
  }
}

@media (max-width: 1050px) {
  .header__nav-mobile-box {
    margin-left: auto;
    gap: 10px;
    align-items: center;
  }

  html.mobile-chrome-ready .header__nav-mobile-box > .header__btn-box {
    display: none !important;
  }

  .header__nav .header__btn-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 0 !important;
    gap: 10px !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
  }

  .header__nav .header__btn-logIn,
  .header__nav .header__btn-signUp {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  .header__mobile-btn {
    width: 44px !important;
    height: 44px !important;
    margin-left: 0 !important;
    background: linear-gradient(#fff, #fff) center / 18px 2px no-repeat !important;
  }

  .header__mobile-btn:before,
  .header__mobile-btn:after {
    width: 18px !important;
    height: 2px !important;
    left: 13px !important;
    right: auto !important;
    background: #fff !important;
  }

  .header__mobile-btn:before {
    top: 15px !important;
  }

  .header__mobile-btn:after {
    bottom: 15px !important;
  }

  .header__mobile-btn.header__mobile-btn-active {
    background: none !important;
  }

  .header-avatar.has-photo {
    background-image: none;
    overflow: hidden;
    padding: 0;
  }

  .header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: #2a2c33 center / 18px 18px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='3.2' stroke='%23fff' stroke-width='1.8'/%3E%3Cpath stroke='%23fff' stroke-width='1.8' stroke-linecap='round' d='M5.5 19.2c1.2-2.6 3.5-3.9 6.5-3.9s5.3 1.3 6.5 3.9'/%3E%3C/svg%3E");
  }
}


.nav-navigate > a.nav-swap::before,
a.item.nav-swap::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 7H18M18 7L15 4M18 7L15 10M17 17H6M6 17L9 14M6 17L9 20' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
.light .nav-navigate > a.nav-swap::before,
.light a.item.nav-swap::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 7H18M18 7L15 4M18 7L15 10M17 17H6M6 17L9 14M6 17L9 20' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
