/*
 * Responsive mobile canvas for member pages that are also opened on desktop.
 * Keep page-specific visual styles in their original stylesheets; this file
 * only normalizes sizing, centering and alignment.
 */

html {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    background-color: #050505;
}

/*
 * Every complete template under application/index/view loads this stylesheet.
 * Desktop browsers render the site as a centered mobile canvas, while real
 * mobile browsers continue to use the full viewport width.
 */
body {
    position: relative;
    width: 100% !important;
    max-width: 559px !important;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin-right: auto !important;
    margin-left: auto !important;
    overflow-x: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.42);
}

body,
body *,
body *::before,
body *::after {
    box-sizing: border-box;
}

body :where(.container, .container-fluid, .main, #app, #appteam, .page, .page-group, .page-current, .content, .page-content, .mui-content, .wrapper, .fui-page, .fui-content) {
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
}

body :where(.swiper, .swiper-container, .swiper-wrapper, .swiper-slide),
body [style*="width:"][style*="px"] {
    min-width: 0;
    max-width: 100% !important;
}

/* Legacy app forms sometimes make their main panel 100vw / 700px. */
body > #app > .main,
body > #app > form > .main {
    width: 100% !important;
    max-width: 559px !important;
}

body :where(img, video, canvas, iframe, svg) {
    max-width: 100%;
}

body :where(input, select, textarea, button) {
    min-width: 0;
    max-width: 100%;
}

body :where(p, span, label, a, button, td, th, .title, .name, .desc, .text) {
    overflow-wrap: anywhere;
}

body :where(pre, code) {
    max-width: 100%;
    overflow-x: auto;
}

body .table-responsive,
body :where(.table-scroll, .table-wrap) {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body .pagination {
    width: 100% !important;
    max-width: 100%;
}

/* Common fixed navigation and modal surfaces must follow the mobile canvas. */
body :where(.footer-nav, .foot, .bar-tab, .fui-navbar, .fui-footer, #footer, #hui-footer, .hui-picker) {
    width: 100%;
    max-width: 559px;
}

body :where(.hui-header, .responsive-fixed-nav) {
    width: 100%;
    max-width: 559px !important;
}

/* Plain legacy headers are fixed to a 750px canvas in public/css/style.css. */
body > header:not([class]) {
    width: 100%;
    max-width: 559px !important;
}

body :where(.pops, .pop-fixed, .pop-background, .share, .dialog, .loader-screen, .van-overlay, .modal, .modal-overlay, .layui-m-layer, .layui-m-layershade, .mobileSelect .grayLayer, .mobileSelect .content, #hui-mask, #hui-transparent-mask, #hui-black-mask, #hui-toast, #hui-dialog, #hui-loading, #hui-image-preview) {
    max-width: 559px;
}

body .pop-box {
    width: calc(100% - 32px);
    max-width: 503px;
}

body.member-responsive-page {
    position: relative;
    width: 100% !important;
    max-width: 559px !important;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto !important;
    overflow-x: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.42);
}

body.member-responsive-page,
body.member-responsive-page *,
body.member-responsive-page *::before,
body.member-responsive-page *::after {
    box-sizing: border-box;
}

body.member-responsive-page > .container,
body.member-responsive-page > #app,
body.member-responsive-page > #app > .main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin-right: auto;
    margin-left: auto;
}

body.member-responsive-page .header {
    width: 100%;
    max-width: 100%;
}

