/*
 * XuNhanh customer visual layer
 * Load after the legacy site styles. All rules are intentionally scoped so
 * authentication, profile, lookup and modal flows retain their existing UI.
 */
body.xn-customer-ui {
    --xn-ink: #183b4a;
    --xn-ink-deep: #123240;
    --xn-ink-soft: #45616c;
    --xn-muted: #71858b;
    --xn-line: #dce9e4;
    --xn-paper: #ffffff;
    --xn-mint: #eff8f4;
    --xn-mint-deep: #e4f2ec;
    --xn-teal: #167d70;
    --xn-teal-dark: #11695f;
    --xn-green: #18794e;
    --xn-green-wash: #e8f5ed;
    --xn-red: #b44843;
    --xn-red-wash: #faecea;
    --xn-shadow: 0 10px 28px rgba(24, 59, 74, .07);
    background: var(--xn-mint);
    color: var(--xn-ink);
    font-family: "Segoe UI", "Noto Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.xn-customer-ui *,
body.xn-customer-ui *::before,
body.xn-customer-ui *::after {
    box-sizing: border-box;
}

body.xn-customer-ui a {
    color: var(--xn-teal);
}

body.xn-customer-ui a:hover,
body.xn-customer-ui a:focus {
    color: var(--xn-teal-dark);
}

/* Existing header/navigation, without changing legacy content or behavior. */
body.xn-customer-ui > .rx-container,
body.xn-customer-ui > .container-fluid {
    min-height: 100vh;
    background: var(--xn-mint);
}

body.xn-customer-ui header {
    position: relative;
    z-index: 5;
    min-height: 0;
    border: 0;
    background: var(--xn-ink-deep);
    box-shadow: 0 3px 12px rgba(12, 43, 53, .12);
}

body.xn-customer-ui > .container-fluid > header {
    width: calc(100% + 30px);
}

body.xn-customer-ui .header_top {
    min-height: 72px;
    padding: 10px 0;
    background: var(--xn-ink-deep);
}

body.xn-customer-ui .header_top .row {
    display: flex;
    align-items: center;
    margin-right: 0;
    margin-left: 0;
}

body.xn-customer-ui .header_top .logo {
    position: static;
    width: 100%;
    margin: 0;
    max-width: 210px;
}

body.xn-customer-ui .header_top .logo img {
    display: block;
    max-width: 100%;
    max-height: 44px;
    height: auto;
    margin: 0;
    object-fit: contain;
    object-position: left center;
}

body.xn-customer-ui .support {
    padding: 32px 20px;
    background: var(--xn-paper);
    color: var(--xn-ink);
    border-top: 1px solid var(--xn-line);
    border-bottom: 1px solid var(--xn-line);
}

body.xn-customer-ui .support h4,
body.xn-customer-ui .support p {
    color: var(--xn-ink);
}

body.xn-customer-ui .support a {
    color: var(--xn-teal);
}

body.xn-customer-ui #cssmenu > ul {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin: 0;
}

body.xn-customer-ui #cssmenu > ul > li > a {
    display: inline-block;
    padding: 12px 15px;
    border-radius: 5px;
    color: #e8f3ef;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease;
}

body.xn-customer-ui #cssmenu > ul > li > a:hover,
body.xn-customer-ui #cssmenu > ul > li.active > a {
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
}

body.xn-customer-ui #mobileToggle .lines span {
    background: #eaf5f1;
}

body.xn-customer-ui #navigation {
    background: var(--xn-ink-deep);
}

body.xn-customer-ui #navigation .navigation-menu a {
    color: #e8f3ef;
}

body.xn-customer-ui #navigation .navigation-menu a:hover {
    color: #ffffff;
}

/* Trade workspace: compact catalog beside the actual Angular trade view. */
body.xn-customer-ui #mainTrading {
    padding-top: 0;
}

body.xn-customer-ui #trade_coin {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px 28px 52px;
}

body.xn-customer-ui #trade_coin > .row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-right: -12px;
    margin-left: -12px;
}

body.xn-customer-ui #trade_coin > .row > .col-sm-12 {
    flex: 0 0 100%;
}

