/* assets/css/features/reader.css */
body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-paper: #f9fafc;
	--wtapp-reader-surface: rgba(255, 255, 255, 0.78);
	--wtapp-reader-ink: #18233e;
	--wtapp-reader-muted: #60708f;
	--wtapp-reader-line: rgba(104, 127, 176, 0.18);
	--wtapp-reader-shadow: 0 16px 36px rgba(29, 42, 74, 0.08);
	--wtapp-reader-accent: #3666f4;
	--wtapp-reader-link: #3666f4;
	--wtapp-reader-control-surface: rgba(255, 255, 255, 0.72);
	--wtapp-reader-control-surface-strong: rgba(255, 255, 255, 0.9);
	--wtapp-reader-control-text: #18233e;
	--wtapp-reader-page-start: rgba(233, 239, 255, 0.88);
	--wtapp-reader-page-end: rgba(249, 246, 252, 0.94);
	--wtapp-reader-max-width: 78ch;
	--wtapp-reader-rail-space: 96px;
	background:
		linear-gradient(180deg, rgba(233, 239, 255, 0.88) 0%, rgba(249, 246, 252, 0.94) 100%);
}

body.wtapp-shell-body.wtapp-reader-theme-dark,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit {
	--wtapp-reader-paper: #121927;
	--wtapp-reader-surface: rgba(18, 25, 39, 0.9);
	--wtapp-reader-ink: #f4f7ff;
	--wtapp-reader-muted: rgba(218, 227, 245, 0.76);
	--wtapp-reader-line: rgba(184, 198, 230, 0.12);
	--wtapp-reader-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
	--wtapp-reader-link: #8fb2ff;
	--wtapp-reader-control-surface: rgba(148, 163, 184, 0.14);
	--wtapp-reader-control-surface-strong: rgba(30, 41, 59, 0.92);
	--wtapp-reader-control-text: #f4f7ff;
	--wtapp-reader-page-start: rgba(9, 16, 31, 0.96);
	--wtapp-reader-page-end: rgba(16, 25, 43, 0.98);
}

body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-prose,
body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-prose :not(a),
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose :not(a),
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-prose,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-prose :not(a) {
	color: var(--wtapp-reader-ink) !important;
}

body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-prose a,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose a,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-prose a {
	color: var(--wtapp-reader-link) !important;
}

body.wtapp-shell-body.wtapp-reader-theme-sepia,
html[data-wtapp-reader-theme="sepia"] body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-paper: #f4ecd9;
	--wtapp-reader-surface: rgba(250, 243, 227, 0.88);
	--wtapp-reader-ink: #342719;
	--wtapp-reader-muted: #74604e;
	--wtapp-reader-line: rgba(108, 85, 53, 0.14);
	--wtapp-reader-shadow: 0 18px 34px rgba(76, 56, 32, 0.1);
	--wtapp-reader-page-start: rgba(241, 232, 211, 0.94);
	--wtapp-reader-page-end: rgba(248, 241, 225, 0.98);
}

body.wtapp-shell-body.wtapp-reader-link-brand,
html[data-wtapp-reader-link-color="brand"] body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-link: #3666f4;
}

body.wtapp-shell-body.wtapp-reader-link-forest,
html[data-wtapp-reader-link-color="forest"] body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-link: #1f8a59;
}

body.wtapp-shell-body.wtapp-reader-link-amber,
html[data-wtapp-reader-link-color="amber"] body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-link: #b97800;
}

body.wtapp-shell-body.wtapp-reader-width-narrow,
html[data-wtapp-reader-width="narrow"] body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-max-width: 100%;
}

body.wtapp-shell-body.wtapp-reader-width-wide,
html[data-wtapp-reader-width="wide"] body.wtapp-shell-body.wtapp-reader-mode {
	--wtapp-reader-max-width: 90ch;
}

body.wtapp-shell-body.wtapp-reader-font-small .wtapp-reader-prose,
html[data-wtapp-reader-font="small"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-size: 1rem;
}