body.member-responsive-page .header > p {
    width: 100%;
    margin: 0;
    padding-right: 60px;
    padding-left: 60px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Withdrawal and the two transaction-password pages. */
body.member-transaction-page {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

body.member-transaction-page > form,
body.member-transaction-page > .save-btn {
    width: auto;
    max-width: none;
}

body.member-transaction-page .my-meun,
body.member-transaction-page .money-bg,
body.member-transaction-page > .save-btn {
    margin-right: 16px;
    margin-left: 16px;
}

body.member-transaction-page .switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    width: 100%;
}

body.member-transaction-page .switch label {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin-left: 0 !important;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.member-transaction-page .switch input {
    flex: 0 0 auto;
}

body.member-deposit-page .money-bg .withdrawInput {
    display: block;
    width: calc(100% - 30px);
    min-width: 0;
    min-height: 44px;
    margin: 0 15px 14px;
}

body.member-deposit-page .bank-info,
body.member-deposit-page .bank-info div {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.member-pass-page > form {
    padding: 0 16px;
}

body.member-pass-page .money-bg {
    margin-right: 0;
    margin-left: 0;
}

body.member-pass-page .withdrawInput {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
}

body.member-transaction-page > .save-btn {
    display: block;
    min-height: 44px;
    padding: 11px 18px;
    line-height: 20px;
}

/* Legacy bank/password forms use a fixed header and rem-based spacing. */
body.member-fixed-form-page .header {
    position: fixed;
    top: 0;
    right: auto;
    left: 50%;
    width: 100% !important;
    max-width: 559px !important;
    margin: 0;
    transform: translateX(-50%);
}

body.member-fixed-form-page .header .Maintitle,
body.member-fixed-form-page .header .Maintitle h3 {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.member-fixed-form-page .header .Maintitle {
    padding-right: 60px;
    padding-left: 60px;
}

body.member-fixed-form-page .header .Maintitle h3 {
    font-size: 16px;
}

body.member-fixed-form-page form {
    width: 100%;
    min-width: 0;
    padding: 0 16px 24px;
}

body.member-fixed-form-page .bink_card {
    width: 100%;
    min-width: 0;
    padding: 16px 0;
}

body.member-fixed-form-page .bink_card_ul {
    width: 100%;
    min-width: 0;
    padding: 0 !important;
}

body.member-fixed-form-page .bink_card_ul li {
    width: 100%;
    min-width: 0;
    margin-bottom: 14px;
    text-align: left;
}

body.member-fixed-form-page .cardTit {
    margin: 0 0 8px;
    text-align: left;
    line-height: 1.45;
}

body.member-fixed-form-page .cardBox {
    display: block;
    width: 100% !important;
    min-width: 0;
    min-height: 46px;
    height: 46px;
    margin: 0 !important;
    padding: 0 16px;
    text-align: left;
}

body.member-fixed-form-page .bink_card input[type="radio"] {
    margin: 0 6px 0 0 !important;
}

body.member-fixed-form-page .bink_card input[type="radio"]:not(:first-of-type) {
    margin-left: 18px !important;
}

body.member-fixed-form-page .bink_card > div,
body.member-fixed-form-page .bink_card > div > div {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
}

body.member-fixed-form-page .save-btn,
body.member-fixed-form-page .subBtn {
    display: block;
    width: 100% !important;
    min-height: 44px;
    margin: 20px 0 0 !important;
    padding: 11px 18px;
    line-height: 20px;
}

body.member-fixed-form-page .pwTit {
    padding-right: 8px;
    padding-left: 8px;
    overflow-wrap: anywhere;
    text-align: center;
}

/* Structural fallback for the minified bind-bank template. */
body > #app > .main > .header {
    position: fixed;
    top: 0;
    right: auto;
    left: 50%;
    width: 100% !important;
    max-width: 559px !important;
    margin: 0;
    transform: translateX(-50%);
}

/* Some Vue-era forms insert a form node between #app and .main. */
body > #app > form > .main > .header {
    position: fixed;
    top: 0;
    right: auto;
    left: 50%;
    width: 100% !important;
    max-width: 559px !important;
    margin: 0;
    transform: translateX(-50%);
}

body > #app > .main > .header .Maintitle {
    padding-right: 60px;
    padding-left: 60px;
}

body > #app > .main > .header .Maintitle,
body > #app > .main > .header .Maintitle h3 {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body > #app > .main > .header .Maintitle h3 {
    font-size: 16px;
}

body > #app > .main > form {
    width: 100%;
    min-width: 0;
    padding: 0 16px 24px;
}

body > #app > .main > form .bink_card {
    width: 100%;
    min-width: 0;
    padding: 16px 0;
}

body > #app > .main > form .bink_card_ul {
    width: 100%;
    min-width: 0;
    padding: 0 !important;
}

body > #app > .main > form .bink_card_ul li {
    width: 100%;
    min-width: 0;
    margin-bottom: 14px;
    text-align: left;
}

body > #app > .main > form .cardTit {
    margin: 0 0 8px;
    text-align: left;
    line-height: 1.45;
}

body > #app > .main > form .cardBox {
    display: block;
    width: 100% !important;
    min-width: 0;
    min-height: 46px;
    height: 46px;
    margin: 0 !important;
    padding: 0 16px;
    text-align: left;
}

body > #app > .main > form .bink_card input[type="radio"] {
    margin: 0 6px 0 0 !important;
}

body > #app > .main > form .bink_card input[type="radio"]:not(:first-of-type) {
    margin-left: 18px !important;
}

body > #app > .main > form .bink_card > div,
body > #app > .main > form .bink_card > div > div {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
}

body > #app > .main > form .save-btn,
body > #app > .main > form .subBtn {
    display: block;
    width: 100% !important;
    min-height: 44px;
    margin: 20px 0 0 !important;
    padding: 11px 18px;
    line-height: 20px;
}

/* Customer service cards. */
body.member-service-page .content {
    min-height: calc(100vh - 128px);
    min-height: calc(100dvh - 128px);
    padding: 20px clamp(16px, 5vw, 28px);
}

body.member-service-page .service-box {
    gap: 18px;
    width: 100%;
    padding-top: clamp(42px, 12vh, 104px);
}

body.member-service-page .service-item {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: clamp(14px, 4vw, 20px);
}

body.member-service-page .service-item img {
    flex: 0 0 auto;
}

