.ls-reading {
	position: relative;
	z-index: 999998;
}

.ls-reading__toggle {
	position: fixed;
	right: 18px;
	bottom: 18px;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #13284a;
	color: #fff;
	font: 700 16px/1 system-ui, sans-serif;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .2);
	cursor: pointer;
}

.ls-reading__toggle:focus-visible,
.ls-reading__dialog button:focus-visible,
.ls-reading__options input:focus-visible {
	outline: 3px solid #1478ff;
	outline-offset: 3px;
}

.ls-reading__dialog {
	position: fixed;
	box-sizing: border-box;
	inset: auto 18px 78px auto;
	width: min(360px, calc(100vw - 36px));
	max-height: calc(100dvh - 104px);
	margin: 0;
	padding: 20px;
	overflow: auto;
	border: 1px solid #d6dce6;
	border-radius: 18px;
	background: #fff;
	color: #172033;
	font: 16px/1.4 system-ui, sans-serif;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .25);
}

.ls-reading__dialog:not([open]) {
	display: none;
}

.ls-reading__dialog::backdrop {
	background: transparent;
}

.ls-reading__dialog h2 {
	margin: 0 42px 18px 0;
	font-family: system-ui, sans-serif !important;
	font-size: 24px !important;
	font-weight: 750 !important;
	line-height: 1.15 !important;
	letter-spacing: -.02em !important;
	text-transform: none !important;
}

.ls-reading__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #172033;
	font: 400 30px/1 system-ui, sans-serif;
	cursor: pointer;
}

.ls-reading__label {
	display: block;
	margin-bottom: 8px;
	font-weight: 700;
}

.ls-reading__stepper {
	display: grid;
	grid-template-columns: 54px 1fr 54px;
	min-height: 50px;
	overflow: hidden;
	border: 1px solid #d6dce6;
	border-radius: 12px;
	background: #f8fafc;
}

.ls-reading__stepper button {
	min-width: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #13284a;
	font: 500 28px/1 system-ui, sans-serif;
	cursor: pointer;
}

.ls-reading__stepper button:first-child {
	border-right: 1px solid #d6dce6;
}

.ls-reading__stepper button:last-child {
	border-left: 1px solid #d6dce6;
}

.ls-reading__stepper output {
	display: grid;
	place-items: center;
	font-size: 19px;
	font-weight: 750;
}

.ls-reading__options {
	display: grid;
	gap: 8px;
	margin: 14px 0;
}

.ls-reading__options label {
	display: grid;
	grid-template-columns: 26px 1fr;
	align-items: center;
	gap: 12px;
	min-height: 50px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid #d6dce6;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
}

.ls-reading__options label:has(input:checked) {
	border-color: #1478ff;
	box-shadow: 0 0 0 1px #1478ff;
}

.ls-reading__options input {
	width: 26px;
	height: 26px;
	margin: 0;
	accent-color: #1478ff;
	cursor: pointer;
}

.ls-reading__options span {
	font-weight: 650;
}

.ls-reading__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.ls-reading__actions button {
	min-height: 46px;
	padding: 10px 14px;
	border: 2px solid #13284a;
	border-radius: 10px;
	font-weight: 750;
	cursor: pointer;
}

.ls-reading__reset {
	background: #fff;
	color: #13284a;
}

.ls-reading__done {
	background: #13284a;
	color: #fff;
}

html {
	font-size: calc(100% * var(--ls-reading-scale, 1));
}

html.ls-reading-spacing body,
html.ls-reading-spacing p,
html.ls-reading-spacing li {
	line-height: 1.8 !important;
}

html.ls-reading-spacing p,
html.ls-reading-spacing li {
	letter-spacing: .02em;
}

html.ls-reading-font body,
html.ls-reading-font button,
html.ls-reading-font input,
html.ls-reading-font textarea {
	font-family: Arial, Verdana, sans-serif !important;
}

html.ls-reading-contrast {
	filter: contrast(1.25);
}

html.ls-reading-links a {
	text-decoration: underline !important;
	text-decoration-thickness: 3px !important;
	text-underline-offset: 3px !important;
}

html.ls-reading-motion *,
html.ls-reading-motion *::before,
html.ls-reading-motion *::after {
	scroll-behavior: auto !important;
	animation-duration: .001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: .001ms !important;
}

@media (max-width: 640px) {
	.ls-reading__dialog {
		inset: 0 0 0 auto;
		width: min(88vw, 420px);
		height: 100dvh;
		max-height: none;
		padding: 24px 20px;
		border-width: 0 0 0 1px;
		border-radius: 20px 0 0 20px;
	}

	.ls-reading__dialog::backdrop {
		background: rgba(5, 16, 35, .58);
	}

	.ls-reading__dialog h2 {
		margin-top: 8px;
		margin-bottom: 24px;
		font-size: 24px !important;
	}

	.ls-reading__stepper {
		min-height: 58px;
	}

	.ls-reading__options {
		gap: 10px;
		margin: 18px 0;
	}

	.ls-reading__options label {
		min-height: 60px;
		padding: 11px 14px;
	}

	.ls-reading__actions {
		grid-template-columns: 1fr;
	}

	.ls-reading__actions button {
		min-height: 52px;
	}
}