body.wtapp-shell-body.wtapp-reader-font-medium .wtapp-reader-prose,
html[data-wtapp-reader-font="medium"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-size: 1.08rem;
}

body.wtapp-shell-body.wtapp-reader-font-large .wtapp-reader-prose,
html[data-wtapp-reader-font="large"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-size: 1.18rem;
}

body.wtapp-shell-body.wtapp-reader-font-x-large .wtapp-reader-prose,
html[data-wtapp-reader-font="x-large"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-size: 1.3rem;
}

body.wtapp-shell-body.wtapp-reader-leading-compact .wtapp-reader-prose,
html[data-wtapp-reader-leading="compact"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	line-height: 1.6;
}

body.wtapp-shell-body.wtapp-reader-leading-relaxed .wtapp-reader-prose,
html[data-wtapp-reader-leading="relaxed"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	line-height: 1.82;
}

body.wtapp-shell-body.wtapp-reader-leading-airy .wtapp-reader-prose,
html[data-wtapp-reader-leading="airy"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	line-height: 2.02;
}

body.wtapp-shell-body.wtapp-reader-style-display .wtapp-reader-prose,
html[data-wtapp-reader-font-style="display"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-family: var(--wtapp-font-display);
}

body.wtapp-shell-body.wtapp-reader-style-serif .wtapp-reader-prose,
html[data-wtapp-reader-font-style="serif"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-family: Georgia, "Times New Roman", serif;
}

