.ui-checkbox {
    --ui-checkbox-size: 17px;
    --ui-checkbox-gap: 10px;
    --ui-checkbox-radius: 5px;
    --ui-checkbox-border: rgba(92, 127, 186, 0.2);
    --ui-checkbox-bg: linear-gradient(180deg, rgba(11, 20, 36, 0.9) 0%, rgba(8, 15, 27, 0.96) 100%);
    --ui-checkbox-hover-border: rgba(120, 165, 234, 0.32);
    --ui-checkbox-hover-bg: linear-gradient(180deg, rgba(12, 23, 40, 0.92) 0%, rgba(10, 19, 34, 0.98) 100%);
    --ui-checkbox-checked-border: rgba(122, 184, 255, 0.82);
    --ui-checkbox-checked-bg: linear-gradient(180deg, rgba(12, 23, 40, 0.94) 0%, rgba(9, 17, 30, 0.98) 100%);
    --ui-checkbox-check-color: #8bc7ff;
    --ui-checkbox-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    --ui-checkbox-checked-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(126, 190, 255, 0.08);
    --ui-checkbox-focus-border: rgba(121, 184, 255, 0.4);
    --ui-checkbox-focus-ring: rgba(96, 165, 250, 0.1);
    --ui-checkbox-label-checked-color: #f4f8ff;

    position: relative;
    display: inline-grid;
    grid-template-columns: var(--ui-checkbox-size) auto;
    align-items: center;
    column-gap: var(--ui-checkbox-gap);
    min-height: var(--ui-checkbox-size);
    cursor: pointer;
    user-select: none;
}

.ui-checkbox--box-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ui-checkbox-size);
    column-gap: 0;
}

.ui-checkbox input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.ui-checkbox-box {
    position: relative;
    display: block;
    width: var(--ui-checkbox-size);
    height: var(--ui-checkbox-size);
    border-radius: var(--ui-checkbox-radius);
    border: 1px solid var(--ui-checkbox-border);
    background: var(--ui-checkbox-bg);
    box-shadow: var(--ui-checkbox-shadow);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ui-checkbox-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--ui-checkbox-check-color);
    opacity: 0;
    transition: opacity 0.16s ease;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.3l2.6 2.7 6.1-6.1' fill='none' stroke='white' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 10px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.3l2.6 2.7 6.1-6.1' fill='none' stroke='white' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 10px no-repeat;
}

.ui-checkbox:hover .ui-checkbox-box {
    border-color: var(--ui-checkbox-hover-border);
    background: var(--ui-checkbox-hover-bg);
}

.ui-checkbox input[type="checkbox"]:checked + .ui-checkbox-box {
    border-color: var(--ui-checkbox-checked-border);
    background: var(--ui-checkbox-checked-bg);
    box-shadow: var(--ui-checkbox-checked-shadow);
}

.ui-checkbox input[type="checkbox"]:checked + .ui-checkbox-box::after {
    opacity: 1;
}

.ui-checkbox input[type="checkbox"]:focus-visible + .ui-checkbox-box {
    border-color: var(--ui-checkbox-focus-border);
    box-shadow: 0 0 0 3px var(--ui-checkbox-focus-ring);
}

.ui-checkbox-label {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
}