body.xn-customer-ui #trade_coin > .row > #xn-trading-catalog,
body.xn-customer-ui #trade_coin > .row > trading-menu {
    flex: 0 0 28%;
    width: 28%;
    max-width: 28%;
    padding-right: 12px;
    padding-left: 12px;
}

body.xn-customer-ui #trade_coin > .row > [ui-view] {
    flex: 0 0 72%;
    width: 72%;
    max-width: 72%;
    padding-right: 12px;
    padding-left: 12px;
}

body.xn-customer-ui #trade_coin .alert {
    border-radius: 7px;
}

body.xn-customer-ui #trade_coin #fixed-price-warning {
    color: #5b4a20;
}

body.xn-customer-ui #xn-trading-catalog {
    min-width: 0;
}

body.xn-customer-ui .xn-coin-toggle {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 11px 14px;
    border: 1px solid #c5ddd4;
    border-radius: 7px;
    background: #ffffff;
    color: var(--xn-ink);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

body.xn-customer-ui .xn-coin-toggle:hover,
body.xn-customer-ui .xn-coin-toggle:focus {
    border-color: var(--xn-teal);
    color: var(--xn-teal-dark);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu {
    overflow: hidden;
    border: 1px solid var(--xn-line);
    border-radius: 9px;
    background: var(--xn-paper);
    box-shadow: var(--xn-shadow);
    color: var(--xn-ink);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search {
    padding: 15px 14px;
    border-bottom-color: var(--xn-line);
    background: #fbfdfc;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search-label {
    color: var(--xn-muted);
    font-size: 10px;
    letter-spacing: .08em;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search-input {
    min-height: 40px;
    padding: 9px 11px;
    border-color: #d4e3dd;
    border-radius: 5px;
    background: #fff;
    color: var(--xn-ink);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search-input:focus {
    border-color: var(--xn-teal);
    box-shadow: 0 0 0 3px rgba(22, 125, 112, .12);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__section {
    border-bottom-color: var(--xn-line);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__toggle {
    min-height: 46px;
    padding: 12px 14px;
    border-left-width: 3px;
    color: var(--xn-ink);
    font-size: 13px;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__toggle:hover,
body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__toggle:focus {
    background: #f4faf7;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__buy-word,
body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__price {
    color: var(--xn-green);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__sell-word {
    color: var(--xn-red);
}

body.xn-customer-ui #xn-trading-catalog #wmx-sell-list .wmx-coin-menu__price:not(.is-empty) {
    color: var(--xn-red);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__content {
    padding: 0 8px 10px;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__row {
    margin: 2px 0;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__item {
    min-height: 48px;
    padding: 7px 8px;
    border-radius: 5px;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__item:hover {
    background: #f1f8f4;
    color: var(--xn-ink);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__row.is-active > .wmx-coin-menu__item {
    background: var(--xn-mint-deep);
    box-shadow: inset 3px 0 var(--xn-teal);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__name {
    color: var(--xn-ink);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__meta {
    color: var(--xn-muted);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__reason {
    color: #89544c;
    white-space: normal;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__price {
    padding: 4px 7px;
    border-radius: 4px;
    background: var(--xn-green-wash);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

body.xn-customer-ui #xn-trading-catalog #wmx-sell-list .wmx-coin-menu__price:not(.is-empty) {
    background: var(--xn-red-wash);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__price.is-empty {
    background: #f1f4f2;
    color: var(--xn-muted);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__partner {
    margin: 12px;
    border-color: var(--xn-line);
    border-radius: 6px;
    background: #fbfdfc;
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__partner h5 {
    border-bottom-color: var(--xn-line);
    color: var(--xn-ink-soft);
}

body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__partner-body {
    color: var(--xn-muted);
}

/* Only the trading forms are restyled; other legacy forms keep their own UI. */
body.xn-customer-ui #trade_coin #myTabs {
    overflow: hidden;
    border: 1px solid var(--xn-line);
    border-radius: 9px;
    background: var(--xn-paper);
    box-shadow: var(--xn-shadow);
}

body.xn-customer-ui #trade_coin #myTabs > .nav-tabs {
    margin: 0;
    padding: 0 24px;
    border-bottom: 1px solid var(--xn-line);
    background: #fbfdfc;
}

body.xn-customer-ui #trade_coin #myTabs > .nav-tabs > li {
    margin-bottom: -1px;
}

body.xn-customer-ui #trade_coin #myTabs > .nav-tabs > li > a {
    padding: 17px 3px 14px;
    border: 0;
    border-bottom: 3px solid var(--xn-teal);
    background: transparent;
    color: var(--xn-ink);
}

body.xn-customer-ui #trade_coin #myTabs h1 {
    margin: 0;
    color: var(--xn-ink);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

body.xn-customer-ui #trade_coin #muangay > .alert {
    margin: 18px 24px 0;
}

body.xn-customer-ui #trade_coin #muangay > .panel-body {
    margin: 0;
    padding: 24px;
}

body.xn-customer-ui #trade_coin form.form-horizontal {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

body.xn-customer-ui #trade_coin form.form-horizontal .form-group {
    margin-right: 0;
    margin-left: 0;
    margin-bottom: 20px;
}

body.xn-customer-ui #trade_coin form.form-horizontal .form-group > .col-sm-4,
body.xn-customer-ui #trade_coin form.form-horizontal .form-group > .col-sm-8 {
    float: none;
    width: 100%;
}

body.xn-customer-ui #trade_coin form.form-horizontal .form-group > .col-sm-4:empty {
    display: none;
}

body.xn-customer-ui #trade_coin form.form-horizontal .control-label {
    display: block;
    width: 100%;
    padding-top: 0;
    padding-right: 0;
    padding-left: 0;
    padding-bottom: 7px;
    color: #405c66;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
}

body.xn-customer-ui #trade_coin form.form-horizontal .form-control {
    min-height: 42px;
    border-color: #d4e3dd;
    border-radius: 5px;
    background: #fff;
    box-shadow: none;
    color: var(--xn-ink);
    font-size: 14px;
}

body.xn-customer-ui #trade_coin form.form-horizontal .form-control:focus {
    border-color: var(--xn-teal);
    box-shadow: 0 0 0 3px rgba(22, 125, 112, .11);
}

body.xn-customer-ui #trade_coin form.form-horizontal .form-control[readonly],
body.xn-customer-ui #trade_coin form.form-horizontal .form-control:disabled {
    background: #f2f7f4;
    color: #60767c;
    opacity: 1;
}

body.xn-customer-ui #trade_coin form.form-horizontal .input-group-addon {
    border-color: #d4e3dd;
    background: #f3f8f5;
    color: #5c7479;
    font-size: 12px;
    font-weight: 600;
}

body.xn-customer-ui #trade_coin form.form-horizontal .error,
body.xn-customer-ui #trade_coin form.form-horizontal [ng-messages] {
    display: block;
    margin-top: 5px;
    color: #ad4640;
    font-size: 12px;
    line-height: 1.45;
}

body.xn-customer-ui #trade_coin form.form-horizontal .has-error .form-control {
    border-color: #c95b52;
}

body.xn-customer-ui #trade_coin form.form-horizontal .has-success .form-control {
    border-color: #56a47a;
}

body.xn-customer-ui #trade_coin form.form-horizontal .btn-primary {
    min-height: 44px;
    padding: 10px 24px;
    border: 1px solid var(--xn-teal);
    border-radius: 5px;
    background: var(--xn-teal);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease;
}

body.xn-customer-ui #trade_coin form.form-horizontal .btn-primary:hover,
body.xn-customer-ui #trade_coin form.form-horizontal .btn-primary:focus {
    border-color: var(--xn-teal-dark);
    background: var(--xn-teal-dark);
}

body.xn-customer-ui #trade_coin form.form-horizontal .btn-primary:disabled,
body.xn-customer-ui #trade_coin form.form-horizontal .btn-primary[disabled] {
    cursor: not-allowed;
    opacity: .58;
}

body.xn-customer-ui #trade_coin #tutorial_ {
    margin: 0 24px 24px;
    border-color: #e5d7b2;
    border-radius: 6px;
    background: #fffaf0;
    color: #635638;
    line-height: 1.65;
}