body.member-service-page .service-text {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

body.member-service-page .footer-nav {
    width: 100%;
    max-width: 559px;
    padding-bottom: env(safe-area-inset-bottom);
}

body.member-service-page .footer-nav-item {
    min-width: 0;
}

body.member-service-page .footer-nav-title {
    max-width: 100%;
    padding-right: 2px;
    padding-left: 2px;
    overflow: hidden;
    font-size: clamp(10px, 3.2vw, 14px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Language selector. */
body.member-language-page .content {
    min-height: calc(100vh - 58px);
    min-height: calc(100dvh - 58px);
    padding: 20px clamp(16px, 5vw, 28px);
}

body.member-language-page .language-item {
    width: 100%;
    max-width: 400px;
    min-width: 0;
    min-height: 50px;
    height: auto;
    padding: 5px 12px 5px 5px;
    cursor: pointer;
}

body.member-language-page .language-img {
    flex: 0 0 40px;
}

body.member-language-page .language-name {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

@media (max-width: 559px) {
    body {
        box-shadow: none;
    }

    body.member-responsive-page {
        box-shadow: none;
    }
}

@media (min-width: 560px) {
    /*
     * Bootstrap uses the browser viewport for its breakpoints.  The desktop
     * shell is intentionally mobile-sized, so keep the unprefixed mobile grid
     * widths even when md/lg/xl media queries are active.
     */
    body .col-1 {
        flex: 0 0 8.333333% !important;
        max-width: 8.333333% !important;
    }

    body .col-2 {
        flex: 0 0 16.666667% !important;
        max-width: 16.666667% !important;
    }

    body .col-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }

    body .col-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }

    body .col-5 {
        flex: 0 0 41.666667% !important;
        max-width: 41.666667% !important;
    }

    body .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    body .col-7 {
        flex: 0 0 58.333333% !important;
        max-width: 58.333333% !important;
    }

    body .col-8 {
        flex: 0 0 66.666667% !important;
        max-width: 66.666667% !important;
    }

    body .col-9 {
        flex: 0 0 75% !important;
        max-width: 75% !important;
    }

    body .col-10 {
        flex: 0 0 83.333333% !important;
        max-width: 83.333333% !important;
    }

    body .col-11 {
        flex: 0 0 91.666667% !important;
        max-width: 91.666667% !important;
    }

    body .col-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    body .col-auto {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 100% !important;
    }

    body > header:not([class]),
    body > .wrapper > .header,
    body > .header[style*="position: fixed"],
    body > .header[style*="position:fixed"],
    body :where(.hui-header, .responsive-fixed-nav),
    body :where(.footer-nav, .foot, .bar-tab, .fui-navbar, .fui-footer, #footer, #hui-footer, .hui-picker),
    body :where(.pops, .pop-fixed, .pop-background, .share, .dialog, .loader-screen, .van-overlay, .modal, .modal-overlay, .layui-m-layer, .layui-m-layershade, .mobileSelect .grayLayer, .mobileSelect .content, #hui-mask, #hui-transparent-mask, #hui-black-mask, #hui-toast, #hui-dialog, #hui-loading, #hui-image-preview) {
        right: auto !important;
        left: 50% !important;
        width: 100% !important;
        max-width: 559px !important;
        transform: translateX(-50%);
    }

    /* Login/register language menus used a desktop-page offset. */
    body .changeLang {
        right: 10px !important;
    }

    body .dialog-content {
        width: 90% !important;
        max-width: calc(100% - 32px) !important;
    }

    body > .header[style*="position: fixed"],
    body > .header[style*="position:fixed"] {
        max-width: 559px;
    }
}

/* The wallet is the only template using the legacy viewport-driven REM scale. */
html.responsive-rem-canvas body :where(.header, .funding-title, .vpay-toolbar, .add-btn, .popup, .slide-warp, .tab-title) {
    width: 100%;
    max-width: 559px;
}

@media (min-width: 560px) {
    html.responsive-rem-canvas {
        font-size: 36px !important;
    }

    html.responsive-rem-canvas body :where(.header, .funding-title, .vpay-toolbar, .add-btn, .popup, .slide-warp, .tab-title) {
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%);
    }

    html.responsive-rem-canvas body .vpay-record .tab-title {
        left: auto !important;
        transform: none;
    }
}

@media (max-width: 359px) {
    body.member-responsive-page .header > p,
    body.member-fixed-form-page .header .Maintitle {
        padding-right: 52px;
        padding-left: 52px;
    }

    body.member-transaction-page .my-meun,
    body.member-transaction-page .money-bg,
    body.member-transaction-page > .save-btn {
        margin-right: 12px;
        margin-left: 12px;
    }

    body.member-pass-page > form,
    body.member-fixed-form-page form {
        padding-right: 12px;
        padding-left: 12px;
    }

    body.member-service-page .service-item img {
        width: 64px;
        height: 64px;
    }

    body.member-service-page .service-text {
        font-size: 18px;
    }
}
