/* ===== Nút/giá/nhãn dùng chung (bản riêng của Sách, không phụ thuộc CSS elc-vocab) ===== */

.elc-sach-package {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	max-width: 900px;
	margin: 0 auto;
}

.elc-sach-btn {
	display: inline-block;
	background: #4B8EDE;
	color: #fff;
	padding: 8px 18px;
	border-radius: 10px;
	text-decoration: none;
	font-weight: 600;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

.elc-sach-btn:hover {
	background: #4B8EDE;
	color: #fff;
}

.elc-sach-btn-outline {
	background: #fff;
	color: #4B8EDE;
	border: 1px solid #4B8EDE;
}

.elc-sach-btn-outline:hover {
	background: #EBF7FF;
	color: #4B8EDE;
}

.elc-sach-btn-big {
	display: block;
	text-align: center;
	padding: 12px 20px;
	font-size: 15px;
}

/* Form "Nộp sách" ở Cổng giáo viên */

.elc-sach-teacher-notice {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #86efac;
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-weight: 600;
}

.elc-sach-teacher-notice-error {
	background: #fee2e2;
	color: #991b1b;
	border-color: #fca5a5;
}

.elc-sach-teacher-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 8px;
}

.elc-sach-teacher-table th,
.elc-sach-teacher-table td {
	text-align: left;
	padding: 10px 8px;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: middle;
}

.elc-sach-teacher-table th {
	color: #6b7280;
	font-size: 12px;
	text-transform: uppercase;
}

