
:root { --i18n-min-font: 11px; --i18n-chip-font: clamp(10px, 2.9vw, 14px); }
html[data-lang], body[data-lang] { overflow-x: hidden; }
body[data-lang] * { min-width: 0; box-sizing: border-box; }
.i18n-auto-fit, button, a, label, span, b, small, em, input, textarea, select, .admin-panel td, .admin-panel th { max-width: 100%; }
button, .admin-sidebar button, .home-nav button, .m-bottom-nav span, .m-action-label, .m-pos-action span, .m-mine-qtext, .m-trade-tab, .m-order-tab, .m-market-tabs button, .m-fin-row span, .m-fin-row b { overflow: hidden; text-overflow: ellipsis; }
button, .m-bottom-nav span, .m-action-label, .m-pos-action span, .m-mine-qtext, .m-trade-tab, .m-order-tab { line-height: 1.18; }
[data-i18n-long="1"] { font-size: max(var(--i18n-min-font), .88em) !important; letter-spacing: -0.01em; }
.admin-sidebar button, .admin-panel td, .admin-panel th, .admin-ops-meta span { overflow-wrap: anywhere; word-break: normal; }
.admin-sidebar button { justify-content: flex-start; gap: 8px; }
.admin-panel table { table-layout: fixed; width: 100%; }
.admin-panel td, .admin-panel th { white-space: normal; vertical-align: top; }
.lang-box, .lang-menu, .lang-dropdown { max-width: min(92vw, 360px); }
.lang-menu button, .lang-dropdown button { width: 100%; text-align: start; white-space: normal; overflow-wrap: anywhere; }
.home-header { overflow: visible; }
.home-nav { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.home-nav button, .home-nav a { max-width: 130px; white-space: nowrap; }
.home-actions, .home-auth, .home-lang { flex-shrink: 0; }
@media (max-width: 900px) {
  body[data-route="home"] .mobile-home, body[data-route="home"] .m-page, body[data-route="home"] .m-card, body[data-route="home"] section { max-width: 100vw; overflow-x: hidden; }
  body[data-route="home"] .m-actions-grid, body[data-route="home"] .m-position-actions, body[data-route="home"] .m-mine-quick, body[data-route="home"] .m-market-tabs, body[data-route="home"] .m-trade-tabs, body[data-route="home"] .m-order-tabs { min-width: 0; }
  body[data-route="home"] .m-action-card, body[data-route="home"] .m-pos-action, body[data-route="home"] .m-mine-qitem { min-width: 0; overflow: hidden; }
  body[data-route="home"] .m-action-label, body[data-route="home"] .m-pos-action span, body[data-route="home"] .m-mine-qtext, body[data-route="home"] .m-bottom-nav span { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: var(--i18n-chip-font); }
  body[data-route="home"] .m-bottom-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-route="home"] .m-bottom-nav button { min-width: 0; padding-left: 2px; padding-right: 2px; }
  body[data-route="home"] .m-trade-tab, body[data-route="home"] .m-order-tab, body[data-route="home"] .m-market-tabs button, body[data-route="home"] .m-pos-tabs button, body[data-route="home"] .m-pos-order-tabs button { white-space: nowrap; font-size: clamp(11px, 3.1vw, 14px) !important; }
  body[data-route="home"] .m-fin-row { gap: 12px; }
  body[data-route="home"] .m-fin-row span { flex: 0 1 44%; }
  body[data-route="home"] .m-fin-row b, body[data-route="home"] .m-fin-row input { flex: 1 1 0; }
  body[data-route="home"] .m-record-row, body[data-route="home"] .m-pos-oh-grid, body[data-route="home"] .m-asset-grid { min-width: 0; }
  body[data-route="home"] .m-record-row b, body[data-route="home"] .m-pos-oh-grid b, body[data-route="home"] .m-asset-grid b { overflow-wrap: anywhere; }
  body[data-route="home"] .m-trade-notice { max-width: calc(100vw - 28px); }
  body[data-route="home"] .m-trade-notice b, body[data-route="home"] .m-trade-notice span { overflow-wrap: anywhere; }
}
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] input, html[dir="rtl"] textarea, html[dir="rtl"] select { direction: rtl; text-align: right; }
html[dir="rtl"] .admin-shell { direction: rtl; }
html[dir="rtl"] .admin-panel table, html[dir="rtl"] .m-record-row, html[dir="rtl"] .m-order-detail-section p, html[dir="rtl"] .m-fin-row { direction: rtl; }
html[dir="rtl"] .m-bottom-nav, html[dir="rtl"] .m-actions-grid, html[dir="rtl"] .m-position-actions { direction: rtl; }
html[dir="rtl"] .m-order-detail-close { left: 16px !important; right: auto !important; }