body.xn-customer-ui #trade_coin #tutorial_ h5 {
    color: #493f29;
    font-size: 14px;
    font-weight: 700;
}

body.xn-customer-ui .xn-home-hero {
    position: relative;
    overflow: hidden;
    padding: 64px 0 60px;
    background:
        radial-gradient(ellipse at 86% 16%, rgba(117, 197, 168, .2), transparent 34%),
        linear-gradient(125deg, #eaf6f0 0%, #f7fbf8 58%, #e5f2ed 100%);
}

body.xn-customer-ui .xn-home-hero__inner {
    position: relative;
    display: grid;
    width: min(1180px, calc(100% - 40px));
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
    align-items: center;
    gap: 52px;
    margin: 0 auto;
}

body.xn-customer-ui .xn-home-hero__copy {
    max-width: 590px;
}

body.xn-customer-ui .xn-home-hero__brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 23px;
}

body.xn-customer-ui .xn-home-hero__brand img {
    display: block;
    width: min(216px, 58vw);
    height: auto;
}

body.xn-customer-ui .xn-home-hero__eyebrow {
    margin: 0 0 12px;
    color: var(--xn-teal);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}

body.xn-customer-ui .xn-home-hero__title {
    max-width: 610px;
    margin: 0 0 17px;
    color: var(--xn-ink-deep);
    font-size: clamp(32px, 4.4vw, 54px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.12;
}

body.xn-customer-ui .xn-home-hero__description {
    max-width: 560px;
    margin: 0;
    color: #526c72;
    font-size: 16px;
    line-height: 1.75;
}

body.xn-customer-ui .xn-home-hero__quick-title {
    margin: 29px 0 11px;
    color: var(--xn-ink);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

body.xn-customer-ui .xn-home-hero__quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

body.xn-customer-ui .xn-home-hero__quick-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 9px;
    border: 1px solid #cfe2d9;
    border-radius: 6px;
    background: rgba(255, 255, 255, .88);
    color: var(--xn-ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

body.xn-customer-ui .xn-home-hero__quick-link:hover,
body.xn-customer-ui .xn-home-hero__quick-link:focus {
    transform: translateY(-2px);
    border-color: #82bba3;
    background: #fff;
    color: var(--xn-teal-dark);
    text-decoration: none;
}

body.xn-customer-ui .xn-home-hero__quick-link img {
    display: block;
    width: 25px;
    height: 25px;
    object-fit: contain;
}

body.xn-customer-ui .xn-home-hero__visual {
    position: relative;
    min-height: 330px;
    padding: 25px;
    border: 1px solid rgba(191, 219, 207, .8);
    border-radius: 14px;
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 22px 55px rgba(25, 72, 59, .09);
}

body.xn-customer-ui .xn-home-hero__visual-heading {
    margin: 0 0 19px;
    color: var(--xn-ink-soft);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

body.xn-customer-ui .xn-home-hero__asset-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.xn-customer-ui .xn-home-hero__asset {
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 1px solid #e4eee9;
    border-radius: 8px;
    background: #fff;
}

body.xn-customer-ui .xn-home-hero__asset-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 50%;
    background: #eef7f2;
}

body.xn-customer-ui .xn-home-hero__asset-icon img {
    display: block;
    width: 27px;
    height: 27px;
    object-fit: contain;
}

body.xn-customer-ui .xn-home-hero__asset-name {
    color: var(--xn-ink);
    font-size: 14px;
    font-weight: 700;
}

body.xn-customer-ui .xn-home-hero__asset-code {
    display: block;
    margin-top: 3px;
    color: var(--xn-muted);
    font-size: 11px;
    letter-spacing: .04em;
}

body.xn-customer-ui .xn-home-hero__visual-note {
    margin: 16px 2px 0;
    color: var(--xn-muted);
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 991px) {
    body.xn-customer-ui #trade_coin > .row > #xn-trading-catalog,
    body.xn-customer-ui #trade_coin > .row > trading-menu {
        flex-basis: 31%;
        width: 31%;
        max-width: 31%;
    }

    body.xn-customer-ui #trade_coin > .row > [ui-view] {
        flex-basis: 69%;
        width: 69%;
        max-width: 69%;
    }

    body.xn-customer-ui .xn-home-hero__inner {
        gap: 32px;
    }
}

@media (min-width: 768px) {
    body.xn-customer-ui #xn-trading-catalog.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible;
    }

    body.xn-customer-ui .xn-coin-toggle {
        display: none;
    }
}