.elc-sach-teacher-replaceform {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.elc-sach-teacher-newform p {
	margin: 0 0 12px;
}

.elc-sach-teacher-newform input[type="text"] {
	width: 100%;
	max-width: 400px;
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-family: inherit;
	margin-top: 4px;
}

.elc-sach-btn-sm {
	padding: 6px 12px;
	font-size: 13px;
}

.elc-sach-price {
	font-weight: 600;
	color: #1f2937;
}

.elc-sach-price-free {
	color: #16a34a;
}

.elc-sach-badge-ribbon {
	position: absolute;
	top: 12px;
	left: 0;
	z-index: 2;
	background: #dc2626;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 14px 4px 12px;
	border-radius: 0 6px 6px 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ===== Trang 1 cuốn sách (hero) - bìa khổ dọc, khác 16:10 của Từ vựng ===== */

.elc-sach-book-layout {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 28px;
	max-width: 1280px;
	margin: 0 auto 28px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	align-items: start;
}

@media (max-width: 900px) {
	.elc-sach-book-layout {
		grid-template-columns: 1fr;
	}
}

.elc-sach-book-right {
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-width: 0;
}

.elc-sach-hero-left {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.elc-sach-hero-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	align-self: start;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.elc-sach-hero-cover {
	position: relative;
	max-width: 220px;
	margin: 24px auto 0;
}

.elc-sach-hero-cover img {
	width: 100%;
	display: block;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.elc-sach-hero-cover-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 2 / 3;
	font-size: 56px;
	background: #f3f4f6;
	border-radius: 8px;
}

.elc-sach-hero-card-body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	text-align: center;
}

.elc-sach-hero-price {
	font-size: 22px;
	font-weight: 700;
}

.elc-sach-hero-progress {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: #6b7280;
}

.elc-sach-hero-progress .elc-progress-bar {
	flex: 1;
	position: relative;
	background: #eef0f4;
	border-radius: 999px;
	height: 8px;
	overflow: hidden;
}

.elc-sach-hero-progress .elc-progress-bar span {
	position: absolute;
	inset: 0 auto 0 0;
	background: #16a34a;
	border-radius: 999px;
}

.elc-sach-hero-meta {
	list-style: none;
	margin: 0;
	padding: 12px 0 0;
	border-top: 1px solid #f3f4f6;
	display: flex;
	justify-content: center;
	gap: 16px;
	font-size: 14px;
	color: #4b5563;
}

.elc-sach-hero-tags {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.elc-sach-hero-tag {
	background: #EBF7FF;
	color: #4B8EDE;
	font-size: 12px;
	font-weight: 700;
	border-radius: 999px;
	padding: 4px 12px;
}

.elc-sach-hero-right {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	padding: 28px 32px;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.elc-sach-hero-title {
	font-size: 30px;
	margin: 0 0 4px;
}

.elc-sach-hero-author {
	color: #9ca3af;
	font-size: 15px;
	margin: 0 0 14px;
}

.elc-sach-hero-desc {
	line-height: 1.7;
	color: #374151;
}

.elc-sach-top-readers,
.elc-sach-hero-left .elc-vocab-top-students,
.elc-sach-banner,
.elc-sach-top-banner {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

.elc-sach-top-readers,
.elc-sach-hero-left .elc-vocab-top-students {
	padding: 20px;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.elc-sach-top-readers h3,
.elc-sach-hero-left .elc-vocab-top-students h3 {
	margin: 0 0 14px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.4;
	letter-spacing: -0.035em;
	color: #4B8EDE;
	font-weight: 800;
}

.elc-sach-top-readers ol,
.elc-sach-hero-left .elc-vocab-top-students ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.elc-sach-top-readers li,
.elc-sach-hero-left .elc-vocab-top-students li {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	min-width: 0;
}

.elc-sach-top-rank,
.elc-sach-hero-left .elc-vocab-top-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	background: #EBF7FF;
	color: #4B8EDE;
	font-size: 12px;
	font-weight: 700;
}

.elc-sach-top-name,
.elc-sach-hero-left .elc-vocab-top-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.elc-sach-top-readers li:nth-child(-n+3) .elc-sach-top-name,
.elc-sach-hero-left .elc-vocab-top-students li:nth-child(-n+3) .elc-vocab-top-name {
	color: #ec4899;
	font-weight: 800;
}

.elc-sach-top-count {
	font-weight: 700;
	color: #4B8EDE;
}

.elc-sach-hero-left .elc-vocab-top-count {
	color: #6b7280;
	font-size: 12px;
	font-weight: 600;
}

.elc-sach-banner img,
.elc-sach-top-banner img {
	width: 100%;
	display: block;
}

.elc-sach-top-banner {
	max-width: 1280px;
	margin: 0 auto 20px;
}

/* ===== Mục lục ===== */

.elc-sach-toc {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	padding: 20px 24px;
}

.elc-sach-toc-title {
	margin-top: 0;
	font-size: 20px;
}

.elc-sach-toc-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f3f4f6;
}

.elc-sach-toc-item:last-child {
	border-bottom: none;
}

.elc-sach-toc-lock {
	opacity: 0.6;
}

.elc-sach-toc-item-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* ===== Trang danh sách [elc_sach_catalog] - copy cấu trúc lọc-tag của elc-vocab, bìa khổ dọc ===== */

.elc-sach-catalog-layout {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	max-width: 1600px;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: 'EB Garamond', Georgia, serif;
}

.elc-sach-catalog {
	flex: 1;
	min-width: 0;
}

.elc-sach-catalog-filter {
	flex: 0 0 220px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	padding: 18px 20px;
	position: sticky;
	top: 24px;
}

.elc-sach-catalog-filter-title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 700;
}

.elc-sach-catalog-filter-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	padding: 6px 0;
	cursor: pointer;
}

.elc-sach-catalog-filter-count {
	margin-left: auto;
	color: #9ca3af;
	font-size: 12px;
}

.elc-sach-catalog-banner {
	flex: 0 0 220px;
	align-self: stretch;
}

.elc-sach-catalog-banner img {
	width: 100%;
	height: 100%;
	aspect-ratio: 9 / 16;
	object-fit: cover;
	border-radius: 14px;
	display: block;
}

.elc-sach-catalog-yearpass {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	background: linear-gradient(120deg, #4B8EDE, #4B8EDE);
	color: #fff;
	border-radius: 18px;
	padding: 20px 28px;
	margin-bottom: 28px;
}

.elc-sach-catalog-yearpass-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.elc-sach-catalog-yearpass-info strong {
	font-size: 18px;
}

.elc-sach-catalog-yearpass .elc-sach-price {
	color: #EBF7FF;
}

.elc-sach-catalog-yearpass .elc-sach-btn {
	background: #fff;
	color: #4B8EDE;
}

/* Các lựa chọn thời hạn trong banner combo (1 tháng / 3 tháng / 1 năm) */
.elc-sach-combo-options {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.elc-sach-combo-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 12px;
	padding: 10px 16px;
	min-width: 110px;
}

.elc-sach-combo-option-label {
	font-weight: 700;
	font-size: 14px;
}

.elc-sach-combo-option-price {
	font-size: 13px;
	color: #EBF7FF;
}

.elc-sach-combo-option-price del {
	color: rgba(224, 231, 255, 0.6);
}

.elc-sach-combo-option .elc-sach-btn {
	padding: 5px 18px;
	font-size: 13px;
}

.elc-sach-catalog-heading {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px;
}

.elc-sach-catalog-group {
	background: #fdf2f8;
	border-radius: 18px;
	padding: 20px 24px;
	margin-bottom: 28px;
}

/* Card nhỏ CỐ ĐỊNH riêng trong khối "Lọc theo thẻ": 150px/cuốn, không co giãn theo màn hình
   (dùng minmax cố định + justify-content thay vì 1fr, để màn rộng không kéo card to ra). */
.elc-sach-catalog-group .elc-sach-catalog-row {
	grid-template-columns: repeat(5, minmax(0, 150px));
	justify-content: start;
	gap: 12px;
}

@media (max-width: 900px) {
	.elc-sach-catalog-group .elc-sach-catalog-row {
		grid-template-columns: repeat(3, minmax(0, 150px));
	}
}

@media (max-width: 560px) {
	.elc-sach-catalog-group .elc-sach-catalog-row {
		grid-template-columns: repeat(2, minmax(0, 150px));
	}
}

.elc-sach-catalog-group .elc-sach-catalog-card-title {
	font-size: 13px;
}

.elc-sach-catalog-see-more {
	display: inline-block;
	margin-top: 14px;
	color: #4B8EDE;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.elc-sach-catalog-see-more:hover {
	text-decoration: underline;
}

.elc-sach-catalog-back {
	display: inline-block;
	margin-bottom: 16px;
	color: #4B8EDE;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.elc-sach-catalog-back:hover {
	text-decoration: underline;
}

.elc-sach-catalog-row {
	display: grid;
	grid-template-columns: repeat(9, 1fr);
	gap: 16px;
}

@media (max-width: 900px) {
	.elc-sach-catalog-row {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 560px) {
	.elc-sach-catalog-row {
		grid-template-columns: 1fr;
	}
}

.elc-sach-catalog-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.elc-sach-catalog-card:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.elc-sach-catalog-thumb {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	background: #f3f4f6;
	overflow: hidden;
}

.elc-sach-catalog-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.elc-sach-catalog-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 40px;
}

.elc-sach-catalog-card-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.elc-sach-catalog-card-title {
	font-weight: 600;
	color: #1f2937;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.4;
	font-family: 'Inter', sans-serif;
}

.elc-sach-catalog-card:hover .elc-sach-catalog-card-title {
	color: #4B8EDE;
}

.elc-sach-catalog-card-author {
	color: #9ca3af;
	font-size: 12.5px;
	font-family: 'Inter', sans-serif;
}

.elc-sach-catalog-empty {
	color: #6b7280;
	padding: 24px 0;
}

.elc-sach-catalog-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 24px;
}

.elc-sach-catalog-page-btn {
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	color: #4b5563;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}

.elc-sach-catalog-page-btn:hover {
	border-color: #4B8EDE;
	color: #4B8EDE;
}

.elc-sach-catalog-page-btn.active {
	background: #4B8EDE;
	border-color: #4B8EDE;
	color: #fff;
}

#elc-sach-catalog-results.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

@media (max-width: 1024px) {
	.elc-sach-catalog-layout {
		flex-direction: column;
	}

	.elc-sach-catalog-filter,
	.elc-sach-catalog-banner {
		flex-basis: auto;
		width: 100%;
		position: static;
	}

	.elc-sach-catalog-banner img {
		aspect-ratio: 16 / 9;
	}
}

/* ===== Trang đọc [elc_sach_reader] - full màn hình, cuộn phẳng kiểu WeRead, không lật trang 3D =====
   Trang này dùng template riêng (templates/reader-fullscreen.php, không qua
   header/footer của theme) nên phải tự reset html/body - không dựa vào CSS
   theme vì theme không được load quanh trang này. */

html:has(body.elc-sach-reader-fullscreen-body),
body.elc-sach-reader-fullscreen-body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: #f9fafb;
}

/* 3 chế độ màu: sepia (mặc định, giấy ngà) - light (trắng sáng bình thường) -
   dark. --elc-sach-outer-bg là nền NGOÀI "trang sách" (xám nhạt kiểu WeRead),
   --elc-sach-page-bg là nền của chính khối nội dung đang đọc. */
.elc-sach-reader {
	--elc-sach-outer-bg: #e9e9ea;
	--elc-sach-page-bg: #f7f3ea;
	--elc-sach-text: #2b2b2b;
	--elc-sach-muted: #8a8a8a;
	font-family: 'EB Garamond', Georgia, serif;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	margin: 0;
	background: var(--elc-sach-outer-bg);
	color: var(--elc-sach-text);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.elc-sach-reader[data-theme="light"] {
	--elc-sach-outer-bg: #eceef1;
	--elc-sach-page-bg: #ffffff;
	--elc-sach-text: #1f2937;
	--elc-sach-muted: #6b7280;
}

.elc-sach-reader[data-theme="dark"] {
	/* Tông than xám dịu kiểu WeRead: tránh nền đen tuyệt đối và chữ trắng gắt. */
	--elc-sach-outer-bg: #272728;
	--elc-sach-page-bg: #1f1f20;
	--elc-sach-text: #b8babd;
	--elc-sach-muted: #7f8388;
	color-scheme: dark;
}

.elc-sach-reader-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 24px;
	flex: 0 0 auto;
	color: var(--elc-sach-muted);
	font-size: 13px;
}

/* Nhóm indicator trang + streak lại thành 1 khối bên phải, để topbar luôn
   chỉ có đúng 2 phần tử flex (nút back trái / nhóm này phải) - space-between
   không bao giờ bị lệch dù thêm badge mới. */
.elc-sach-reader-topbar-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Badge streak kiểu "capsule" macOS: viền mảnh + bo tròn hết cỡ, cùng chiều
   cao dòng chữ với page-indicator bên cạnh nên không lồi lõm. 2 trạng thái:
   đã đọc hôm nay (ấm, nổi bật) / chưa đọc hôm nay (trung tính, hoà với topbar). */
.elc-sach-streak-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 28px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	font-size: 13px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
	color: var(--elc-sach-muted);
	background: transparent;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.elc-sach-streak-badge[data-goal-met="1"] {
	color: #b45309;
	border-color: rgba(245, 158, 11, 0.35);
	background: rgba(245, 158, 11, 0.14);
}

.elc-sach-reader-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 15px;
	border: 1px solid rgba(100, 116, 139, 0.18);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.78);
	color: var(--elc-sach-text);
	text-decoration: none;
	font-weight: 500;
	font-size: 13px;
	cursor: pointer;
	font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
	transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.elc-sach-reader-btn:hover {
	border-color: rgba(75, 142, 222, 0.55);
	color: #4B8EDE;
	background: #fff;
	box-shadow: 0 5px 16px rgba(15, 23, 42, 0.09);
	transform: translateY(-1px);
}

.elc-sach-reader-btn.is-active {
	background: #EBF7FF;
	border-color: rgba(75, 142, 222, 0.42);
	color: #4B8EDE;
}

.elc-sach-reader-btn-icon {
	width: 38px;
	padding: 0;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 24px;
	font-weight: 400;
	line-height: 1;
}

.elc-sach-reader[data-theme="dark"] .elc-sach-reader-btn {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
}

.elc-sach-reader[data-theme="dark"] .elc-sach-reader-btn:hover,
.elc-sach-reader[data-theme="dark"] .elc-sach-reader-btn.is-active {
	background: rgba(75, 142, 222, 0.16);
	border-color: rgba(75, 142, 222, 0.52);
}

.elc-sach-reading-anchor {
	display: inline-block;
	width: 0;
	height: 0;
	overflow: hidden;
	vertical-align: baseline;
}

/* Không tràn viền: "thân sách" là 1 khối căn giữa, có max-width + bo góc +
   đổ bóng như 1 cuốn sách thật trên nền xám nhạt xung quanh (kiểu WeRead),
   không kéo full 100vw như bản cũ. */
.elc-sach-reader-body {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	justify-content: center;
	padding: 20px clamp(16px, 4vw, 56px) 8px;
	box-sizing: border-box;
	gap: 20px;
}

.elc-sach-reader-pages {
	position: relative;
	flex: 1 1 auto;
	max-width: 1900px;
	min-width: 0;
	background: var(--elc-sach-page-bg);
	border-radius: 14px;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.14);
	overflow: hidden;
}

