.switcher {
	--switcher-active-i: 0;
	--switcher-n: 0; /* кількість контролів */
	--switcher-h: 16px; /* висота одного контролу */
	--switcher-g: 4px; /* gap між контролами */
	display: flex;
	align-self: stretch;
	overflow: clip;
}
.switcher__track {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 12px;
}
.switcher__track:after {
	content: '';
	position: absolute;

	--switcher-offset: calc((100% - (var(--switcher-h) * var(--switcher-n) + var(--switcher-g) * (var(--switcher-n) - 1))) / 2);

	top: calc( var(--switcher-offset) + (var(--switcher-h) + var(--switcher-g)) * (var(--switcher-active-i) - 1) );
	bottom: calc( var(--switcher-offset) + (var(--switcher-h) + var(--switcher-g)) * (var(--switcher-n) - var(--switcher-active-i)) );

	left: 50%;
	transform: translateX(-50%);
	border-radius: 4px;
	width: 4px;
	background: var(--base-txt-primary);
	pointer-events: none;
}
.switcher--backward .switcher__track:after {
	transition: top 0.2s ease, bottom 0.2s ease 0.1s;
}
.switcher--forward .switcher__track:after {
	transition: top 0.2s ease 0.1s, bottom 0.2s ease;
}
.switcher__item {
	width: 100%;
	height: calc(var(--switcher-h) + var(--switcher-g));
	padding: calc(var(--switcher-g) / 2) 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	flex-grow: 0;
	flex-shrink: 0;
}
.switcher__item:first-child {
	flex-grow: 1;
	align-items: flex-end;
}
.switcher__item:last-child {
	flex-grow: 1;
	align-items: flex-start;
}
.switcher__item:after {
	content: '';
	display: block;
	width: 4px;
	height: var(--switcher-h);
	background: var(--base-txt-muted);
	border-radius: 4px;
	transition: background-color .2s ease;
}
/* .switcher__item--active:after {
	background: var(--base-txt-primary);
} */
.switcher__captionWrapper {
	position: relative;
	flex-shrink: 0;
	margin-left: -10px;
	width: 30px;
	box-sizing: border-box;
	border-radius: 0 16px 16px 0;
	background: var(--base-txt-muted);
	overflow: hidden;
	transition: background-color .2s ease;
}
.switcher__caption {
	--switcher-i: 1;
	position: absolute;
	left: 0;
	padding: 6px 0 6px 8px;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	color: var(--base-txt-alt-light);
	font: 10px/20px var(--font-mono);
	text-align: center;
	writing-mode: sideways-lr;
	text-orientation: sideways;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	text-transform: lowercase;

	transition: transform 0.2s linear;
	transform: translateY(calc((var(--switcher-i) - var(--switcher-active-i)) * 100% * -1));
}

.switcher--horizontal {
	display: block;
	.switcher__track {
		margin: 0 auto;
		width: fit-content;
		height: 12px;
		flex-direction: row;
	}
	.switcher__track:after {

		left: calc( var(--switcher-offset) + (var(--switcher-h) + var(--switcher-g)) * (var(--switcher-active-i) - 1) );
		right: calc( var(--switcher-offset) + (var(--switcher-h) + var(--switcher-g)) * (var(--switcher-n) - var(--switcher-active-i)) );

		top: 50%;
		bottom: unset;
		transform: translateY(-50%);
		width: unset;
		height: 4px;
	}
	&.switcher--backward .switcher__track:after {
		transition: left 0.2s ease, right 0.2s ease 0.1s;
	}
	&.switcher--forward .switcher__track:after {
		transition: left 0.2s ease 0.1s, right 0.2s ease;
	}
	.switcher__item {
		width: calc(var(--switcher-h) + var(--switcher-g));
		height: 4px;
		padding: 0 calc(var(--switcher-g) / 2);
	}
	.switcher__item:after {
		width: var(--switcher-h);
		height: 4px;
	}
}

@media (min-width: 481px) {

	.switcher__track:hover:has(.switcher__item--active:hover):after {
		background: var(--base-txt-max);
	}
	.switcher__item:hover:after {
		background: var(--base-txt-tertiary);
	}
	.switcher__captionWrapper:hover {
		background: var(--base-txt-tertiary);
	}
}