@media (max-width: 767px) {
    body.xn-customer-ui #cssmenu > ul.hidden-mob {
        display: none;
    }

    body.xn-customer-ui .header_top .row > div:first-child {
        width: 70%;
    }

    body.xn-customer-ui .header_top .row > div:nth-child(2) {
        position: static;
        width: 30%;
    }

    body.xn-customer-ui #navigation {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        width: 100%;
        margin: 0;
        background: var(--xn-ink-deep);
        box-shadow: var(--xn-shadow);
    }

    body.xn-customer-ui #navigation .has-submenu {
        float: none;
        width: 100%;
    }

    body.xn-customer-ui .navbar-toggle .lines {
        height: 44px;
        padding-top: 13px;
    }

    body.xn-customer-ui .header_top {
        min-height: 62px;
        padding: 8px 0;
    }

    body.xn-customer-ui .header_top .row {
        min-height: 46px;
    }

    body.xn-customer-ui .header_top .logo {
        max-width: 170px;
    }

    body.xn-customer-ui #trade_coin {
        padding: 16px 12px 32px;
    }

    body.xn-customer-ui #trade_coin > .row {
        display: block;
        margin-right: -8px;
        margin-left: -8px;
    }

    body.xn-customer-ui #trade_coin > .row > #xn-trading-catalog,
    body.xn-customer-ui #trade_coin > .row > trading-menu,
    body.xn-customer-ui #trade_coin > .row > [ui-view] {
        width: 100%;
        max-width: 100%;
        padding-right: 8px;
        padding-left: 8px;
    }

    body.xn-customer-ui #trade_coin > .row > [ui-view] {
        margin-top: 12px;
    }

    body.xn-customer-ui #xn-trading-catalog.collapse:not(.in) {
        display: none;
    }

    body.xn-customer-ui #xn-trading-catalog.collapse.in {
        display: block;
        height: auto !important;
        visibility: visible;
    }

    body.xn-customer-ui #trade_coin #myTabs > .nav-tabs {
        padding-right: 17px;
        padding-left: 17px;
    }

    body.xn-customer-ui #trade_coin #myTabs h1 {
        font-size: 20px;
    }

    body.xn-customer-ui #trade_coin #muangay > .alert {
        margin-right: 15px;
        margin-left: 15px;
    }

    body.xn-customer-ui #trade_coin #muangay > .panel-body {
        padding: 18px 15px;
    }

    body.xn-customer-ui #trade_coin form.form-horizontal .form-group {
        margin-bottom: 17px;
    }

    body.xn-customer-ui #trade_coin form.form-horizontal .control-label {
        padding-left: 0;
        text-align: left;
    }

    body.xn-customer-ui #trade_coin form.form-horizontal .form-group > [class*="col-"] {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    body.xn-customer-ui #trade_coin #tutorial_ {
        margin-right: 15px;
        margin-left: 15px;
    }

    body.xn-customer-ui .xn-home-hero {
        padding: 40px 0 36px;
    }

    body.xn-customer-ui .xn-home-hero__inner {
        width: min(100% - 28px, 600px);
        grid-template-columns: minmax(0, 1fr);
        gap: 29px;
    }

    body.xn-customer-ui .xn-home-hero__brand {
        margin-bottom: 18px;
    }

    body.xn-customer-ui .xn-home-hero__title {
        font-size: clamp(31px, 9vw, 43px);
    }

    body.xn-customer-ui .xn-home-hero__description {
        font-size: 15px;
    }

    body.xn-customer-ui .xn-home-hero__quick-title {
        margin-top: 23px;
    }

    body.xn-customer-ui .xn-home-hero__visual {
        min-height: 0;
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.xn-customer-ui *,
    body.xn-customer-ui *::before,
    body.xn-customer-ui *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* At phone/tablet widths, show the full compact catalog above the trade form. */
@media (max-width: 991px) {
    body.xn-customer-ui #trade_coin {
        width: 100%;
        padding: 12px 12px 28px;
    }

    body.xn-customer-ui #trade_coin > .row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-right: 0;
        margin-left: 0;
    }

    body.xn-customer-ui #trade_coin > .row > #xn-trading-catalog,
    body.xn-customer-ui #trade_coin > .row > trading-menu,
    body.xn-customer-ui #trade_coin > .row > [ui-view] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    body.xn-customer-ui #trade_coin #myTabs > .nav-tabs {
        padding: 0 14px;
    }

    body.xn-customer-ui #trade_coin #muangay > .alert {
        margin: 12px 14px 0;
    }

    body.xn-customer-ui #trade_coin #muangay > .panel-body,
    body.xn-customer-ui #trade_coin #banngay > .panel-body {
        padding: 14px;
    }

    body.xn-customer-ui #trade_coin form.form-horizontal .form-group {
        margin-bottom: 14px;
    }

    body.xn-customer-ui #trade_coin input[name="quantity"] {
        scroll-margin-block: 16px;
    }
}

