.root {
	font-family: var(--font-family);
	box-sizing: border-box;
	display: block;
	font: var(--font-size-base);
	line-height: var(--line-height-base);
}

.inputWrapper {
	margin: var(--spacing-regular) 0;
	position: relative;
}

.track {
	background-color: var(--color-border-strong);
	height: var(--border-width);
	position: relative;
	transition: background var(--transition-duration) var(--transition-easing);
	width: 100%;
}

.fill {
	display: none;
}

.thumb {
	background-color: var(--color-background);
	border: var(--border-width) solid var(--color-border-strong);
	border-radius: 50%;
	height: calc(var(--grid-base) * 2);
	left: 50%;
	margin-left: calc(var(--grid-base) * -1);
	position: absolute;
	top: calc(var(--grid-base) * -1);
	transition: border var(--transition-duration) var(--transition-easing),
		background var(--transition-duration) var(--transition-easing);
	width: calc(var(--grid-base) * 2);
}

.root .input {
	height: 15px;
	outline: none;
	top: -7px;
}
.input::-ms-thumb {
	height: var(--touch-target-min);
	width: var(--touch-target-min);
}
.input::-moz-range-thumb {
	height: var(--touch-target-min);
	width: var(--touch-target-min);
}
.input::-webkit-slider-thumb {
	height: var(--touch-target-min);
	width: var(--touch-target-min);
}

/* focused styles */
.input:focus ~ .track {
	background-color: var(--color-highlight);
}

.input:focus ~ .track .thumb {
	border: var(--border-width-emphasized) solid var(--color-highlight);
	box-shadow: var(--box-shadow-dimensions-small) var(--color-box-shadow-highlight);
}

.input:focus ~ .outputTooltip,
.root:hover .outputTooltip {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.output {
	background-color: var(--color-background-inverted);
	color: var(--color-text-inverted);
	display: inline-block;
	margin: var(--spacing-regular) 0 0;
	padding: var(--spacing-regular);
}

.outputTooltip {
	margin: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	top: calc(var(--grid-base) * 2.5);
	transform: translate(-50%, 0);
	transition: opacity var(--transition-duration) var(--transition-easing);
}

.outputTooltip::before {
	border-left: var(--grid-base) solid transparent;
	border-right: var(--grid-base) solid transparent;
	border-bottom: var(--grid-base) solid var(--color-background-inverted);
	content: '';
	left: 50%;
	margin-left: calc(var(--grid-base) * -1);
	margin-top: calc(var(--grid-base) * -1);
	position: absolute;
	top: 0;
}

.vertical .outputTooltip {
	left: calc(var(--grid-base) * 2.5);
	top: auto;
	transform: translate(0, -50%);
}

.vertical .outputTooltip::before {
	border-bottom: var(--grid-base) solid transparent;
	border-left: 0;
	border-right: var(--grid-base) solid var(--color-background-inverted);
	border-top: var(--grid-base) solid transparent;
	left: 0;
	top: 50%;
}

/* vertical slider */
.vertical .input,
.vertical .track {
	transform-origin: 0 0;
	transform: rotate(-90deg) translate(-100%, 0);
}

/* disabled and readonly styles */
.disabled .track,
.readonly .track {
	background-color: var(--color-border);
}

.disabled .thumb,
.readonly .thumb {
	background-color: var(--color-background-faded);
}

/* invalid style */
.invalid .track {
	background-color: var(--color-error);
}
.invalid .thumb {
	border-color: var(--color-error);
}

/* valid style */
.valid .track {
	background-color: var(--color-success);
}
.valid .thumb {
	border-color: var(--color-success);
}
