/**
 * THX Library - E-Reader UX Stylesheet (Kindle & Apple Books UX)
 * Cung cấp phân trang động theo kích thước màn hình, theme công thái học (Light, Sepia, Dark),
 * thanh trạng thái số trang, ngăn kéo mục lục và bộ điều khiển lật trang cảm ứng.
 */

:root {
	--thx-reader-bg: #faf9f5;
	--thx-reader-text: #242424;
	--thx-reader-heading: #111827;
	--thx-reader-surface: rgba(250, 249, 245, 0.94);
	--thx-reader-surface-solid: #ffffff;
	--thx-reader-border: rgba(0, 0, 0, 0.08);
	--thx-reader-accent: #059669;
	--thx-reader-accent-hover: #047857;
	--thx-reader-quote-bg: #f3f2ec;
	--thx-reader-quote-border: #059669;
	--thx-reader-font-size: 18px;
	--thx-reader-line-height: 1.82;
	--thx-reader-max-width: 840px;
	--thx-reader-font-family: "Merriweather", "Georgia", "Cambria", serif;
	--thx-reader-gap: 50px;
	--thx-reader-top-bar-height: calc(56px + env(safe-area-inset-top, 0px));
	--thx-reader-bottom-bar-height: calc(54px + env(safe-area-inset-bottom, 0px));
	--thx-reader-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* =========================================================================
   1. THEME DEFINITIONS (Light, Sepia, Sage, Dark)
   ========================================================================= */
body.thx-reader-active {
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	height: 100% !important;
	height: 100vh !important;
	height: 100dvh !important;
	width: 100% !important;
	width: 100vw !important;
}

.thx-reader-container {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	height: -webkit-fill-available;
	background-color: var(--thx-reader-bg);
	color: var(--thx-reader-text);
	font-family: var(--thx-reader-font-family);
	font-size: var(--thx-reader-font-size);
	line-height: var(--thx-reader-line-height);
	z-index: 99999;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	user-select: text;
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Light (Paper White) */
.thx-reader-container[data-theme="light"] {
	--thx-reader-bg: #faf9f5;
	--thx-reader-text: #242424;
	--thx-reader-heading: #111827;
	--thx-reader-surface: rgba(250, 249, 245, 0.94);
	--thx-reader-surface-solid: #ffffff;
	--thx-reader-border: rgba(0, 0, 0, 0.09);
	--thx-reader-accent: #059669;
	--thx-reader-accent-hover: #047857;
	--thx-reader-quote-bg: #f4f3ec;
	--thx-reader-quote-border: #059669;
}

/* Theme Sepia (Kindle Paperwhite Warm Tone) */
.thx-reader-container[data-theme="sepia"] {
	--thx-reader-bg: #f6ecd9;
	--thx-reader-text: #3f2f1d;
	--thx-reader-heading: #2a1f13;
	--thx-reader-surface: rgba(246, 236, 217, 0.95);
	--thx-reader-surface-solid: #efe3cb;
	--thx-reader-border: rgba(67, 52, 34, 0.12);
	--thx-reader-accent: #854d0e;
	--thx-reader-accent-hover: #713f12;
	--thx-reader-quote-bg: #efe1c8;
	--thx-reader-quote-border: #a16207;
	--thx-reader-shadow: 0 4px 20px rgba(67, 52, 34, 0.1);
}

/* Theme Sage (Forest Calm / Xanh Thảo Mộc Dịu Mắt) */
.thx-reader-container[data-theme="sage"] {
	--thx-reader-bg: #edf4ee;
	--thx-reader-text: #193826;
	--thx-reader-heading: #0f2719;
	--thx-reader-surface: rgba(237, 244, 238, 0.95);
	--thx-reader-surface-solid: #e2ede4;
	--thx-reader-border: rgba(25, 56, 38, 0.12);
	--thx-reader-accent: #0f766e;
	--thx-reader-accent-hover: #115e59;
	--thx-reader-quote-bg: #deebe0;
	--thx-reader-quote-border: #0f766e;
	--thx-reader-shadow: 0 4px 20px rgba(15, 39, 25, 0.1);
}

/* Theme Dark (Night OLED Reading) */
.thx-reader-container[data-theme="dark"] {
	--thx-reader-bg: #111318;
	--thx-reader-text: #d2d7e0;
	--thx-reader-heading: #f1f4f9;
	--thx-reader-surface: rgba(20, 24, 33, 0.96);
	--thx-reader-surface-solid: #1c212d;
	--thx-reader-border: rgba(255, 255, 255, 0.1);
	--thx-reader-accent: #10b981;
	--thx-reader-accent-hover: #34d399;
	--thx-reader-quote-bg: #181d27;
	--thx-reader-quote-border: #10b981;
	--thx-reader-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Font Family Types */
.thx-reader-container[data-font="serif"] {
	--thx-reader-font-family: "Merriweather", "Georgia", "Cambria", "Times New Roman", serif;
}
.thx-reader-container[data-font="literata"] {
	--thx-reader-font-family: "Literata", "Merriweather", "Georgia", "Cambria", serif;
}
.thx-reader-container[data-font="sans"] {
	--thx-reader-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.thx-reader-container[data-font="vietnam"] {
	--thx-reader-font-family: "Be Vietnam Pro", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Line Height Variations */
.thx-reader-container[data-line-height="compact"] {
	--thx-reader-line-height: 1.55;
}
.thx-reader-container[data-line-height="normal"] {
	--thx-reader-line-height: 1.82;
}
.thx-reader-container[data-line-height="relaxed"] {
	--thx-reader-line-height: 2.15;
}

/* Reading Width Variations */
.thx-reader-container[data-page-width="narrow"] {
	--thx-reader-max-width: 680px;
}
.thx-reader-container[data-page-width="medium"] {
	--thx-reader-max-width: 840px;
}
.thx-reader-container[data-page-width="wide"] {
	--thx-reader-max-width: 1040px;
}

/* Text Alignment */
.thx-reader-container[data-text-align="justify"] .thx-reader-flow p,
.thx-reader-container[data-text-align="justify"] .thx-pane-flow p,
.thx-reader-container[data-text-align="justify"] .thx-interleaved-flow p {
	text-align: justify;
	text-justify: inter-word;
}
.thx-reader-container[data-text-align="left"] .thx-reader-flow p,
.thx-reader-container[data-text-align="left"] .thx-pane-flow p,
.thx-reader-container[data-text-align="left"] .thx-interleaved-flow p {
	text-align: left;
}

/* =========================================================================
   2. FLOATING BARS (Header & Footer)
   ========================================================================= */
.thx-reader-top-bar,
.thx-reader-bottom-bar {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 100;
	background: var(--thx-reader-surface);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-color: var(--thx-reader-border);
	transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

.thx-reader-top-bar {
	top: 0;
	height: var(--thx-reader-top-bar-height);
	border-bottom: 1px solid var(--thx-reader-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.25rem;
	padding-top: env(safe-area-inset-top, 0px);
	box-sizing: border-box;
}

.thx-reader-bottom-bar {
	bottom: 0;
	height: var(--thx-reader-bottom-bar-height);
	border-top: 1px solid var(--thx-reader-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.25rem;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	box-sizing: border-box;
}

/* Trạng thái ẩn thanh công cụ khi đọc tập trung (Zen Mode) */
.thx-reader-container.ui-hidden .thx-reader-top-bar {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}
.thx-reader-container.ui-hidden .thx-reader-bottom-bar {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

/* Top Bar Left: Back & Book Title */
.thx-reader-header-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}
.thx-reader-btn-back {
	background: none;
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	padding: 0.35rem 0.75rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	transition: all 0.15s ease;
	text-decoration: none;
}
.thx-reader-btn-back:hover {
	background: var(--thx-reader-border);
}
.thx-reader-book-heading {
	font-size: 0.938rem;
	font-weight: 600;
	color: var(--thx-reader-heading);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 320px;
}

/* Top Bar Center: Current Chapter */
.thx-reader-current-chapter-title {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--thx-reader-text);
	opacity: 0.85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 400px;
	text-align: center;
}

/* Top Bar Right: Action buttons */
.thx-reader-header-right {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.thx-reader-icon-btn {
	background: none;
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	width: 36px;
	height: 36px;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	transition: all 0.15s ease;
}
.thx-reader-icon-btn:hover,
.thx-reader-icon-btn.active {
	background: var(--thx-reader-border);
	color: var(--thx-reader-accent);
}

.thx-reader-edition-switcher-btn {
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
	transition: all 0.15s ease;
}
.thx-reader-edition-switcher-btn:hover {
	border-color: var(--thx-reader-accent);
	color: var(--thx-reader-accent);
	background: var(--thx-reader-border);
}
@media (max-width: 640px) {
	.thx-reader-edition-switcher-btn {
		padding: 4px 8px;
		font-size: 0.75rem;
	}
}

/* Quick Mode / Parallel Toggle Badge Buttons */
.thx-reader-badge-btn {
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	padding: 5px 11px;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
	transition: all 0.15s ease;
}
.thx-reader-badge-btn:hover {
	border-color: var(--thx-reader-accent);
	color: var(--thx-reader-accent);
	background: var(--thx-reader-border);
}
.thx-reader-badge-btn.active {
	background: var(--thx-reader-accent);
	color: #ffffff;
	border-color: var(--thx-reader-accent);
}
@media (max-width: 768px) {
	.thx-reader-badge-btn .thx-mode-text,
	.thx-reader-badge-btn .thx-parallel-text {
		display: none;
	}
	.thx-reader-badge-btn {
		padding: 5px 8px;
	}
}

/* Bottom Bar Elements */
.thx-reader-btn-nav {
	background: none;
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	padding: 0.35rem 0.85rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	transition: all 0.15s ease;
}
.thx-reader-btn-nav:hover:not(:disabled) {
	background: var(--thx-reader-border);
	color: var(--thx-reader-accent);
}
.thx-reader-btn-nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.thx-reader-status-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 0.813rem;
	gap: 2px;
}
.thx-reader-page-indicator {
	font-weight: 600;
	color: var(--thx-reader-heading);
	letter-spacing: 0.02em;
}
.thx-reader-time-left {
	font-size: 0.75rem;
	opacity: 0.75;
}

/* Minimalist Progress Bar at the bottom edge */
.thx-reader-progress-track {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--thx-reader-border);
	z-index: 101;
}
.thx-reader-progress-fill {
	height: 100%;
	width: 0%;
	background: var(--thx-reader-accent);
	transition: width 0.25s ease;
}

/* =========================================================================
   3. VIEWPORT & RESPONSIVE MULTI-COLUMN PAGINATION ENGINE
   ========================================================================= */
.thx-reader-main-area {
	position: relative;
	flex: 1;
	width: 100%;
	height: 100%;
	padding-top: var(--thx-reader-top-bar-height);
	padding-bottom: var(--thx-reader-bottom-bar-height);
	box-sizing: border-box;
	overflow: hidden;
}

/* Viewport khung đọc sách */
.thx-reader-viewport {
	width: 100%;
	height: 100%;
	max-width: var(--thx-reader-max-width, 840px);
	margin: 0 auto;
	box-sizing: border-box;
	padding: 2rem 2rem 2.25rem 2rem;
	overflow: hidden;
	position: relative;
	z-index: 10;
	pointer-events: auto;
	transition: max-width 0.2s ease;
}

/* Khối nội dung động phân trang ngang kiểu Apple Books / Kindle */
.thx-reader-flow {
	height: 100%;
	column-width: var(--thx-reader-col-width, 836px);
	column-gap: var(--thx-reader-gap);
	column-fill: auto;
	transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1);
	will-change: transform;
	box-sizing: border-box;
	position: relative;
	pointer-events: auto;
}

/* Chế độ cuộn liên tục (Continuous Scroll Mode) */
.thx-reader-container[data-mode="scroll"] .thx-reader-main-area {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
}
.thx-reader-container[data-mode="scroll"] .thx-reader-viewport {
	overflow: visible;
	height: auto;
	padding-top: 2rem;
	padding-bottom: 5rem;
}
.thx-reader-container[data-mode="scroll"] .thx-reader-flow {
	column-width: auto;
	column-gap: normal;
	column-fill: balance;
	transform: none !important;
	height: auto;
}

/* Quy tắc Typography & Ngăn ngắt dòng xấu xí */
.thx-reader-flow h1,
.thx-reader-flow h2,
.thx-reader-flow h3,
.thx-reader-flow h4 {
	color: var(--thx-reader-heading);
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
	font-weight: 700;
	line-height: 1.35;
	break-after: avoid;
	page-break-after: avoid;
}
.thx-reader-flow h1 { font-size: 1.75em; }
.thx-reader-flow h2 { font-size: 1.45em; border-bottom: 1px solid var(--thx-reader-border); padding-bottom: 0.3rem; }
.thx-reader-flow h3 { font-size: 1.2em; }
.thx-reader-flow h4 { font-size: 1.05em; }

.thx-reader-flow .thx-part-heading {
	font-size: 1.55em;
	font-weight: 800;
	color: var(--thx-reader-accent, #059669);
	margin-top: 2rem;
	margin-bottom: 1rem;
	border-bottom: 2px solid var(--thx-reader-accent, #059669);
	padding-bottom: 0.4rem;
}

.thx-reader-flow .thx-habit-heading {
	font-size: 1.35em;
	font-weight: 800;
	color: var(--thx-reader-heading);
	margin-top: 1.75rem;
	margin-bottom: 0.75rem;
}

.thx-reader-flow .thx-subheading {
	font-size: 1.15em;
	font-weight: 700;
	color: var(--thx-reader-heading);
	margin-top: 1.5rem;
	margin-bottom: 0.6rem;
}

.thx-reader-flow .thx-sub-subheading {
	font-size: 1.05em;
	font-weight: 700;
	color: var(--thx-reader-heading);
	margin-top: 1.25rem;
	margin-bottom: 0.5rem;
}

.thx-reader-flow .thx-challenge-heading {
	font-size: 1.05em;
	font-weight: 700;
	color: var(--thx-reader-accent, #059669);
	margin-top: 1.25rem;
	margin-bottom: 0.4rem;
}

.thx-reader-flow .thx-block-heading,
.thx-reader-flow .thx-reader-block-title {
	font-weight: 700;
	color: var(--thx-reader-heading);
}

.thx-reader-flow p {
	margin: 0 0 1.25em 0;
	text-align: justify;
	text-justify: inter-word;
	break-inside: auto;
	page-break-inside: auto;
	orphans: 2;
	widows: 2;
	hyphens: auto;
}

.thx-reader-flow blockquote {
	margin: 1.5em 0;
	padding: 0.75rem 1.25rem;
	background: var(--thx-reader-quote-bg);
	border-left: 4px solid var(--thx-reader-quote-border);
	font-style: italic;
	border-radius: 0 8px 8px 0;
	break-inside: avoid;
	page-break-inside: avoid;
}

/* Epigraph & Chapter Opening Quotations (Task 624) */
.thx-reader-flow blockquote.thx-reader-epigraph {
	margin: 1.75em auto;
	padding: 1.25rem 1.75rem;
	max-width: 92%;
	background: rgba(5, 150, 105, 0.04);
	border-left: 4px solid var(--thx-reader-accent, #059669);
	font-style: italic;
	font-size: 1.05em;
	line-height: 1.75;
	border-radius: 4px 12px 12px 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.thx-reader-flow blockquote.thx-reader-epigraph p {
	margin: 0;
	font-style: italic;
}

.thx-reader-flow blockquote.thx-reader-epigraph cite {
	display: block;
	margin-top: 0.75rem;
	font-style: normal;
	font-weight: 600;
	font-size: 0.9em;
	text-align: right;
	color: var(--thx-reader-heading, #1f2937);
	letter-spacing: 0.02em;
}

/* Interview Questions & Foreword Subtitle Typography */
.thx-reader-flow .thx-interview-question {
	color: var(--thx-reader-heading, #111827);
	font-size: 1.05em;
	font-weight: 700;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
	line-height: 1.5;
}

.thx-reader-flow .thx-doc-subtitle {
	color: var(--thx-reader-accent, #059669);
	font-size: 0.92em;
	letter-spacing: 0.04em;
	margin-bottom: 1.25em;
}

/* Defensive Rule: Hide duplicated block title if present immediately as first child */
.thx-reader-block > .thx-reader-block-title + .thx-reader-col-content > .thx-block-heading:first-child {
	display: none !important;
}

.thx-reader-flow ul,
.thx-reader-flow ol {
	margin: 0 0 1.25em 1.5rem;
	padding: 0;
	break-inside: avoid;
	page-break-inside: avoid;
}

.thx-reader-flow li {
	margin-bottom: 0.5em;
}

.thx-reader-flow img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 1rem auto;
	display: block;
	break-inside: avoid;
	page-break-inside: avoid;
}

.thx-reader-flow .thx-reader-figure {
	margin: 1.75rem auto;
	text-align: center;
	max-width: 100%;
	break-inside: avoid;
	page-break-inside: avoid;
}

.thx-reader-flow .thx-reader-figure img,
.thx-reader-flow img.thx-reader-image {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
	margin: 0 auto 0.5rem auto;
	display: block;
}

.thx-reader-flow .thx-reader-figcaption {
	font-size: 0.88em;
	color: var(--thx-reader-text-muted, #64748b);
	font-style: italic;
	line-height: 1.4;
	margin-top: 0.4rem;
	display: block;
}

.thx-reader-flow strong {
	font-weight: 700;
	color: var(--thx-reader-heading);
}

.thx-reader-block {
	margin-bottom: 1.5rem;
	break-inside: auto;
	page-break-inside: auto;
}

/* =========================================================================
   4. INTERACTIVE TAP ZONES (Kindle Tap to Turn & Toggle UI)
   ========================================================================= */
.thx-reader-tap-left,
.thx-reader-tap-right,
.thx-reader-tap-center {
	position: absolute;
	top: var(--thx-reader-top-bar-height);
	bottom: var(--thx-reader-bottom-bar-height);
	z-index: 5;
	pointer-events: none;
	cursor: pointer;
}

.thx-reader-tap-left {
	left: 0;
	width: 20%;
}
.thx-reader-tap-right {
	right: 0;
	width: 20%;
}
.thx-reader-tap-center {
	left: 20%;
	right: 20%;
	width: 60%;
}

/* Vô hiệu hóa và ẩn hoàn toàn Tap Zones khi ở chế độ cuộn dọc (Continuous Scroll) */
.thx-reader-container[data-mode="scroll"] .thx-reader-tap-left,
.thx-reader-container[data-mode="scroll"] .thx-reader-tap-center,
.thx-reader-container[data-mode="scroll"] .thx-reader-tap-right {
	display: none !important;
	pointer-events: none !important;
}

/* Subtle Hover indicator for Left / Right turn zones */
.thx-reader-tap-left::before,
.thx-reader-tap-right::before {
	content: "";
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 2rem;
	color: var(--thx-reader-text);
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}
.thx-reader-tap-left::before {
	content: "‹";
	left: 1.5rem;
}
.thx-reader-tap-right::before {
	content: "›";
	right: 1.5rem;
}
@media (hover: hover) {
	.thx-reader-tap-left:hover::before,
	.thx-reader-tap-right:hover::before,
	.thx-reader-container.hover-tap-left .thx-reader-tap-left::before,
	.thx-reader-container.hover-tap-right .thx-reader-tap-right::before {
		opacity: 0.35;
	}
}

/* =========================================================================
   5. SLIDE-OUT CHAPTER DRAWER (TOC)
   ========================================================================= */
.thx-reader-drawer-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
	z-index: 200;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.thx-reader-drawer-overlay.active {
	opacity: 1;
	visibility: visible;
}

.thx-reader-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	width: 380px;
	max-width: 85vw;
	background: var(--thx-reader-surface-solid);
	color: var(--thx-reader-text);
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
	z-index: 201;
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--thx-reader-border);
}
.thx-reader-drawer.active {
	transform: translateX(0);
}

.thx-reader-drawer-header {
	padding: 1.25rem;
	border-bottom: 1px solid var(--thx-reader-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.thx-reader-drawer-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--thx-reader-heading);
}
.thx-reader-drawer-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	color: var(--thx-reader-text);
	cursor: pointer;
	padding: 0 0.5rem;
	line-height: 1;
}

.thx-reader-drawer-list {
	flex: 1;
	overflow-y: auto;
	padding: 0.75rem 0;
	margin: 0;
	list-style: none;
}
.thx-reader-drawer-item {
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid var(--thx-reader-border);
	cursor: pointer;
	transition: background 0.15s ease;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.thx-reader-drawer-item:hover {
	background: var(--thx-reader-quote-bg);
}
.thx-reader-drawer-item.active {
	background: var(--thx-reader-quote-bg);
	border-left: 4px solid var(--thx-reader-accent);
}
.thx-reader-drawer-item-title {
	font-weight: 600;
	font-size: 0.938rem;
	color: var(--thx-reader-heading);
}
.thx-reader-drawer-item-meta {
	font-size: 0.781rem;
	opacity: 0.7;
	display: flex;
	gap: 0.75rem;
}

/* Drawer Live Search Filter */
.thx-reader-drawer-search-wrap {
	padding: 10px 14px;
	border-bottom: 1px solid var(--thx-reader-border);
	background: var(--thx-reader-surface);
}
.thx-reader-drawer-search-wrap input {
	width: 100%;
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid var(--thx-reader-border);
	background: var(--thx-reader-surface-solid);
	color: var(--thx-reader-text);
	font-size: 0.8125rem;
	box-sizing: border-box;
	outline: none;
	transition: border-color 0.15s ease;
}
.thx-reader-drawer-search-wrap input:focus {
	border-color: var(--thx-reader-accent);
}

/* =========================================================================
   6. APPEARANCE SETTINGS MODAL / POPOVER (HIGH-END READING CONTROLS)
   ========================================================================= */
.thx-reader-settings-overlay {
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 140;
}

.thx-reader-settings-popover {
	position: absolute;
	top: calc(var(--thx-reader-top-bar-height) + 10px);
	right: 1.5rem;
	width: 390px;
	max-height: calc(100vh - var(--thx-reader-top-bar-height) - 30px);
	overflow-y: auto;
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 2px 10px rgba(0, 0, 0, 0.08);
	padding: 1.25rem;
	z-index: 150;
	display: none;
	flex-direction: column;
	gap: 1.1rem;
	color: var(--thx-reader-text);
	scrollbar-width: thin;
	animation: thxSettingsSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes thxSettingsSlideIn {
	from {
		opacity: 0;
		transform: translateY(-8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}
.thx-reader-settings-popover.active {
	display: flex;
}

/* Modal Header */
.thx-reader-settings-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--thx-reader-border);
}
.thx-reader-settings-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--thx-reader-text);
	letter-spacing: -0.01em;
}
.thx-reader-settings-subtitle {
	margin: 3px 0 0 0;
	font-size: 0.781rem;
	color: var(--thx-reader-text);
	opacity: 0.7;
}
.thx-reader-settings-close {
	background: transparent;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--thx-reader-text);
	opacity: 0.6;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 6px;
	transition: all 0.15s ease;
}
.thx-reader-settings-close:hover {
	opacity: 1;
	background: var(--thx-reader-quote-bg);
}

/* Grouped Card Sections */
.thx-reader-settings-section {
	background: var(--thx-reader-surface);
	border: 1px solid var(--thx-reader-border);
	border-radius: 12px;
	padding: 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}
.thx-reader-section-header {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--thx-reader-text);
	opacity: 0.85;
}
.thx-sublabel {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--thx-reader-text);
	opacity: 0.75;
	margin-bottom: 4px;
}

.thx-reader-setting-group label,
.thx-reader-setting-group-half label {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.45rem;
	opacity: 0.75;
}

.thx-reader-setting-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.thx-reader-select {
	width: 100%;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid var(--thx-reader-border);
	background: var(--thx-reader-surface-solid);
	color: var(--thx-reader-text);
	font-size: 0.8125rem;
	font-weight: 600;
	box-sizing: border-box;
	cursor: pointer;
}

/* Theme Pills with Live Color Dots */
.thx-theme-preview-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	display: inline-block;
	border: 1px solid rgba(0, 0, 0, 0.2);
}
.light-dot { background: #faf9f5; }
.sepia-dot { background: #f6ecd9; }
.sage-dot  { background: #edf4ee; }
.dark-dot  { background: #111318; border-color: rgba(255, 255, 255, 0.35); }

.thx-pill-theme {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 7px 4px;
}

/* Font Family Live Preview */
.font-serif-preview { font-family: "Merriweather", Georgia, serif; }
.font-literata-preview { font-family: "Literata", Georgia, serif; }
.font-sans-preview { font-family: "Inter", system-ui, sans-serif; }
.font-vietnam-preview { font-family: "Be Vietnam Pro", system-ui, sans-serif; }
.thx-font-sample {
	font-size: 0.95rem;
	font-weight: 700;
	margin-right: 4px;
}

/* Font Size Control */
.thx-reader-font-size-ctrl {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	border-radius: 8px;
	padding: 3px;
}
.thx-reader-font-btn {
	background: none;
	border: none;
	font-weight: 700;
	padding: 0.35rem 1rem;
	cursor: pointer;
	color: var(--thx-reader-text);
	border-radius: 6px;
	font-size: 0.95rem;
	transition: background 0.15s ease;
}
.thx-reader-font-btn:hover {
	background: var(--thx-reader-quote-bg);
}
.thx-reader-font-val-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
}
.thx-reader-font-val {
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--thx-reader-accent);
}

/* Switcher Pills (Grid variations) */
.thx-reader-edition-pills,
.thx-reader-line-pills,
.thx-reader-width-pills,
.thx-reader-fn-pills {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
.thx-reader-theme-pills {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
}
.thx-reader-font-pills {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 6px;
}
.thx-reader-mode-pills,
.thx-reader-align-pills {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.thx-pill-btn {
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	padding: 0.5rem 0.35rem;
	border-radius: 7px;
	cursor: pointer;
	font-size: 0.781rem;
	font-weight: 600;
	text-align: center;
	transition: all 0.15s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.thx-pill-btn:hover {
	border-color: var(--thx-reader-accent);
	color: var(--thx-reader-accent);
	background: var(--thx-reader-surface-solid);
}
.thx-pill-btn.active {
	border-color: var(--thx-reader-accent);
	background: var(--thx-reader-accent);
	color: #ffffff !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Specific theme pills appearance */
.thx-pill-theme-light { background: #faf9f5; color: #242424; }
.thx-pill-theme-sepia { background: #f6ecd9; color: #3f2f1d; }
.thx-pill-theme-sage  { background: #edf4ee; color: #193826; }
.thx-pill-theme-dark  { background: #111318; color: #d2d7e0; }

/* =========================================================================
   6B. DUAL-PANE PARALLEL READING LAYOUT & SPLITTER
   ========================================================================= */
.thx-reader-parallel-container {
	position: absolute;
	top: var(--thx-reader-top-bar-height);
	bottom: var(--thx-reader-bottom-bar-height);
	left: 0;
	right: 0;
	display: flex;
	width: 100%;
	height: calc(100vh - var(--thx-reader-top-bar-height) - var(--thx-reader-bottom-bar-height));
	overflow: hidden;
	z-index: 40;
	background: var(--thx-reader-bg);
}

.thx-pane {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 280px;
	position: relative;
	background: var(--thx-reader-bg);
	overflow: hidden;
}

.thx-pane-header {
	height: 38px;
	border-bottom: 1px solid var(--thx-reader-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1rem;
	background: var(--thx-reader-surface);
	backdrop-filter: blur(8px);
	z-index: 10;
}

.thx-pane-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.thx-pane-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}
.primary-dot {
	background: var(--thx-reader-accent);
}
.secondary-dot {
	background: #3b82f6;
}

.thx-pane-title {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--thx-reader-heading);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 240px;
}

.thx-pane-select {
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-text);
	border-radius: 6px;
	padding: 3px 8px;
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
	max-width: 220px;
}

.thx-pane-status {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--thx-reader-text);
	opacity: 0.75;
}

.thx-pane-viewport {
	flex: 1;
	overflow-y: auto;
	padding: 2rem 2.25rem;
	position: relative;
	box-sizing: border-box;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
}

.thx-pane-flow {
	max-width: 100%;
	line-height: var(--thx-reader-line-height, 1.82);
	font-family: var(--thx-reader-font-family);
	font-size: var(--thx-reader-font-size);
	color: var(--thx-reader-text);
}

/* Splitter Bar */
.thx-reader-splitter {
	width: 30px;
	background: var(--thx-reader-surface);
	border-left: 1px solid var(--thx-reader-border);
	border-right: 1px solid var(--thx-reader-border);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	z-index: 60;
	user-select: none;
	position: relative;
}

.thx-splitter-handle {
	width: 100%;
	display: flex;
	gap: 2px;
	justify-content: center;
	cursor: col-resize;
	padding: 10px 0;
}
.thx-splitter-handle span {
	width: 2px;
	height: 18px;
	background: var(--thx-reader-border);
	border-radius: 1px;
}

.thx-splitter-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.thx-splitter-btn {
	width: 22px;
	height: 22px;
	border: 1px solid var(--thx-reader-border);
	border-radius: 4px;
	background: var(--thx-reader-surface-solid);
	color: var(--thx-reader-text);
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
	padding: 0;
}
.thx-splitter-btn:hover {
	border-color: var(--thx-reader-accent);
	color: var(--thx-reader-accent);
}
.thx-splitter-btn.active {
	background: var(--thx-reader-accent);
	color: #ffffff;
	border-color: var(--thx-reader-accent);
}
.thx-btn-close-split:hover {
	background: #ef4444 !important;
	color: #ffffff !important;
	border-color: #ef4444 !important;
}

/* =========================================================================
   6C. INTERLEAVED READING LAYOUT
   ========================================================================= */
.thx-reader-interleaved-container {
	position: absolute;
	top: var(--thx-reader-top-bar-height);
	bottom: var(--thx-reader-bottom-bar-height);
	left: 0;
	right: 0;
	overflow-y: auto;
	padding: 2.25rem 2rem;
	box-sizing: border-box;
	z-index: 40;
	background: var(--thx-reader-bg);
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
}

.thx-interleaved-viewport {
	max-width: var(--thx-reader-max-width, 840px);
	margin: 0 auto;
}

.thx-interleaved-block {
	margin-bottom: 2rem;
	padding: 1.25rem 1.5rem;
	border-radius: 10px;
	background: var(--thx-reader-quote-bg);
	border-left: 4px solid var(--thx-reader-accent);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.thx-interleaved-block:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.thx-interleaved-col {
	margin-bottom: 0.75rem;
}
.thx-interleaved-col:last-child {
	margin-bottom: 0;
}

.thx-interleaved-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 4px;
	margin-bottom: 6px;
}
.thx-interleaved-badge.primary-badge {
	background: var(--thx-reader-accent);
	color: #ffffff;
}
.thx-interleaved-badge.secondary-badge {
	background: #3b82f6;
	color: #ffffff;
}

/* =========================================================================
   6D. SYNCHRONIZED MATCHING PARAGRAPH / SEGMENT HIGHLIGHTS
   ========================================================================= */
.thx-segment-highlight {
	background: rgba(5, 150, 105, 0.12) !important;
	border-left: 3px solid var(--thx-reader-accent) !important;
	padding-left: 8px !important;
	border-radius: 4px;
	transition: all 0.25s ease;
}

.thx-matched-target {
	background: rgba(59, 130, 246, 0.12) !important;
	border-left: 3px solid #3b82f6 !important;
	padding-left: 8px !important;
	border-radius: 4px;
	transition: all 0.25s ease;
}

/* =========================================================================
   6E. ENHANCED CONTINUOUS SCROLL MODE & FLOATING CONTROLS
   ========================================================================= */
.thx-reader-scroll-progress {
	position: absolute;
	top: var(--thx-reader-top-bar-height);
	left: 0;
	right: 0;
	height: 3px;
	z-index: 95;
	background: transparent;
	pointer-events: none;
}
.thx-scroll-progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--thx-reader-accent), #3b82f6);
	transition: width 0.1s linear;
}

.thx-reader-back-to-top {
	position: absolute;
	bottom: calc(var(--thx-reader-bottom-bar-height) + 16px);
	right: 1.5rem;
	z-index: 80;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--thx-reader-surface-solid);
	border: 1px solid var(--thx-reader-border);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	color: var(--thx-reader-text);
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	font-weight: 700;
	transition: all 0.2s ease;
}
.thx-reader-back-to-top:hover {
	border-color: var(--thx-reader-accent);
	color: var(--thx-reader-accent);
	transform: translateY(-2px);
}

.thx-reader-next-chapter-bar {
	margin: 3.5rem auto 2rem auto;
	max-width: 520px;
	text-align: center;
}
.thx-next-chapter-card {
	padding: 1.5rem;
	border-radius: 12px;
	background: var(--thx-reader-quote-bg);
	border: 1px solid var(--thx-reader-border);
	box-shadow: var(--thx-reader-shadow);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.thx-next-chapter-text {
	font-size: 0.938rem;
	font-weight: 600;
	color: var(--thx-reader-heading);
}
.thx-btn-next-chapter {
	background: var(--thx-reader-accent);
	color: #ffffff;
	border: none;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 700;
	cursor: pointer;
	font-size: 0.875rem;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: background 0.15s ease, transform 0.15s ease;
}
.thx-btn-next-chapter:hover {
	background: var(--thx-reader-accent-hover);
	transform: translateY(-1px);
}

/* =========================================================================
   6F. ZEN FOCUS MODE (IMMERSIVE FULLSCREEN READING UX)
   ========================================================================= */
.thx-reader-zen-top-sensor {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 14px;
	z-index: 180;
	pointer-events: none;
}
.thx-reader-container.ui-zen-mode .thx-reader-zen-top-sensor {
	pointer-events: auto;
}

/* Nút thoát Zen Mode dạng floating pill */
.thx-reader-zen-exit-pill {
	position: fixed;
	top: 16px;
	right: 20px;
	z-index: 195;
	display: none;
	align-items: center;
	gap: 6px;
	background: rgba(15, 23, 42, 0.5);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	padding: 6px 14px 6px 10px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0.35;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.thx-reader-zen-exit-pill:hover,
.thx-reader-zen-exit-pill.revealed {
	opacity: 1;
	transform: translateY(2px) scale(1.03);
	background: rgba(15, 23, 42, 0.88);
	border-color: rgba(255, 255, 255, 0.45);
}
.thx-zen-exit-icon {
	font-size: 0.875rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
}
.thx-zen-exit-kbd {
	font-size: 0.6875rem;
	background: rgba(255, 255, 255, 0.15);
	padding: 1px 5px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	font-family: inherit;
}

.thx-reader-container.ui-zen-mode .thx-reader-zen-exit-pill {
	display: inline-flex;
}

/* Ẩn hoàn toàn header và footer khi bật chế độ tập trung */
.thx-reader-container.ui-zen-mode .thx-reader-top-bar {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.thx-reader-container.ui-zen-mode .thx-reader-bottom-bar {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

/* Tối ưu không gian đọc sách đắm chìm toàn màn hình */
.thx-reader-container.ui-zen-mode .thx-reader-main-area {
	padding-top: 1rem;
	padding-bottom: 1rem;
	height: 100vh;
}
.thx-reader-container.ui-zen-mode .thx-reader-viewport {
	height: 100vh;
}
.thx-reader-container.ui-zen-mode .thx-reader-flow {
	margin-top: auto;
	margin-bottom: auto;
}
.thx-reader-container.ui-zen-mode .thx-reader-parallel-container,
.thx-reader-container.ui-zen-mode .thx-reader-interleaved-container {
	top: 0;
	bottom: 0;
	height: 100vh;
}

/* =========================================================================
   7. RESPONSIVE OPTIMIZATIONS (Mobile & Tablet)
   ========================================================================= */
@media (max-width: 768px) {
	:root {
		--thx-reader-gap: 30px;
		--thx-reader-top-bar-height: calc(50px + env(safe-area-inset-top, 0px));
		--thx-reader-bottom-bar-height: calc(52px + env(safe-area-inset-bottom, 0px));
	}
	.thx-reader-viewport {
		padding: 1.25rem 1.25rem 2rem 1.25rem;
	}
	.thx-reader-book-heading {
		max-width: 140px;
		font-size: 0.875rem;
	}
	.thx-reader-current-chapter-title {
		display: none;
	}
	.thx-reader-flow p {
		text-align: left;
	}
	.thx-reader-settings-popover {
		position: fixed;
		top: auto;
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		border-radius: 20px 20px 0 0;
		max-height: 82vh;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28);
		border-bottom: none;
		border-left: none;
		border-right: none;
		padding: 1.25rem 1rem 2rem 1rem;
	}
	.thx-reader-zen-exit-pill {
		top: 10px;
		right: 12px;
		padding: 5px 11px;
		font-size: 0.75rem;
		opacity: 0.7;
	}

	/* Task 643: Tối ưu chế độ đối chiếu xen kẽ trên Mobile màn hình hẹp (<= 768px) */
	.thx-reader-interleaved-container {
		padding: 1rem 0.75rem;
	}
	.thx-interleaved-block {
		margin-bottom: 1.25rem;
		padding: 1rem;
		border-radius: 8px;
		border-left-width: 3px;
	}
	.thx-interleaved-badge {
		font-size: 0.625rem;
		padding: 2px 6px;
	}
	.thx-interleaved-col p {
		font-size: calc(var(--thx-reader-font-size, 18px) * 0.95);
		line-height: 1.65;
		margin: 0.35rem 0;
	}

	/* Phòng vệ layout dual-pane nếu bị ép render split trên màn hình hẹp */
	.thx-reader-parallel-container {
		flex-direction: column;
	}
	.thx-pane {
		min-width: 100% !important;
		flex: 1 1 auto;
	}
	.thx-splitter {
		display: none !important;
	}
}

/* =========================================================================
   8. THX DOCUMENT & ANNOTATIONS SUPPORT (data-note & col_defs)
   ========================================================================= */
.thx-reader-col-content.thx-reader-col-hidden {
	display: none !important;
}

.thx-reader-flow .thx-annotation,
.thx-annotation {
	border-bottom: 1.5px dashed var(--thx-reader-accent, #059669);
	cursor: help;
	color: inherit;
	text-decoration: none;
	background: rgba(5, 150, 105, 0.08);
	padding: 0 3px;
	border-radius: 3px;
	transition: background 0.2s ease;
	position: relative;
	z-index: 20;
	pointer-events: auto;
}
.thx-reader-flow .thx-annotation:hover,
.thx-annotation:hover {
	background: rgba(5, 150, 105, 0.22);
}

.thx-reader-note-tooltip {
	position: fixed;
	z-index: 999999;
	max-width: 320px;
	background: #1e293b;
	color: #f8fafc;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.5;
	pointer-events: none;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.15s ease;
	word-break: break-word;
}
.thx-reader-note-tooltip.active {
	opacity: 1;
}

.thx-reader-note-modal-backdrop {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(15, 23, 42, 0.55);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	backdrop-filter: blur(2px);
}
.thx-reader-note-modal-card {
	background: var(--thx-reader-bg, #ffffff);
	color: var(--thx-reader-text, #1e293b);
	max-width: 480px;
	width: 100%;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
}
.thx-reader-note-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--thx-reader-border, #e2e8f0);
	font-weight: 700;
	font-size: 15px;
}
.thx-reader-note-modal-close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: var(--thx-reader-muted, #64748b);
}
.thx-reader-note-modal-close:hover {
	color: var(--thx-reader-heading, #0f172a);
}
.thx-reader-note-modal-body {
	font-size: 14px;
	line-height: 1.6;
	color: var(--thx-reader-text, #334155);
}

/* =========================================================================
   FOOTNOTE MODES & STYLING (TASK 221)
   ========================================================================= */

/* 1. Footnote Markers in Text */
.thx-footnote-inline,
.thx-footnote-ref {
	display: inline-block;
	font-size: 0.82em;
	line-height: 1;
	vertical-align: super;
	font-weight: 600;
	color: #059669;
	cursor: pointer;
	margin: 0 1px;
	padding: 0 2px;
	border-radius: 3px;
	transition: background-color 0.2s ease, color 0.2s ease;
	text-decoration: none;
	position: relative;
	z-index: 20;
	pointer-events: auto;
}
.thx-footnote-inline:hover,
.thx-footnote-ref:hover,
.thx-footnote-ref a:hover {
	background-color: rgba(5, 150, 105, 0.18);
	color: #047857;
}
.thx-footnote-ref a {
	color: inherit;
	text-decoration: none;
}

/* 2. Chapter Notes Section (Cuối chương) */
.thx-chapter-notes {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px dashed var(--thx-reader-border, #cbd5e1);
	break-inside: avoid;
	page-break-inside: avoid;
}
.thx-chapter-notes-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin-bottom: 1rem;
	color: var(--thx-reader-heading, #0f172a);
}
.thx-chapter-notes-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.thx-chapter-note-item {
	padding: 8px 12px;
	margin-bottom: 8px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.02);
	border-left: 3px solid #059669;
	font-size: 0.9em;
	line-height: 1.55;
	transition: background 0.3s ease;
}
.thx-chapter-note-num {
	font-weight: 700;
	color: #059669;
	margin-right: 4px;
}
.thx-note-backref {
	display: inline-block;
	margin-left: 6px;
	color: #059669;
	text-decoration: none;
	font-weight: bold;
	padding: 0 4px;
	border-radius: 3px;
	transition: transform 0.2s ease;
}
.thx-note-backref:hover {
	transform: scale(1.2);
}

/* 3. Page Footnotes Section (Chân trang) */
.thx-page-footnotes {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--thx-reader-border, #e2e8f0);
	font-size: 0.85em;
	color: var(--thx-reader-muted, #64748b);
	break-inside: avoid;
	page-break-inside: avoid;
}
.thx-page-footnotes-header {
	font-weight: 600;
	font-size: 0.85em;
	margin-bottom: 6px;
	color: var(--thx-reader-heading, #0f172a);
}
.thx-page-notes-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.thx-page-note-item {
	padding: 4px 0;
	line-height: 1.45;
}
.thx-page-note-num {
	font-weight: 700;
	color: #059669;
	margin-right: 4px;
}

/* 4. Highlight animation khi nhảy anchor */
.thx-note-highlight {
	animation: thxNotePulse 1.8s ease;
}
@keyframes thxNotePulse {
	0% { background-color: rgba(5, 150, 105, 0.35); }
	100% { background-color: transparent; }
}

/* 5. Footnote Pills in Reader Aa Settings Popover */
.thx-reader-fn-pills {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.thx-pill-fn {
	font-size: 11.5px;
	padding: 5px 8px;
}

/* 6. Dynamic Footnote Mode Display Synchronization */
#thx-reader-container[data-footnote-mode="inline_tooltip"] .thx-chapter-notes,
#thx-reader-container[data-footnote-mode="inline_tooltip"] .thx-page-footnotes {
	display: none !important;
}
#thx-reader-container[data-footnote-mode="chapter_note"] .thx-chapter-notes {
	display: block !important;
}
#thx-reader-container[data-footnote-mode="chapter_note"] .thx-page-footnotes {
	display: none !important;
}
#thx-reader-container[data-footnote-mode="page_footnote"] .thx-chapter-notes {
	display: none !important;
}
#thx-reader-container[data-footnote-mode="page_footnote"] .thx-page-footnotes {
	display: block !important;
}

/* ==========================================================================
   TASK 245: SCANNED BOOK PAGES (PHOTO PAGES) STYLES IN E-READER
   ========================================================================== */
.thx-scanned-page-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	min-height: 70vh;
	padding: 15px 10px;
	box-sizing: border-box;
}

.thx-scanned-page-img {
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
	background: #ffffff;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#thx-reader-container[data-theme="sepia"] .thx-scanned-page-img {
	filter: sepia(0.18) contrast(1.02);
	box-shadow: 0 4px 20px rgba(112, 66, 20, 0.16);
}

#thx-reader-container[data-theme="dark"] .thx-scanned-page-img {
	box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
	background: #1e293b;
	border: 1px solid #334155;
}

/* ==========================================================================
   E-READER FULL READING ACL & COPYRIGHT PROTECTION OVERLAY (TASK 318)
   ========================================================================== */

.thx-reader-acl-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 85;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	background: rgba(248, 250, 252, 0.96);
	backdrop-filter: blur(8px);
}

#thx-reader-container[data-theme="sepia"] .thx-reader-acl-overlay {
	background: rgba(244, 236, 216, 0.96);
}

#thx-reader-container[data-theme="dark"] .thx-reader-acl-overlay {
	background: rgba(15, 23, 42, 0.96);
}

.thx-reader-acl-card {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 16px;
	padding: 32px 28px;
	max-width: 520px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	animation: thxAclCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#thx-reader-container[data-theme="sepia"] .thx-reader-acl-card {
	background: #fbf0d9;
	border-color: #d8c29d;
	color: #433422;
}

#thx-reader-container[data-theme="dark"] .thx-reader-acl-card {
	background: #1e293b;
	border-color: #334155;
	color: #f1f5f9;
}

@keyframes thxAclCardPop {
	0% { opacity: 0; transform: scale(0.95) translateY(10px); }
	100% { opacity: 1; transform: scale(1) translateY(0); }
}

.thx-acl-icon {
	font-size: 42px;
	line-height: 1;
	margin-bottom: 12px;
}

.thx-acl-badge {
	display: inline-block;
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.05em;
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 12px;
	text-transform: uppercase;
}

#thx-reader-container[data-theme="dark"] .thx-acl-badge {
	background: rgba(6, 95, 70, 0.3);
	color: #6ee7b7;
	border-color: #059669;
}

.thx-acl-title {
	font-size: 1.25rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 6px 0;
	line-height: 1.35;
}

#thx-reader-container[data-theme="dark"] .thx-acl-title {
	color: #f8fafc;
}

.thx-acl-author {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 16px;
}

#thx-reader-container[data-theme="dark"] .thx-acl-author {
	color: #94a3b8;
}

.thx-acl-desc {
	font-size: 14px;
	line-height: 1.6;
	color: #334155;
	margin: 0 0 24px 0;
}

#thx-reader-container[data-theme="dark"] .thx-acl-desc {
	color: #cbd5e1;
}

.thx-acl-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
	margin-bottom: 16px;
}

.thx-acl-btn-primary {
	background: #059669;
	color: #ffffff !important;
	text-decoration: none;
	padding: 11px 18px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 14px;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: none;
	cursor: pointer;
}

.thx-acl-btn-primary:hover {
	background: #047857;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.thx-acl-btn-login {
	background: #1e3a8a;
	color: #ffffff !important;
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 13px;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.thx-acl-btn-login:hover {
	background: #1d4ed8;
}

.thx-acl-btn-secondary {
	background: #f1f5f9;
	color: #334155 !important;
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 13px;
	border: 1px solid #cbd5e1;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.thx-acl-btn-secondary:hover {
	background: #e2e8f0;
}

#thx-reader-container[data-theme="dark"] .thx-acl-btn-secondary {
	background: #334155;
	color: #e2e8f0 !important;
	border-color: #475569;
}

.thx-acl-note {
	font-size: 12px;
	color: #64748b;
	line-height: 1.5;
	border-top: 1px dashed #e2e8f0;
	padding-top: 12px;
	margin-top: 8px;
}

#thx-reader-container[data-theme="dark"] .thx-acl-note {
	border-color: #334155;
	color: #94a3b8;
}

/* ==========================================================================
   Bilingual Edition Asymmetry & Structural Alignment Styles (Task 634)
   ========================================================================== */

.thx-reader-asymmetry-card {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 22px;
	border-radius: 12px;
	margin: 20px 0 26px 0;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-left: 5px solid #f59e0b;
	color: #92400e;
	box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
	transition: all 0.25s ease;
}

.thx-asymmetry-icon {
	font-size: 1.6rem;
	line-height: 1;
	flex-shrink: 0;
	margin-top: 2px;
}

.thx-asymmetry-body {
	flex: 1;
	min-width: 0;
}

.thx-asymmetry-badge {
	display: inline-block;
	background: #fef3c7;
	color: #b45309;
	border: 1px solid #fcd34d;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 999px;
	margin-bottom: 6px;
}

.thx-asymmetry-title {
	margin: 0 0 6px 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #78350f;
	line-height: 1.4;
}

.thx-asymmetry-desc {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.6;
	color: #92400e;
}

/* Theme variations for Asymmetry Card */
#thx-reader-container[data-theme="sepia"] .thx-reader-asymmetry-card {
	background: #fbf0d9;
	border-color: #e6c594;
	border-left-color: #b45309;
	color: #78350f;
}
#thx-reader-container[data-theme="sepia"] .thx-asymmetry-badge {
	background: #edd5b3;
	border-color: #d6ba90;
	color: #5c2d0c;
}

#thx-reader-container[data-theme="sage"] .thx-reader-asymmetry-card {
	background: #eef5ee;
	border-color: #c2dcc2;
	border-left-color: #3b7a57;
	color: #234e35;
}
#thx-reader-container[data-theme="sage"] .thx-asymmetry-badge {
	background: #ddeadc;
	border-color: #b4d1b4;
	color: #1e462f;
}

