.pm-custom-select {
    --pm-select-height: 42px;
    --pm-select-bg: var(--pm-control-bg, #f5f6f6);
    --pm-select-bg-open: var(--pm-surface-raised, #fff);
    --pm-select-menu-bg: var(--pm-popover-bg, #fff);
    --pm-select-text: var(--pm-text, #171b1e);
    --pm-select-muted: var(--pm-text-muted, #818990);
    --pm-select-line: var(--pm-line, rgba(20, 27, 31, .1));
    --pm-select-line-active: var(--pm-green-border, rgba(24, 201, 116, .3));
    --pm-select-accent: var(--pm-green, #18c974);
    --pm-select-accent-soft: var(--pm-green-soft, rgba(24, 201, 116, .11));
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    font: inherit;
}

.pm-custom-select[hidden] {
    display: none !important;
}

.pm-custom-select__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    white-space: nowrap !important;
}

.pm-custom-select__trigger {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: var(--pm-select-height);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px 0 14px;
    border: 1px solid var(--pm-select-line);
    border-radius: var(--pm-radius-sm, 8px);
    outline: none;
    background: var(--pm-select-bg);
    color: var(--pm-select-text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease,
                background-color 150ms ease,
                box-shadow 150ms ease;
}

.pm-custom-select__trigger:hover {
    border-color: color-mix(in srgb, var(--pm-select-text) 16%, transparent);
    background: var(--pm-select-bg-open);
}

.pm-custom-select__trigger:focus-visible,
.pm-custom-select.is-open .pm-custom-select__trigger {
    border-color: var(--pm-select-line-active);
    background: var(--pm-select-bg-open);
    box-shadow: 0 0 0 3px var(--pm-select-accent-soft);
}

.pm-custom-select.is-invalid .pm-custom-select__trigger {
    border-color: rgba(228, 79, 85, .55);
    box-shadow: 0 0 0 3px rgba(228, 79, 85, .1);
}

.pm-custom-select.is-disabled .pm-custom-select__trigger {
    opacity: .55;
    cursor: not-allowed;
}

.pm-custom-select__value {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-custom-select.is-placeholder .pm-custom-select__value {
    color: var(--pm-select-muted);
}

.pm-custom-select__chevron {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: var(--pm-select-muted);
    transition: color 150ms ease, transform 190ms cubic-bezier(.2, .75, .2, 1);
}

.pm-custom-select__chevron::before,
.pm-custom-select__chevron::after {
    content: "";
    position: absolute;
    top: 8px;
    width: 7px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
}

.pm-custom-select__chevron::before {
    left: 2px;
    transform: rotate(42deg);
}

.pm-custom-select__chevron::after {
    right: 2px;
    transform: rotate(-42deg);
}

.pm-custom-select.is-open .pm-custom-select__chevron {
    color: var(--pm-select-accent);
    transform: rotate(180deg);
}

.pm-custom-select-menu {
    --pm-select-menu-bg: var(--pm-popover-bg, #fff);
    --pm-select-text: var(--pm-text, #171b1e);
    --pm-select-muted: var(--pm-text-muted, #818990);
    --pm-select-line: var(--pm-line, rgba(20, 27, 31, .1));
    --pm-select-accent: var(--pm-green, #18c974);
    --pm-select-accent-soft: var(--pm-green-soft, rgba(24, 201, 116, .11));
    position: fixed;
    z-index: 12000;
    min-width: 148px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--pm-select-line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--pm-select-menu-bg) 97%, transparent);
    box-shadow: var(--pm-shadow-popover, 0 16px 42px rgba(16, 24, 20, .13));
    color: var(--pm-select-text);
    scrollbar-width: thin;
    transform-origin: top center;
    animation: pmCustomSelectIn 170ms cubic-bezier(.16, 1, .3, 1) both;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.pm-custom-select-menu.is-above {
    transform-origin: bottom center;
}

.pm-custom-select-menu[hidden] {
    display: none !important;
}

.pm-custom-select-menu__group {
    display: block;
    padding: 8px 10px 5px;
    color: var(--pm-select-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pm-custom-select-menu__option {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    gap: 10px;
    padding: 8px 34px 8px 10px;
    border: 0;
    border-radius: 7px;
    outline: none;
    background: transparent;
    color: var(--pm-select-text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.pm-custom-select-menu__option:hover,
.pm-custom-select-menu__option.is-active {
    background: color-mix(in srgb, var(--pm-select-text) 6%, transparent);
}

.pm-custom-select-menu__option.is-selected {
    background: var(--pm-select-accent-soft);
    color: var(--pm-select-accent);
}

.pm-custom-select-menu__option.is-selected::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 8px;
    height: 4px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-65%) rotate(-45deg);
}

.pm-custom-select-menu__option:disabled {
    color: var(--pm-select-muted);
    opacity: .45;
    cursor: not-allowed;
}

.pm-custom-select-menu__label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-withdraw-field .pm-custom-select {
    --pm-select-height: 44px;
}

.ps-row--field .pm-custom-select {
    width: min(100%, 280px);
}

.ps-bio .pm-custom-select {
    --pm-select-height: 42px;
}

.pe-social__panel .pm-custom-select {
    --pm-select-height: 34px;
    max-width: 260px;
}

.pcp-body .pm-custom-select {
    --pm-select-height: 42px;
    --pm-select-bg: var(--pcp-surface-2, #14141a);
    --pm-select-bg-open: var(--pcp-surface-3, #191923);
    --pm-select-menu-bg: var(--pcp-surface-2, #14141a);
    --pm-select-text: var(--pcp-text, #f3f4fb);
    --pm-select-muted: var(--pcp-muted, #8b8f9d);
    --pm-select-line: var(--pcp-line, rgba(255, 255, 255, .075));
    --pm-select-line-active: rgba(107, 92, 255, .48);
    --pm-select-accent: var(--pcp-accent-2, #8b7bff);
    --pm-select-accent-soft: var(--pcp-accent-soft, rgba(107, 92, 255, .16));
}

.pcp-body .pm-custom-select-menu {
    --pm-select-menu-bg: var(--pcp-surface-2, #14141a);
    --pm-select-text: var(--pcp-text, #f3f4fb);
    --pm-select-muted: var(--pcp-muted, #8b8f9d);
    --pm-select-line: var(--pcp-line, rgba(255, 255, 255, .075));
    --pm-select-accent: var(--pcp-accent-2, #8b7bff);
    --pm-select-accent-soft: var(--pcp-accent-soft, rgba(107, 92, 255, .16));
    box-shadow: 0 18px 52px rgba(0, 0, 0, .42);
}

.pcp-compact-field .pm-custom-select {
    --pm-select-height: 34px;
}

.pcp-compact-field .pm-custom-select__trigger {
    padding-left: 10px;
    font-size: 12px;
}

@keyframes pmCustomSelectIn {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 700px) {
    .ps-row--field .pm-custom-select {
        width: 100%;
    }

    .pm-custom-select-menu {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        top: auto !important;
        width: auto !important;
        max-width: none;
        max-height: min(52vh, 380px) !important;
        padding: 8px;
        border-radius: 14px;
        transform-origin: bottom center;
        animation-name: pmCustomSelectMobileIn;
    }

    .pm-custom-select-menu__option {
        min-height: 44px;
        font-size: 14px;
    }
}

@keyframes pmCustomSelectMobileIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-custom-select-menu {
        animation: none;
    }

    .pm-custom-select__trigger,
    .pm-custom-select__chevron,
    .pm-custom-select-menu__option {
        transition: none;
    }
}