.ui-checkbox:has(input:checked) .ui-checkbox-label {
    color: var(--ui-checkbox-label-checked-color);
}
/* ui-filter-checkbox:start */
.ui-filter-checkbox {
    --ui-checkbox-size: 16px;
    --ui-checkbox-gap: 9px;
    --ui-checkbox-radius: 4px;
    --ui-checkbox-border: rgba(77, 97, 136, 0.26);
    --ui-checkbox-bg: #0b1423;
    --ui-checkbox-hover-border: rgba(118, 149, 205, 0.34);
    --ui-checkbox-hover-bg: #0c1526;
    --ui-checkbox-checked-border: #6b82f4;
    --ui-checkbox-checked-bg: linear-gradient(180deg, #6f86ff 0%, #5c76ef 100%);
    --ui-checkbox-check-color: #ffffff;
    --ui-checkbox-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
    --ui-checkbox-hover-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 0 1px rgba(55, 89, 148, 0.08);
    --ui-checkbox-checked-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(88, 110, 221, 0.18);
    --ui-checkbox-focus-border: rgba(121, 184, 255, 0.44);
    --ui-checkbox-focus-ring: rgba(74, 114, 210, 0.1);
    --ui-checkbox-label-checked-color: #ffffff;

    position: relative;
    display: grid;
    grid-template-columns: var(--ui-checkbox-size) minmax(0, 1fr);
    width: 100%;
    color: #edf2ff;
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.ui-filter-checkbox:hover,
.ui-filter-checkbox:has(input:focus-visible) {
    background: rgba(97, 121, 174, 0.14);
    color: #ffffff;
}

.ui-filter-checkbox:has(input:checked) {
    background: transparent;
    box-shadow: none;
}

.ui-filter-checkbox .ui-checkbox-box {
    flex: 0 0 var(--ui-checkbox-size);
    width: var(--ui-checkbox-size);
    height: var(--ui-checkbox-size);
    box-sizing: border-box;
}

.ui-filter-checkbox:not(.ui-checkbox--radio) .ui-checkbox-box::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 5px;
    height: 9px;
    box-sizing: border-box;
    opacity: 0;
    background: transparent;
    border-right: 2px solid var(--ui-checkbox-check-color);
    border-bottom: 2px solid var(--ui-checkbox-check-color);
    -webkit-mask: none;
    mask: none;
    transform: translate(-50%, -60%) rotate(45deg) scale(0.9);
    transform-origin: center;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.ui-filter-checkbox input[type="checkbox"]:checked + .ui-checkbox-box::after {
    opacity: 1;
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.ui-filter-checkbox .ui-checkbox-label {
    min-height: 0;
    color: inherit;
}

.ui-filter-checkbox.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.ui-filter-checkbox.is-disabled:hover,
.ui-filter-checkbox.is-disabled:focus-within {
    background: transparent;
    color: #edf2ff;
    box-shadow: none;
}

.ui-filter-checkbox input:disabled + .ui-checkbox-box {
    opacity: 0.58;
}
/* ui-filter-check-option:start */
.ui-filter-check-option {
    --ui-filter-check-size: var(--ui-checkbox-size, 16px);
    --ui-filter-check-left: 8px;
    --ui-filter-check-radius: var(--ui-checkbox-radius, 4px);
    --ui-filter-check-border: var(--ui-checkbox-border, rgba(77, 97, 136, 0.26));
    --ui-filter-check-bg: var(--ui-checkbox-bg, #0b1423);
    --ui-filter-check-hover-border: var(--ui-checkbox-hover-border, rgba(118, 149, 205, 0.34));
    --ui-filter-check-hover-bg: var(--ui-checkbox-hover-bg, #0c1526);
    --ui-filter-check-checked-border: var(--ui-checkbox-checked-border, #6b82f4);
    --ui-filter-check-checked-bg: var(--ui-checkbox-checked-bg, linear-gradient(180deg, #6f86ff 0%, #5c76ef 100%));
    --ui-filter-check-shadow: var(--ui-checkbox-shadow, inset 0 0 0 1px rgba(255, 255, 255, 0.015));
    --ui-filter-check-hover-shadow: var(--ui-checkbox-hover-shadow, inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 0 1px rgba(55, 89, 148, 0.08));
    --ui-filter-check-checked-shadow: var(--ui-checkbox-checked-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(88, 110, 221, 0.18));

    position: relative;
}

.ui-filter-check-option::before {
    content: "";
    position: absolute;
    left: var(--ui-filter-check-left);
    top: 50%;
    width: var(--ui-filter-check-size);
    height: var(--ui-filter-check-size);
    border-radius: var(--ui-filter-check-radius);
    border: 1px solid var(--ui-filter-check-border);
    background: var(--ui-filter-check-bg);
    box-sizing: border-box;
    box-shadow: var(--ui-filter-check-shadow);
    transform: translateY(-50%);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ui-filter-check-option::after {
    content: "";
    position: absolute;
    left: var(--ui-filter-check-left);
    top: 50%;
    width: var(--ui-filter-check-size);
    height: var(--ui-filter-check-size);
    opacity: 0;
    background: center / 8px 6px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1.2 4.1 3.8 6.5 8.8 1.5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    transform: translateY(-50%) scale(0.9);
    transform-origin: center;
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.ui-filter-check-option:hover::before,
.ui-filter-check-option:focus-visible::before {
    border-color: var(--ui-filter-check-hover-border);
    background: var(--ui-filter-check-hover-bg);
    box-shadow: var(--ui-filter-check-hover-shadow);
}

.ui-filter-check-option.is-active::before,
.ui-filter-check-option[aria-pressed="true"]::before,
.ui-filter-check-option[aria-selected="true"]::before {
    border-color: var(--ui-filter-check-checked-border);
    background: var(--ui-filter-check-checked-bg);
    box-shadow: var(--ui-filter-check-checked-shadow);
}

.ui-filter-check-option.is-active::after,
.ui-filter-check-option[aria-pressed="true"]::after,
.ui-filter-check-option[aria-selected="true"]::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}
/* ui-filter-check-option:end */

/* Single-choice filters keep the checkbox component's sizing and focus model,
 * but expose a native radio control with a radio indicator. */
.ui-checkbox--radio input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.ui-checkbox--radio .ui-checkbox-box {
    border-radius: 50%;
}

.ui-checkbox--radio input[type="radio"]:checked + .ui-checkbox-box {
    border-color: var(--ui-checkbox-checked-border);
    background: var(--ui-checkbox-checked-bg);
    box-shadow: var(--ui-checkbox-checked-shadow);
}

.ui-checkbox--radio input[type="radio"]:focus-visible + .ui-checkbox-box {
    border-color: var(--ui-checkbox-focus-border);
    box-shadow: 0 0 0 3px var(--ui-checkbox-focus-ring);
}

.ui-checkbox--radio .ui-checkbox-box::after {
    inset: 50% auto auto 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ui-checkbox-check-color);
    -webkit-mask: none;
    mask: none;
    transform: translate(-50%, -50%) scale(0.7);
    transform-origin: center;
}

.ui-checkbox--radio input[type="radio"]:checked + .ui-checkbox-box::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Keep native single-choice semantics while using the shared checkbox visual. */
.ui-filter-checkbox.ui-checkbox--radio-checkmark .ui-checkbox-box {
    border-radius: var(--ui-checkbox-radius);
}

.ui-filter-checkbox.ui-checkbox--radio-checkmark .ui-checkbox-box::after {
    inset: 50% auto auto 50%;
    width: 5px;
    height: 9px;
    box-sizing: border-box;
    opacity: 0;
    background: transparent;
    border-right: 2px solid var(--ui-checkbox-check-color);
    border-bottom: 2px solid var(--ui-checkbox-check-color);
    -webkit-mask: none;
    mask: none;
    transform: translate(-50%, -60%) rotate(45deg) scale(0.9);
    transform-origin: center;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.ui-filter-checkbox.ui-checkbox--radio-checkmark input[type="radio"]:checked + .ui-checkbox-box::after {
    opacity: 1;
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
}
/* ui-filter-checkbox:end */
