.slr {
	--slr-green: #00ff88;
	--slr-green-dim: #0b8a50;
	--slr-bg: #0a0a0a;
	--slr-line: #243024;
	--slr-text: #e8fff3;
	--slr-muted: #7d9a8a;

	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	width: 100%;
	max-width: none;
	margin: 1.75rem 0 1.25rem;
	padding: 0.7rem 1.25rem;
	background: linear-gradient(90deg, #0f1a14 0%, var(--slr-bg) 45%);
	border: 1px solid var(--slr-line);
	border-radius: 12px;
	box-shadow: 0 0 24px rgba(0, 255, 136, 0.05);
	color: var(--slr-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.3;
}
.slr *, .slr *::before, .slr *::after { box-sizing: border-box; }

/* Left: title, average, status message */
.slr__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 0 0 auto;
	min-width: 130px;
}
.slr__title {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--slr-green);
	white-space: nowrap;
}
.slr__avg { font-size: 0.78rem; color: var(--slr-muted); white-space: nowrap; }
.slr__avg-num { font-size: 1rem; font-weight: 700; color: var(--slr-text); }
.slr__count { margin-left: 0.1rem; }
.slr__msg { font-size: 0.72rem; color: var(--slr-muted); }
.slr__msg:empty { display: none; }
.slr__msg.is-ok { color: var(--slr-green); }
.slr__msg.is-error { color: #ff6b81; }

/* Middle: slider (stretches to fill the bar) */
.slr__slider {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	padding: 0 12px;
	cursor: pointer;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
.slr__rail { position: relative; height: 100%; }
.slr__track {
	position: absolute;
	left: 0; right: 0; top: 14px;
	height: 6px;
	margin-top: -3px;
	background: #1b221d;
	border-radius: 999px;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
	overflow: hidden;
}
.slr__fill {
	height: 100%;
	width: 44.44%;
	background: linear-gradient(90deg, var(--slr-green-dim), var(--slr-green));
	box-shadow: 0 0 12px rgba(0, 255, 136, 0.7);
	border-radius: inherit;
	transition: width 0.12s ease-out;
}
.slr.is-dragging .slr__fill, .slr.is-dragging .slr__thumb { transition: none; }
.slr--idle .slr__fill { filter: grayscale(0.8) brightness(0.6); box-shadow: none; }

.slr__thumb {
	position: absolute;
	top: 14px;
	left: 44.44%;
	width: 22px; height: 22px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #7dffc0, var(--slr-green) 55%, #00b35f);
	border: 3px solid var(--slr-bg);
	box-shadow: 0 0 0 2px var(--slr-green), 0 0 14px rgba(0, 255, 136, 0.8);
	cursor: grab;
	outline: none;
	transition: left 0.12s ease-out, box-shadow 0.2s ease, transform 0.15s ease;
}
.slr.is-dragging .slr__thumb { cursor: grabbing; transform: translate(-50%, -50%) scale(1.15); }
.slr__thumb:focus-visible { box-shadow: 0 0 0 2px var(--slr-green), 0 0 0 5px rgba(0, 255, 136, 0.3), 0 0 14px rgba(0, 255, 136, 0.8); }
.slr--idle .slr__thumb {
	background: radial-gradient(circle at 35% 30%, #9ab2a5, #5d7468);
	box-shadow: 0 0 0 2px #3b4a41;
}

/* Ticks */
.slr__ticks { position: absolute; left: 0; right: 0; top: 28px; height: 16px; }
.slr__tick {
	position: absolute;
	transform: translateX(-50%);
	font-size: 0.68rem;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--slr-muted);
	transition: color 0.15s ease, text-shadow 0.15s ease;
}
.slr__tick.is-on { color: var(--slr-green); }
.slr__tick.is-current { color: #fff; text-shadow: 0 0 8px var(--slr-green); font-weight: 700; }

/* Right: big number + submit */
.slr__side {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	flex: 0 0 auto;
}
.slr__readout {
	min-width: 2ch;
	font-size: 1.9rem;
	font-weight: 800;
	line-height: 1;
	text-align: center;
	color: var(--slr-green);
	text-shadow: 0 0 14px rgba(0, 255, 136, 0.55);
	font-variant-numeric: tabular-nums;
	transition: transform 0.12s ease;
}
.slr--idle .slr__readout { color: var(--slr-muted); text-shadow: none; opacity: 0.7; }
.slr.is-dragging .slr__readout { transform: scale(1.1); }

.slr__submit {
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--slr-green);
	background: var(--slr-green);
	color: #03140b;
	font: inherit;
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.5rem 1.2rem;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 0 16px rgba(0, 255, 136, 0.3);
	transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.slr__submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 24px rgba(0, 255, 136, 0.55); }
.slr__submit:active:not(:disabled) { transform: translateY(0); }
.slr__submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.slr__submit:disabled {
	background: transparent;
	color: var(--slr-muted);
	border-color: var(--slr-line);
	box-shadow: none;
	cursor: not-allowed;
}
.slr__submit.is-busy { opacity: 0.7; cursor: progress; }

/* Logged-out state */
.slr--locked .slr__slider { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.slr__login-btn { display: inline-block; text-decoration: none; white-space: nowrap; }
.slr__login-btn:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(0, 255, 136, 0.55); }
.slr__login { margin: 0; font-size: 0.85rem; color: var(--slr-muted); }
.slr__login a { color: var(--slr-green); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--slr-green-dim); }
.slr__login a:hover { border-bottom-color: var(--slr-green); }

/* Narrow screens: stack into rows */
@media (max-width: 640px) {
	.slr { flex-wrap: wrap; gap: 0.6rem 1rem; padding: 0.8rem 1rem; }
	.slr__info { flex: 1 1 auto; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 0.75rem; }
	.slr__slider { order: 3; flex: 1 0 100%; }
	.slr__side { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
	.slr *, .slr *::before, .slr *::after { transition: none !important; }
}
