.vaba {
	--vaba-pos: 50%;
	--vaba-ratio: 16 / 9;
	--vaba-height: auto;
	--vaba-radius: 0;
	--vaba-handle: #4b3fe0;
	--vaba-line: #ffffff;
	--vaba-line-width: 2px;
	--vaba-button-size: 52px;
	--vaba-label-bg: rgba(0, 0, 0, .55);
	--vaba-label-color: #fff;

	position: relative;
	width: 100%;
	aspect-ratio: var(--vaba-ratio);
	border-radius: var(--vaba-radius);
	overflow: hidden;
	isolation: isolate;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
	cursor: col-resize;
}
.vaba--vertical { cursor: row-resize; touch-action: pan-x; }
.vaba.is-dragging { cursor: grabbing; }

/* Feste Höhe statt Seitenverhältnis */
.vaba--fixed-height {
	aspect-ratio: auto;
	height: var(--vaba-height);
}
@media (max-width: 1024px) {
	.vaba--fixed-height { height: var(--vaba-height-tablet, var(--vaba-height)); }
}
@media (max-width: 767px) {
	.vaba--fixed-height { height: var(--vaba-height-mobile, var(--vaba-height-tablet, var(--vaba-height))); }
}

.vaba__after,
.vaba__before {
	position: absolute;
	inset: 0;
}
.vaba img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	max-width: none;
	border-radius: 0;
}

.vaba--horizontal .vaba__before { clip-path: inset(0 calc(100% - var(--vaba-pos)) 0 0); }
.vaba--vertical   .vaba__before { clip-path: inset(0 0 calc(100% - var(--vaba-pos)) 0); }

/* Trennlinie + Griff */
.vaba__handle {
	position: absolute;
	z-index: 2;
	outline: none;
}
.vaba--horizontal .vaba__handle {
	top: 0; bottom: 0;
	left: var(--vaba-pos);
	width: var(--vaba-line-width);
	background: var(--vaba-line);
	transform: translateX(-50%);
}
.vaba--vertical .vaba__handle {
	left: 0; right: 0;
	top: var(--vaba-pos);
	height: var(--vaba-line-width);
	background: var(--vaba-line);
	transform: translateY(-50%);
}
.vaba__button {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: var(--vaba-button-size);
	height: var(--vaba-button-size);
	border-radius: 50%;
	background: var(--vaba-handle);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
	border: 2px solid #fff;
	transition: transform .15s ease;
}
.vaba--vertical .vaba__button svg { transform: rotate(90deg); }
.vaba__handle:focus-visible .vaba__button {
	box-shadow: 0 0 0 4px rgba(75, 63, 224, .35), 0 2px 10px rgba(0, 0, 0, .3);
}
.vaba.is-dragging .vaba__button { transform: translate(-50%, -50%) scale(1.08); }

/* Labels */
.vaba__label {
	position: absolute;
	top: 16px;
	padding: 6px 12px;
	font: 600 13px/1 system-ui, sans-serif;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--vaba-label-color);
	background: var(--vaba-label-bg);
	border-radius: 4px;
	pointer-events: none;
	transition: opacity .2s ease;
	z-index: 3;
}
.vaba__label--before { left: 16px; }
.vaba__label--after  { right: 16px; }
.vaba--vertical .vaba__label--after { top: auto; bottom: 16px; left: 16px; right: auto; }

.vaba--labels-hide .vaba__label { display: none; }
.vaba--labels-hover .vaba__label { opacity: 0; }
.vaba--labels-hover:hover .vaba__label,
.vaba--labels-hover.is-dragging .vaba__label { opacity: 1; }

.vaba--at-min .vaba__label--before,
.vaba--at-max .vaba__label--after { opacity: 0; }

.vaba-error { color: #b00; background: #fee; padding: 8px 12px; border: 1px solid #fbb; }
