.bfba {
    --bfba-border-width: var(--section-border, 2px);
    --bfba-radius: var(--card-radius, 24px);
    --bfba-gap: var(--site-grid-gap, 1rem);
    --bfba-button-border: var(--button-border-color, #111);
    --bfba-button-bg: var(--button-bg-color, #fff);
    --bfba-button-text: var(--button-text-color, #111);
    --bfba-button-hover-bg: var(--button-hover-bg-color, #111);
    --bfba-button-hover-text: var(--button-hover-text-color, #fff);
    --bfba-font-nav: var(--font-family-navigation, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    --bfba-font-body: var(--font-family-body, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    --bfba-position: 50%;
    display: block;
    margin: 0 0 var(--bfba-gap);
    font-family: var(--bfba-font-body);
}

.bfba-stage,
.bfba-side-grid {
    border: var(--bfba-border-width) solid var(--bfba-button-border);
    border-radius: var(--bfba-radius);
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.bfba-stage {
    position: relative;
    aspect-ratio: var(--bfba-aspect-ratio, 16 / 9);
    width: 100%;
    touch-action: none;
    user-select: none;
}

.bfba-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bfba-layer--before {
    z-index: 1;
}

.bfba-layer--after {
    z-index: 2;
    clip-path: inset(0 0 0 var(--bfba-position));
}

.bfba--hover .bfba-layer--after {
    clip-path: none;
    opacity: 0;
    transition: opacity 220ms ease-in-out;
}

.bfba--hover .bfba-stage:hover .bfba-layer--after,
.bfba--hover .bfba-stage:focus .bfba-layer--after,
.bfba--hover .bfba-stage:focus-within .bfba-layer--after {
    opacity: 1;
}

.bfba-media {
    width: 100%;
    height: 100%;
    display: block;
    max-width: none;
}

.bfba--fit-cover .bfba-media {
    object-fit: cover;
}

.bfba--fit-contain .bfba-media {
    object-fit: contain;
    background: #000;
}

.bfba-label,
.bfba-hover-hint {
    position: absolute;
    z-index: 4;
    left: 1rem;
    top: 1rem;
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border: var(--bfba-border-width) solid var(--bfba-button-border);
    border-radius: 999px;
    background: var(--bfba-button-bg);
    color: var(--bfba-button-text);
    font-family: var(--bfba-font-nav);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bfba-label--after {
    left: auto;
    right: 1rem;
}

.bfba--hover .bfba-layer--before .bfba-label,
.bfba--hover .bfba-layer--after .bfba-label {
    left: 50%;
    right: auto;
    top: 1rem;
    transform: translateX(-50%);
    transition: opacity 220ms ease-in-out;
}

.bfba--hover .bfba-stage:hover .bfba-layer--before .bfba-label,
.bfba--hover .bfba-stage:focus .bfba-layer--before .bfba-label,
.bfba--hover .bfba-stage:focus-within .bfba-layer--before .bfba-label {
    opacity: 0;
}

.bfba-hover-hint {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 180ms ease;
}

.bfba--hover .bfba-stage:hover .bfba-hover-hint,
.bfba--hover .bfba-stage:focus .bfba-hover-hint,
.bfba--hover .bfba-stage:focus-within .bfba-hover-hint {
    opacity: 0;
}

.bfba-handle {
    position: absolute;
    z-index: 6;
    inset-block: 0;
    left: var(--bfba-position);
    width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bfba-button-text);
    cursor: ew-resize;
    transform: translateX(-50%);
}

.bfba-handle:focus-visible .bfba-handle-knob {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.bfba-handle-line {
    position: absolute;
    inset-block: 0;
    left: 50%;
    width: var(--bfba-border-width);
    min-width: 2px;
    background: var(--bfba-button-border);
    transform: translateX(-50%);
}

.bfba-handle-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3.1rem;
    height: 3.1rem;
    display: grid;
    place-items: center;
    border: var(--bfba-border-width) solid var(--bfba-button-border);
    border-radius: 999px;
    background: var(--bfba-button-bg);
    color: var(--bfba-button-text);
    font-family: var(--bfba-font-nav);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.bfba-handle:hover .bfba-handle-knob {
    background: var(--bfba-button-hover-bg);
    color: var(--bfba-button-hover-text);
}

.bfba-side-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.bfba-side-panel {
    position: relative;
    aspect-ratio: var(--bfba-aspect-ratio, 16 / 9);
    min-width: 0;
    overflow: hidden;
}

.bfba-side-panel + .bfba-side-panel {
    border-left: var(--bfba-border-width) solid var(--bfba-button-border);
}

.bfba-notice {
    border: 2px solid #b32d2e;
    border-radius: 14px;
    padding: 1rem;
    background: #fff;
    color: #1d2327;
}

@media (max-width: 700px) {
    .bfba-side-grid {
        grid-template-columns: 1fr;
    }

    .bfba-side-panel + .bfba-side-panel {
        border-left: 0;
        border-top: var(--bfba-border-width) solid var(--bfba-button-border);
    }

    .bfba-label,
    .bfba-hover-hint {
        font-size: 0.72rem;
        min-height: 1.75rem;
        padding: 0.3rem 0.6rem;
    }

    .bfba-handle-knob {
        width: 2.7rem;
        height: 2.7rem;
    }
}

.bfba-iframe-shell {
    position: absolute;
    inset: 0 auto auto 0;
    width: var(--bfba-iframe-width, 1500px);
    height: 100%;
    transform-origin: top left;
    background: #fff;
}

.bfba-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}
