body, html {
    font-family: 'Urbanist', sans-serif !important;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

body {
    background: #ffffff;
}

#almaden-reader-app,
#almaden-reader-panel,
#almaden-view-index,
#almaden-view-chapter,
#almaden-view-highlights {
    background: #ffffff;
}

/* Cover CSS requirements */
.cover-thumbnail-wrapper {
    width: 100%;
    background-color: #ffffff;
    overflow: hidden;
    position: relative;
}

@media (max-width: 767px) {
	#almaden-view-index {
		flex-direction: column !important;
	}

	#almaden-view-chapter {
		height: 100dvh !important;
		min-height: 100dvh !important;
	}

	#chapter-navbar {
		position: sticky !important;
		top: 0 !important;
		z-index: 60 !important;
		min-height: calc(3.75rem + env(safe-area-inset-top, 0px)) !important;
		padding-top: env(safe-area-inset-top, 0px) !important;
		padding-left: 1rem !important;
		padding-right: 1rem !important;
		background: rgba(255, 255, 255, 0.98) !important;
		backdrop-filter: blur(18px);
	}

	#chapter-navbar-index-btn,
	#chapter-navbar-controls,
	#chapter-nav-title {
		transition: opacity 0.2s ease, transform 0.2s ease;
	}

	#chapter-navbar h3 {
		max-width: 52vw;
	}

	#chapter-navbar.chapter-navbar-mobile-title-mode #chapter-navbar-index-btn,
	#chapter-navbar.chapter-navbar-mobile-title-mode #chapter-navbar-controls {
		opacity: 0 !important;
		pointer-events: none !important;
		transform: translateY(-0.35rem);
	}

	#chapter-navbar.chapter-navbar-mobile-title-mode #chapter-nav-title {
		opacity: 1 !important;
		pointer-events: auto !important;
		transform: translate(-50%, 0) !important;
	}

	#chapter-navbar.chapter-navbar-mobile-controls-mode #chapter-navbar-index-btn,
	#chapter-navbar.chapter-navbar-mobile-controls-mode #chapter-navbar-controls {
		opacity: 1 !important;
		pointer-events: auto !important;
		transform: translateY(0);
	}

	#chapter-navbar.chapter-navbar-mobile-controls-mode #chapter-nav-title {
		opacity: 0 !important;
		pointer-events: none !important;
		transform: translate(-50%, -0.35rem) !important;
	}

	#almaden-chapter-scroll-area {
		min-height: 0 !important;
		padding-top: 1rem !important;
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}

	#reader-cover-panel {
		flex: 0 0 34vh !important;
		height: 34vh !important;
		min-height: 0 !important;
		padding-top: 1.25rem !important;
		padding-bottom: 1.25rem !important;
		padding-left: 1.25rem !important;
		padding-right: 1.25rem !important;
	}
	#reader-cover-wrapper {
		width: min(72vw, 18rem);
		max-width: min(72vw, 18rem);
		margin-left: auto;
		margin-right: auto;
	}
	#reader-index-panel {
		flex: 1 1 auto !important;
		min-height: 0 !important;
	}
	#reader-index-header {
		padding: 1rem 1.25rem 0.75rem !important;
	}
	#chapters-list {
		min-height: 0 !important;
		padding: 0.35rem 1.25rem 1.25rem !important;
	}
	.cover-thumbnail-wrapper {
		width: 100%;
		margin-left: auto;
		margin-right: auto;
	}
	.cover-thumbnail-wrapper img {
		display: block;
		width: 100% !important;
		height: auto !important;
		max-width: 100% !important;
		object-fit: contain !important;
	}
}
.cover-spread-container {
    position: absolute;
    top: 0;
    left: 0;
}
.cover-spread-container .absolute { position: absolute; }
.cover-spread-container .inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.cover-spread-container .top-0 { top: 0; }
.cover-spread-container .bottom-0 { bottom: 0; }
.cover-spread-container .bg-cover { background-size: cover; }
.cover-spread-container .bg-center { background-position: center; }

