.app-select-shell {
    position: relative;
    display: inline-block;
    min-width: 92px;
    max-width: 100%;
    flex: 0 0 auto;
    vertical-align: middle;
}

.app-select-native {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    min-inline-size: 0 !important;
    min-block-size: 0 !important;
    margin: -1px !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;
}

.app-select-trigger {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 34px 8px 12px;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #f7f7f8;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
        #171719;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.app-select-trigger::after {
    content: '';
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-inline-end: 1.7px solid rgba(255, 255, 255, 0.72);
    border-block-end: 1.7px solid rgba(255, 255, 255, 0.72);
    transform: translateY(-68%) rotate(45deg);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.app-select-trigger:hover,
.app-select-trigger[aria-expanded='true'] {
    border-color: rgba(255, 52, 61, 0.66);
    background:
        linear-gradient(145deg, rgba(255, 52, 61, 0.12), rgba(255, 255, 255, 0.02)),
        #19191c;
}

.app-select-trigger[aria-expanded='true']::after {
    border-color: #ff5961;
    transform: translateY(-28%) rotate(225deg);
}

.app-select-trigger:focus-visible {
    outline: none;
    border-color: #ff343d;
    box-shadow: 0 0 0 3px rgba(255, 52, 61, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-select-trigger:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.app-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-select-menu {
    position: fixed;
    z-index: 2147483000;
    display: grid;
    gap: 3px;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 13px;
    color: #f7f7f8;
    background:
        radial-gradient(circle at 88% 0%, rgba(255, 52, 61, 0.14), transparent 38%),
        rgba(18, 18, 21, 0.985);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px) scale(0.985);
    transform-origin: top center;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 52, 61, 0.52) transparent;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.app-select-menu.opens-above {
    transform: translateY(5px) scale(0.985);
    transform-origin: bottom center;
}

.app-select-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.app-select-menu::-webkit-scrollbar {
    width: 5px;
}

.app-select-menu::-webkit-scrollbar-track {
    margin: 7px 0;
    background: transparent;
}

.app-select-menu::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 52, 61, 0.5);
}

.app-select-option {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.84);
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.25;
    text-align: start;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.app-select-option:hover,
.app-select-option:focus-visible {
    outline: none;
    color: #fff;
    background: rgba(255, 52, 61, 0.16);
    box-shadow: inset 2px 0 0 rgba(255, 52, 61, 0.85);
}

.app-select-option.is-selected {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 52, 61, 0.9), rgba(190, 19, 35, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.app-select-option:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.app-select-shell--settings {
    min-width: 96px;
}

.setting-item > .app-select-shell--settings {
    margin-inline-start: auto;
}

.app-select-shell--mobile {
    width: min(46vw, 176px);
    max-width: 176px;
}

.app-select-shell--mobile .app-select-trigger {
    min-height: 44px;
    padding-block: 10px;
    border-radius: 15px;
    font-size: 0.88rem;
}

#settings-view .settings-language-row .app-select-shell--mobile,
#settings-view .settings-privacy-row .app-select-shell--mobile {
    width: 100%;
    max-width: none;
}

.app-select-shell--wide {
    display: block;
    width: 100%;
}

.app-select-shell--wide .app-select-trigger {
    min-height: 44px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
}

.app-select-shell--legal {
    min-width: 180px;
}

.app-select-shell--legal .app-select-trigger {
    min-height: 40px;
    border-radius: 12px;
    background: #121212;
}

.app-select-shell--auth {
    min-width: 150px;
}

[dir='rtl'] .app-select-option,
[dir='rtl'] .app-select-trigger {
    text-align: right;
}

@media (max-width: 380px) {
    .app-select-shell--mobile {
        width: min(43vw, 154px);
    }

    #settings-view .settings-language-row .app-select-shell--mobile {
        width: 100%;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-select-trigger,
    .app-select-trigger::after,
    .app-select-menu,
    .app-select-option {
        transition: none;
    }
}
