/* Native, hand-drawn CRM checkboxes inspired by KanchanaSW's public checkbox preview. */
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch) {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: inline-block;
    flex: 0 0 20px;
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: 20px;
    min-height: 20px;
    max-height: 20px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    border: 1.7px solid currentColor;
    border-radius: 20% 13% 18% 12% / 13% 19% 12% 21%;
    background: var(--ac-paper, #fff);
    color: var(--ac-ink, #18181b);
    box-shadow: inset .5px -.5px 0 currentColor;
    transform: rotate(-1.5deg);
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m3 10 4.6 5.1L17.3 4.6' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m3 10 4.6 5.1L17.3 4.6' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: rotate(1.5deg);
    transition: clip-path 220ms ease, opacity 100ms ease;
    pointer-events: none;
}
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch):is(:checked, :indeterminate) {
    color: var(--ac-accent, #6750b2);
    background-color: color-mix(in srgb, var(--ac-accent, #6750b2) 9%, var(--ac-paper, #fff));
}
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch):is(:checked, :indeterminate)::before {
    opacity: 1;
    clip-path: inset(0);
}
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch):indeterminate::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 12-.4' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 12-.4' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
}
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch):focus-visible {
    outline: 2px solid var(--ac-focus, #7057ce);
    outline-offset: 4px;
}
body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch):disabled {
    color: var(--ac-muted, #62626b);
    opacity: .55;
    cursor: not-allowed;
}
body[data-crm-design="admincn"] .crm-task-done-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    min-height: 32px;
    padding: 2px 4px;
    margin: 0;
    color: var(--ac-ink);
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
}
body[data-crm-design="admincn"] .crm-task-done-control:has(input:disabled) { cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
    body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch),
    body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch)::before { transition: none; transform: none; }
}
@media (forced-colors: active) {
    body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch) {
        -webkit-appearance: auto;
        appearance: auto;
        border: initial;
        border-radius: 0;
        box-shadow: none;
        background: Canvas;
        color: ButtonText;
        transform: none;
        forced-color-adjust: auto;
    }
    body[data-crm-design="admincn"] input[type="checkbox"]:not([role="switch"]):not(.form-switch *):not(.form-switch)::before { display: none; }
}