/* Typography for Reader Content */
.prose {
    font-family: Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
    max-width: 700px;
    margin: 0 auto;
}
.prose h1, .prose h2, .prose h3 {
    font-family: 'Urbanist', sans-serif;
    color: #111;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.prose p {
    margin-bottom: 1.5rem;
}
.prose blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1rem;
    color: #555;
    font-style: italic;
}

#chapter-content {
    position: relative;
}

.reader-index-access {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .35rem .65rem;
	border-radius: 999px;
	font-size: .72rem;
	font-weight: 700;
	white-space: nowrap;
}
.reader-index-access.is-locked { background: #f3f4f6; color: #6b7280; }
.reader-index-access.is-sample { background: #dcfce7; color: #166534; }
.reader-sample-indicator {
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	box-shadow: none;
}
.reader-sample-indicator i { font-size: .95rem; }
.reader-lock-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}
.reader-lock-trigger i { font-size: .95rem; }
.reader-lock-trigger:hover {
	background: #e5e7eb;
	color: #4b5563;
}
.reader-index-item.is-locked {
	cursor: not-allowed;
	opacity: .78;
}
.reader-index-item.is-locked:hover {
	background: transparent;
}
.reader-index-item.is-locked .group-hover\:text-black {
	color: #1f2937;
}
body.reader-modal-open {
	overflow: hidden;
}

.reader-purchase-modal {
	position: fixed;
	inset: 0;
	z-index: 10020;
	display: grid;
	place-items: center;
	padding: 1.25rem;
}

.reader-purchase-modal.hidden {
	display: none;
}

.reader-purchase-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .48);
	backdrop-filter: blur(10px);
}

.reader-purchase-modal-panel {
	position: relative;
	z-index: 1;
	width: min(28rem, 100%);
	padding: 2rem 1.75rem 1.75rem;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: 1.5rem;
	background: #fff;
	box-shadow: 0 30px 70px rgba(15, 23, 42, .24);
	text-align: center;
}

.reader-purchase-modal-close {
	position: absolute;
	top: .9rem;
	right: .9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: 0;
	border-radius: 999px;
	background: #f8fafc;
	color: #475569;
	font-size: 1.4rem;
	line-height: 1;
}

.reader-purchase-modal-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin-bottom: 1rem;
	border-radius: 999px;
	background: #f3f4f6;
	color: #111827;
	font-size: 1.1rem;
}

.reader-purchase-modal-kicker {
	margin: 0 0 .45rem;
	color: #6b7280;
	font-family: 'Urbanist', sans-serif;
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .18em;
	text-transform: uppercase;
}

.reader-purchase-modal-panel h2 {
	margin: 0;
	color: #111827;
	font-family: 'Urbanist', sans-serif;
	font-size: clamp(1.5rem, 4vw, 2rem);
	line-height: 1.12;
}

.reader-purchase-modal-copy {
	margin: .9rem auto 0;
	max-width: 26rem;
	color: #64748b;
	font-family: 'Urbanist', sans-serif;
	font-size: .98rem;
	line-height: 1.6;
}

.reader-purchase-modal-actions {
	display: flex;
	justify-content: center;
	margin-top: 1.5rem;
}

.reader-purchase-modal-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .85rem 1.4rem;
	border-radius: 999px;
	background: #111827;
	color: #fff !important;
	font-family: 'Urbanist', sans-serif;
	font-size: .92rem;
	font-weight: 800;
	text-decoration: none !important;
	transition: transform .16s ease, background .16s ease;
}

.reader-purchase-modal-button:hover {
	background: #000;
	transform: translateY(-1px);
}