#thx-reader-container[data-theme="dark"] .thx-reader-asymmetry-card {
	background: rgba(245, 158, 11, 0.12);
	border-color: rgba(245, 158, 11, 0.35);
	border-left-color: #f59e0b;
	color: #fde68a;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
#thx-reader-container[data-theme="dark"] .thx-asymmetry-title {
	color: #fef08a;
}
#thx-reader-container[data-theme="dark"] .thx-asymmetry-desc {
	color: #fef3c7;
}
#thx-reader-container[data-theme="dark"] .thx-asymmetry-badge {
	background: rgba(245, 158, 11, 0.25);
	border-color: rgba(245, 158, 11, 0.5);
	color: #fef08a;
}

/* Interleaved Asymmetry & Empty styling */
.thx-interleaved-block.thx-is-asymmetric {
	border-left: 3px solid #f59e0b;
	background: rgba(254, 243, 199, 0.15);
}
#thx-reader-container[data-theme="dark"] .thx-interleaved-block.thx-is-asymmetric {
	background: rgba(245, 158, 11, 0.05);
}

.thx-interleaved-empty {
	background: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 10px,
		rgba(156, 163, 175, 0.05) 10px,
		rgba(156, 163, 175, 0.05) 20px
	);
	border: 1px dashed var(--thx-reader-border);
	border-radius: 8px;
	padding: 12px;
	min-height: 60px;
}