/* Keep the trading menu and form readable on phones/tablets without altering desktop layout. */
@media (max-width: 991px) {
    body.xn-customer-ui #trade_coin > .row > .xn-coin-toggle {
        display: none !important;
    }

    body.xn-customer-ui #xn-trading-catalog.collapse,
    body.xn-customer-ui #xn-trading-catalog.collapse:not(.in) {
        display: block !important;
        height: auto !important;
        visibility: visible;
    }

    body.xn-customer-ui #trade_coin {
        width: 100%;
        padding: 12px 12px 28px;
    }

    body.xn-customer-ui #trade_coin > .row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-right: 0;
        margin-left: 0;
    }

    body.xn-customer-ui #trade_coin > .row > #xn-trading-catalog,
    body.xn-customer-ui #trade_coin > .row > trading-menu,
    body.xn-customer-ui #trade_coin > .row > [ui-view] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu {
        border-radius: 14px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search {
        padding: 9px 12px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search-label {
        margin-bottom: 3px;
        font-size: 9px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__search-input {
        min-height: 36px;
        padding: 7px 9px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__toggle {
        min-height: 44px;
        padding: 10px 13px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__content {
        padding: 0 7px 9px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        align-items: stretch;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__row {
        min-width: 0;
        margin: 0;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__item {
        min-width: 0;
        min-height: 68px;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 5px;
        padding: 7px 8px;
        border: 1px solid var(--xn-line);
        border-radius: 13px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__asset {
        gap: 7px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__icon {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__details {
        flex: 1 1 auto;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__name {
        font-size: 12px;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__price {
        align-self: center;
        max-width: 100%;
        overflow: hidden;
        padding: 4px 8px;
        border-radius: 999px;
        font-size: 10px;
        line-height: 1.2;
        text-overflow: ellipsis;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__price.is-empty {
        padding: 0;
        background: transparent;
    }

    body.xn-customer-ui #xn-trading-catalog .wmx-coin-menu__partner {
        margin: 8px 0 0;
    }

    body.xn-customer-ui #trade_coin #myTabs > .nav-tabs {
        padding: 0 14px;
    }

    body.xn-customer-ui #trade_coin #muangay > .alert {
        margin: 12px 14px 0;
    }

    body.xn-customer-ui #trade_coin #muangay > .panel-body,
    body.xn-customer-ui #trade_coin #banngay > .panel-body {
        padding: 14px;
    }

    body.xn-customer-ui #trade_coin form.form-horizontal .form-group {
        margin-bottom: 14px;
    }

    body.xn-customer-ui #trade_coin input[name="quantity"] {
        scroll-margin-block: 16px;
    }
}