body.wtapp-shell-body.wtapp-reader-style-sans .wtapp-reader-prose,
html[data-wtapp-reader-font-style="sans"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-prose {
	font-family: var(--wtapp-font-ui);
}

body.wtapp-shell-body.wtapp-reader-mode .wtapp-topbar,
body.wtapp-shell-body.wtapp-reader-mode #wtapp-footer,
body.wtapp-shell-body.wtapp-reader-mode .wtapp-mobile-tabs,
body.wtapp-shell-body.wtapp-reader-mode .wtapp-mobile-topbar {
	display: none;
}

body.wtapp-shell-body.wtapp-reader-mode .wtapp-site-content {
	padding-top: calc(10px + var(--wtapp-safe-top));
	background: linear-gradient(180deg, var(--wtapp-reader-page-start) 0%, var(--wtapp-reader-page-end) 100%);
	color: var(--wtapp-reader-ink);
	transition: background-color 180ms ease, color 180ms ease;
}

body.wtapp-shell-body.wtapp-reader-mode .wtapp-main-shell,
body.wtapp-shell-body.wtapp-reader-mode .wtapp-screen--reader {
	color: var(--wtapp-reader-ink);
}

body.wtapp-shell-body.wtapp-reader-mode .wtapp-layout {
	width: min(calc(100% - 20px), 1180px);
}

body.wtapp-shell-body.wtapp-reader-mode .wtapp-screen--reader {
	gap: 12px;
	padding-bottom: calc(var(--wtapp-reader-rail-space) + var(--wtapp-safe-bottom));
}

.wtapp-reader {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: calc(100vh - 18px - var(--wtapp-safe-top));
}

.wtapp-reader .wtapp-button,
.wtapp-reader-comments .wtapp-button {
	min-height: 30px;
	padding: 5px 8px;
	font-size: 0.8rem;
}

.wtapp-reader-topbar,
.wtapp-reader-resume,
.wtapp-reader-article,
.wtapp-reader-lock,
.wtapp-reader-novel-resume,
.wtapp-reader-comments .wtapp-surface--discussion {
	background: var(--wtapp-reader-surface);
	color: var(--wtapp-reader-ink);
	border: 1px solid var(--wtapp-reader-line);
	box-shadow: var(--wtapp-reader-shadow);
	backdrop-filter: blur(14px);
}

.wtapp-reader-topbar {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: start;
	padding: 12px 14px;
	border-radius: 18px;
	position: sticky;
	top: calc(6px + var(--wtapp-safe-top));
	z-index: 20;
	margin-bottom: 0;
	transition: transform 220ms ease, opacity 220ms ease, margin-bottom 220ms ease;
	will-change: transform, opacity;
}

.wtapp-reader-topbar__bar,
.wtapp-reader-topbar__identity {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wtapp-reader-topbar__bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	width: 100%;
}

.wtapp-reader-topbar__links,
.wtapp-reader-topbar__actions,
.wtapp-reader-lock__actions,
.wtapp-sheet__actions,
.wtapp-reader-end-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wtapp-reader-topbar__links {
	justify-content: flex-start;
}

.wtapp-reader-topbar__actions {
	justify-content: flex-end;
}

.wtapp-reader-topbar__chapter {
	min-width: 0;
	padding: 0 6px;
	color: var(--wtapp-reader-muted);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wtapp-reader-topbar__link {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 5px 8px;
	border: 1px solid var(--wtapp-reader-line);
	border-radius: 999px;
	background: var(--wtapp-reader-control-surface);
	color: var(--wtapp-reader-control-text);
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: none;
}

.wtapp-reader-topbar__link--back::before {
	content: "←";
	margin-right: 6px;
}

.wtapp-reader-topbar__eyebrow,
.wtapp-reader-lock__eyebrow,
.wtapp-reader-end-card__eyebrow {
	margin: 0;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-topbar__title,
.wtapp-reader-lock__title,
.wtapp-reader-end-card__title {
	margin: 0;
	font-family: var(--wtapp-font-display);
	font-size: 1.5rem;
	line-height: 1.12;
	color: var(--wtapp-reader-ink);
}

.wtapp-reader-topbar__identity {
	display: none;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-show-title .wtapp-reader-topbar__identity,
html[data-wtapp-reader-show-title="1"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-topbar__identity {
	display: flex;
}

.wtapp-reader-topbar__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	color: var(--wtapp-reader-muted);
	font-size: 0.82rem;
}

.wtapp-reader-topbar__wallet,
.wtapp-reader-topbar__views {
	font-weight: 700;
	color: var(--wtapp-reader-link);
}

.wtapp-reader-toggle,
.wtapp-reader-rail__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 5px 8px;
	border: 1px solid var(--wtapp-reader-line);
	border-radius: 999px;
	background: var(--wtapp-reader-control-surface);
	color: var(--wtapp-reader-control-text);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.wtapp-reader-resume,
.wtapp-reader-novel-resume,
.wtapp-reader-end-card {
	padding: 10px 12px;
	border-radius: 16px;
}

.wtapp-reader-resume {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.wtapp-reader-resume__text,
.wtapp-reader-lock__message,
.wtapp-reader-lock__panel-copy {
	margin: 0;
	color: var(--wtapp-reader-muted);
	font-size: 0.9rem;
}

.wtapp-reader-layout {
	display: flex;
	justify-content: center;
}

.wtapp-reader-article {
	width: min(100%, var(--wtapp-reader-max-width));
	padding: 18px 18px 22px;
	border-radius: 18px;
	background: var(--wtapp-reader-paper);
}

.wtapp-reader-prose {
	color: var(--wtapp-reader-ink);
	text-wrap: pretty;
}

.wtapp-reader-prose > *:first-child {
	margin-top: 0;
}

.wtapp-reader-prose > *:last-child {
	margin-bottom: 0;
}

.wtapp-reader-prose a {
	color: var(--wtapp-reader-link);
}

.wtapp-reader-lock {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px;
	border-radius: 18px;
	outline: none;
}

.wtapp-reader-lock__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.wtapp-reader-lock__price-chip {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(54, 102, 244, 0.12);
	color: var(--wtapp-reader-link);
	font-size: 0.8rem;
	font-weight: 700;
}

.wtapp-reader-lock__meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 8px;
}

.wtapp-reader-lock__stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 10px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.56);
	border: 1px solid var(--wtapp-reader-line);
}

.wtapp-reader-lock__stat-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-lock__stat-value {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--wtapp-reader-ink);
}

.wtapp-reader-lock__commerce {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wtapp-reader-lock__panel {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.44);
	border: 1px solid var(--wtapp-reader-line);
}

.wtapp-reader-lock__purchase .wtapp-buy-this-content-button,
.wtapp-reader-lock__purchase button,
.wtapp-reader-lock__purchase input[type="submit"] {
	min-height: 30px;
	padding: 5px 8px;
	font-size: 0.8rem;
}

.wtapp-reader-lock__buy-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wtapp-reader-lock__buy-form .myCRED-buy-form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.wtapp-reader-lock__buy-form input[type="number"],
.wtapp-reader-settings-form select {
	min-height: 34px;
	padding: 6px 10px;
	border-radius: 12px;
	border: 1px solid var(--wtapp-reader-line);
	background: var(--wtapp-reader-control-surface-strong);
	color: var(--wtapp-reader-control-text);
	font-size: 0.84rem;
}

.wtapp-reader-settings-sheet__header {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wtapp-reader-settings-sheet__header .wtapp-card-title {
	margin: 0;
	font-size: clamp(1.2rem, 1.7vw, 1.45rem);
	line-height: 1.08;
}

.wtapp-modal__panel--reader-settings {
	width: min(560px, 100%);
	max-height: min(82vh, 760px);
	padding: 22px 20px 20px;
	border-radius: 24px;
	background:
		radial-gradient(circle at top right, rgba(54, 102, 244, 0.12), transparent 30%),
		var(--wtapp-reader-paper);
	border-color: var(--wtapp-reader-line);
}

.wtapp-modal__panel--reader-settings .wtapp-modal__body {
	gap: 12px;
}

.wtapp-modal__panel--reader-settings .wtapp-modal__close {
	padding: 8px 12px;
	background: var(--wtapp-reader-control-surface);
	color: var(--wtapp-reader-control-text);
}

.wtapp-modal--reader-chapters {
	align-items: center;
	justify-content: center;
	padding: 28px;
}

.wtapp-modal__panel--reader-chapters {
	display: flex;
	flex-direction: column;
	width: min(560px, 100%);
	max-height: min(84vh, 780px);
	padding: 18px 18px 18px;
	border-radius: 28px;
	background:
		radial-gradient(circle at top right, rgba(54, 102, 244, 0.12), transparent 30%),
		var(--wtapp-reader-paper);
	border-color: var(--wtapp-reader-line);
	color: var(--wtapp-reader-ink);
	overflow: hidden;
}

.wtapp-modal__panel--reader-chapters .wtapp-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	gap: 0;
	overflow: hidden;
}

.wtapp-modal__panel--reader-chapters .wtapp-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	background: var(--wtapp-reader-control-surface-strong);
	color: var(--wtapp-reader-control-text);
	border: 1px solid var(--wtapp-reader-line);
	box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
	font-size: 0;
}

