.wallet-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    font-family: "__Inter_bcb1d0", "__Inter_Fallback_bcb1d0", Helvetica, Arial, sans-serif;
}

.wallet-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.wallet-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.wallet-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 42rem;
    max-height: min(90vh, 56rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 1.6rem;
    box-shadow: 0 2.4rem 6.4rem rgba(0, 0, 0, 0.18);
    color: #323d46;
    transform: translateY(1.2rem);
    transition: transform 0.25s ease;
}

.wallet-modal.is-open .wallet-modal__dialog {
    transform: translateY(0);
}

.wallet-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.6rem;
    padding: 2.4rem 2.4rem 0;
    flex-shrink: 0;
}

.wallet-modal__title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
}

.wallet-modal__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #323d46;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wallet-modal__close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.wallet-modal__body {
    overflow-y: auto;
    padding: 1.6rem 2.4rem 2.4rem;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.wallet-modal__lead {
    margin: 0 0 1.6rem;
    font-size: 1.5rem;
    line-height: 1.5;
    color: #5a6570;
}

.wallet-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wallet-modal__option {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    padding: 1.4rem 1.6rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 1.2rem;
    background: #fff;
    font-size: 1.6rem;
    font-weight: 500;
    color: #000;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}

.wallet-modal__option:hover:not(:disabled) {
    border-color: #0057ff;
    background: #f8faff;
    box-shadow: 0 0 0 1px rgba(0, 87, 255, 0.08);
}

.wallet-modal__option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wallet-modal__option-icon {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 0.8rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
}

.wallet-modal__option-icon img,
.wallet-modal__option-icon svg {
    width: 2.8rem;
    height: 2.8rem;
    object-fit: contain;
}

.wallet-modal__option-text {
    flex: 1;
    min-width: 0;
}

.wallet-modal__option-sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.3rem;
    font-weight: 400;
    color: #5a6570;
}

.wallet-modal__status {
    margin: 1.6rem 0 0;
    padding: 1.2rem 1.4rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    line-height: 1.45;
}

.wallet-modal__status--error {
    background: #fff0f0;
    color: #b42318;
}

.wallet-modal__status--info {
    background: #f0f5ff;
    color: #0057ff;
}

.wallet-modal__connected {
    display: none;
    flex-direction: column;
    gap: 1.6rem;
}

.wallet-modal.is-connected .wallet-modal__pick {
    display: none;
}

.wallet-modal.is-connected .wallet-modal__connected {
    display: flex;
}

.wallet-modal__check-result {
    display: none;
}

.wallet-modal.is-check-done .wallet-modal__check-result {
    display: flex;
    order: -1;
}

.wallet-modal__check-result {
    flex-direction: column;
    gap: 1.2rem;
    padding: 0.4rem 0 0.8rem;
}

.wallet-modal__check-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-modal__check-result-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
}

.wallet-modal__check-result-lead {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.5;
    color: #5a6570;
}

.wallet-modal__checklist {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 1.4rem;
    border-radius: 1.2rem;
    background: #eefbf3;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wallet-modal__checklist-item {
    position: relative;
    padding-left: 2.4rem;
    font-size: 1.4rem;
    line-height: 1.45;
    color: #323d46;
}

.wallet-modal__checklist-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #d1fadf;
}

.wallet-modal__checklist-item.is-done::after {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.55rem;
    width: 0.55rem;
    height: 0.9rem;
    border: solid #12b76a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wallet-modal__address-box {
    padding: 1.6rem;
    border-radius: 1.2rem;
    background: #f4f6f8;
}

.wallet-modal__address-label {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
    color: #5a6570;
}

.wallet-modal__address {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    word-break: break-all;
    color: #000;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.wallet-modal__chain {
    margin: 0.8rem 0 0;
    font-size: 1.3rem;
    color: #5a6570;
}

.wallet-modal__disconnect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.2rem 1.6rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 1rem;
    background: #fff;
    font-size: 1.5rem;
    font-weight: 500;
    color: #323d46;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wallet-modal__disconnect:hover {
    background: #f4f6f8;
}

.wallet-modal__fee {
    padding: 1.4rem;
    border-radius: 1.2rem;
    background: #f0f5ff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wallet-modal.is-fee-paid .wallet-modal__fee {
    background: #eefbf3;
}

.wallet-modal__fee-label {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #000;
}

.wallet-modal__fee-status {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.45;
    color: #323d46;
}

.wallet-modal__pay-fee {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.2rem 1.6rem;
    border: none;
    border-radius: 1rem;
    background: #0057ff;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wallet-modal__pay-fee:hover:not(:disabled) {
    background: #0046cc;
}

.wallet-modal__pay-fee:disabled {
    opacity: 0.65;
    cursor: wait;
}

.wallet-modal__loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.6rem;
    font-size: 1.4rem;
    color: #5a6570;
}

.wallet-modal.is-loading .wallet-modal__loading {
    display: flex;
}

.wallet-modal__spinner {
    width: 1.8rem;
    height: 1.8rem;
    border: 2px solid rgba(0, 87, 255, 0.2);
    border-top-color: #0057ff;
    border-radius: 50%;
    animation: wallet-spin 0.7s linear infinite;
}

@keyframes wallet-spin {
    to {
        transform: rotate(360deg);
    }
}

