/* ys-select: see public/assets/js/custom-select.js. Pages restyle the trigger
   per context; these are the defaults for a plain form field. */
.ys-select {
    position: relative;
    width: 100%;
}

.ys-select[hidden] {
    display: none;
}

/* !important: page rules like `.form select { width: 100% }` outrank a class. */
.ys-select__native {
    position: absolute !important;
    bottom: 0;
    right: 0;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip-path: inset(50%) !important;
    overflow: hidden;
}

.ys-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0 .75rem;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: .92rem;
    line-height: 1.5;
    color: #222;
    text-align: right;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.ys-select__trigger:focus {
    outline: none;
}

.ys-select__trigger:focus-visible,
.ys-select.is-open .ys-select__trigger {
    border-color: #2ab88d;
    box-shadow: 0 0 0 3px rgba(42, 184, 141, .18);
}

.ys-select__trigger:disabled {
    cursor: default;
    background: #f4f5f6;
    color: #6b6b6b;
}

.ys-select__value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ys-select__chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: #157f60;
    transition: transform .18s ease-out;
}

.ys-select__trigger:disabled .ys-select__chevron {
    color: #9a9a9a;
}

.ys-select.is-open .ys-select__chevron {
    transform: rotate(180deg);
}

.ys-select__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #e6e6e8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ys-select--up .ys-select__panel {
    top: auto;
    bottom: calc(100% + 4px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
}

.ys-select__panel[hidden] {
    display: none;
}

.ys-select__option {
    padding: .6rem .75rem;
    border-radius: 6px;
    font-size: .95rem;
    line-height: 1.5;
    color: #333;
    text-align: right;
    cursor: pointer;
}

.ys-select__option:hover,
.ys-select__option.is-active {
    background: #f1f7f4;
}

.ys-select__option.is-selected {
    color: #157f60;
    font-weight: 700;
}

.ys-select__option[aria-disabled="true"] {
    color: #9a9a9a;
    background: none;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .ys-select__trigger,
    .ys-select__chevron {
        transition: none;
    }
}
