.card.ym-wallet-balance {
    padding: clamp(16px, 3vw, 28px);
    border-color: #203653;
    background: radial-gradient(ellipse at top right, #123c7b 0, transparent 65%), #0b1220;
    color: #fff;
}

.ym-wallet-balance-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ym-wallet-balance-summary { min-width: 0; }
.ym-wallet-recharge-link { flex-shrink: 0; }

#wallet-balance-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #bdcce2;
    font-size: 13px;
    font-weight: 600;
}

#wallet-balance-amount {
    margin-top: 4px;
    color: #fff;
    font-size: clamp(32px, 5vw, 42px);
    font-weight: 660;
    line-height: 1.16;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
}

.ym-wallet-balance-stats,
.ym-wallet-referral-actions,
.ym-wallet-referral-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.ym-wallet-referral-stats,
.ym-wallet-referral-body p {
    color: #475d7b;
    font-size: 12px;
}

.ym-wallet-balance-stats { margin-top: 7px; color: #c3d1e6; font-size: 12px; }

.ym-wallet-referral {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #d7e4fc;
    border-radius: 12px;
    background: linear-gradient(115deg, #eff5ff 0%, #fff 58%, #f2f3ff 100%);
}

.ym-wallet-referral-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e5efff;
    color: #1554cb;
}

#wallet-referral-title { color: #142746; font-size: 14px; font-weight: 650; }
#wallet-referral-title a:hover { text-decoration: underline; }
.ym-wallet-referral-body p { margin-top: 3px; }
.ym-wallet-referral-actions { margin: 9px 0 7px; gap: 6px; }

.ym-wallet-invite-code {
    min-width: 0;
    border: 1px solid #d7e4fc;
    border-radius: 8px;
    background: #fff;
    padding: 6px 9px;
    color: #142746;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.ym-wallet-referral .btn-ghost {
    border-color: #d7e4fc;
    background: #fff;
    color: #204264;
}

.ym-wallet-referral .btn-ghost:hover:not(:disabled) {
    border-color: #a9c8ff;
    background: #edf4ff;
    color: #1453b5;
}

.ym-wallet-referral .ym-wallet-copy-link,
.ym-wallet-referral .ym-wallet-transfer:not(:disabled) {
    border-color: #1458d4;
    background: #1458d4;
    color: #fff;
}

.ym-wallet-referral .ym-wallet-copy-link:hover,
.ym-wallet-referral .ym-wallet-transfer:hover:not(:disabled) {
    border-color: #1046ad;
    background: #1046ad;
    color: #fff;
}

.ym-wallet-referral .ym-wallet-transfer:disabled {
    border-color: #d7e4fc;
    background: #eaf1fc;
    color: #536887;
    opacity: 1;
}

#wallet-recharge,
#wallet-redeem { scroll-margin-top: 86px; }

.ym-wallet-topup-dialog { display: grid; gap: 14px; }
.ym-wallet-amount-input {
    display: flex;
    border: 1px solid #dbdce1;
    border-radius: 8px;
    overflow: hidden;
}
.ym-wallet-amount-input span {
    display: grid;
    place-items: center;
    padding: 12px;
    color: #5b6574;
    background: #f8f9fb;
    border-right: 1px solid #e0e2e7;
    font-size: 12px;
    font-weight: 650;
}
.ym-wallet-amount-input input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    color: #202124;
    background: #fff;
    font-size: 27px;
    font-weight: 650;
    outline-offset: -3px;
}
.ym-wallet-topup-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.ym-wallet-topup-presets .btn { padding-inline: 8px; font-size: 12px; }
.ym-wallet-topup-dialog button[aria-pressed="true"] {
    background: #f5f5f5;
    border-color: #202124;
    color: #202124;
}
.ym-wallet-payment-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.ym-wallet-payment-methods .btn { justify-content: flex-start; min-height: 62px; }
.ym-wallet-payment-methods span { display: grid; gap: 3px; text-align: left; flex: 1; }
.ym-wallet-payment-methods small { color: #7a7c80; font-size: 11px; font-weight: 400; }
.ym-wallet-payment-total,
.ym-wallet-payment-credit {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    color: #75777b;
    font-size: 13px;
}
.ym-wallet-payment-total { border-top: 1px solid #e8e9eb; }
.ym-wallet-payment-credit { padding-top: 0; }
.ym-wallet-payment-total strong,
.ym-wallet-payment-credit strong { color: #202124; }
div[role="dialog"]:has(.ym-wallet-topup-dialog) {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.ym-wallet-topup-limits { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ym-wallet-alipay-icon { flex: 0 0 32px; border-radius: 7px; background: #f0faff; padding: 3px; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) {
    border: 1px solid #e1e1e3;
    background: #fff !important;
    backdrop-filter: none !important;
    border-radius: 15px;
    color: #202124;
    box-shadow: 0 24px 70px #11182733;
}
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:first-child {
    padding: 24px 22px 18px;
    border-bottom: 1px solid #ececef;
}
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:first-child h3 { color: #202124; font-size: 20px; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:first-child p { color: #828489; font-size: 13px; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:first-child > button {
    display: grid; place-items: center; width: 42px; height: 42px;
    border: 1px solid #e0e1e4; border-radius: 10px; color: #202124; background: #fff;
}
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:nth-child(2) { padding: 22px; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:last-child {
    padding: 16px 22px 22px;
    border-color: #ececef;
    background: #fff;
}
#root .ym-wallet-topup-dialog .label { color: #515358; font-size: 13px; }
#root .ym-wallet-topup-dialog .btn {
    background: #fff;
    border: 1px solid #dcdde1;
    color: #515358;
    box-shadow: none;
    border-radius: 7px;
    min-height: 38px;
}
#root .ym-wallet-topup-dialog .btn[aria-pressed="true"] { color: #202124; border-color: #202124; background: #f5f5f5; }
#root .ym-wallet-payment-methods .btn[aria-pressed="true"] { background: #fff; border-width: 2px; }
#root .ym-wallet-payment-methods .btn { min-height: 62px; padding: 10px 12px; white-space: normal; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:last-child .btn { min-height: 44px; border-radius: 9px; box-shadow: none; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:last-child .btn-primary { color: #fff; background: #17191c; border-color: #17191c; }
#root [role="dialog"]:has(.ym-wallet-topup-dialog) > div:last-child .btn-ghost { color: #202124; background: #fff; border-color: #d4d5d9; }
.ym-wallet-amount-input input::-webkit-inner-spin-button,
.ym-wallet-amount-input input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.ym-wallet-amount-input input { appearance: textfield; }

@media (max-width: 640px) {
    .ym-wallet-referral {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 10px;
    }

    .ym-wallet-referral-icon { width: 30px; height: 30px; }
    .ym-wallet-transfer { grid-column: 2; justify-self: start; }
}
