.custom-select {
    position: relative;
    width: 100%;
    min-width: 0;
    color: var(--text, var(--admin-text, #171717));
    font: inherit;
}

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

.custom-select__button {
    display: grid;
    width: 100%;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) 22px;
    gap: 12px;
    align-items: center;
    padding: 9px 14px;
    border: 1px solid var(--border, var(--line, var(--admin-line, #d9d9d9)));
    border-radius: 6px;
    background: var(--surface, var(--admin-panel, #ffffff));
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
}

.custom-select__button:hover {
    border-color: color-mix(in srgb, var(--accent, var(--brand, #fcbd01)) 70%, var(--border, var(--line, #d9d9d9)));
}

.custom-select__button:focus-visible {
    outline: 2px solid var(--accent, var(--brand, #fcbd01));
    outline-offset: 2px;
}

.custom-select.is-disabled .custom-select__button {
    cursor: not-allowed;
    opacity: 0.55;
}

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

.custom-select__chevron {
    position: relative;
    width: 22px;
    height: 22px;
    justify-self: end;
}

.custom-select__chevron::before {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: rotate(45deg);
    transition: transform 180ms ease, top 180ms ease;
}

.custom-select.is-open .custom-select__chevron::before {
    top: 9px;
    transform: rotate(225deg);
}

.custom-select__menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-width: none;
    max-height: 280px;
    margin: 0;
    padding: 5px;
    overflow: auto;
    border: 1px solid var(--border, var(--line, var(--admin-line, #d9d9d9)));
    border-radius: 6px;
    background: var(--surface, var(--admin-panel, #ffffff));
    box-shadow: 0 16px 40px rgb(0 0 0 / 24%);
    list-style: none;
}

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

.custom-select__option {
    display: flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    color: inherit;
    cursor: pointer;
}

.custom-select__option:hover,
.custom-select__option.is-active {
    background: color-mix(in srgb, var(--accent, var(--brand, #fcbd01)) 16%, var(--surface, var(--admin-panel, #ffffff)));
}

.custom-select__option.is-selected {
    background: var(--accent, var(--brand, #fcbd01));
    color: #111111;
    font-weight: 800;
}

.custom-select__option.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.custom-select--code-language {
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 10px;
    width: min(210px, calc(100% - 20px));
    color: #e8e6df;
}

.custom-select--editor-language {
    position: relative;
    z-index: 12;
    width: 190px;
    color: #e8e6df;
}

.custom-select--editor-language .custom-select__button {
    min-height: 34px;
    padding: 5px 9px;
    border-color: #4b4943;
    background: #292824;
    color: #e8e6df;
    font: 700 12px/1.2 Consolas, "Courier New", monospace;
}

.custom-select--editor-language .custom-select__menu {
    right: 0;
    left: auto;
    width: 100%;
    background: #292824;
    color: #e8e6df;
}

.custom-select--editor-language .custom-select__option {
    min-height: 34px;
    font: 13px/1.25 Consolas, "Courier New", monospace;
}

.custom-select:has(> select[hidden]) {
    display: none;
}

.custom-select--code-language .custom-select__button {
    min-height: 34px;
    padding: 5px 9px;
    border-color: #4b4943;
    background: #292824;
    color: #e8e6df;
    font: 700 12px/1.2 Consolas, "Courier New", monospace;
}

.custom-select--code-language .custom-select__menu {
    right: 0;
    left: auto;
    width: 100%;
    background: #292824;
    color: #e8e6df;
}

.custom-select--code-language .custom-select__option {
    min-height: 34px;
    font: 13px/1.25 Consolas, "Courier New", monospace;
}

[dir="rtl"] .custom-select--code-language {
    right: auto;
    left: 10px;
}

.panel-title__actions--filters .custom-select:has(.admin-filter--select) {
    flex: 0 0 170px;
    width: 170px;
}

.panel-title__actions--filters .custom-select__button {
    min-height: 46px;
    padding-inline: 16px 13px;
}

.panel-title__actions--filters .custom-select__value {
    text-align: center;
}

@media (max-width: 560px) {
    .custom-select__menu {
        width: 100%;
        max-width: none;
    }
}
