
.kk-ba {
    position: relative;
    display: block;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee;
    margin: 24px auto;
    border-radius: 8px;
    user-select: none;
    touch-action: pan-y;
    isolation: isolate;
}

.kk-ba-after,
.kk-ba-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.kk-ba-after {
    z-index: 1;
}

.kk-ba-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.kk-ba img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    pointer-events: none !important;
}

.kk-ba-divider {
    position: absolute;
    z-index: 4;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: #fff;
    box-shadow: 0 0 5px rgba(0,0,0,.65);
    transform: translateX(-50%);
    pointer-events: none;
}

.kk-ba-handle {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(30,30,30,.68);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 1px 8px rgba(0,0,0,.3);
    pointer-events: none;
}

.kk-ba-label {
    position: absolute;
    z-index: 6;
    top: 14px;
    padding: 6px 11px;
    border-radius: 4px;
    color: #fff;
    background: rgba(0,0,0,.58);
    font: 600 12px/1.2 Arial,sans-serif;
    letter-spacing: .5px;
    pointer-events: none;
}

.kk-ba-label-before { left: 14px; }
.kk-ba-label-after { right: 14px; }

.kk-ba-range {
    position: absolute;
    z-index: 8;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    opacity: 0;
    cursor: ew-resize;
    touch-action: pan-y;
}

.kk-ba:focus-within {
    outline: 2px solid #b89562;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .kk-ba { border-radius: 5px; }
    .kk-ba-label {
        top: 9px;
        padding: 5px 8px;
        font-size: 10px;
    }
    .kk-ba-label-before { left: 9px; }
    .kk-ba-label-after { right: 9px; }
    .kk-ba-handle {
        width: 38px;
        height: 38px;
        font-size: 19px;
    }
}