#elc-sach-reader-viewport {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	padding: 44px 56px;
	box-sizing: border-box;
}

/* Vạch chia đôi giữa 2 cột, mô phỏng gáy sách - căn giữa đúng tâm khe cột vì
   padding trái/phải của viewport bằng nhau (56px cả 2 bên). */
#elc-sach-reader-viewport::after {
	content: '';
	position: absolute;
	top: 44px;
	bottom: 44px;
	left: 50%;
	width: 1px;
	background: rgba(0, 0, 0, 0.08);
	pointer-events: none;
}

#elc-sach-reader-columns {
	transition: transform 0.25s ease;
	font-family: 'EB Garamond', Georgia, serif;
	line-height: 1.9;
	text-align: justify;
	column-gap: 64px;
	column-fill: auto;
}

#elc-sach-reader-columns p,
#elc-sach-reader-columns h2,
#elc-sach-reader-columns h3,
#elc-sach-reader-columns li {
	break-inside: avoid;
	margin: 0 0 1.1em;
}

#elc-sach-reader-columns h2 {
	font-size: 1.3em;
	text-align: left;
	text-indent: 0;
	color: inherit;
}

/* Bảng (VD bảng từ vựng/collocation) PHẢI nằm gọn trong 1 cột như đoạn văn
   (không "phá cột" chiếm cả 2 cột - lúc đầu làm vậy user báo lại là nhìn như
   bảng tràn sang "trang bên"). Ép vừa 1 cột bằng cách: cỡ chữ nhỏ hơn, đệm ô
   hẹp lại, `table-layout:fixed` để cột chia đều thay vì tự co giãn theo nội
   dung dài. Bảng dài hơn 1 cột thì tự chảy tiếp sang cột kế - GIỐNG HỆT cách
   đoạn văn dài chảy sang cột sau, không phải lỗi (`break-inside:avoid` chỉ
   đặt ở <tr> để không cắt đôi 1 dòng bảng, KHÔNG đặt ở <table> để không biến
   cả bảng thành 1 khối cứng không cắt được). */
#elc-sach-reader-columns table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0 0 1.4em;
	font-size: 0.78em;
	text-align: left;
}

#elc-sach-reader-columns table tr {
	break-inside: avoid;
}

#elc-sach-reader-columns table td {
	border: 1px solid rgba(0, 0, 0, 0.14);
	padding: 5px 7px;
	vertical-align: top;
	text-align: left;
	word-break: break-word;
}

/* max-height đề phòng ảnh khổ dọc (chân dung) cao hơn hẳn 1 cột đọc - không
   ép nó tràn quá khỏi vùng nhìn thấy (viewport overflow:hidden sẽ cắt cụt
   phần dư nếu không giới hạn trước). */
#elc-sach-reader-columns img {
	max-width: 100%;
	max-height: 65vh;
	display: block;
	margin: 0 auto;
	object-fit: contain;
}

/* Chỉ chiếm đúng vùng lề trắng (bằng padding trái/phải của viewport, xem
   #elc-sach-reader-viewport) - trước đây 12% (rộng theo % cả trang) lấn sâu
   vào cả vùng chữ trên màn hình rộng, khiến bấm vào từ vựng gần rìa bị lật
   trang thay vì hiện hộp thoại nghĩa từ. */
.elc-sach-reader-navzone {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 48px;
	background: transparent;
	border: none;
	cursor: pointer;
	z-index: 2;
}

.elc-sach-reader-navzone-prev {
	left: 0;
}

.elc-sach-reader-navzone-next {
	right: 0;
}

/* Nút "Trang trước / Trang tiếp theo" hiện rõ ở 2 góc dưới, giống WeRead -
   navzone ở trên vẫn giữ để bấm nhanh bất kỳ đâu ở rìa trái/phải, nút này
   chỉ để hiện RÕ chữ (z-index cao hơn nên nằm trên navzone, luôn bắt được click). */
.elc-sach-reader-navlabel {
	position: absolute;
	bottom: 16px;
	z-index: 3;
	background: none;
	border: none;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--elc-sach-muted);
	cursor: pointer;
	padding: 6px 12px;
	border-radius: 6px;
}

.elc-sach-reader-navlabel:hover {
	color: #4B8EDE;
	background: rgba(75, 142, 222, 0.08);
}

.elc-sach-reader-navlabel-prev {
	left: 16px;
}

.elc-sach-reader-navlabel-next {
	right: 16px;
}

.elc-sach-reader-toc {
	flex: 0 0 260px;
	border-left: 1px solid rgba(0, 0, 0, 0.08);
	padding: 20px;
	overflow-y: auto;
	background: var(--elc-sach-outer-bg);
}

.elc-sach-reader-toc h3 {
	margin-top: 0;
	font-size: 16px;
	line-height: 1.35;
	font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.elc-sach-reader-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.elc-sach-reader-toc li {
	margin-bottom: 4px;
}

.elc-sach-reader-toc-vocab {
	display: block;
	padding: 2px 6px 8px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--elc-sach-muted);
	text-decoration: none;
}

.elc-sach-reader-toc-vocab:hover {
	color: #4B8EDE;
	text-decoration: underline;
}

.elc-sach-reader-toc button {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	padding: 8px 6px;
	border-radius: 8px;
	cursor: pointer;
	font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--elc-sach-text);
}

.elc-sach-reader-toc button:hover {
	background: rgba(75, 142, 222, 0.1);
	color: #4B8EDE;
}