.reader-access-denied {
	display: flex;
	min-height: min(34rem, calc(100vh - 12rem));
	flex-direction: column;
	align-items: center;
	justify-content: center;
	max-width: 700px;
	margin: 0 auto;
	padding: 3rem 2rem;
	text-align: center;
}
.reader-access-denied-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin-bottom: 1.25rem;
	border: 1px solid rgba(17, 24, 39, .12);
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	color: #111827;
}
.reader-access-denied .reader-access-kicker { margin: 0 0 .55rem; color: #6b7280; font-family: 'Urbanist', sans-serif; font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.reader-access-denied h1 { margin: 0; color: #111827; font-family: 'Urbanist', sans-serif; font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.1; }
.reader-access-denied > p:not(.reader-access-kicker) { max-width: 34rem; margin: 1rem 0 0; color: #6b7280; font-family: 'Urbanist', sans-serif; font-size: 1rem; line-height: 1.65; }
.reader-access-buy-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1.75rem;
	padding: .85rem 1.5rem;
	border-radius: 999px;
	background: #111827;
	color: #fff !important;
	font-family: 'Urbanist', sans-serif;
	font-size: .9rem;
	font-weight: 800;
	text-decoration: none !important;
	transition: transform .16s ease, background .16s ease;
}
.reader-access-buy-button:hover { background: #000; transform: translateY(-1px); }

.reader-highlight-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.reader-highlight {
    position: absolute;
    background: rgba(250, 204, 21, 0.46);
    border-radius: 0.28rem;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
    mix-blend-mode: multiply;
    pointer-events: auto;
    cursor: pointer;
}

.reader-highlight.is-focus {
    background: rgba(250, 204, 21, 0.68);
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.18), inset 0 0 0 1px rgba(245, 158, 11, 0.1);
}

#btn-save-highlight[data-reader-highlight-action="delete"] {
    background: #fee2e2;
    color: #b91c1c;
}

#btn-save-highlight[data-reader-highlight-action="delete"]:hover {
    background: #fecaca;
    color: #991b1b;
}

#btn-save-highlight[data-reader-highlight-action="save"] {
    background: #fde047;
    color: #111827;
}

#btn-save-highlight[data-reader-highlight-action="save"]:hover {
    background: #facc15;
}

#highlight-toolbar {
    transform: translate(-50%, -100%);
    pointer-events: auto;
    white-space: nowrap;
}

#highlight-toolbar.hidden {
    display: none;
}

#highlight-toolbar button {
    flex: 0 0 auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    #footnote-popup {
        width: 90vw !important;
        max-width: 90vw !important;
        left: 50% !important;
        right: auto !important;
        box-sizing: border-box;
    }
}

#highlight-comment-composer {
    transform: translate(-50%, -100%);
}

#reader-highlights-panel {
    backdrop-filter: blur(18px);
}

.reader-highlights-section {
    border: 1px solid #f1f5f9;
    border-radius: 1.25rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.8) 0%, rgba(255, 255, 255, 1) 100%);
}

.reader-highlights-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid #eef2f7;
    background: rgba(255, 255, 255, 0.72);
}

.reader-highlights-badge {
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.45rem;
    border-radius: 9999px;
    background: #111827;
    color: #fff;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reader-highlights-items {
    padding: 0.75rem;
}

.reader-highlight-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.65rem;
    border-radius: 1rem;
    transition: background-color 160ms ease, transform 160ms ease;
}

.reader-highlight-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

.reader-highlight-item-body {
    flex: 1;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    min-width: 0;
}

.reader-highlight-item-quote {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reader-highlight-item-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-top: 0.05rem;
}

.reader-highlight-comments-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 9999px;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.reader-highlight-comments-btn:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.reader-highlight-delete-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    border-radius: 9999px;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.reader-highlight-delete-btn:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.reader-highlight-comments-box {
    flex: 0 0 100%;
    width: 100%;
    margin: 0.35rem 0 0;
    padding: 0.45rem 0 0;
    border-top: 1px solid #edf2f7;
}

.reader-highlight-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.reader-highlight-comment-item {
    position: relative;
    padding: 0.5rem 1.9rem 0.6rem 0.15rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.reader-highlight-comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.reader-highlight-comment-author {
    font-size: 0.76rem;
    font-weight: 800;
    color: #0f172a;
}

.reader-highlight-comment-date {
    font-size: 0.72rem;
    color: #94a3b8;
}

.reader-highlight-comment-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
    white-space: pre-wrap;
}

.reader-highlight-comment-actions {
    position: absolute;
    top: 0.35rem;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.22rem;
}

.reader-highlight-comment-edit-btn,
.reader-highlight-comment-delete-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    border-radius: 9999px;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.reader-highlight-comment-edit-btn {
    color: #334155;
}