.wtapp-sheet--reader-chapters {
	flex: 1 1 auto;
	min-height: 0;
	gap: 0;
}

.wtapp-reader-chapter-picker__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 42px 12px 0;
	border-bottom: 1px solid var(--wtapp-reader-line);
}

.wtapp-reader-chapter-picker__title-wrap {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wtapp-reader-chapter-picker__title-wrap .wtapp-card-summary {
	margin: 0;
}

.wtapp-reader-chapter-picker__title-wrap .wtapp-card-summary {
	font-size: 0.96rem;
	font-weight: 600;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-chapter-picker__sort {
	flex: 0 0 auto;
	min-height: 38px;
	padding-inline: 14px;
}

.wtapp-reader-chapter-picker__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-height: 0;
	padding: 10px 4px 0 0;
	overflow-y: auto;
}

.wtapp-reader-chapter-picker__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 2px;
	border: 0;
	border-bottom: 1px solid rgba(104, 127, 176, 0.12);
	background: transparent;
	color: var(--wtapp-reader-control-text);
	text-align: left;
	text-decoration: none;
	box-shadow: none;
	transition: color 180ms ease, opacity 180ms ease, background-color 180ms ease;
}

.wtapp-reader-chapter-picker__item:hover,
.wtapp-reader-chapter-picker__item:focus-visible {
	color: var(--wtapp-reader-link);
	background: rgba(54, 102, 244, 0.04);
}