.elc-sach-reader-rail {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 12px 14px 14px;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

/* Highlight/gạch chân - bọc trực tiếp vào text thật nên tự trôi theo khi đổi cỡ chữ. */
.elc-sach-hl-highlight.elc-sach-hl-color-yellow { background: #fef08a; }
.elc-sach-hl-highlight.elc-sach-hl-color-green  { background: #bbf7d0; }
.elc-sach-hl-highlight.elc-sach-hl-color-pink   { background: #fbcfe8; }
.elc-sach-hl-highlight.elc-sach-hl-color-blue   { background: #EBF7FF; }

.elc-sach-hl-underline {
	background: none;
	border-bottom: 2px solid #16a34a;
}

/* Gạch sóng kiểu WeRead: đường lượn sóng thật (SVG hình sin lặp lại theo
   chiều ngang), không phải vạch chéo gạch nối như bản cũ - và đổi màu từ đỏ
   gắt sang xanh dương nhạt cho giống ảnh mẫu WeRead user gửi. */
.elc-sach-hl-wavy {
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M0 3 Q3 0 6 3 T12 3' fill='none' stroke='%232563eb' stroke-width='1.4'/%3E%3C/svg%3E");
	background-repeat: repeat-x;
	background-position: 0 100%;
	background-size: 12px 6px;
	text-decoration: none;
	border-bottom: none;
	padding-bottom: 4px;
}

/* Thanh chức năng bôi đen kiểu WeRead: nền sáng, icon + chú thích nhỏ bên
   dưới, các nhóm chức năng cách nhau bằng vạch dọc mảnh - thay cho bản cũ
   (nền tối + 2 nút chữ) trông rời rạc và không giống WeRead. */
.elc-sach-highlight-popup {
	position: absolute;
	display: flex;
	align-items: stretch;
	gap: 2px;
	background: #ffffff;
	padding: 8px 10px;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	z-index: 20;
}

/* .elc-sach-highlight-popup { display: flex } ở trên đè luôn cả UA stylesheet
   [hidden]{display:none} (CSS tác giả luôn thắng UA stylesheet bất kể độ đặc
   hiệu) - nếu không có dòng dưới đây thì popup sẽ LUÔN hiện, kể cả khi có
   thuộc tính hidden, đứng lì ở vị trí top:0/left:0 mặc định. */
.elc-sach-highlight-popup[hidden] {
	display: none;
}

/* Gạch chân RẤT mờ những từ đã có trong bộ từ vựng của sách (nút "Từ vựng" ở
   rail) - cố tình để nhạt, không lấn át chữ thật, chỉ đủ gợi ý "từ này có
   tra được nghĩa". */
.elc-sach-vocab-word {
	border-bottom: 1.5px dotted rgba(75, 142, 222, 0.4);
	cursor: pointer;
}

.elc-sach-vocab-word:hover {
	border-bottom-color: rgba(75, 142, 222, 0.85);
}

/* Hộp thoại nghĩa của 1 từ - cùng ngôn ngữ khung nổi với .elc-sach-highlight-popup (bo góc, đổ bóng, nền trắng). */
.elc-sach-vocab-popup {
	position: absolute;
	width: 260px;
	background: #ffffff;
	padding: 16px 18px;
	border-radius: 14px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	z-index: 21;
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

.elc-sach-vocab-popup[hidden] {
	display: none;
}

.elc-sach-vocab-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.elc-sach-vocab-popup-close {
	background: none;
	border: none;
	font-size: 12px;
	font-weight: 600;
	color: #9ca3af;
	cursor: pointer;
	padding: 4px 2px;
	line-height: 1;
}

.elc-sach-vocab-popup-close:hover {
	color: #1f2937;
}

.elc-sach-vocab-popup-star {
	background: #f3f4f6;
	border: none;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 6px 12px;
}

.elc-sach-vocab-popup-star.is-starred {
	background: #fef3c7;
	color: #92400e;
}

.elc-sach-vocab-popup-word {
	font-size: 19px;
	font-weight: 700;
	color: #1f2937;
}

.elc-sach-vocab-popup-phonetic {
	font-size: 13px;
	color: #6b7280;
	margin-top: 2px;
}

.elc-sach-vocab-popup-pos {
	display: inline-block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #4B8EDE;
	font-weight: 600;
	margin-top: 8px;
}

.elc-sach-vocab-popup-meaning {
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
	margin-top: 6px;
}

.elc-sach-vocab-popup-example {
	font-size: 13px;
	font-style: italic;
	color: #6b7280;
	margin-top: 8px;
}

.elc-sach-vocab-popup-example:empty,
.elc-sach-vocab-popup-meaning:empty {
	display: none;
}

/* Popup API độc lập với từ vựng theo sách. Dùng fixed để không tham gia dàn
   cột và không làm thay đổi vị trí trang khi hiện/ẩn. */
.elc-sach-dictionary-popup {
	position: fixed;
	width: min(340px, calc(100vw - 24px));
	box-sizing: border-box;
	background: #ffffff;
	padding: 16px 18px 17px;
	border: 1px solid #dbe7e3;
	border-radius: 16px;
	box-shadow: 0 16px 42px rgba(31, 41, 55, 0.18);
	z-index: 30;
	pointer-events: auto;
	font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.elc-sach-dictionary-popup[hidden] {
	display: none;
}

.elc-sach-dictionary-head,
.elc-sach-dictionary-pronunciation {
	display: flex;
	align-items: center;
}

.elc-sach-dictionary-head {
	justify-content: space-between;
	gap: 12px;
}

.elc-sach-dictionary-word {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #172b26;
}

.elc-sach-dictionary-actions {
	display: flex;
	align-items: center;
	gap: 7px;
}

.elc-sach-dictionary-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid rgba(26, 84, 69, 0.08);
	border-radius: 50%;
	background: #e4f3ee;
	color: #205f4f;
	cursor: pointer;
	transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.elc-sach-dictionary-icon:hover { background: #d7eee7; box-shadow: 0 4px 12px rgba(32, 95, 79, .14); transform: translateY(-1px); }
.elc-sach-dictionary-icon:active { transform: scale(.94); }
.elc-sach-dictionary-icon:focus-visible { outline: 2px solid #17866a; outline-offset: 2px; }
.elc-sach-dictionary-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.elc-sach-dictionary-save { background: #f6f7f7; color: #536760; }
.elc-sach-dictionary-save:hover { background: #fff3cd; color: #9a6b00; }
.elc-sach-dictionary-save.is-saved { background: #fff3cd; color: #9a6b00; }
.elc-sach-dictionary-save.is-saved svg { fill: currentColor; }
.elc-sach-dictionary-audio[hidden] { display: none; }

.elc-sach-dictionary-pronunciation {
	gap: 8px;
	margin-top: 4px;
}

.elc-sach-dictionary-phonetic {
	font-size: 13px;
	color: #547168;
}

.elc-sach-dictionary-pos {
	padding: 2px 8px;
	border-radius: 999px;
	background: #e4f3ee;
	font-size: 11px;
	font-weight: 750;
	text-transform: uppercase;
	color: #28765f;
}

.elc-sach-dictionary-meaning {
	margin-top: 9px;
	padding: 9px 11px;
	border-left: 3px solid #3a9b7c;
	border-radius: 0 8px 8px 0;
	background: #f0f8f5;
	font-size: 15px;
	font-weight: 700;
	color: #1d4f40;
}

.elc-sach-dictionary-definition {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.55;
	color: #344b44;
}

.elc-sach-dictionary-example,
.elc-sach-dictionary-synonyms {
	margin-top: 9px;
	font-size: 12px;
	line-height: 1.5;
	color: #71827c;
}

.elc-sach-dictionary-example { font-style: italic; }
.elc-sach-dictionary-example:empty,
.elc-sach-dictionary-synonyms:empty { display: none; }
}

/* Panel audio "đang nghe": nổi cố định phía trên thanh công cụ dưới cùng
   (position: fixed) - KHÔNG chiếm chỗ trong layout flex của .elc-sach-reader
   nên không đẩy lệch trang/thanh rail khi bật/tắt. Cùng bo góc + đổ bóng với
   .elc-sach-highlight-popup (12-14px, shadow tương tự) để đồng bộ 1 ngôn ngữ
   thiết kế cho mọi khung nổi trong trang đọc. */
.elc-sach-audio-panel {
	position: fixed;
	left: 50%;
	bottom: 78px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 16px;
	background: #ffffff;
	padding: 10px 20px;
	border-radius: 14px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	z-index: 15;
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

.elc-sach-audio-panel[hidden] {
	display: none;
}

.elc-sach-audio-panel-title {
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
	white-space: nowrap;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.elc-sach-audio-panel audio {
	height: 32px;
	max-width: 320px;
}

/* Ô tìm kiếm nổi kiểu Spotlight macOS: viên thuốc bo tròn hết cỡ, nổi cố định
   gần đầu trang (position: fixed, không chiếm chỗ trong layout) - cùng ngôn
   ngữ thiết kế (bo góc + đổ bóng) với panel audio/highlight popup. */
.elc-sach-search-panel {
	position: fixed;
	top: 70px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 4px;
	height: 44px;
	background: #ffffff;
	padding: 4px 6px 4px 18px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	z-index: 16;
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
	box-sizing: border-box;
}

.elc-sach-search-panel[hidden] {
	display: none;
}

.elc-sach-search-input {
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
	font-family: inherit;
	color: #1f2937;
	width: 220px;
	height: 100%;
}

.elc-sach-search-status {
	font-size: 12px;
	font-weight: 600;
	color: #9ca3af;
	white-space: nowrap;
	min-width: 42px;
	text-align: center;
}

/* 3 nút tròn cùng 32px - đối xứng với nhau, căn giữa theo chiều dọc trong panel 44px. */
.elc-sach-search-nav,
.elc-sach-search-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #4b5563;
	cursor: pointer;
	font-size: 16px;
	font-family: inherit;
	line-height: 1;
}

.elc-sach-search-nav:hover,
.elc-sach-search-close:hover {
	background: #f3f4f6;
	color: #1f2937;
}

.elc-sach-search-nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.elc-sach-search-nav:disabled:hover {
	background: transparent;
}

/* Tô sáng tạm thời khi tìm kiếm - KHÁC màu với highlight vĩnh viễn học viên tự
   tô (elc-sach-hl-*) để phân biệt rõ đây chỉ là kết quả tìm, không lưu lại. */
.elc-sach-search-mark {
	background: #fde68a;
	color: inherit;
	border-radius: 2px;
}

.elc-sach-search-mark.is-active {
	background: #fb923c;
	color: #fff;
}

.elc-sach-hl-group-colors {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 0 8px;
}

.elc-sach-hl-swatch {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
	cursor: pointer;
	padding: 0;
}

.elc-sach-hl-swatch:hover {
	box-shadow: 0 0 0 2px rgba(75, 142, 222, 0.5);
}

.elc-sach-hl-divider {
	width: 1px;
	align-self: stretch;
	margin: 2px 2px;
	background: rgba(0, 0, 0, 0.08);
}

.elc-sach-hl-icon-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	background: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	padding: 2px 12px;
	border-radius: 8px;
	color: #374151;
}

.elc-sach-hl-icon-btn:hover {
	background: rgba(75, 142, 222, 0.08);
	color: #4B8EDE;
}

.elc-sach-hl-icon-a {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
}

.elc-sach-hl-icon-underline {
	border-bottom: 2px solid #16a34a;
}

.elc-sach-hl-icon-wavy {
	border-bottom: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M0 3 Q3 0 6 3 T12 3' fill='none' stroke='%232563eb' stroke-width='1.4'/%3E%3C/svg%3E");
	background-position: 0 100%;
	background-size: 10px 5px;
	background-repeat: repeat-x;
	padding-bottom: 3px;
}

.elc-sach-hl-icon-label {
	font-size: 10px;
	white-space: nowrap;
}

/* Chế độ bảo vệ mắt: tất cả bề mặt nổi cũng dùng than xám để không xuất hiện
   mảng trắng chói khi tra từ, tìm kiếm, nghe hoặc bôi chọn trong lúc đọc tối. */
.elc-sach-reader[data-theme="dark"] .elc-sach-reader-pages {
	border: 1px solid rgba(255, 255, 255, 0.035);
	box-shadow: 0 12px 38px rgba(0, 0, 0, 0.22);
}

.elc-sach-reader[data-theme="dark"] #elc-sach-reader-viewport::after {
	background: rgba(255, 255, 255, 0.055);
}

.elc-sach-reader[data-theme="dark"] .elc-sach-reader-toc {
	border-left-color: rgba(255, 255, 255, 0.065);
}

.elc-sach-reader[data-theme="dark"] #elc-sach-reader-columns table td {
	border-color: rgba(255, 255, 255, 0.1);
}

.elc-sach-reader[data-theme="dark"] .elc-sach-highlight-popup,
.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-popup,
.elc-sach-reader[data-theme="dark"] .elc-sach-audio-panel,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-panel {
	background: #29292b;
	color: #b8babd;
	border-color: rgba(255, 255, 255, 0.085);
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-word,
.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-meaning,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-meaning,
.elc-sach-reader[data-theme="dark"] .elc-sach-audio-panel-title,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-input {
	color: #c1c3c6;
}

.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-phonetic,
.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-example,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-phonetic,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-definition,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-example,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-synonyms,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-status {
	color: #898d92;
}

.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-word { color: #f1f5f3; }
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-pos,
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-icon { background: #23473d; color: #a9e0cf; }
.elc-sach-reader[data-theme="dark"] .elc-sach-dictionary-meaning { background: #213a33; color: #c7eadf; }

.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-close,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-nav,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-close,
.elc-sach-reader[data-theme="dark"] .elc-sach-hl-icon-btn {
	color: #a5a8ac;
}

.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-close:hover,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-nav:hover,
.elc-sach-reader[data-theme="dark"] .elc-sach-search-close:hover {
	background: rgba(255, 255, 255, 0.07);
	color: #c7c9cc;
}

.elc-sach-reader[data-theme="dark"] .elc-sach-vocab-popup-star {
	background: rgba(255, 255, 255, 0.07);
	color: #a7aaae;
}

.elc-sach-reader[data-theme="dark"] .elc-sach-hl-divider {
	background: rgba(255, 255, 255, 0.09);
}

.elc-sach-reader[data-theme="dark"] .elc-sach-hl-swatch {
	border-color: #29292b;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

@media (max-width: 700px) {
	.elc-sach-reader-body {
		flex-direction: column;
		padding: 12px 8px 4px;
	}

	.elc-sach-reader-pages {
		border-radius: 8px;
	}

	#elc-sach-reader-viewport {
		padding: 24px 16px;
	}

	#elc-sach-reader-viewport::after {
		top: 24px;
		bottom: 24px;
	}

	.elc-sach-reader-navzone {
		width: 14px;
	}

	.elc-sach-reader-toc {
		border-left: none;
		border-top: 1px solid rgba(0, 0, 0, 0.08);
		max-height: 200px;
		flex-basis: auto;
	}

	.elc-sach-reader[data-theme="dark"] .elc-sach-reader-toc {
		border-top-color: rgba(255, 255, 255, 0.065);
	}

	.elc-sach-audio-panel {
		width: calc(100% - 24px);
		box-sizing: border-box;
	}

	.elc-sach-audio-panel audio {
		max-width: none;
		flex: 1;
		min-width: 0;
	}

	.elc-sach-audio-panel-title {
		max-width: 100px;
	}

	.elc-sach-search-panel {
		width: calc(100% - 24px);
		box-sizing: border-box;
		top: 60px;
	}

	.elc-sach-search-input {
		width: auto;
		flex: 1;
		min-width: 0;
	}
}

/* ===== Dải "Tiếp tục đọc" kiểu WeRead — lưới tĩnh, không tự trượt (shortcode [elc_sach_continue_reading]) ===== */
.elc-sach-continue-reading {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	margin-bottom: 32px;
}

@media (max-width: 900px) {
	.elc-sach-continue-reading {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 560px) {
	.elc-sach-continue-reading {
		grid-template-columns: repeat(2, 1fr);
	}
}

.elc-sach-continue-card {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	padding: 10px;
	border-radius: 10px;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.elc-sach-continue-card:hover {
	background: #EBF7FF;
	transform: translateY(-2px);
}

.elc-sach-continue-cover {
	width: 48px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.elc-sach-continue-cover-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #EBF7FF;
	font-size: 20px;
}

.elc-sach-continue-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.elc-sach-continue-title {
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.elc-sach-popular {
	margin-bottom: 32px;
}

.elc-sach-popular-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.elc-sach-popular-heading {
	font-size: 20px;
	font-weight: 700;
	color: #1f2937;
	margin: 0;
}

.elc-sach-popular-shuffle {
	background: none;
	border: none;
	color: #4B8EDE;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

.elc-sach-popular-shuffle:hover {
	background: #EBF7FF;
}

.elc-sach-popular-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 160px));
	gap: 16px;
	justify-content: start;
}

@media (max-width: 900px) {
	.elc-sach-popular-grid {
		grid-template-columns: repeat(3, minmax(0, 140px));
	}
}

@media (max-width: 560px) {
	.elc-sach-popular-grid {
		grid-template-columns: repeat(2, minmax(0, 140px));
	}
}

.elc-sach-popular-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	text-decoration: none;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.elc-sach-popular-card:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.elc-sach-popular-cover {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	display: block;
	background: #EBF7FF;
}

.elc-sach-popular-cover-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
}

.elc-sach-popular-title {
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
	padding: 8px 10px 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.elc-sach-popular-sub {
	font-size: 11px;
	color: #6b7280;
	padding: 0 10px 10px;
}

.elc-sach-continue-progress {
	font-size: 12px;
	color: #6b7280;
}

/* ===== Thanh tìm kiếm sách kiểu WeRead/macOS (shortcode [elc_sach_search]) =====
   Selector viết dư bậc (.elc-sach-search-box form... + [type="text"]) CỐ Ý để
   thắng CSS input mặc định của theme Blocksy - trước đây rule 1 class bị theme
   đè mất border-radius/padding nên icon kính lúp đè lên chữ placeholder. */
.elc-sach-search-box {
	max-width: 480px;
	margin: 0 auto 32px;
}

.elc-sach-search-box form.elc-sach-search-box-form {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
}

.elc-sach-search-box form.elc-sach-search-box-form svg {
	position: absolute;
	left: 18px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	color: #9ca3af;
	pointer-events: none;
	z-index: 1;
}

.elc-sach-search-box form.elc-sach-search-box-form input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	font-size: 15px;
	line-height: 1.4;
	color: #1f2937;
	background: #f0f1f3;
	border: none;
	border-radius: 999px;
	padding: 13px 20px 13px 50px;
	outline: none;
	box-shadow: none;
	transition: background 0.15s ease, box-shadow 0.15s ease;
}

.elc-sach-search-box form.elc-sach-search-box-form input[type="text"]::placeholder {
	color: #9ca3af;
}

.elc-sach-search-box form.elc-sach-search-box-form input[type="text"]:focus {
	background: #fff;
	border: none;
	box-shadow: 0 0 0 3px rgba(75, 142, 222, 0.15), 0 1px 6px rgba(0, 0, 0, 0.08);
}

.elc-sach-catalog-card.elc-sach-search-hidden {
	display: none !important;
}

/* Stoody Reading library — WeRead-inspired catalogue, reader logic untouched. */
body:has(.elc-sach-library) { background: #f5f7fa; }
body:has(.elc-sach-library) .entry-header,
body:has(.elc-sach-library) .page-title,
body:has(.elc-sach-library) [class*="mobile-cart"],
body:has(.elc-sach-library) [class*="book-cart"] { display: none !important; }
.elc-sach-library, .elc-sach-library * { box-sizing: border-box; }
.elc-sach-library {
	--sach-blue: #4b8ede; --sach-pale: #ebf7ff; --sach-ink: #17233b; --sach-muted: #6d7a90;
    width: 78%; max-width: 1500px; margin: 22px auto 72px;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--sach-ink);
}
.elc-sach-library-hero {
	padding: 34px 20px 36px; text-align: center; border: 0; border-radius: 0; background: transparent;
}
.elc-sach-library-brand { display: flex; min-height: 52px; align-items: center; justify-content: center; }
.elc-sach-library-brand-text { color: #111827; font: 800 32px/1.15 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing: -.025em; }
.elc-sach-library-logo { display: block; width: auto; max-width: min(300px,75vw); height: auto; max-height: 68px; object-fit: contain; }
.elc-sach-library .elc-sach-search-box { width: min(740px, 100%); max-width: none; margin: 26px auto 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.elc-sach-library .elc-sach-search-box form.elc-sach-search-box-form {
	height: 54px; padding: 0; border: 0; border-radius: 999px; background: #fff; box-shadow: none;
}
.elc-sach-library .elc-sach-search-box form.elc-sach-search-box-form input[type="text"] {
	height: 54px; margin: 0; padding: 0 24px 0 52px; border: 0 !important; border-radius: 999px !important;
	background: transparent !important; box-shadow: none !important; font: 500 15px/1.2 Inter,sans-serif;
}
.elc-sach-library .elc-sach-search-box form.elc-sach-search-box-form input[type="text"]:focus { background: transparent !important; box-shadow: none !important; }
.elc-sach-library .elc-sach-catalog-yearpass { margin: 22px 0 0; }
.elc-sach-library-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.elc-sach-library-section-head h2 { margin: 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.35; letter-spacing: -.02em; }
.elc-sach-library-section-head > a { flex: none; font-size: 14px; font-weight: 700; color: var(--sach-blue); }
.elc-sach-library-continue, .elc-sach-ranking, .elc-sach-categories, .elc-sach-library-subpage { margin-top: 30px; }
.elc-sach-library .elc-sach-continue-reading { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.elc-sach-library .elc-sach-continue-card { min-height: 112px; padding: 16px; border: 1px solid #e4eaf1; border-radius: 16px; background: #fff; box-shadow: none; }
.elc-sach-library .elc-sach-continue-card:hover { transform: translateY(-2px); border-color: #bfd8f5; box-shadow: 0 12px 30px rgba(40,71,107,.09); }
.elc-sach-ranking-stack { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 20px 24px; margin-top: 30px; }
.elc-sach-ranking { margin: 0; padding: 24px; border: 1px solid #e3e9f0; border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(30,55,85,.055); }
.elc-sach-ranking-title-content { min-width: 0; }
.elc-sach-ranking-title-content > :first-child { margin-top: 0; }
.elc-sach-ranking-title-content > :last-child { margin-bottom: 0; }
.elc-sach-ranking .elc-sach-ranking-title-content h2 { margin: 0; font-size: 17px; line-height: 1.5; }
.elc-sach-ranking-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 22px; }
.elc-sach-ranking-card {
	display: grid; grid-template-columns: 28px 54px minmax(0,1fr); align-items: center; gap: 10px; min-width: 0;
	padding: 13px 0; border-top: 1px solid #edf0f4; color: inherit; text-decoration: none;
}
.elc-sach-ranking-card:nth-child(-n+2) { border-top: 0; }
.elc-sach-ranking-number { font-size: 17px; font-weight: 800; color: var(--sach-blue); }
.elc-sach-ranking-cover { display: flex; width: 54px; height: 72px; align-items: center; justify-content: center; overflow: hidden; border-radius: 5px; background: var(--sach-pale); box-shadow: 0 5px 14px rgba(31,52,77,.12); }
.elc-sach-ranking-cover img { width: 100%; height: 100%; object-fit: cover; }
.elc-sach-ranking-placeholder { font: 800 22px/1 Georgia,serif; color: var(--sach-blue); }
.elc-sach-ranking-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.elc-sach-ranking-copy strong, .elc-sach-ranking-copy span, .elc-sach-ranking-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-ranking-copy strong { font-size: 14px; transition: color .18s ease; }
.elc-sach-ranking-copy span, .elc-sach-ranking-copy small { font-size: 12px; color: var(--sach-muted); }
.elc-sach-ranking-card:hover .elc-sach-ranking-copy strong { color: var(--sach-blue); }
.elc-sach-categories { padding: 28px; border-radius: 20px; background: #eef2f6; }
.elc-sach-category-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.elc-sach-category-card { display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 16px; border: 1px solid #e0e7ef; border-radius: 14px; background: #fff; color: inherit; text-decoration: none; transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.elc-sach-category-card:hover { transform: translateY(-2px); border-color: #bcd7f5; box-shadow: 0 12px 28px rgba(40,71,107,.08); }
.elc-sach-category-mark { display: grid; width: 52px; height: 64px; flex: none; place-items: center; border-radius: 8px 12px 12px 8px; background: linear-gradient(145deg,#4b8ede,#78afe9); font: 800 22px/1 Georgia,serif; color: #fff; }
.elc-sach-category-card > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.elc-sach-category-card strong { font-size: 15px; }
.elc-sach-category-card small { font-size: 12px; color: var(--sach-muted); }
.elc-sach-library-subpage { padding: 26px; border: 1px solid #e3e9f0; border-radius: 20px; background: #fff; }
.elc-sach-library-back { display: inline-flex; margin-bottom: 22px; font-size: 14px; font-weight: 700; color: var(--sach-blue); }
.elc-sach-library .elc-sach-catalog-row { grid-template-columns: repeat(5,minmax(0,1fr)); }
.elc-sach-library .elc-sach-search-hidden { display: none !important; }
.elc-sach-library *, .elc-sach-library *::before, .elc-sach-library *::after { animation: none !important; }
@media (max-width: 1024px) {
	.elc-sach-ranking-stack { grid-template-columns: 1fr; }
	.elc-sach-ranking-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
	.elc-sach-library .elc-sach-continue-reading, .elc-sach-category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
	.elc-sach-library .elc-sach-catalog-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 640px) {
	.elc-sach-library { width: min(100% - 24px,1240px); margin-top: 12px; }
	.elc-sach-library-hero { padding: 24px 10px 28px; }
	.elc-sach-library-brand-text { font-size: 27px; }
	.elc-sach-ranking { padding: 18px; }
	.elc-sach-ranking-grid, .elc-sach-library .elc-sach-continue-reading, .elc-sach-category-grid { grid-template-columns: 1fr; }
	.elc-sach-ranking-card:nth-child(2) { border-top: 1px solid #edf0f4; }
	.elc-sach-categories { padding: 20px; }
	.elc-sach-library .elc-sach-catalog-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Lớp tìm kiếm thư viện độc lập, không tải lại/lọc trang Sách phía sau. */
body.elc-sach-library-search-open { overflow: hidden !important; }

/* Gợi ý ngẫu nhiên kiểu WeRead: bìa lớn, tác giả rõ, đổi nhóm không tải trang. */
.elc-sach-random { margin: 34px 0 42px; }
.elc-sach-random .elc-sach-library-section-head { margin-bottom: 18px; }
.elc-sach-random-refresh {
	padding: 0; border: 0; background: transparent; box-shadow: none; color: #4b8ede;
	font: 600 14px/1.4 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; cursor: pointer;
}
.elc-sach-random-refresh:hover { color: #2f78ca; background: transparent; transform: none; }
.elc-sach-random-refresh:disabled { opacity: .55; cursor: wait; }
.elc-sach-random-toolbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.elc-sach-random-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 16px; transition: opacity .16s ease; }
.elc-sach-random-grid.is-loading { opacity: .46; }
.elc-sach-random-card {
	display: flex; min-width: 0; min-height: 350px; align-items: center; flex-direction: column; justify-content: center;
	padding: 30px 18px 26px; border-radius: 12px; background: #fff; color: #17233b; text-align: center; text-decoration: none;
}
.elc-sach-random-cover {
	display: grid; width: 112px; height: 164px; place-items: center; overflow: hidden; margin-bottom: 24px; border-radius: 3px;
	background: #ebf7ff; color: #4b8ede; font: 800 30px/1 Georgia,serif; box-shadow: 0 7px 22px rgba(35,55,80,.1);
}
.elc-sach-random-cover img { width: 100%; height: 100%; object-fit: cover; }
.elc-sach-random-card strong { max-width: 100%; overflow: hidden; font: 600 16px/1.45 Inter,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-random-author { max-width: 100%; overflow: hidden; margin-top: 9px; color: #7a8799; font: 400 14px/1.4 Inter,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-random-card:hover { color: #4b8ede; transform: translateY(-2px); }
@media (max-width: 900px) { .elc-sach-random-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 520px) {
	.elc-sach-random-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
	.elc-sach-random-card { min-height: 270px; padding: 22px 10px 20px; }
	.elc-sach-random-cover { width: 88px; height: 130px; margin-bottom: 18px; }
}

.elc-sach-library-search-overlay[hidden] { display: none !important; }
.elc-sach-library-search-overlay {
	position: fixed; inset: 0; z-index: 2147483000; overflow-y: auto; padding: clamp(90px,16vh,180px) 20px 60px;
	background: #f0f1f3; opacity: 0; transition: opacity .16s ease;
	font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color: #17233b;
}
.elc-sach-library-search-overlay.is-open { opacity: 1; }
.elc-sach-library-search-shell { width: min(740px,100%); margin: 0 auto; }
.elc-sach-library-search-topbar { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 16px; align-items: center; margin-bottom: 22px; }
.elc-sach-library-search-back {
	display: grid; width: 52px; height: 52px; padding: 0; place-items: center; border: 0; border-radius: 50%;
	background: #fff; color: #8793a4; box-shadow: none; font: 300 36px/1 Inter,sans-serif; cursor: pointer;
}
.elc-sach-library-search-back:hover { background: #fff; color: #4b8ede; transform: none; }
.elc-sach-library-search-form {
	display: grid; height: 54px; grid-template-columns: 42px minmax(0,1fr) 44px; align-items: center;
	margin: 0; padding: 0 9px 0 14px; border-radius: 999px; background: #fff;
}
.elc-sach-library-search-form > svg, .elc-sach-library-search-form button svg {
	width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
.elc-sach-library-search-form > svg { justify-self: center; color: #8a96a7; }
.elc-sach-library-search-form input[type="search"] {
	width: 100%; height: 52px; margin: 0; padding: 0; border: 0 !important; border-radius: 0 !important;
	background: transparent !important; box-shadow: none !important; outline: 0; color: #17233b; font: 500 16px/1 Inter,sans-serif;
}
.elc-sach-library-search-form input[type="search"]::-webkit-search-cancel-button { display: none; }
.elc-sach-library-search-form button {
	display: grid; width: 36px; height: 36px; padding: 0; place-items: center; justify-self: end; border: 0; border-radius: 50%;
	background: #f5f6f8; color: #8a96a7; box-shadow: none; cursor: pointer;
}
.elc-sach-library-search-form button:hover { background: #ebf7ff; color: #4b8ede; transform: none; }
.elc-sach-library-search-card { overflow: hidden; border: 0; border-radius: 14px; background: #fff; box-shadow: none; }
.elc-sach-library-search-label { padding: 22px 20px 10px; font-size: 14px; color: #607087; }
.elc-sach-library-search-status { padding: 8px 20px 16px; font-size: 13px; color: #8a96a7; }
.elc-sach-library-search-results { transition: opacity .12s ease; }
.elc-sach-library-search-results.is-loading { opacity: .45; }
.elc-sach-search-result {
	display: grid; min-height: 132px; grid-template-columns: 74px minmax(0,1fr) 24px; gap: 16px; align-items: center;
	margin: 0 20px; padding: 14px 0; border-top: 1px solid #e7e9ed; color: inherit; text-decoration: none;
}
.elc-sach-search-result:first-child { border-top: 0; }
.elc-sach-search-result-cover {
	display: grid; width: 72px; height: 104px; place-items: center; overflow: hidden; border-radius: 4px;
	background: #ebf7ff; color: #4b8ede; font: 800 25px/1 Georgia,serif; box-shadow: 0 4px 12px rgba(31,52,77,.1);
}
.elc-sach-search-result-cover img { width: 100%; height: 100%; object-fit: cover; }
.elc-sach-search-result-copy { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.elc-sach-search-result-copy strong { overflow: hidden; color: #367fcf; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-search-result-copy span { overflow: hidden; color: #7a8799; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-search-result-arrow { color: #b3bbc6; font-size: 24px; }
.elc-sach-search-result:hover .elc-sach-search-result-copy strong { color: #246ebf; }
.elc-sach-search-empty { display: flex; min-height: 220px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 36px; text-align: center; }
.elc-sach-search-empty strong { font-size: 17px; }
.elc-sach-search-empty span { color: #8793a4; font-size: 14px; }
@media (max-width: 640px) {
	.elc-sach-library-search-overlay { padding: 24px 12px 40px; }
	.elc-sach-library-search-topbar { grid-template-columns: 44px minmax(0,1fr); gap: 10px; }
	.elc-sach-library-search-back { width: 44px; height: 44px; font-size: 31px; }
	.elc-sach-library-search-form { height: 48px; grid-template-columns: 34px minmax(0,1fr) 38px; }
	.elc-sach-library-search-form input[type="search"] { height: 46px; font-size: 15px; }
	.elc-sach-search-result { min-height: 112px; grid-template-columns: 58px minmax(0,1fr) 16px; gap: 12px; margin: 0 14px; }
	.elc-sach-search-result-cover { width: 56px; height: 82px; }
	.elc-sach-search-result-copy strong { font-size: 14px; }
	.elc-sach-search-result-copy span { font-size: 12px; }
}

/* One destination for rankings and categories: category rail + book results. */
.elc-sach-library-browser {
	display: grid; width: min(1320px,calc(100% - 40px)); grid-template-columns: 310px minmax(0,1fr);
	overflow: hidden; margin: 28px auto 48px; border-radius: 18px; background: #fff;
	color: #17233b; font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.elc-sach-library-sidebar {
	padding: 26px 18px 34px; border-right: 1px solid #e5e9ef; background: #fbfcfd;
}
.elc-sach-library-sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.elc-sach-library-sidebar h3 {
	margin: 22px 12px 8px; color: #8793a4; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.elc-sach-library-sidebar-link {
	display: flex; min-height: 44px; align-items: center; justify-content: flex-start; gap: 12px;
	padding: 12px 14px; border-radius: 9px; color: #3d485a; font-size: 14px; font-weight: 700; line-height: 1.45; text-decoration: none;
}
.elc-sach-library-sidebar-link:hover { background: #ebf7ff; color: #367fcf; }
.elc-sach-library-sidebar-link.is-active { background: #4b8ede; color: #fff; }
.elc-sach-library-category-link { min-height: 44px; }
.elc-sach-library-category-link .elc-sach-category-mark { width: 46px; height: 64px; flex: 0 0 46px; overflow: hidden; border-radius: 4px; }
.elc-sach-library-category-link .elc-sach-category-mark img { width: 100%; height: 100%; object-fit: cover; }
.elc-sach-library-category-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.elc-sach-library-category-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-library-category-copy small { font-size: 12px; font-weight: 500; opacity: .72; }
.elc-sach-library-browser-content { min-width: 0; padding: 28px 42px 48px; }
.elc-sach-library-back {
	display: inline-flex; margin-bottom: 18px; color: #4b8ede; font-size: 14px; font-weight: 700; text-decoration: none;
}
.elc-sach-library-browser-results > h2 { margin: 0 0 8px; color: #17233b; font-size: 28px; line-height: 1.3; }
.elc-sach-library-browser-results.is-loading { opacity: .48; pointer-events: none; }
.elc-sach-library-book-list { display: flex; flex-direction: column; }
.elc-sach-library-book-row {
	display: grid; min-width: 0; grid-template-columns: 34px 100px minmax(0,1fr); gap: 24px; align-items: center;
	padding: 24px 18px; border-top: 1px solid #e5e9ef; border-radius: 10px; color: #17233b; text-decoration: none;
}
.elc-sach-library-book-row:first-child { border-top: 0; }
.elc-sach-library-book-rank { color: #65748a; font-size: 18px; text-align: center; }
.elc-sach-library-book-cover {
	display: grid; width: 100px; height: 142px; place-items: center; overflow: hidden; border-radius: 4px;
	background: #ebf7ff; color: #4b8ede; font: 800 28px/1 Georgia,serif; box-shadow: 0 7px 20px rgba(31,52,77,.1);
}
.elc-sach-library-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.elc-sach-library-book-copy { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.elc-sach-library-book-copy strong { overflow: hidden; font-size: 18px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.elc-sach-library-book-copy span { color: #607087; font-size: 14px; }
.elc-sach-library-book-copy small {
	display: -webkit-box; overflow: hidden; color: #8793a4; font-size: 14px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.elc-sach-library-book-row:hover { background: #f3f5f7; }
.elc-sach-library-book-row:hover .elc-sach-library-book-copy strong { color: #367fcf; }
.elc-sach-library-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 28px; }
.elc-sach-library-page-btn { min-width: 38px; height: 38px; padding: 0 11px; border: 1px solid #dce3eb; border-radius: 8px; background: #fff; color: #3d485a; cursor: pointer; font: 700 14px/1 Inter,sans-serif; }
.elc-sach-library-page-btn:hover { border-color: #4b8ede; color: #4b8ede; }
.elc-sach-library-page-btn.is-active { border-color: #4b8ede; background: #4b8ede; color: #fff; }
.elc-sach-library-book-empty { padding: 70px 20px; color: #8793a4; text-align: center; }
@media (max-width: 760px) {
	.elc-sach-library-browser { width: calc(100% - 20px); grid-template-columns: 1fr; margin-top: 16px; }
	.elc-sach-library-sidebar { padding: 16px; border-right: 0; border-bottom: 1px solid #e5e9ef; }
	.elc-sach-library-sidebar nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
	.elc-sach-library-sidebar h3 { grid-column: 1 / -1; }
	.elc-sach-library-browser-content { padding: 24px 18px 36px; }
	.elc-sach-library-book-row { grid-template-columns: 24px 76px minmax(0,1fr); gap: 13px; padding: 18px 0; }
	.elc-sach-library-book-cover { width: 76px; height: 108px; }
	.elc-sach-library-book-copy strong { font-size: 15px; }
	.elc-sach-library-book-copy span, .elc-sach-library-book-copy small { font-size: 12px; }
}