.thx-asymmetry-inline-notice {
	margin: 0;
	color: #9ca3af;
	font-size: 0.85rem;
}

/* ==========================================================================
   RESEARCH ASSISTANT TOOLS & HIGHLIGHTER ENGINE (Task 672)
   ========================================================================== */

/* 1. Floating Text Selection Popover */
.thx-reader-selection-popover {
	position: absolute;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: rgba(15, 23, 42, 0.94);
	color: #fff;
	border-radius: 999px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	font-family: var(--thx-reader-font-sans);
	font-size: 13px;
	transform: translate(-50%, -100%);
	pointer-events: auto;
	animation: thxPopoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes thxPopoverFadeIn {
	from {
		opacity: 0;
		transform: translate(-50%, -90%) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translate(-50%, -100%) scale(1);
	}
}

.thx-reader-selection-popover::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%);
	border-width: 6px 6px 0;
	border-style: solid;
	border-color: rgba(15, 23, 42, 0.94) transparent transparent;
	display: block;
	width: 0;
}

.thx-sel-popover-colors {
	display: flex;
	align-items: center;
	gap: 6px;
}

.thx-color-dot {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid transparent;
	cursor: pointer;
	padding: 0;
	transition: transform 0.15s ease, border-color 0.15s ease;
	outline: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
}
.thx-color-dot:hover {
	transform: scale(1.22);
}
.thx-color-dot.active {
	border-color: #fff;
	transform: scale(1.15);
	box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.thx-color-dot.dot-yellow  { background: #facc15; }
.thx-color-dot.dot-green   { background: #4ade80; }
.thx-color-dot.dot-blue    { background: #60a5fa; }
.thx-color-dot.dot-pink    { background: #f472b6; }
.thx-color-dot.dot-orange  { background: #fb923c; }
.thx-color-dot.dot-clear   { background: #ef4444; }

.thx-sel-popover-divider {
	width: 1px;
	height: 18px;
	background: rgba(255, 255, 255, 0.2);
}

.thx-sel-popover-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.thx-sel-btn {
	background: transparent;
	border: none;
	color: #e2e8f0;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 3px;
}
.thx-sel-btn:hover {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

/* 2. Highlight Marks in Text Canvas */
.thx-highlight-mark {
	border-radius: 3px;
	padding: 1px 2px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	position: relative;
}

.thx-highlight-mark.thx-hl-yellow {
	background-color: rgba(254, 240, 138, 0.65);
	border-bottom: 2px solid #eab308;
}
.thx-highlight-mark.thx-hl-green {
	background-color: rgba(187, 247, 208, 0.65);
	border-bottom: 2px solid #22c55e;
}
.thx-highlight-mark.thx-hl-blue {
	background-color: rgba(191, 219, 254, 0.65);
	border-bottom: 2px solid #3b82f6;
}
.thx-highlight-mark.thx-hl-pink {
	background-color: rgba(251, 207, 232, 0.65);
	border-bottom: 2px solid #ec4899;
}
.thx-highlight-mark.thx-hl-orange {
	background-color: rgba(254, 215, 170, 0.65);
	border-bottom: 2px solid #f97316;
}

/* Dark mode highlights */
#thx-reader-container[data-theme="dark"] .thx-highlight-mark.thx-hl-yellow {
	background-color: rgba(234, 179, 8, 0.28);
	border-bottom-color: #facc15;
	color: #fef08a;
}
#thx-reader-container[data-theme="dark"] .thx-highlight-mark.thx-hl-green {
	background-color: rgba(34, 197, 94, 0.28);
	border-bottom-color: #4ade80;
	color: #bbf7d0;
}
#thx-reader-container[data-theme="dark"] .thx-highlight-mark.thx-hl-blue {
	background-color: rgba(59, 130, 246, 0.28);
	border-bottom-color: #60a5fa;
	color: #bfdbfe;
}
#thx-reader-container[data-theme="dark"] .thx-highlight-mark.thx-hl-pink {
	background-color: rgba(236, 72, 153, 0.28);
	border-bottom-color: #f472b6;
	color: #fbcfe8;
}
#thx-reader-container[data-theme="dark"] .thx-highlight-mark.thx-hl-orange {
	background-color: rgba(249, 115, 22, 0.28);
	border-bottom-color: #fb923c;
	color: #fed7aa;
}

.thx-highlight-mark.has-note::after {
	content: '💬';
	font-size: 10px;
	margin-left: 2px;
	vertical-align: super;
	opacity: 0.85;
}

/* 3. Research Assistant Drawer */
.thx-research-drawer {
	width: 440px;
	max-width: 90vw;
	background: var(--thx-reader-bg, #ffffff);
	color: var(--thx-reader-text, #1e293b);
	border-left: 1px solid var(--thx-reader-border, #e2e8f0);
	box-shadow: -8px 0 28px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	z-index: 950;
	right: 0;
	transform: translateX(100%);
	transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.thx-research-drawer.active {
	transform: translateX(0);
}

.thx-research-tabs-nav {
	display: flex;
	background: var(--thx-reader-surface-solid, #f8fafc);
	border-bottom: 1px solid var(--thx-reader-border, #e2e8f0);
	overflow-x: auto;
	scrollbar-width: none;
}
.thx-research-tabs-nav::-webkit-scrollbar {
	display: none;
}

.thx-res-tab-btn {
	flex: 1;
	min-width: 78px;
	padding: 10px 8px;
	border: none;
	background: transparent;
	color: var(--thx-reader-text, #475569);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	transition: all 0.15s ease;
}
.thx-res-tab-btn:hover {
	color: #059669;
	background: rgba(5, 150, 105, 0.05);
}
.thx-res-tab-btn.active {
	color: #059669;
	border-bottom-color: #059669;
	background: var(--thx-reader-bg, #ffffff);
	font-weight: 700;
}

.thx-res-tab-content {
	display: none;
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}
.thx-res-tab-content.active {
	display: block;
}

/* Highlights Tab */
.thx-res-hl-toolbar {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 12px;
}
.thx-res-hl-toolbar input {
	flex: 1;
	padding: 7px 12px;
	border: 1px solid var(--thx-reader-border, #cbd5e1);
	border-radius: 8px;
	font-size: 13px;
	background: var(--thx-reader-bg, #ffffff);
	color: var(--thx-reader-text, #1e293b);
	outline: none;
}
.thx-res-hl-filter-dots {
	display: flex;
	gap: 5px;
}
.thx-filter-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid transparent;
	cursor: pointer;
	padding: 0;
}
.thx-filter-dot[data-filter="all"] {
	background: #94a3b8;
}
.thx-filter-dot.active {
	box-shadow: 0 0 0 2px #059669;
}

.thx-res-hl-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px dashed var(--thx-reader-border, #e2e8f0);
}
.thx-res-mini-btn {
	background: var(--thx-reader-surface-solid, #f1f5f9);
	border: 1px solid var(--thx-reader-border, #cbd5e1);
	color: var(--thx-reader-text, #334155);
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}
.thx-res-mini-btn:hover {
	background: #e2e8f0;
}
.thx-res-mini-btn.btn-danger {
	color: #ef4444;
	border-color: #fecaca;
	background: #fef2f2;
}
.thx-res-mini-btn.btn-danger:hover {
	background: #fee2e2;
}

.thx-hl-card {
	background: var(--thx-reader-surface-solid, #f8fafc);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-left-width: 4px;
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.thx-hl-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.thx-hl-card.hl-yellow { border-left-color: #facc15; }
.thx-hl-card.hl-green  { border-left-color: #4ade80; }
.thx-hl-card.hl-blue   { border-left-color: #60a5fa; }
.thx-hl-card.hl-pink   { border-left-color: #f472b6; }
.thx-hl-card.hl-orange { border-left-color: #fb923c; }

.thx-hl-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
}
.thx-hl-card-quote {
	font-size: 13px;
	line-height: 1.5;
	font-style: italic;
	color: var(--thx-reader-text, #1e293b);
	margin-bottom: 6px;
}
.thx-hl-card-note {
	font-size: 12px;
	background: rgba(5, 150, 105, 0.08);
	border-left: 2px solid #059669;
	padding: 4px 8px;
	border-radius: 4px;
	color: var(--thx-reader-text, #065f46);
	margin-top: 6px;
}
.thx-hl-card-del {
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	font-size: 14px;
	padding: 2px 6px;
}
.thx-hl-card-del:hover {
	color: #ef4444;
}

/* In-depth Search Tab */
.thx-res-search-box {
	margin-bottom: 16px;
}
.thx-res-search-input-wrap {
	display: flex;
	gap: 6px;
}
.thx-res-search-input-wrap input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid var(--thx-reader-border, #cbd5e1);
	border-radius: 8px;
	font-size: 13px;
	background: var(--thx-reader-bg, #ffffff);
	color: var(--thx-reader-text, #1e293b);
	outline: none;
}
.thx-res-search-meta {
	font-size: 12px;
	color: #64748b;
	margin-top: 6px;
}
.thx-res-search-card {
	background: var(--thx-reader-surface-solid, #f8fafc);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: all 0.15s ease;
}
.thx-res-search-card:hover {
	border-color: #059669;
	background: rgba(5, 150, 105, 0.03);
}
.thx-res-search-ch-title {
	font-weight: 700;
	font-size: 13px;
	color: #059669;
	margin-bottom: 4px;
	display: flex;
	justify-content: space-between;
}
.thx-res-search-snippet {
	font-size: 12px;
	line-height: 1.5;
	color: var(--thx-reader-text, #334155);
	margin-bottom: 4px;
}
.thx-res-search-snippet mark {
	background: #fef08a;
	color: #854d0e;
	padding: 1px 3px;
	border-radius: 2px;
	font-weight: 600;
}

/* Concepts Mesh Tab */
.thx-res-concepts-intro {
	font-size: 13px;
	line-height: 1.5;
	padding: 10px 14px;
	background: rgba(14, 165, 233, 0.08);
	border: 1px solid rgba(14, 165, 233, 0.2);
	border-radius: 8px;
	margin-bottom: 14px;
	color: var(--thx-reader-text, #0369a1);
}
.thx-concept-card {
	background: var(--thx-reader-surface-solid, #f8fafc);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 12px;
}
.thx-concept-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--thx-reader-text, #0f172a);
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.thx-concept-model {
	font-size: 11px;
	font-weight: 600;
	color: #2563eb;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	padding: 2px 8px;
	border-radius: 999px;
	display: inline-block;
	margin-bottom: 8px;
}
.thx-concept-desc {
	font-size: 12px;
	line-height: 1.55;
	color: var(--thx-reader-text, #334155);
	margin-bottom: 10px;
}
.thx-concept-conn-heading {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #64748b;
	margin-bottom: 6px;
}
.thx-concept-conn-item {
	padding: 6px 10px;
	background: var(--thx-reader-bg, #ffffff);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-radius: 6px;
	margin-bottom: 6px;
	font-size: 12px;
}
.thx-concept-conn-item a {
	color: #059669;
	font-weight: 600;
	text-decoration: none;
}
.thx-concept-conn-item a:hover {
	text-decoration: underline;
}

/* Analytics Tab */
.thx-res-analytics-scope {
	font-size: 14px;
	font-weight: 700;
	color: var(--thx-reader-text, #0f172a);
	margin-bottom: 12px;
	display: flex;
	justify-content: space-between;
}
.thx-res-stats-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}
.thx-stat-card {
	background: var(--thx-reader-surface-solid, #f8fafc);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-radius: 10px;
	padding: 12px;
	text-align: center;
}
.thx-stat-val {
	font-size: 20px;
	font-weight: 800;
	color: #059669;
	margin-bottom: 2px;
}
.thx-stat-lbl {
	font-size: 11px;
	color: #64748b;
	font-weight: 600;
}
.thx-stat-section-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--thx-reader-text, #1e293b);
	margin-bottom: 8px;
}

/* Citations Tab */
.thx-res-cite-intro {
	font-size: 13px;
	line-height: 1.5;
	padding: 10px 14px;
	background: rgba(16, 185, 129, 0.08);
	border: 1px solid rgba(16, 185, 129, 0.2);
	border-radius: 8px;
	margin-bottom: 14px;
	color: var(--thx-reader-text, #065f46);
}
.thx-cite-card {
	background: var(--thx-reader-surface-solid, #f8fafc);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 12px;
}
.thx-cite-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}
.thx-cite-label {
	font-size: 11px;
	font-weight: 700;
	color: #2563eb;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.thx-cite-body {
	font-size: 12px;
	line-height: 1.55;
	color: var(--thx-reader-text, #334155);
	background: var(--thx-reader-bg, #ffffff);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	border-radius: 6px;
	padding: 8px 10px;
	word-break: break-word;
	font-family: monospace;
	user-select: all;
}
.thx-btn-copy-cite {
	background: #059669;
	color: #fff;
	border: none;
	padding: 4px 10px;
	border-radius: 5px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.thx-btn-copy-cite:hover {
	background: #047857;
}

/* 4. Quick Note Editor Modal */
.thx-reader-note-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(4px);
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: thxModalBackdrop 0.15s ease-out;
}
@keyframes thxModalBackdrop {
	from { opacity: 0; }
	to { opacity: 1; }
}

.thx-reader-note-modal-card {
	width: 480px;
	max-width: 96%;
	background: var(--thx-reader-bg, #ffffff);
	color: var(--thx-reader-text, #1e293b);
	border-radius: 14px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
	border: 1px solid var(--thx-reader-border, #e2e8f0);
	padding: 20px;
	animation: thxModalCard 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes thxModalCard {
	from { transform: scale(0.95) translateY(10px); opacity: 0; }
	to { transform: scale(1) translateY(0); opacity: 1; }
}

.thx-note-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}
.thx-note-modal-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--thx-reader-text, #0f172a);
}
.thx-note-modal-close {
	background: transparent;
	border: none;
	font-size: 20px;
	color: #94a3b8;
	cursor: pointer;
}
.thx-note-modal-close:hover {
	color: #ef4444;
}

.thx-note-modal-quote {
	font-size: 13px;
	line-height: 1.5;
	font-style: italic;
	color: #64748b;
	background: var(--thx-reader-surface-solid, #f8fafc);
	border-left: 3px solid #059669;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 14px;
	max-height: 100px;
	overflow-y: auto;
}

.thx-note-color-picker {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
}

.thx-note-editor-textarea {
	width: 100%;
	height: 110px;
	border: 1px solid var(--thx-reader-border, #cbd5e1);
	border-radius: 8px;
	padding: 10px;
	font-size: 14px;
	line-height: 1.5;
	background: var(--thx-reader-bg, #ffffff);
	color: var(--thx-reader-text, #1e293b);
	font-family: inherit;
	resize: vertical;
	margin-bottom: 16px;
	outline: none;
}
.thx-note-editor-textarea:focus {
	border-color: #059669;
	box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.thx-note-modal-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* ==========================================================================
   Modern Interactive Table of Contents & Book Cover Styles (Task 685)
   ========================================================================== */
.thx-book-cover-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 80vh;
	padding: 24px 16px;
}
.thx-book-cover-wrapper {
	text-align: center;
	margin: 0 auto;
}
.thx-book-cover-full-img {
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
	display: inline-block;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.thx-book-cover-full-img:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.thx-toc-modern-wrapper {
	max-width: 900px;
	margin: 0 auto 30px auto;
	padding: 10px 0;
}
.thx-toc-intro-card {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
	border: 1px solid rgba(16, 185, 129, 0.2);
	border-radius: 14px;
	padding: 24px;
	margin-bottom: 24px;
	text-align: center;
}
.thx-toc-main-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 8px 0;
	color: #0f766e;
}
.thx-toc-subtitle {
	font-size: 14px;
	color: #64748b;
	margin: 0;
	line-height: 1.6;
}
.thx-toc-modern-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.thx-toc-item-link {
	display: block;
	text-decoration: none !important;
	color: inherit !important;
}
.thx-toc-item-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
}
[data-theme="dark"] .thx-toc-item-card {
	background: #1e293b;
	border-color: #334155;
	color: #f1f5f9;
}
[data-theme="sepia"] .thx-toc-item-card {
	background: #fbf0d9;
	border-color: #e4d5b7;
	color: #433422;
}
.thx-toc-item-card:hover {
	transform: translateX(4px);
	border-color: #10b981;
	box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
}
.thx-toc-item-icon {
	font-size: 24px;
	width: 44px;
	height: 44px;
	min-width: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border-radius: 10px;
}
[data-theme="dark"] .thx-toc-item-icon {
	background: #334155;
}
[data-theme="sepia"] .thx-toc-item-icon {
	background: #eedcc0;
}
.thx-toc-item-info {
	flex: 1;
	min-width: 0;
}
.thx-toc-item-title {
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 2px;
}
[data-theme="dark"] .thx-toc-item-title {
	color: #f8fafc;
}
[data-theme="sepia"] .thx-toc-item-title {
	color: #2b1810;
}
.thx-toc-item-desc {
	font-size: 13px;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
[data-theme="dark"] .thx-toc-item-desc {
	color: #94a3b8;
}
[data-theme="sepia"] .thx-toc-item-desc {
	color: #79664f;
}
.thx-toc-item-page {
	font-size: 13px;
	font-weight: 600;
	padding: 4px 12px;
	background: #f0fdf4;
	color: #15803d;
	border-radius: 20px;
	border: 1px solid #bbf7d0;
	white-space: nowrap;
}
[data-theme="dark"] .thx-toc-item-page {
	background: #064e3b;
	color: #6ee7b7;
	border-color: #047857;
}
[data-theme="sepia"] .thx-toc-item-page {
	background: #f1e2c9;
	color: #644018;
	border-color: #dcc49e;
}

/* ==========================================================================
   TASK 708: Ẩn các phần liên quan đến nghiên cứu chuyên sâu trên website THX Library
   (Tạm thời cất đi để anh Thanh xem lại sau)
   ========================================================================== */
#thx-reader-btn-research,
#thx-reader-btn-search,
#thx-reader-btn-highlights,
#thx-reader-research-overlay,
#thx-reader-research-drawer,
#thx-reader-selection-popover,
#thx-reader-note-editor-modal,
.thx-research-drawer,
.thx-res-tab-btn,
.thx-res-tab-content {
	display: none !important;
}

/* ==========================================================================
   TASK 737: CƠ CHẾ INDEX & GIAO DIỆN ĐỐI CHIẾU SONG NGỮ SÁCH '7 HABITS' (EN-VI)
   - Đoạn không có đoạn tương ứng ở sách kia: Hiển thị màu hồng (Unmatched Pink)
   - Đoạn có tương ứng: Highlight màu xanh lá khi được chọn (Matched Green Active)
   - Bảng điều khiển & tìm kiếm đối chiếu song ngữ phân cấp (Heading/Paragraph)
   ========================================================================== */

/* 1. ĐOẠN KHÔNG CÓ TƯƠNG ỨNG Ở SÁCH KIA -> HIỂN THỊ MÀU HỒNG (UNMATCHED PINK) */
.thx-align-unmatched,
[data-align-status="unmatched"] {
	background-color: rgba(244, 63, 94, 0.08) !important;
	border-left: 3px solid #f43f5e !important;
	padding-left: 12px !important;
	padding-right: 8px !important;
	border-radius: 4px;
	position: relative;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}

.thx-align-unmatched:hover,
[data-align-status="unmatched"]:hover {
	background-color: rgba(244, 63, 94, 0.14) !important;
	border-left-color: #e11d48 !important;
	cursor: pointer;
}

/* Thẻ chỉ dẫn độc bản khi hover */
.thx-align-unmatched::before,
[data-align-status="unmatched"]::before {
	content: "🌸 Độc bản";
	display: none;
	position: absolute;
	right: 8px;
	top: -10px;
	font-size: 10px;
	font-weight: 600;
	padding: 1px 6px;
	background: #f43f5e;
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(244, 63, 94, 0.3);
	z-index: 5;
	pointer-events: none;
}

.thx-align-unmatched:hover::before,
[data-align-status="unmatched"]:hover::before {
	display: inline-block;
}

/* 2. ĐOẠN CÓ TƯƠNG ỨNG -> HIGHLIGHT MÀU XANH LÁ KHI ĐƯỢC CHỌN (MATCHED GREEN ACTIVE) */
.thx-align-matched,
[data-align-status="matched"] {
	position: relative;
	cursor: pointer;
	border-radius: 4px;
	transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.thx-align-matched:hover,
[data-align-status="matched"]:hover,
.thx-align-hover-target {
	background-color: rgba(16, 185, 129, 0.08) !important;
	border-left: 3px solid rgba(16, 185, 129, 0.6) !important;
	padding-left: 10px !important;
}

/* KHI ĐƯỢC CHỌN (SELECTED / ACTIVE) -> HIGHLIGHT XANH LÁ ĐẬM ĐÀ RỰC RỠ */
.thx-align-matched.thx-align-selected,
[data-align-status="matched"].thx-align-selected,
.thx-align-active-green,
.thx-matched-target-green {
	background-color: rgba(16, 185, 129, 0.18) !important;
	border-left: 3.5px solid #10b981 !important;
	box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35) !important;
	padding-left: 12px !important;
	padding-right: 8px !important;
	border-radius: 4px;
	animation: thxGreenPulse 1.2s ease-out 1;
}

@keyframes thxGreenPulse {
	0% {
		background-color: rgba(16, 185, 129, 0.35);
		box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4);
	}
	100% {
		background-color: rgba(16, 185, 129, 0.18);
		box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
	}
}

/* Thẻ chỉ dẫn đối chiếu khi hover */
.thx-align-matched:hover::after,
[data-align-status="matched"]:hover::after {
	content: "🔗 Đối chiếu";
	display: inline-block;
	position: absolute;
	right: 8px;
	top: -10px;
	font-size: 10px;
	font-weight: 600;
	padding: 1px 6px;
	background: #10b981;
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
	z-index: 5;
	pointer-events: none;
}

/* 3. TƯƠNG THÍCH MÀU SẮC CHO 4 THEMES (SEPIA, SAGE, DARK OLED) */
/* Sepia Theme */
[data-theme="sepia"] .thx-align-unmatched,
[data-theme="sepia"] [data-align-status="unmatched"] {
	background-color: rgba(225, 29, 72, 0.09) !important;
	border-left-color: #e11d48 !important;
}
[data-theme="sepia"] .thx-align-matched.thx-align-selected,
[data-theme="sepia"] [data-align-status="matched"].thx-align-selected,
[data-theme="sepia"] .thx-align-active-green {
	background-color: rgba(13, 148, 136, 0.16) !important;
	border-left-color: #0d9488 !important;
	box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.35) !important;
}

/* Sage Theme */
[data-theme="sage"] .thx-align-unmatched,
[data-theme="sage"] [data-align-status="unmatched"] {
	background-color: rgba(244, 63, 94, 0.09) !important;
	border-left-color: #f43f5e !important;
}
[data-theme="sage"] .thx-align-matched.thx-align-selected,
[data-theme="sage"] [data-align-status="matched"].thx-align-selected,
[data-theme="sage"] .thx-align-active-green {
	background-color: rgba(16, 185, 129, 0.22) !important;
	border-left-color: #059669 !important;
	box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4) !important;
}

/* Dark OLED Theme */
[data-theme="dark"] .thx-align-unmatched,
[data-theme="dark"] [data-align-status="unmatched"] {
	background-color: rgba(244, 63, 94, 0.16) !important;
	border-left-color: #fb7185 !important;
}
[data-theme="dark"] .thx-align-matched.thx-align-selected,
[data-theme="dark"] [data-align-status="matched"].thx-align-selected,
[data-theme="dark"] .thx-align-active-green {
	background-color: rgba(16, 185, 129, 0.28) !important;
	border-left-color: #34d399 !important;
	box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.4) !important;
}

/* 4. DRAWER BẢNG ĐIỀU HƯỚNG & TÌM KIẾM ĐỐI CHIẾU SONG NGỮ (BILINGUAL DRAWER) */
.thx-bilingual-drawer {
	width: 380px !important;
	max-width: 90vw;
}

.thx-bilingual-header-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	padding: 3px 8px;
	background: rgba(16, 185, 129, 0.12);
	color: #059669;
	border-radius: 12px;
	font-weight: 600;
	margin-left: 8px;
}

.thx-bilingual-filter-pills {
	display: flex;
	gap: 6px;
	padding: 8px 16px;
	background: var(--thx-reader-surface-solid);
	border-bottom: 1px solid var(--thx-reader-border);
}

.thx-bilingual-pill-btn {
	background: var(--thx-reader-bg);
	border: 1px solid var(--thx-reader-border);
	color: var(--thx-reader-muted);
	padding: 4px 10px;
	font-size: 12px;
	border-radius: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-weight: 500;
}

.thx-bilingual-pill-btn:hover {
	border-color: var(--thx-reader-accent);
	color: var(--thx-reader-text);
}

.thx-bilingual-pill-btn.active {
	background: var(--thx-reader-accent);
	color: #ffffff !important;
	border-color: var(--thx-reader-accent);
}

.thx-bilingual-list {
	list-style: none;
	padding: 12px 16px;
	margin: 0;
	overflow-y: auto;
	flex: 1;
}

.thx-bilingual-chapter-group {
	margin-bottom: 16px;
	border-radius: 8px;
	border: 1px solid var(--thx-reader-border);
	overflow: hidden;
	background: var(--thx-reader-surface-solid);
}

.thx-bilingual-ch-header {
	padding: 10px 14px;
	font-weight: 700;
	font-size: 13px;
	background: rgba(0, 0, 0, 0.03);
	border-bottom: 1px solid var(--thx-reader-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
}

.thx-bilingual-item {
	padding: 8px 12px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.04);
	cursor: pointer;
	transition: background 0.15s ease;
	font-size: 12.5px;
	line-height: 1.5;
}

.thx-bilingual-item:last-child {
	border-bottom: none;
}

.thx-bilingual-item:hover {
	background: rgba(0, 0, 0, 0.04);
}

.thx-bilingual-item-heading {
	font-weight: 600;
	color: var(--thx-reader-text);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.thx-bilingual-item-snippet {
	font-size: 12px;
	color: var(--thx-reader-muted);
	margin-top: 4px;
}

.thx-badge-matched {
	display: inline-block;
	font-size: 10px;
	padding: 1px 6px;
	background: rgba(16, 185, 129, 0.15);
	color: #059669;
	border-radius: 8px;
	font-weight: 600;
}

.thx-badge-unmatched {
	display: inline-block;
	font-size: 10px;
	padding: 1px 6px;
	background: rgba(244, 63, 94, 0.15);
	color: #e11d48;
	border-radius: 8px;
	font-weight: 600;
}

/* ==========================================================================
   THX STANDARD TEXT - SENTENCE & PARAGRAPH NUMBERING (FILE MANAGER UX)
   ========================================================================== */

.thx-verse-num-css::before {
	content: attr(data-verse);
}

.thx-verse-num {
	display: inline-block;
	color: #2563eb;
	font-weight: 700;
	margin-right: 4px;
	margin-left: 1px;
	user-select: none;
	font-size: 0.72em;
	cursor: pointer;
	scroll-margin-top: 100px;
	vertical-align: super;
	line-height: 1;
	padding: 1px 4px;
	border-radius: 4px;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.thx-verse-num:hover,
.thx-verse-num.thx-verse-num-active {
	background-color: rgba(37, 99, 235, 0.15);
	color: #1d4ed8;
	text-decoration: underline;
	transform: scale(1.08);
}

.thx-verse-segment {
	transition: background-color 0.2s ease;
	border-radius: 2px;
}

.thx-verse-segment.thx-verse-segment-active {
	background-color: #fef08a !important; /* Soft butter yellow */
	color: inherit;
}

.thx-verse-segment.thx-verse-target-flash {
	background-color: #fde047 !important;
	box-shadow: 0 0 0 2px #facc15;
	border-radius: 4px;
	animation: thxVersePulse 2.2s ease-out;
}

@keyframes thxVersePulse {
	0% { background-color: #facc15; }
	60% { background-color: #fef08a; }
	100% { background-color: transparent; }
}

/* Sepia Theme */
.thx-reader-container[data-theme="sepia"] .thx-verse-num {
	color: #92400e;
}
.thx-reader-container[data-theme="sepia"] .thx-verse-num:hover,
.thx-reader-container[data-theme="sepia"] .thx-verse-num.thx-verse-num-active {
	background-color: rgba(180, 83, 9, 0.15);
	color: #78350f;
}
.thx-reader-container[data-theme="sepia"] .thx-verse-segment.thx-verse-segment-active {
	background-color: #fde68a !important;
}

/* Sage Theme */
.thx-reader-container[data-theme="sage"] .thx-verse-num {
	color: #065f46;
}
.thx-reader-container[data-theme="sage"] .thx-verse-num:hover,
.thx-reader-container[data-theme="sage"] .thx-verse-num.thx-verse-num-active {
	background-color: rgba(5, 150, 105, 0.18);
	color: #047857;
}
.thx-reader-container[data-theme="sage"] .thx-verse-segment.thx-verse-segment-active {
	background-color: #d1fae5 !important;
}

/* Dark Theme */
.thx-reader-container[data-theme="dark"] .thx-verse-num {
	color: #60a5fa;
}
.thx-reader-container[data-theme="dark"] .thx-verse-num:hover,
.thx-reader-container[data-theme="dark"] .thx-verse-num.thx-verse-num-active {
	background-color: rgba(96, 165, 250, 0.22);
	color: #93c5fd;
}
.thx-reader-container[data-theme="dark"] .thx-verse-segment.thx-verse-segment-active {
	background-color: rgba(161, 98, 7, 0.45) !important;
}

/* Numbering Settings Pills in Aa Popover */
.thx-reader-numbering-pills {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}

/* Verse Link & Citation Modal (THX Community standard) */
.thx-verse-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 999998;
	cursor: pointer;
	animation: thxFadeIn 0.2s ease;
}

.thx-verse-link-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #ffffff;
	padding: 24px 22px;
	border-radius: 14px;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
	z-index: 999999;
	width: 360px;
	max-width: 90vw;
	text-align: center;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	animation: thxModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes thxModalPop {
	from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.thx-verse-modal-header {
	margin-bottom: 12px;
}

.thx-verse-modal-badge {
	display: inline-block;
	background: #eff6ff;
	color: #2563eb;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 999px;
	margin-bottom: 6px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.thx-verse-modal-title {
	margin: 0 0 4px 0;
	color: #1e293b;
	font-size: 18px;
	font-weight: 700;
}

.thx-verse-modal-sub {
	margin: 0;
	color: #64748b;
	font-size: 12px;
	font-weight: 500;
}

.thx-verse-modal-quote {
	background: #f8fafc;
	border-left: 3px solid #3b82f6;
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 13px;
	color: #334155;
	line-height: 1.5;
	text-align: left;
	font-style: italic;
	margin-bottom: 14px;
	max-height: 110px;
	overflow-y: auto;
}

.thx-verse-modal-input {
	position: absolute;
	left: -9999px;
	opacity: 0;
}

.thx-verse-modal-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.thx-btn-verse-action {
	width: 100%;
	padding: 11px 14px;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	font-size: 12.5px;
	cursor: pointer;
	letter-spacing: 0.3px;
	transition: all 0.18s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.thx-btn-copy-verse-link {
	background: #059669;
	color: #ffffff;
}
.thx-btn-copy-verse-link:hover {
	background: #047857;
}

.thx-btn-copy-verse-cite {
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #bfdbfe;
}
.thx-btn-copy-verse-cite:hover {
	background: #dbeafe;
}

.thx-btn-bookmark-verse {
	background: #f8fafc;
	color: #475569;
	border: 1px solid #e2e8f0;
}
.thx-btn-bookmark-verse:hover {
	background: #f1f5f9;
}

.thx-btn-close-verse-modal {
	background: #f1f5f9;
	color: #64748b;
	margin-top: 4px;
}
.thx-btn-close-verse-modal:hover {
	background: #e2e8f0;
	color: #334155;
}

.thx-btn-verse-action.copied {
	background: #2563eb !important;
	color: #ffffff !important;
	border-color: #2563eb !important;
}