.wtapp-reader-chapter-picker__item.is-current {
	color: var(--wtapp-reader-link);
	background: rgba(54, 102, 244, 0.06);
}

.wtapp-reader-chapter-picker__empty {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-chapter-picker__item-title {
	min-width: 0;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--wtapp-reader-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wtapp-reader-chapter-picker__item.is-current .wtapp-reader-chapter-picker__item-title {
	font-weight: 700;
}

.wtapp-reader-chapter-picker__item.is-locked {
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-chapter-picker__item.is-locked .wtapp-reader-chapter-picker__item-title {
	color: inherit;
}

.wtapp-reader-chapter-picker__lock {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	color: currentColor;
}

.wtapp-reader-chapter-picker__empty {
	margin: 0;
	padding: 28px 12px;
	text-align: center;
}

.wtapp-sheet--reader-settings {
	gap: 12px;
}

.wtapp-reader-settings-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 12px;
}

.wtapp-reader-settings-form .wtapp-field {
	gap: 5px;
}

.wtapp-reader-settings-form .wtapp-field > span {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-settings-form__field--inline,
.wtapp-reader-settings-form__actions {
	grid-column: 1 / -1;
}

.wtapp-reader-settings-form__actions {
	padding-top: 4px;
}

.wtapp-reader-lock__buy-form .myCRED-buy-form > label,
.wtapp-reader-lock__buy-form .myCRED-buy-form > span {
	font-size: 0.8rem;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-lock__pending {
	font-size: 0.8rem;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-rail {
	position: sticky;
	bottom: calc(10px + var(--wtapp-safe-bottom));
	z-index: 24;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: min(100%, 980px);
	margin: 0 auto;
	padding: 10px;
	border-radius: 48px;
	background: rgba(20, 29, 49, 0.94);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 18px 40px rgba(9, 15, 30, 0.28);
	transition: transform 220ms ease, opacity 220ms ease;
	will-change: transform, opacity;
}

.wtapp-reader-rail__group {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
}

.wtapp-reader-rail .wtapp-button {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 5px 8px;
	font-size: 0.8rem;
	line-height: 1.2;
	white-space: nowrap;
	width: 100%;
	justify-content: center;
	text-align: center;
}

.wtapp-reader-rail .wtapp-button--ghost,
.wtapp-reader-rail .wtapp-button--secondary {
	color: #f7f9ff;
	border-color: rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.06);
}

.wtapp-reader-rail .wtapp-button.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}

.wtapp-reader-end-prompt[hidden],
.wtapp-reader-resume[hidden] {
	display: none;
}

.wtapp-reader-end-prompt {
	width: min(100%, var(--wtapp-reader-max-width));
	margin: 0 auto;
	padding: 10px 0;
}

.wtapp-reader-end-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	backdrop-filter: none;
}

.wtapp-reader-end-card__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
}

.wtapp-reader-end-card__actions .wtapp-button {
	min-height: 30px;
	padding: 5px 8px;
	font-size: 0.8rem;
	min-width: 124px;
	text-align: center;
}

.wtapp-reader-end-card__actions [data-wtapp-reader-nav="next-prompt"] {
	margin-left: auto;
}

.wtapp-reader-comments {
	width: min(100%, var(--wtapp-reader-max-width));
	margin: 0 auto;
}

.wtapp-reader-comments .wtapp-surface--discussion {
	padding: 12px;
	border-radius: 16px;
	background: var(--wtapp-reader-paper);
}

.wtapp-reader-comments .wtapp-discussion__header,
.wtapp-reader-comments .wtapp-review-feed__header {
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--wtapp-reader-line);
}

.wtapp-reader-comments .wtapp-discussion__eyebrow {
	margin: 0 0 4px;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	color: var(--wtapp-reader-link);
}