.reader-highlight-comment-edit-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.reader-highlight-comment-delete-btn:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.reader-highlight-comment-form {
    margin-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.reader-highlight-comment-input {
    width: 100%;
    resize: vertical;
    min-height: 4.5rem;
    border: 1px solid #dbe4f0;
    background: #fff;
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #0f172a;
    outline: none;
}

.reader-highlight-comment-input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.12);
}

.reader-highlight-comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    align-items: center;
}

.reader-highlight-comment-submit-btn {
    border: 0;
    background: #111827;
    color: #fff;
    border-radius: 9999px;
    padding: 0.36rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    transition: opacity 160ms ease, transform 160ms ease;
}

.reader-highlight-comment-submit-btn:hover {
    opacity: 0.9;
}

.reader-highlight-comment-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.reader-highlight-comment-cancel-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    border-radius: 9999px;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.reader-highlight-comment-cancel-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Expanded highlights view */
#almaden-view-highlights,
#reader-highlights-panel {
    --reader-neutral-bg: #ffffff;
    --reader-neutral-surface: #fafafa;
    --reader-neutral-surface-soft: #f5f5f5;
    --reader-neutral-border: #e5e5e5;
    --reader-neutral-border-strong: #d4d4d4;
    --reader-neutral-text: #111827;
    --reader-neutral-text-strong: #171717;
    --reader-neutral-text-muted: #525252;
    --reader-neutral-text-soft: #737373;
    --reader-neutral-text-faint: #a3a3a3;
    --reader-neutral-accent: #111827;
}

#almaden-view-highlights {
    width: min(100%, 1300px);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
    border-right: 1px solid var(--reader-neutral-border);
    border-left: 1px solid var(--reader-neutral-border);
    background: var(--reader-neutral-bg);
    color: var(--reader-neutral-text);
}

#almaden-view-highlights button:focus,
#almaden-view-highlights button:focus-visible {
    outline: none;
    box-shadow: none;
}

.reader-highlights-page-navbar {
    position: relative;
    flex: 0 0 4.5rem;
    min-height: 4.5rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 max(1.75rem, calc((100vw - 1300px) / 2 + 1.75rem));
    border-bottom: 1px solid var(--reader-neutral-border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    z-index: 20;
}

.reader-highlights-page-heading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: min(60vw, 42rem);
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    color: var(--reader-neutral-text);
    white-space: nowrap;
}

.reader-highlights-page-heading span {
    font-size: 1rem;
    font-weight: 800;
}

.reader-highlights-page-heading strong {
    max-width: 28rem;
    overflow: hidden;
    color: var(--reader-neutral-text-faint);
    font-size: 0.82rem;
    font-weight: 600;
    text-overflow: ellipsis;
}

