.multiselect-wrapper,
.uniselect-wrapper {
    --unit: 1rem;
    width: 100%;
    font-family: sans-serif;
    position: relative;
}

.multiselect-wrapper .select-box,
.uniselect-wrapper .select-box {
    border: solid 2px rgba(21, 43, 110, 0.3);
    padding: 0;
    background: #fff;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    position: relative;
}

.select-box:focus {
    outline: none;
}

.select-box.active {
    color: inherit;
}

.select-box.active .options-container {
    display: block;
}

.options-container .options-list {
    max-height: 200px;
    overflow-y: auto;
}

.options-container .options-list label {
    display: flex;
    align-items: center;
    gap: var(--unit);
    padding: 0 calc(1.2 * var(--unit));
    height: 36px;
    font-size: calc(1.5 * var(--unit));
    color: #666;
    cursor: pointer;
}

.options-container .options-list label strong {
    color: #333;
    font-weight: var(--font-weight-bold);
}

.options-container .options-list label:not(:last-child) {
    border-bottom: 1px solid #ccc;
}

.options-container .options-list label:hover {
    background-color: #f5f9fc;
}

.options-container .options-list label:has(input:checked) {
    background-color: #e4e9ed;
    font-weight: var(--font-weight-bold);
}

.options-container .options-list label input[type=checkbox],
.options-container .options-list label input[type=radio] {
    appearance: none;
    box-sizing: border-box;
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    min-width: 20px;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    border-radius: calc(.3 * var(--unit));
    background: transparent url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMTQwcHgiIGhlaWdodD0iMTQwcHgiIHZpZXdCb3g9IjAgMCAxNDAgMTQwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPlNoYXBlPC90aXRsZT4gICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlBhZ2UtMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+ICAgICAgICA8ZyBpZD0ib2stc2xpbSIgZmlsbD0iIzU4NTg1OCI+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlNoYXBlIiBwb2ludHM9IjExMy41MzE1MjEgMjMgNTYuNDQ0NDAyMSA3OS45MDU1ODE2IDI2Ljk5NDIwMjggNTAuNTYwOTIzNSA4IDY5LjUzOTgzNjcgNTYuNDQ0NDAyMSAxMTcuODYzMDU2IDEzMi40OTE0NjkgNDEuOTc4NTYxMiI+PC9wb2x5Z29uPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+) no-repeat center / 75% 75%;
    opacity: .125;
}

.options-container .options-list label input[type=checkbox]:checked,
.options-container .options-list label input[type=radio]:checked {
    opacity: .875;
}

.options-container input[type=text].search-box {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 12px;
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    outline: none;
    height: unset;
    font-weight: normal;
}

.search-box:focus {
    outline: none;
    border-bottom-color: #007bff;
}

.options-container input[type=text].search-box::placeholder {
    color: #999;
    font-weight: normal;
    font-size: .8em;
}

.uniselect-wrapper .select-box button.selection,
.multiselect-wrapper .select-box button.selection {
    cursor: pointer;
    display: flex;
    width: 100%;
    inset: 0;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0 calc(1.2 * var(--unit));
    height: calc(4 * var(--unit));
    background-color: unset;
    font-weight: normal;
    font-family: var(--font-body);
    color: #333;
}

.uniselect-wrapper .select-box button.selection::after,
.multiselect-wrapper .select-box button.selection::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1.5rem;
    width: 8px;
    height: 8px;
    padding: 3px;
    margin-top: -2px;
    border: solid #888;
    border-width: 0 1px 1px 0;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
}

.select-box:has([popover]:popover-open) button.selection::after {
    transform: translateY(-50%) rotate(-135deg);
    margin-top: 0;
}

.select-box:has([popover]:popover-open) {
    border-radius: 8px 8px 8px 0;
}

.multiselect-wrapper .select-box .selection .tag {
    display: flex;
    align-items: center;
    gap: var(--unit);
    padding: 0 0 0 var(--unit);
    height: calc(3 * var(--unit));
    background: #fff;
    border: solid 1px #636877;
    border-radius: calc(0.5 * var(--unit));
    font-size: calc(1.3 * var(--unit));
    overflow: hidden;
}

.uniselect-wrapper .select-box .selection .tag {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: calc(1.5 * var(--unit));
}

.tag span.remove {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(2.8 * var(--unit));
    height: 100%;
    padding: 0;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-left: 1px solid #ccc;
    border-radius: 0;
    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 18px;
    color: #333;
    cursor: pointer;
}

.collapsible-multi .collapsible-block {
    display: none;
}

.collapsible-multi .switch-inputs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: .5rem;
}

.collapsible-multi .switch-inputs label {
    display: flex;
    flex-grow: 1;
    align-items: center;
    height: 48px;
    padding: 0 14px;
    border: solid 1px rgba(21, 43, 110, 0.3);
    border-radius: 24px;
    cursor: pointer;
}

.collapsible-multi .switch-inputs label input {
    width: 20px;
    min-width: 20px;
    height: 20px;
    border: solid 1px rgb(40 45 104);
}

.collapsible-multi .switch-inputs label input:checked {
    background: rgb(40 45 104);
}

.collapsible-multi .switch-inputs label:has(input[type=radio]:checked) {
    border-color: rgb(40 45 104);
    background-color: rgb(220 217 254);
}

.collapsible-multi:has(input[type=radio][value=yes]:checked) .collapsible-block {
    display: block;
}

@media (max-width: 600px) {
    .multiselect-wrapper {
        max-width: 100%;
    }

    dialog>div {
        width: 100%;
    }
}