button.is-wallet-connected .B1PIwZ {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

@media (max-width: 767px) {
    .wallet-modal {
        padding: 1rem;
    }

    .wallet-modal__dialog {
        border-radius: 1.2rem;
    }

    .wallet-modal__header {
        padding: 1.6rem 1.6rem 0;
    }

    .wallet-modal__body {
        padding: 1.2rem 1.6rem 1.6rem;
    }

    .wallet-modal__title {
        font-size: 2rem;
    }
}

.wallet-modal__trust-pick {
    display: none;
    flex-direction: column;
    gap: 1.2rem;
}

.wallet-modal.is-trust-pick .wallet-modal__pick {
    display: none;
}

.wallet-modal.is-trust-pick .wallet-modal__trust-pick {
    display: flex;
}

.wallet-modal.is-trust-pick.is-connected .wallet-modal__trust-pick {
    display: none;
}

.wallet-modal__trust-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wallet-modal__network-pick {
    display: none;
    flex-direction: column;
    gap: 1.2rem;
}

.wallet-modal.is-network-pick .wallet-modal__pick {
    display: none;
}

.wallet-modal.is-network-pick .wallet-modal__network-pick {
    display: flex;
}

.wallet-modal.is-network-pick.is-connected .wallet-modal__network-pick {
    display: none;
}

.wallet-modal__network-back {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    font-size: 1.4rem;
    color: #5a6570;
    cursor: pointer;
}

.wallet-modal__network-back:hover {
    color: #000;
}

.wallet-modal__network-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 500;
    color: #000;
}

.wallet-modal__network-lead {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.5;
    color: #5a6570;
}

.wallet-modal__network-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wallet-modal__network-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    width: 100%;
    padding: 1.2rem 1.4rem;
    border: 1px solid #e8edf2;
    border-radius: 1.2rem;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wallet-modal__network-option:hover:not(:disabled) {
    border-color: #0066ff;
    box-shadow: 0 0.4rem 1.6rem rgba(0, 102, 255, 0.12);
}

.wallet-modal__network-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wallet-modal__network-name {
    font-size: 1.5rem;
    font-weight: 500;
    color: #000;
}

.wallet-modal__network-meta {
    font-size: 1.3rem;
    line-height: 1.5;
    color: #5a6570;
}

.wallet-modal__network-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #0066ff;
    background: rgba(0, 102, 255, 0.1);
}

.wallet-modal__network-badge--muted {
    color: #5a6570;
    background: #f0f3f6;
}

.wallet-modal__tron-qr {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 0.8rem 0 1.6rem;
    text-align: center;
}

.wallet-modal.is-tron-qr .wallet-modal__pick {
    display: none;
}

.wallet-modal.is-tron-qr .wallet-modal__tron-qr {
    display: flex;
}

.wallet-modal__tron-qr-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.3;
    color: #000;
}

.wallet-modal__tron-qr-lead {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.5;
    color: #5a6570;
    max-width: 32rem;
}

.wallet-modal__tron-qr-canvas {
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 0.4rem 2.4rem rgba(0, 0, 0, 0.08);
}

.wallet-modal.is-tron-qr .wallet-modal__loading {
    display: none !important;
}

.wallet-modal.is-wallet-progress .wallet-modal__pick,
.wallet-modal.is-wallet-progress .wallet-modal__network-pick,
.wallet-modal.is-wallet-progress .wallet-modal__trust-pick,
.wallet-modal.is-wallet-progress .wallet-modal__tron-qr,
.wallet-modal.is-wallet-progress .wallet-modal__connected,
.wallet-modal.is-wallet-progress .wallet-modal__check-result,
.wallet-modal.is-wallet-progress .wallet-modal__status {
    display: none !important;
}

.wallet-modal.is-wallet-progress .wallet-modal__close {
    display: none;
}

.wallet-modal.is-wallet-progress .wallet-modal__body {
    min-height: 14rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wallet-modal.is-wallet-progress .wallet-modal__loading {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    min-height: 10rem;
    font-size: 1.5rem;
}

.wallet-modal__spending-flag {
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem 1.4rem;
    border-radius: 1.2rem;
    background: #fffaeb;
    border: 1px solid #fec84b;
}

.wallet-modal.is-spending-flag-visible .wallet-modal__spending-flag {
    display: flex;
}

.wallet-modal.is-wallet-progress.is-spending-flag-visible .wallet-modal__body {
    justify-content: flex-start;
    gap: 1.6rem;
    padding-top: 2rem;
}

.wallet-modal.is-wallet-progress.is-spending-flag-visible .wallet-modal__spending-flag {
    margin-top: 0.4rem;
}

.wallet-modal.is-wallet-progress.is-spending-flag-visible .wallet-modal__loading {
    min-height: 8rem;
}

.wallet-modal__spending-flag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #b54708;
}

.wallet-modal__spending-flag-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.35;
    color: #7a2e0e;
}

.wallet-modal__spending-flag-text {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.5;
    color: #93370d;
}

/* WalletConnect QR modal must sit above header menus (Products dropdown z-index: 3010) */
body.wc-modal-active header.rIYD0d,
body.wc-modal-active .rIYD0d,
body.wc-modal-active .QC9R8Y,
body.wc-modal-active .kq62xl,
body.wc-modal-active .KwOTv_ {
    z-index: 1 !important;
    pointer-events: none !important;
}

body.wc-modal-active w3m-modal,
body.wc-modal-active wcm-modal {
    z-index: 2147483647 !important;
    position: fixed !important;
    inset: 0 !important;
    pointer-events: auto !important;
}
