.tui-toggle {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0.35rem 0;
	padding: 0.35rem 0.5rem;
	font-size: 0.9rem;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.15s ease;
	user-select: none;
}

.tui-toggle.inline {
	display: inline-flex;
	margin: 0 0.75rem 0 0;
}

.tui-toggle:hover:not(.disabled) {
	background: color-mix(in srgb, var(--toggle-color) 10%, transparent);
}

.tui-toggle:focus-visible {
	outline: 1px solid var(--toggle-color);
	outline-offset: 2px;
}

.tui-toggle.disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

:global(.toggle-icon) {
	color: var(--toggle-color);
}

.toggle-label {
	color: var(--terminal-text);
}

.toggle-track {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.5rem;
	background: color-mix(in srgb, var(--terminal-bg) 80%, black);
	border: 1px solid var(--terminal-muted);
	border-radius: 4px;
	font-size: 0.75rem;
	transition: all 0.15s ease;
}

.tui-toggle.checked .toggle-track {
	border-color: var(--toggle-color);
	background: color-mix(in srgb, var(--toggle-color) 15%, transparent);
}

.toggle-off-label,
.toggle-on-label {
	color: var(--terminal-muted);
	font-weight: bold;
	text-transform: uppercase;
	min-width: 2rem;
	text-align: center;
	transition: color 0.15s ease;
}

.tui-toggle:not(.checked) .toggle-off-label {
	color: var(--terminal-text);
}

.tui-toggle.checked .toggle-on-label {
	color: var(--toggle-color);
}

.toggle-switch {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	position: relative;
}

.toggle-knob {
	font-size: 1rem;
	color: var(--terminal-muted);
	transition: all 0.2s ease;
	transform: translateX(-0.5rem);
}

.tui-toggle.checked .toggle-knob {
	color: var(--toggle-color);
	transform: translateX(0.5rem);
}
