.bas-wrap {
	position: relative;
	max-width: 100%;
	margin: 1.5em auto;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
}

.bas-stage {
	position: relative;
	width: 100%;
	overflow: hidden;
	line-height: 0;
	background: #000;
}

.bas-img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
	-webkit-user-drag: none;
}

.bas-after-wrap {
	position: absolute;
	inset: 0;
	overflow: hidden;
	will-change: clip-path;
}

.bas-after-wrap .bas-after {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top left;
}

/* Horizontal: clip "after" from the left */
.bas-horizontal .bas-after-wrap {
	clip-path: inset(0 0 0 var(--bas-pos, 50%));
}

/* Vertical: clip "after" from the top */
.bas-vertical .bas-after-wrap {
	clip-path: inset(var(--bas-pos, 50%) 0 0 0);
}

/* Divider line */
.bas-divider {
	position: absolute;
	background: #fff;
	box-shadow: 0 0 4px rgba(0,0,0,0.5);
	pointer-events: none;
}

.bas-horizontal .bas-divider {
	top: 0;
	bottom: 0;
	width: 2px;
	left: var(--bas-pos, 50%);
	transform: translateX(-1px);
}

.bas-vertical .bas-divider {
	left: 0;
	right: 0;
	height: 2px;
	top: var(--bas-pos, 50%);
	transform: translateY(-1px);
}

/* Handle */
.bas-handle {
	position: absolute;
	width: 40px;
	height: 40px;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.35);
	cursor: grab;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	z-index: 2;
}

.bas-handle:active {
	cursor: grabbing;
}

.bas-handle:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

.bas-horizontal .bas-handle {
	top: 50%;
	left: var(--bas-pos, 50%);
	transform: translate(-50%, -50%);
}

.bas-vertical .bas-handle {
	left: 50%;
	top: var(--bas-pos, 50%);
	transform: translate(-50%, -50%);
}

.bas-handle-arrow {
	width: 0;
	height: 0;
	border-style: solid;
}

.bas-horizontal .bas-handle-arrow-1 {
	border-width: 6px 8px 6px 0;
	border-color: transparent #333 transparent transparent;
}
.bas-horizontal .bas-handle-arrow-2 {
	border-width: 6px 0 6px 8px;
	border-color: transparent transparent transparent #333;
}

.bas-vertical .bas-handle {
	flex-direction: column;
}
.bas-vertical .bas-handle-arrow-1 {
	border-width: 0 6px 8px 6px;
	border-color: transparent transparent #333 transparent;
}
.bas-vertical .bas-handle-arrow-2 {
	border-width: 8px 6px 0 6px;
	border-color: #333 transparent transparent transparent;
}

/* Labels */
.bas-label {
	position: absolute;
	padding: 4px 10px;
	background: rgba(0,0,0,0.6);
	color: #fff;
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	border-radius: 3px;
	pointer-events: none;
	z-index: 1;
}

.bas-horizontal .bas-label-before { top: 12px; left: 12px; }
.bas-horizontal .bas-label-after  { top: 12px; right: 12px; }
.bas-vertical   .bas-label-before { top: 12px; left: 12px; }
.bas-vertical   .bas-label-after  { bottom: 12px; left: 12px; }
