.gfm-ba-gallery {
    --gfm-ba-accent: #974FC2;
    --gfm-ba-accent-dark: #733699;
    --gfm-ba-card: #050505;
    --gfm-ba-text: #ffffff;
    --gfm-ba-muted: rgba(255, 255, 255, 0.72);
    --gfm-ba-position: 50%;
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
}

.gfm-ba-gallery * {
    box-sizing: border-box;
}

.gfm-ba-shell {
    position: relative;
    width: 100%;
    min-height: 360px;
    height: var(--gfm-ba-height, 720px);
    max-height: 82vh;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
    isolation: isolate;
}

.gfm-ba-viewport,
.gfm-ba-track,
.gfm-ba-slide,
.gfm-ba-compare {
    width: 100%;
    height: 100%;
}

.gfm-ba-viewport {
    position: relative;
    overflow: hidden;
}

.gfm-ba-track {
    display: flex;
    transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.gfm-ba-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 100%;
}

.gfm-ba-compare {
    position: relative;
    overflow: hidden;
    cursor: ew-resize;
    touch-action: pan-y;
    user-select: none;
}

.gfm-ba-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

.gfm-ba-after-img {
    z-index: 1;
}

.gfm-ba-before-wrap {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--gfm-ba-position, 50%);
    overflow: hidden;
    z-index: 2;
    transform: translateZ(0);
}

.gfm-ba-before-img {
    width: 100vw;
    max-width: none;
}

.gfm-ba-label {
    position: absolute;
    top: 22px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(5, 5, 5, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.gfm-ba-label.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
}

.gfm-ba-label-before {
    left: 22px;
}

.gfm-ba-label-after {
    right: 22px;
}

.gfm-ba-handle {
    position: absolute;
    top: 0;
    left: var(--gfm-ba-position, 50%);
    z-index: 5;
    width: 58px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateX(-50%);
    cursor: ew-resize;
}

.gfm-ba-handle-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
}

.gfm-ba-handle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #050505;
    color: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    border: 3px solid rgba(255, 255, 255, 0.95);
}

.gfm-ba-handle-arrow {
    display: block;
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
    margin-top: -2px;
}

.gfm-ba-card {
    position: absolute;
    left: 28px;
    bottom: 28px;
    z-index: 8;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    width: min(430px, calc(100% - 56px));
    min-height: 150px;
    padding: 26px;
    border-radius: 8px;
    background: rgba(5, 5, 5, 0.88);
    color: var(--gfm-ba-text);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

.gfm-ba-card::before {
    content: "";
    position: absolute;
    left: 26px;
    bottom: 20px;
    width: 118px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gfm-ba-accent), var(--gfm-ba-accent-dark));
}

.gfm-ba-card-content {
    min-width: 0;
    padding-bottom: 22px;
}

.gfm-ba-count {
    display: block;
    margin-bottom: 10px;
    color: var(--gfm-ba-muted);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.gfm-ba-title {
    margin: 0;
    color: #fff;
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.gfm-ba-controls {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding-bottom: 12px;
}

.gfm-ba-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #050505;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.gfm-ba-nav:hover,
.gfm-ba-nav:focus-visible {
    background: var(--gfm-ba-accent);
    color: #fff;
    transform: translateY(-2px);
    outline: none;
}

.gfm-ba-empty {
    padding: 18px 20px;
    border: 1px dashed #b8b8b8;
    border-radius: 12px;
    background: #fafafa;
    color: #333;
}

@media (max-width: 980px) {
    .gfm-ba-shell {
        height: min(var(--gfm-ba-height, 620px), 72vh);
        border-radius: 8px;
    }

    .gfm-ba-card {
        left: 18px;
        bottom: 18px;
        width: calc(100% - 36px);
        min-height: 132px;
        padding: 22px;
    }
}

@media (max-width: 640px) {
    .gfm-ba-shell {
        height: 520px;
        min-height: 420px;
        border-radius: 8px;
    }

    .gfm-ba-label {
        top: 14px;
        min-width: 72px;
        padding: 8px 11px;
        font-size: 11px;
    }

    .gfm-ba-label-before {
        left: 14px;
    }

    .gfm-ba-label-after {
        right: 14px;
    }

    .gfm-ba-handle-button {
        width: 50px;
        height: 50px;
    }

    .gfm-ba-card {
        align-items: center;
        min-height: 122px;
        padding: 20px;
        border-radius: 8px;
    }

    .gfm-ba-title {
        font-size: 18px;
    }

    .gfm-ba-nav {
        width: 38px;
        height: 38px;
        font-size: 27px;
    }
}