.reader-highlights-page-nav-button {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--reader-neutral-border);
    border-radius: 9999px;
    background: var(--reader-neutral-bg);
    color: var(--reader-neutral-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.reader-highlights-page-nav-button:hover {
    border-color: var(--reader-neutral-border-strong);
    background: var(--reader-neutral-surface);
    color: var(--reader-neutral-text);
}

.reader-highlights-page-layout {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(17rem, 19rem) minmax(0, 1fr);
    background: var(--reader-neutral-surface);
}

.reader-highlights-page-sidebar {
    min-height: 0;
    overflow-y: auto;
    padding: 1.75rem 1.25rem;
    border-right: 1px solid var(--reader-neutral-border);
    background: var(--reader-neutral-bg);
}

.reader-highlights-page-filters {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.reader-highlights-page-filter-row {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
}

.reader-highlights-page-filter-heading {
    padding: 0 0.75rem 0.75rem;
    color: var(--reader-neutral-text-faint);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.reader-highlights-page-filter {
    width: 100%;
    min-height: 2.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 0.85rem;
    background: transparent;
    color: var(--reader-neutral-text-muted);
    font-size: 0.88rem;
    font-weight: 650;
    text-align: left;
    transition: background-color 160ms ease, color 160ms ease;
    flex: 1 1 auto;
}

.reader-highlights-page-filter > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-highlights-page-filter:hover {
    background: var(--reader-neutral-surface);
    color: var(--reader-neutral-text);
}

.reader-highlights-page-filter.is-active {
    background: var(--reader-neutral-accent);
    color: #fff;
}

.reader-highlights-page-filter.is-empty:not(.is-active) {
    color: var(--reader-neutral-text-faint);
}

.reader-highlights-page-filter-count {
    flex: 0 0 auto;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.4rem;
    border-radius: 9999px;
    background: #ececec;
    color: var(--reader-neutral-text-soft);
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reader-highlights-page-filter.is-active .reader-highlights-page-filter-count {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.reader-highlights-page-main {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0 1.25rem 4rem;
}

.reader-highlights-page-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: calc(100% + 2.5rem);
    margin: 0 -1.25rem 1.5rem;
    padding: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--reader-neutral-border);
}

.reader-highlights-page-toolbar-inner {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0.6rem 1.25rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.reader-highlights-page-toolbar-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.reader-highlights-page-toolbar-kicker {
    color: var(--reader-neutral-text-faint);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reader-highlights-page-toolbar-title {
    overflow: hidden;
    color: var(--reader-neutral-text);
    font-size: 0.9rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-highlights-page-toolbar-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.52rem 0.8rem;
    border: 1px solid var(--reader-neutral-border);
    border-radius: 9999px;
    background: var(--reader-neutral-bg);
    color: var(--reader-neutral-text);
    font-size: 0.8rem;
    font-weight: 750;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.reader-highlights-page-toolbar-button:hover {
    border-color: var(--reader-neutral-border-strong);
    background: var(--reader-neutral-surface);
}

.reader-highlights-page-feed {
    width: min(100%, 64rem);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#reader-highlights-list {
    background: #f1f1f1;
}

.reader-highlights-page-status {
    padding: 3.5rem 2rem;
    border: 1px solid var(--reader-neutral-border);
    border-radius: 1.5rem;
    background: var(--reader-neutral-bg);
    color: var(--reader-neutral-text-soft);
    text-align: center;
}

.reader-highlights-page-status.is-error {
    border-color: #d4d4d4;
    background: #fafafa;
    color: #171717;
}

.reader-highlights-feed-card {
    overflow: hidden;
    border: 1px solid var(--reader-neutral-border);
    border-radius: 1.25rem;
    background: #f1f1f1;
    box-shadow: none;
}

.reader-highlights-feed-meta {
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--reader-neutral-border);
    background: #fff;
}

.reader-highlights-feed-chapter {
    overflow: hidden;
    color: var(--reader-neutral-text-muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-highlights-feed-date {
    flex: 0 0 auto;
    color: var(--reader-neutral-text-faint);
    font-size: 0.73rem;
    font-weight: 600;
}

.reader-highlights-feed-quote-section {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.75rem 1.5rem;
    background: #fff;
}

.reader-highlights-feed-quote-button {
    min-width: 0;
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--reader-neutral-text-strong);
    font-family: Georgia, serif;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.65;
    text-align: left;
    cursor: pointer;
}

.reader-highlights-feed-quote {
    padding: 0.08em 0.18em;
    border-radius: 0.2em;
    background: linear-gradient(180deg, transparent 12%, rgba(245, 211, 107, 0.72) 12%, rgba(245, 211, 107, 0.72) 92%, transparent 92%);
    color: inherit;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.reader-highlights-feed-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 0.45rem;
}

.reader-highlights-feed-action {
    width: 2.3rem;
    height: 2.3rem;
    border: 1px solid var(--reader-neutral-border);
    border-radius: 9999px;
    background: var(--reader-neutral-bg);
    color: var(--reader-neutral-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.reader-highlights-feed-action:hover {
    border-color: var(--reader-neutral-border-strong);
    background: var(--reader-neutral-surface);
    color: var(--reader-neutral-text);
}

.reader-highlights-feed-delete:hover {
    border-color: var(--reader-neutral-border-strong);
    background: #f5f5f5;
    color: #111827;
}

.reader-highlights-feed-comments {
    border-top: 1px solid var(--reader-neutral-border);
    background: #fff;
}

.reader-highlights-feed-comments-heading {
    padding: 1rem 1.5rem 0;
    color: var(--reader-neutral-text-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reader-highlights-feed-comments-body {
    padding: 0.65rem 1.5rem 1.4rem;
}

.reader-highlights-feed-comments-empty {
    margin: 0;
    padding: 0.5rem 0;
    color: var(--reader-neutral-text-faint);
    font-size: 0.86rem;
}

.reader-highlights-feed-comments .reader-highlight-comments-list {
    gap: 0.6rem;
}

.reader-highlights-feed-comments .reader-highlight-comment-item {
    border-color: var(--reader-neutral-border);
    background: #fff;
}

@media (max-width: 768px) {
    #almaden-view-highlights {
        width: 100%;
        border: 0;
    }

    .reader-highlights-page-navbar {
        width: 100%;
        margin-left: 0;
        min-height: 4rem;
        padding: 0 1rem;
    }

    .reader-highlights-page-heading strong {
        display: none;
    }

    .reader-highlights-page-layout {
        display: flex;
        flex-direction: column;
    }

    .reader-highlights-page-sidebar {
        flex: 0 0 auto;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.75rem 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--reader-neutral-border);
    }

    .reader-highlights-page-filters {
        width: max-content;
        max-width: none;
        flex-direction: row;
    }

    .reader-highlights-page-filter-heading {
        display: none;
    }

    .reader-highlights-page-filter {
        width: auto;
        max-width: 15rem;
        min-height: 2.5rem;
        padding: 0.55rem 0.75rem;
        background: var(--reader-neutral-surface);
    }

    .reader-highlights-page-filter-row {
        width: max-content;
    }

    .reader-highlights-page-main {
        padding: 0 0.85rem 3rem;
    }

    .reader-highlights-page-toolbar {
        margin-bottom: 1rem;
        width: calc(100% + 1.7rem);
        margin-left: -0.85rem;
        margin-right: -0.85rem;
        padding-left: 0;
        padding-right: 0;
    }

    .reader-highlights-page-toolbar-inner {
        width: 100%;
        max-width: none;
        padding: 0.45rem 0.85rem;
        box-sizing: border-box;
        gap: 0.6rem;
    }

    .reader-highlights-page-toolbar-button {
        padding: 0.45rem 0.72rem;
    }

    .reader-highlights-page-feed {
        gap: 1rem;
    }

    .reader-highlights-feed-card {
        border-radius: 1.15rem;
    }

    .reader-highlights-feed-meta,
    .reader-highlights-feed-quote-section,
    .reader-highlights-feed-comments-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .reader-highlights-feed-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .reader-highlights-feed-quote-section {
        flex-direction: column;
    }

    .reader-highlights-feed-actions {
        align-self: flex-end;
    }
}

/* Transitions */
.fade-enter {
    opacity: 0;
    transform: translateY(10px);
}
.fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms ease, transform 300ms ease;
}

/* Hide scrollbar */
#almaden-chapter-scroll-area::-webkit-scrollbar {
    display: none;
}
#almaden-chapter-scroll-area {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Flip Mode CSS */
.mode-flip #almaden-chapter-scroll-area {
    overflow: hidden !important;
    display: flex;
    align-items: center;
    position: relative;
}
.mode-flip #chapter-content {
    height: calc(100vh - 12rem) !important;
    column-count: 2 !important;
    column-gap: 6rem !important;
    column-fill: auto !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mode-flip #chapter-footer-nav {
    -webkit-column-span: all;
    column-span: all;
    break-inside: avoid;
    width: min(100%, 700px);
    margin-top: 3.25rem;
    margin-left: auto;
    margin-right: auto;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

#chapter-footer-nav {
    color: var(--reader-neutral-text);
    font-family: 'Urbanist', sans-serif;
}

#chapter-footer-nav button {
    font-family: inherit;
}

#chapter-footer-nav #btn-prev-chapter,
#chapter-footer-nav #btn-next-chapter {
    width: 3rem;
    height: 3rem;
}

.mode-flip .prose h1, .mode-flip .prose h2, .mode-flip .prose h3 {
    break-after: avoid;
}

@media (max-width: 768px) {
    .mode-flip #chapter-content {
        column-count: 1 !important;
        column-gap: 3rem !important;
    }
}
