.currency-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    background: rgba(8, 6, 18, 0.72);
    backdrop-filter: blur(6px);
    box-sizing: border-box;
}

.currency-overlay-close {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 2;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #2a2744;
    color: #9ca3af;
    cursor: pointer;
}

.currency-overlay-close:hover {
    background: #343152;
    color: #fff;
}

.currency-overlay-close svg {
    width: 16px;
    height: 16px;
    display: block;
}

.modal-backdrop .modal-container:has(.currency-modal-shell),
.modal-backdrop .modal-container.modal-container--currency {
    box-sizing: border-box;
    width: min(94vw, 360px);
    max-width: min(94vw, 360px);
    max-height: calc(100dvh - 1.5rem);
    padding: 1.35rem 1.25rem 1.35rem;
    background: radial-gradient(120% 120% at 8% 0%, #20235b 0%, #151742 42%, #10122f 100%);
    border: 1px solid rgba(135, 97, 255, 0.28);
    border-radius: 16px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.52);
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    color: #fff;
}

.currency-modal-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.currency-modal-brand {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.35rem;
}

.currency-modal-logo {
    height: 34px;
    width: auto;
    max-width: min(100%, 200px);
    object-fit: contain;
    display: block;
}

.modal-currency-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
}

.modal-currency-title {
    margin: 0;
    font-size: clamp(1.15rem, 4vw, 1.35rem);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.modal-currency-subtitle {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.3;
    color: #8b86a8;
}

.currency-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.currency-options::-webkit-scrollbar {
    width: 4px;
}

.currency-options::-webkit-scrollbar-thumb {
    background: rgba(123, 97, 255, 0.45);
    border-radius: 4px;
}

.currency-option {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border: 1px solid rgba(137, 142, 190, 0.22);
    border-radius: 14px;
    background: rgba(25, 29, 71, 0.8);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.currency-option:hover {
    background: rgba(36, 40, 82, 0.92);
}

.currency-option.active {
    border-color: #7f61ff;
    background: linear-gradient(170deg, rgba(52, 48, 87, 0.95) 0%, rgba(43, 41, 74, 0.95) 100%);
}

.currency-option-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #3f3d63;
    border: 2px solid rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
    overflow: hidden;
}

.currency-option-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.currency-option-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    min-width: 0;
    overflow: hidden;
}

.currency-option-code {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
}

.currency-option-label {
    font-size: 0.82rem;
    color: #8b86a8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.currency-option-check-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.currency-option-check {
    width: 24px;
    height: 24px;
    color: #7b61ff;
    flex-shrink: 0;
}

.modal-currency-footer {
    flex-shrink: 0;
    padding-top: 1rem;
    margin-top: 0.75rem;
    width: 100%;
}

.modal-currency-done {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0.84rem 1rem;
    border: none;
    border-radius: 9px;
    background: linear-gradient(180deg, #9f75ff 0%, #7f52f4 100%);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-sizing: border-box;
    transition: filter 0.15s ease;
}

.modal-currency-done:hover {
    filter: brightness(1.08);
}

@media (max-width: 420px) {
    .modal-backdrop .modal-container:has(.currency-modal-shell),
    .modal-backdrop .modal-container.modal-container--currency {
        width: min(98vw, 360px);
        max-width: 98vw;
        padding: 1.15rem 1rem 1.2rem;
    }

    .currency-option {
        padding: 0.72rem 0.85rem;
    }

    .modal-currency-done {
        min-height: 44px;
        font-size: 0.9rem;
    }
}