@media (max-width: 900px) {
  body[data-route="home"] .m-home-header {
    grid-template-columns: minmax(96px, 118px) minmax(0, 1fr) 34px !important;
    column-gap: 6px !important;
    padding-right: 8px !important;
  }

  body[data-route="home"] .m-account-switch {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    font-size: clamp(13px, 3.65vw, 16px) !important;
    justify-content: center !important;
  }

  body[data-route="home"] .m-search {
    width: 30px !important;
    min-width: 30px !important;
  }

  body[data-route="home"] .lang-box {
    top: 2px !important;
    right: 35px !important;
    max-width: 82px !important;
    z-index: 130 !important;
  }

  body[data-route="home"] .lang-btn {
    max-width: 82px !important;
    min-width: 0 !important;
    width: auto !important;
    height: 20px !important;
    padding: 0 4px !important;
    font-size: 12px !important;
    line-height: 18px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
    border: 0 !important;
  }

  body[data-route="home"] .lang-menu {
    right: 0 !important;
    top: 24px !important;
    width: min(220px, 84vw) !important;
  }

  body[data-route="home"] .m-asset-hero {
    height: auto !important;
    min-height: 418px !important;
    padding: 70px 0 18px !important;
    overflow: hidden !important;
  }

  body[data-route="home"] .m-asset-card {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    height: auto !important;
    min-height: 332px !important;
    margin: 0 8px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }

  body[data-route="home"] .m-card-account {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-route="home"] .m-card-line {
    flex: 0 0 auto !important;
    margin: 16px 0 !important;
  }

  body[data-route="home"] .m-asset-label {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    max-width: 100% !important;
    line-height: 20px !important;
    margin-bottom: 8px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
  }

  body[data-route="home"] .m-asset-total {
    max-width: 100% !important;
    font-size: clamp(25px, 7.1vw, 30px) !important;
    line-height: 1.18 !important;
    letter-spacing: clamp(.5px, .45vw, 2px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-route="home"] .m-asset-hint {
    max-width: 100% !important;
    line-height: 20px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body[data-route="home"] .m-asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 22px !important;
    row-gap: 16px !important;
  }

  body[data-route="home"] .m-asset-grid > div {
    min-width: 0 !important;
  }

  body[data-route="home"] .m-asset-grid span {
    min-height: 19px !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    line-height: 19px !important;
  }

  body[data-route="home"] .m-asset-grid b {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}



@media (max-width: 900px) {
  body[data-route="home"] .m-home-header {
    grid-template-columns: minmax(92px, 118px) minmax(0, 1fr) 34px !important;
    column-gap: 5px !important;
  }

  body[data-route="home"] .m-account-switch {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  body[data-route="home"] .m-asset-hero {
    position: relative !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 74px 0 18px !important;
    overflow: visible !important;
  }

  body[data-route="home"] .m-asset-card {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 8px !important;
    padding: 20px 18px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    contain: none !important;
  }

  body[data-route="home"] .m-card-account {
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-route="home"] .m-card-line {
    margin: 16px 0 !important;
    flex: 0 0 auto !important;
  }

  body[data-route="home"] .m-asset-label,
  body[data-route="home"] .m-asset-hint,
  body[data-route="home"] .m-asset-grid span {
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body[data-route="home"] .m-asset-label {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 4px 6px !important;
    line-height: 20px !important;
    margin-bottom: 8px !important;
  }

  body[data-route="home"] .m-asset-hint {
    line-height: 20px !important;
    margin-bottom: 0 !important;
  }

  body[data-route="home"] .m-asset-total {
    max-width: 100% !important;
    font-size: clamp(25px, 7.1vw, 30px) !important;
    line-height: 1.18 !important;
    letter-spacing: clamp(.4px, .42vw, 2px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-route="home"] .m-asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 22px !important;
    row-gap: 16px !important;
  }

  body[data-route="home"] .m-asset-grid > div {
    min-width: 0 !important;
  }

  body[data-route="home"] .m-asset-grid b {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-route="home"] .m-bottom-nav {
    height: 54px !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    overflow: visible !important;
  }

  body[data-route="home"] .m-bottom-item {
    min-width: 0 !important;
    overflow: visible !important;
    gap: 2px !important;
  }

  body[data-route="home"] .m-bottom-item .m-bottom-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    display: grid !important;
    place-items: center !important;
    position: relative !important;
    overflow: visible !important;
    color: #5f6675 !important;
  }

  body[data-route="home"] .m-bottom-icon::before,
  body[data-route="home"] .m-bottom-icon::after {
    content: none !important;
    display: none !important;
  }

  body[data-route="home"] .m-bottom-icon svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.65 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  body[data-route="home"] .m-bottom-item.active .m-bottom-icon {
    color: #ffdf00 !important;
  }

  body[data-route="home"] .m-bottom-item em {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: clamp(10px, 2.75vw, 12px) !important;
    line-height: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
    font-style: normal !important;
  }

  body[data-route="home"] .lang-box {
    top: 2px !important;
    right: 37px !important;
    max-width: 78px !important;
    z-index: 140 !important;
  }

  body[data-route="home"] .lang-btn {
    max-width: 78px !important;
    width: auto !important;
    min-width: 0 !important;
    border: 0 !important;
    background: transparent !important;
    height: 22px !important;
    padding: 0 2px !important;
    line-height: 20px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}