.wtapp-reader-comments .wtapp-card-title {
	margin: 0;
	font-family: var(--wtapp-font-display);
	font-size: clamp(1.2rem, 1.9vw, 1.55rem);
	line-height: 1.12;
}

.wtapp-reader-comments .wtapp-card-summary,
.wtapp-reader-comments .wtapp-discussion-card__author-meta,
.wtapp-reader-comments .wtapp-discussion-card__date,
.wtapp-reader-comments .wtapp-empty-state {
	font-size: 0.84rem;
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-comments .wtapp-review-feed__empty-title,
.wtapp-reader-comments .wtapp-discussion-card__author,
.wtapp-reader-comments .wtapp-discussion-card__meta strong,
.wtapp-reader-comments .wtapp-rating-input legend {
	color: var(--wtapp-reader-ink);
}

.wtapp-reader-comments .wtapp-review-feed__empty-copy,
.wtapp-reader-comments .wtapp-discussion-card__meta span,
.wtapp-reader-comments .wtapp-discussion-auth .wtapp-card-summary,
.wtapp-reader-comments .wtapp-review-feed__empty-icon {
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-comments .wtapp-discussion-auth,
.wtapp-reader-comments .wtapp-discussion-form,
.wtapp-reader-comments .wtapp-discussion-card,
.wtapp-reader-comments .wtapp-review-feed__empty {
	border-radius: 14px;
	border: 1px solid var(--wtapp-reader-line);
	background: var(--wtapp-reader-control-surface);
	box-shadow: none;
}

.wtapp-reader-comments .wtapp-discussion-auth,
.wtapp-reader-comments .wtapp-discussion-form {
	padding: 10px;
	margin-bottom: 10px;
}

.wtapp-reader-comments .wtapp-discussion-form textarea {
	min-height: 92px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid var(--wtapp-reader-line);
	background: var(--wtapp-reader-control-surface-strong);
	color: var(--wtapp-reader-control-text);
	font-size: 0.92rem;
	line-height: 1.55;
}

.wtapp-reader-comments .wtapp-discussion-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wtapp-reader-comments .wtapp-discussion-card {
	padding: 10px;
}

.wtapp-reader-comments .wtapp-discussion-card__content {
	font-size: 0.92rem;
	line-height: 1.6;
}

.wtapp-reader-comments .wtapp-discussion-card__content,
.wtapp-reader-comments .wtapp-discussion-card__content :not(a) {
	color: var(--wtapp-reader-ink);
}

.wtapp-reader-comments .wtapp-discussion-card__content a {
	color: var(--wtapp-reader-link);
}

.wtapp-reader-comments .wtapp-discussion-card__actions {
	gap: 6px;
}

.wtapp-reader-comments .wtapp-discussion-card__action {
	color: var(--wtapp-reader-muted);
}

.wtapp-reader-comments .wtapp-discussion-card__action.is-active {
	color: var(--wtapp-reader-link);
}

.wtapp-reader-comments .wtapp-discussion-card__replies {
	gap: 8px;
}

.wtapp-reader-comments .wtapp-discussion-card--reply,
.wtapp-reader-comments .wtapp-discussion-form--reply {
	background: var(--wtapp-reader-control-surface-strong);
	border-color: var(--wtapp-reader-line);
}

.wtapp-reader-comments .wtapp-discussion-card__top,
.wtapp-reader-comments .wtapp-discussion-card__meta {
	margin-bottom: 6px;
}

.wtapp-reader-comments .wtapp-discussion-card__avatar {
	width: 38px;
	height: 38px;
}

.wtapp-reader-comments .wtapp-discussion-card__author {
	font-size: 0.9rem;
}

.wtapp-reader-comments .wtapp-review-feed__cta {
	align-self: flex-start;
}

.wtapp-reader-comments .wtapp-review-feed__more-wrap {
	display: flex;
	justify-content: center;
	padding-top: 6px;
}

.wtapp-reader-comments .wtapp-review-feed__more {
	background: linear-gradient(180deg, rgba(54, 102, 244, 0.08), rgba(54, 102, 244, 0.14));
	border: 1px solid rgba(54, 102, 244, 0.16);
	border-radius: 999px;
	color: var(--wtapp-reader-link);
}

.wtapp-reader-comments .wtapp-rating-input legend {
	font-size: 0.84rem;
	font-weight: 700;
}

.wtapp-reader-comments .wtapp-rating-input__stars {
	gap: 4px;
}

.wtapp-reader-comments .wtapp-star.is-filled,
.wtapp-reader-comments .wtapp-discussion-card__rating .wtapp-star.is-filled {
	color: #f59e0b;
}

.wtapp-reader-comments .wtapp-discussion-form textarea::placeholder {
	color: color-mix(in srgb, var(--wtapp-reader-muted) 78%, transparent);
}

body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-end-card__actions .wtapp-button--secondary,
body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-end-card__actions .wtapp-button--ghost,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-end-card__actions .wtapp-button--secondary,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-end-card__actions .wtapp-button--ghost,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-end-card__actions .wtapp-button--secondary,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-end-card__actions .wtapp-button--ghost,
body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-comments .wtapp-discussion-auth__actions .wtapp-button--secondary,
body.wtapp-shell-body.wtapp-reader-theme-dark .wtapp-reader-comments .wtapp-discussion-auth__actions .wtapp-button--ghost,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-comments .wtapp-discussion-auth__actions .wtapp-button--secondary,
html[data-wtapp-reader-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode .wtapp-reader-comments .wtapp-discussion-auth__actions .wtapp-button--ghost,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-comments .wtapp-discussion-auth__actions .wtapp-button--secondary,
html[data-wtapp-public-theme="dark"] body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-theme-inherit .wtapp-reader-comments .wtapp-discussion-auth__actions .wtapp-button--ghost {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--wtapp-reader-line);
	color: var(--wtapp-reader-control-text);
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-topbar-collapsed .wtapp-reader-topbar {
	padding: 10px 12px;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-chrome-hidden {
	--wtapp-reader-rail-space: 18px;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-chrome-hidden .wtapp-reader-topbar {
	opacity: 0;
	pointer-events: none;
	transform: translateY(calc(-1 * (var(--wtapp-reader-topbar-height, 96px) + 18px)));
	margin-bottom: calc(-1 * var(--wtapp-reader-topbar-height, 96px));
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-chrome-hidden .wtapp-reader-rail {
	opacity: 0;
	pointer-events: none;
	transform: translateY(calc(var(--wtapp-reader-rail-height, 72px) + 20px));
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-topbar-collapsed .wtapp-reader-topbar__identity,
body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-topbar-collapsed .wtapp-reader-topbar__meta {
	display: none;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-rail-collapsed {
	--wtapp-reader-rail-space: 64px;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-reader-rail-collapsed .wtapp-reader-rail {
	width: max-content;
	max-width: calc(100% - 10px);
	padding: 8px;
}

@media (max-width: 860px) {
	body.wtapp-shell-body.wtapp-reader-mode {
		--wtapp-reader-rail-space: 132px;
	}

	.wtapp-reader-topbar {
		align-items: stretch;
	}

	.wtapp-reader-toggle,
	.wtapp-reader-rail__toggle {
		display: inline-flex;
		align-self: flex-start;
	}

	.wtapp-reader-topbar__actions .wtapp-button,
		.wtapp-reader-lock__actions .wtapp-button {
		flex: 1 1 calc(50% - 4px);
		text-align: center;
	}

	.wtapp-reader-layout,
	.wtapp-reader-comments {
		width: 100%;
	}

	.wtapp-reader-article,
	.wtapp-reader-comments .wtapp-surface--discussion {
		width: 100%;
	}

	.wtapp-reader-lock__header,
	.wtapp-reader-resume {
		flex-direction: column;
		align-items: flex-start;
	}

	.wtapp-reader-rail {
		width: 100%;
	}

	.wtapp-reader-rail__group {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	body.wtapp-shell-body.wtapp-reader-mode .wtapp-layout {
		width: min(calc(100% - 12px), 1180px);
	}

	.wtapp-reader {
		gap: 8px;
	}

	.wtapp-reader-topbar,
	.wtapp-reader-article,
	.wtapp-reader-lock,
	.wtapp-reader-comments .wtapp-surface--discussion,
	.wtapp-reader-end-prompt {
		border-radius: 14px;
	}

	.wtapp-reader-topbar,
	.wtapp-reader-article,
	.wtapp-reader-lock,
	.wtapp-reader-comments .wtapp-surface--discussion,
	.wtapp-reader-resume {
		padding: 10px;
	}

	.wtapp-reader-topbar__title,
	.wtapp-reader-lock__title {
		font-size: 1.22rem;
	}

	.wtapp-reader-topbar__links {
		max-width: 100%;
	}

	.wtapp-reader-topbar__bar {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.wtapp-reader-topbar__chapter {
		grid-column: 1 / -1;
		order: 3;
		padding-top: 2px;
	}

	.wtapp-reader-prose {
		font-size: 1rem;
	}

	.wtapp-reader-lock__meta {
		grid-template-columns: 1fr;
	}

	.wtapp-reader-rail {
		padding: 8px;
		border-radius: 14px;
	}

	.wtapp-reader-rail__group {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.wtapp-reader-end-card__actions {
		gap: 8px;
	}

	.wtapp-reader-end-card__actions .wtapp-button {
		min-width: 0;
		flex: 1 1 0;
	}

	.wtapp-reader-comments .wtapp-surface--discussion {
		padding: 10px;
	}

	.wtapp-reader-comments .wtapp-discussion__header,
	.wtapp-reader-comments .wtapp-review-feed__header {
		margin-bottom: 8px;
		padding-bottom: 8px;
	}

	.wtapp-reader-comments .wtapp-card-title {
		font-size: 1.12rem;
	}

	.wtapp-modal__panel--reader-settings {
		width: min(100%, 520px);
		padding: 20px 16px 16px;
	}

	.wtapp-modal--reader-chapters {
		align-items: flex-end;
		padding: 0;
	}

	.wtapp-modal__panel--reader-chapters {
		width: 100%;
		max-width: none;
		max-height: min(90dvh, 760px);
		padding: 52px 16px calc(16px + var(--wtapp-safe-bottom));
		border-radius: 28px 28px 0 0;
	}

	.wtapp-reader-chapter-picker__header {
		align-items: stretch;
		flex-direction: column;
		padding-right: 0;
	}

	.wtapp-reader-chapter-picker__sort {
		width: 100%;
	}

	.wtapp-reader-chapter-picker__item {
		padding: 11px 2px;
	}

	.wtapp-reader-chapter-picker__item-title {
		font-size: 0.98rem;
	}

	.wtapp-reader-settings-form {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.wtapp-reader-comments .wtapp-card-summary,
	.wtapp-reader-comments .wtapp-discussion-card__author-meta,
	.wtapp-reader-comments .wtapp-discussion-card__date,
	.wtapp-reader-comments .wtapp-empty-state {
		font-size: 0.82rem;
	}

	.wtapp-reader-comments .wtapp-discussion-auth,
	.wtapp-reader-comments .wtapp-discussion-form,
	.wtapp-reader-comments .wtapp-discussion-card,
	.wtapp-reader-comments .wtapp-review-feed__empty {
		border-radius: 14px;
	}

	.wtapp-reader-comments .wtapp-discussion-card {
		grid-template-columns: 44px minmax(0, 1fr);
		gap: 10px;
		padding: 10px;
	}

	.wtapp-reader-comments .wtapp-discussion-card__avatar {
		width: 40px;
		height: 40px;
	}

	.wtapp-reader-comments .wtapp-discussion-card__content {
		font-size: 0.9rem;
		line-height: 1.55;
	}
}
