/**
 * Masonic Flipbook Viewer — Frontend styles
 *
 * Palette:
 * Deep navy  #10182F
 * Burgundy   #5A1F2B
 * Gold       #C8A24A
 * Cream      #F7F1E3
 * White      #FFFFFF
 * Dark text  #222222
 *
 * Future enhancement: styles for PDF.js / page-turn engine
 * can target .mfv-viewer__engine-slot and [data-mfv-engine="pdfjs"].
 */

.mfv-library,
.mfv-viewer,
.mfv-modal,
.mfv-notice {
	--mfv-navy: #10182f;
	--mfv-burgundy: #5a1f2b;
	--mfv-gold: #c8a24a;
	--mfv-cream: #f7f1e3;
	--mfv-white: #ffffff;
	--mfv-text: #222222;
	--mfv-muted: #5c5c5c;
	--mfv-border: rgba(200, 162, 74, 0.55);
	--mfv-shadow: 0 8px 24px rgba(16, 24, 47, 0.12);
	--mfv-radius: 10px;
	box-sizing: border-box;
	color: var(--mfv-text);
	font-family: Georgia, "Times New Roman", Times, serif;
}

.mfv-library *,
.mfv-viewer *,
.mfv-modal *,
.mfv-notice * {
	box-sizing: border-box;
}

/* ---------- Buttons ---------- */

.mfv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.55rem 1rem;
	border-radius: 6px;
	border: 1px solid transparent;
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 0.92rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mfv-btn--primary {
	background: linear-gradient(135deg, #2657c5 0%, #16367a 100%);
	color: #fff;
	border-color: transparent;
}

.mfv-btn--primary:hover,
.mfv-btn--primary:focus {
	background: linear-gradient(135deg, #3470e0 0%, #1a418f 100%);
	color: #fff;
	border-color: transparent;
}

.mfv-btn--secondary {
	background: #fff;
	color: #16367a;
	border-color: #2657c5;
}

.mfv-btn--secondary:hover,
.mfv-btn--secondary:focus {
	background: #f8fafc;
	border-color: #16367a;
	color: #0e2458;
}

/* ---------- Notice ---------- */

.mfv-notice {
	padding: 1rem 1.25rem;
	background: var(--mfv-cream);
	border: 1px solid var(--mfv-border);
	border-radius: var(--mfv-radius);
	box-shadow: var(--mfv-shadow);
}

.mfv-notice p {
	margin: 0;
}

/* ---------- Library grid ---------- */

.mfv-library {
	margin: 1.5rem 0;
}

.mfv-library__grid {
	display: grid;
	gap: 1.5rem;
}

.mfv-library__grid--cols-1 { grid-template-columns: 1fr; }
.mfv-library__grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mfv-library__grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mfv-library__grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
	.mfv-library__grid--cols-3,
	.mfv-library__grid--cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.mfv-library__grid--cols-2,
	.mfv-library__grid--cols-3,
	.mfv-library__grid--cols-4 {
		grid-template-columns: 1fr;
	}
}

.mfv-card {
	display: flex;
	flex-direction: column;
	background: var(--mfv-white);
	border: 1px solid var(--mfv-border);
	border-radius: var(--mfv-radius);
	overflow: hidden;
	box-shadow: var(--mfv-shadow);
	min-height: 100%;
}

.mfv-card__cover {
	background: var(--mfv-navy);
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-bottom: 1px solid var(--mfv-border);
	position: relative;
}

.mfv-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mfv-card__cover-placeholder {
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.mfv-card__cover .mfv-cover-placeholder {
	align-items: center;
	background:
		radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.16), transparent 55%),
		linear-gradient(165deg, #1e2f55 0%, #121a30 100%);
	display: flex;
	flex-direction: column;
	gap: 14px;
	height: 100%;
	justify-content: center;
	padding: 24px 16px;
	text-align: center;
	width: 100%;
}

.mfv-card__cover .mfv-cover-placeholder__mark {
	height: 48px;
	width: 48px;
}

.mfv-card__cover .mfv-cover-placeholder__label {
	color: rgba(247, 241, 227, 0.88);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 13px;
	font-style: italic;
	letter-spacing: 0.04em;
	max-width: 10em;
}

.mfv-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	padding: 1.15rem 1.2rem 1.3rem;
	flex: 1;
	background: var(--mfv-cream);
}

.mfv-card__type {
	display: inline-block;
	align-self: flex-start;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mfv-burgundy);
	border: 1px solid rgba(90, 31, 43, 0.25);
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.65);
}

.mfv-card__title {
	margin: 0.15rem 0 0;
	font-size: 1.2rem;
	line-height: 1.3;
	color: var(--mfv-navy);
	font-weight: 600;
}

.mfv-card__date {
	margin: 0;
	font-size: 0.9rem;
	color: var(--mfv-muted);
}

.mfv-card__description {
	margin: 0.2rem 0 0;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--mfv-text);
	flex: 1;
}

.mfv-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 0.85rem;
}

.mfv-card__unavailable {
	font-size: 0.9rem;
	color: var(--mfv-muted);
}

/* ---------- Viewer ---------- */

.mfv-viewer {
	margin: 1.5rem 0;
	background: var(--mfv-cream);
	border: 1px solid var(--mfv-border);
	border-radius: var(--mfv-radius);
	box-shadow: var(--mfv-shadow);
	overflow: hidden;
}

.mfv-viewer__header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.15rem 1.35rem;
	background: var(--mfv-navy);
	color: var(--mfv-cream);
	border-bottom: 1px solid var(--mfv-gold);
}

.mfv-viewer__type {
	display: inline-block;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mfv-gold);
	margin-bottom: 0.35rem;
}

.mfv-viewer__title {
	margin: 0;
	font-size: 1.45rem;
	line-height: 1.25;
	color: var(--mfv-cream);
	font-weight: 600;
}

.mfv-viewer__meta {
	margin-top: 0.45rem;
}

.mfv-viewer__date {
	display: block;
	font-size: 0.9rem;
	color: rgba(247, 241, 227, 0.8);
}

.mfv-viewer__description {
	margin: 0.4rem 0 0;
	font-size: 0.95rem;
	line-height: 1.45;
	color: rgba(247, 241, 227, 0.88);
	max-width: 46rem;
}

.mfv-viewer__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: flex-start;
}

.mfv-viewer__toolbar .mfv-btn--secondary {
	background: transparent;
	color: var(--mfv-cream);
	border-color: rgba(200, 162, 74, 0.65);
}

.mfv-viewer__toolbar .mfv-btn--secondary:hover,
.mfv-viewer__toolbar .mfv-btn--secondary:focus {
	background: rgba(247, 241, 227, 0.1);
	color: var(--mfv-white);
	border-color: var(--mfv-gold);
}

.mfv-viewer__toolbar .mfv-btn--primary {
	background: var(--mfv-burgundy);
}

.mfv-viewer__cover-gate {
	padding: 2rem 1.25rem;
	background: var(--mfv-cream);
}

.mfv-viewer__cover-panel {
	max-width: 320px;
	margin: 0 auto;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
}

.mfv-viewer__cover-image {
	width: 100%;
	max-width: 260px;
	border-radius: 6px;
	border: 1px solid var(--mfv-gold);
	box-shadow: 0 10px 28px rgba(16, 24, 47, 0.18);
	background: var(--mfv-white);
}

.mfv-viewer__stage {
	padding: 1rem;
	background: #e9e2d2;
}

.mfv-viewer__stage.is-hidden {
	display: none;
}

.mfv-viewer__frame-wrap {
	position: relative;
	width: 100%;
	min-height: 70vh;
	background: var(--mfv-white);
	border: 1px solid var(--mfv-border);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px rgba(16, 24, 47, 0.03);
}

.mfv-viewer__frame {
	display: block;
	width: 100%;
	height: 70vh;
	min-height: 480px;
	border: 0;
	background: var(--mfv-white);
}

.mfv-viewer__fallback {
	margin-top: 0.85rem;
	padding: 0.9rem 1rem;
	background: rgba(255, 255, 255, 0.72);
	border: 1px dashed rgba(90, 31, 43, 0.25);
	border-radius: 6px;
	color: var(--mfv-muted);
	font-size: 0.92rem;
}

.mfv-viewer__fallback p {
	margin: 0 0 0.65rem;
}

/* Fullscreen / iOS immersive fallback */
.mfv-viewer.is-fullscreen,
.mfv-modal__dialog.is-fullscreen,
.mfv-viewer.mfv-immersive,
.mfv-modal__dialog.mfv-immersive {
	background: var(--mfv-navy);
}

.mfv-viewer.is-fullscreen .mfv-viewer__stage,
.mfv-modal__dialog.is-fullscreen .mfv-modal__stage,
.mfv-viewer.mfv-immersive .mfv-viewer__stage,
.mfv-modal__dialog.mfv-immersive .mfv-modal__stage,
.mfv-viewer.mfv-immersive .mfv-modal__stage,
.mfv-modal__dialog.mfv-immersive [data-mfv-modal-stage] {
	min-height: calc(100vh - 90px);
	min-height: calc(100dvh - 90px);
	padding: 0.75rem;
}

.mfv-viewer.mfv-immersive,
.mfv-modal__dialog.mfv-immersive {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	max-height: none !important;
	margin: 0 !important;
	border-radius: 0 !important;
	z-index: 2147483000 !important;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

body.mfv-immersive-open {
	overflow: hidden !important;
	touch-action: none;
}

body.mfv-immersive-open .mfv-modal {
	padding: 0;
}

body.mfv-immersive-open .mfv-modal__backdrop {
	display: none;
}

.mfv-viewer.mfv-immersive .mfv-flipbook__book,
.mfv-modal__dialog.mfv-immersive .mfv-flipbook__book,
.mfv-viewer.mfv-immersive .mfv-flipbook__spread,
.mfv-modal__dialog.mfv-immersive .mfv-flipbook__spread,
.mfv-viewer.mfv-immersive .mfv-flipbook__page,
.mfv-modal__dialog.mfv-immersive .mfv-flipbook__page {
	min-height: calc(100dvh - 150px);
}

/* ---------- Modal ---------- */

.mfv-modal[hidden] {
	display: none !important;
}

.mfv-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.mfv-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 24, 47, 0.72);
}

.mfv-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(1100px, 96vw);
	max-height: 92vh;
	overflow: auto;
	background: var(--mfv-cream);
	border: 1px solid var(--mfv-gold);
	border-radius: var(--mfv-radius);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.mfv-modal__close {
	position: absolute;
	top: 0.65rem;
	right: 0.75rem;
	z-index: 2;
	width: 2.1rem;
	height: 2.1rem;
	border: 1px solid rgba(200, 162, 74, 0.65);
	border-radius: 50%;
	background: transparent;
	color: var(--mfv-cream);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.mfv-modal__close:hover,
.mfv-modal__close:focus {
	background: rgba(247, 241, 227, 0.12);
	color: var(--mfv-white);
}

.mfv-modal__header {
	padding-right: 3rem;
}

.mfv-modal__stage {
	padding: 1rem;
}

body.mfv-modal-open {
	overflow: hidden;
}

/* ---------- Card lock badge ---------- */

.mfv-card__lock {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	padding: 0.25rem 0.55rem;
	border-radius: 4px;
	background: var(--mfv-burgundy);
	color: var(--mfv-cream);
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: 1px solid var(--mfv-gold);
}

/* ---------- Password gate ---------- */

.mfv-password-gate {
	padding: 2rem 1.25rem;
	background: var(--mfv-cream);
}

.mfv-password-gate__panel {
	max-width: 380px;
	margin: 0 auto;
	text-align: center;
}

.mfv-password-gate__cover {
	width: 140px;
	margin: 0 auto 1rem;
	border: 1px solid var(--mfv-gold);
	border-radius: 6px;
	display: block;
}

.mfv-password-gate__title {
	margin: 0 0 0.5rem;
	color: var(--mfv-navy);
	font-size: 1.25rem;
}

.mfv-password-gate__text {
	margin: 0 0 1.1rem;
	color: var(--mfv-muted);
	font-size: 0.95rem;
	line-height: 1.45;
}

.mfv-password-form {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	align-items: stretch;
}

.mfv-password-form__input {
	width: 100%;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--mfv-border);
	border-radius: 6px;
	background: var(--mfv-white);
	color: var(--mfv-text);
	font-size: 1rem;
}

.mfv-password-form__error {
	margin: 0;
	color: var(--mfv-burgundy);
	font-size: 0.9rem;
}

.mfv-password-form.is-busy {
	opacity: 0.7;
	pointer-events: none;
}

/* ---------- Flipbook engine ---------- */

.mfv-flipbook {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.mfv-flipbook__loading {
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mfv-navy);
	border: 1px solid var(--mfv-border);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.55);
}

.mfv-flipbook__loading[hidden],
.mfv-flipbook__book[hidden],
.mfv-flipbook__controls[hidden],
.mfv-viewer__fallback[hidden],
.mfv-viewer__stage[hidden],
.mfv-password-gate[hidden],
.mfv-modal-password[hidden],
.mfv-modal [hidden] {
	display: none !important;
}

.mfv-flipbook__book {
	position: relative;
	display: flex;
	align-items: stretch;
	min-height: 62vh;
}

.mfv-flipbook__spread {
	position: relative;
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	min-height: 62vh;
	perspective: 2200px;
	background: #d9d1bf;
	border: 1px solid var(--mfv-border);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px rgba(16, 24, 47, 0.04);
}

.mfv-flipbook--single .mfv-flipbook__spread {
	grid-template-columns: 1fr;
}

.mfv-flipbook--single .mfv-flipbook__page--right {
	display: none;
}

.mfv-flipbook__page {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--mfv-white);
	padding: 0.75rem;
	min-height: 62vh;
}

.mfv-flipbook__page--left {
	border-right: 1px solid rgba(16, 24, 47, 0.12);
	box-shadow: inset -10px 0 18px -14px rgba(16, 24, 47, 0.35);
}

.mfv-flipbook__page--right {
	box-shadow: inset 10px 0 18px -14px rgba(16, 24, 47, 0.35);
}

.mfv-flipbook__page canvas {
	max-width: 100%;
	max-height: calc(62vh - 1.5rem);
	width: auto;
	height: auto;
	display: block;
	box-shadow: 0 2px 10px rgba(16, 24, 47, 0.08);
}

.mfv-flipbook__flipper {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50%;
	right: 0;
	transform-origin: left center;
	transform-style: preserve-3d;
	pointer-events: none;
	opacity: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	background: var(--mfv-white);
	box-shadow: -4px 0 18px rgba(16, 24, 47, 0.18);
}

.mfv-flipbook--single .mfv-flipbook__flipper {
	width: 100%;
	right: 0;
}

.mfv-flipbook__flipper canvas {
	max-width: 100%;
	max-height: calc(62vh - 1.5rem);
}

.mfv-flipbook__flipper.is-flipping-next {
	opacity: 1;
	animation: mfv-flip-next 0.6s ease forwards;
}

.mfv-flipbook__flipper.is-flipping-prev {
	opacity: 1;
	left: 0;
	right: auto;
	transform-origin: right center;
	animation: mfv-flip-prev 0.6s ease forwards;
}

@keyframes mfv-flip-next {
	0% { transform: rotateY(0deg); opacity: 1; }
	100% { transform: rotateY(-120deg); opacity: 0.35; }
}

@keyframes mfv-flip-prev {
	0% { transform: rotateY(0deg); opacity: 1; }
	100% { transform: rotateY(120deg); opacity: 0.35; }
}

.mfv-flipbook__hotspot {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 12%;
	max-width: 70px;
	z-index: 4;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.mfv-flipbook__hotspot--prev { left: 0; }
.mfv-flipbook__hotspot--next { right: 0; }

.mfv-flipbook__hotspot:hover {
	background: rgba(200, 162, 74, 0.08);
}

.mfv-flipbook__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
}

.mfv-flipbook__status {
	min-width: 8rem;
	text-align: center;
	color: var(--mfv-navy);
	font-size: 0.95rem;
}

.mfv-modal__dialog {
	width: min(1200px, 96vw);
}

/* ---------- Premium bookshelf ---------- */

.mfv-shelf {
	--mfv-wood-dark: #2b1810;
	--mfv-wood: #7a4a2a;
	--mfv-wood-mid: #9a6338;
	--mfv-wood-light: #c08958;
	--mfv-wood-highlight: #d7a872;
	--mfv-alcove: #efe4cf;
	--mfv-alcove-deep: #e2d3b6;
	margin: 2rem 0;
}

.mfv-shelf__header {
	margin-bottom: 1.35rem;
	text-align: center;
}

.mfv-shelf__title {
	margin: 0;
	font-size: 1.85rem;
	color: var(--mfv-navy);
	letter-spacing: 0.03em;
}

.mfv-shelf__description {
	margin: 0.5rem auto 0;
	max-width: 40rem;
	color: var(--mfv-muted);
	font-size: 1rem;
	line-height: 1.45;
}

.mfv-shelf__case {
	position: relative;
	padding: 1.35rem 1.15rem 1.6rem;
	border-radius: 16px;
	border: 2px solid var(--mfv-gold);
	background:
		linear-gradient(180deg, #5a3420 0%, #3d2214 18%, #2b1810 100%);
	box-shadow:
		0 22px 48px rgba(16, 24, 47, 0.28),
		inset 0 1px 0 rgba(255, 230, 180, 0.2),
		inset 0 0 0 8px rgba(90, 52, 32, 0.55);
}

.mfv-shelf__case::before {
	content: "";
	position: absolute;
	inset: 12px;
	border-radius: 10px;
	pointer-events: none;
	box-shadow: inset 0 0 0 1px rgba(200, 162, 74, 0.28);
}

.mfv-shelf__row {
	position: relative;
	margin: 0 0 1.9rem;
	padding: 0.35rem 0.35rem 0;
	border-radius: 8px;
	background:
		linear-gradient(180deg, var(--mfv-alcove) 0%, var(--mfv-alcove-deep) 100%);
	box-shadow:
		inset 0 10px 18px rgba(90, 52, 32, 0.12),
		inset 0 -2px 0 rgba(255, 255, 255, 0.35);
}

.mfv-shelf__row:last-child {
	margin-bottom: 0.2rem;
}

.mfv-shelf__ledge {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 18px;
	border-radius: 0 0 4px 4px;
	background:
		linear-gradient(180deg, var(--mfv-wood-highlight) 0%, var(--mfv-wood-mid) 35%, var(--mfv-wood) 70%, var(--mfv-wood-dark) 100%);
	box-shadow:
		0 10px 16px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 235, 200, 0.45),
		inset 0 -2px 0 rgba(0, 0, 0, 0.25);
	z-index: 2;
}

.mfv-shelf__ledge::after {
	content: "";
	position: absolute;
	left: 8%;
	right: 8%;
	top: 3px;
	height: 2px;
	border-radius: 2px;
	background: rgba(255, 230, 180, 0.35);
}

.mfv-shelf__books {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: flex-end;
	gap: 1.1rem;
	padding: 1.1rem 1rem 1.35rem;
	min-height: 250px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	position: relative;
	z-index: 1;
}

.mfv-shelf__empty {
	margin: 0;
	padding: 2.4rem 1rem;
	color: #6d5b45;
	text-align: center;
	width: 100%;
	font-style: italic;
}

.mfv-book {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	width: 124px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.55rem;
	color: var(--mfv-navy);
	font-family: Georgia, "Times New Roman", Times, serif;
	transition: transform 0.22s ease, filter 0.22s ease;
}

.mfv-book:hover,
.mfv-book:focus {
	transform: translateY(-10px) scale(1.02);
	outline: none;
	filter: drop-shadow(0 10px 14px rgba(43, 24, 16, 0.28));
}

.mfv-book__cover {
	position: relative;
	width: 100%;
	height: 172px;
	border-radius: 3px 7px 7px 3px;
	overflow: hidden;
	border: 2px solid #c8a24a;
	box-shadow:
		4px 8px 16px rgba(43, 24, 16, 0.35),
		inset -8px 0 14px rgba(0, 0, 0, 0.22),
		inset 0 0 0 1px rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
}

.mfv-book__cover::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 8px;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.08));
	z-index: 1;
	pointer-events: none;
}

/* Blue book covers against cream shelf — high contrast */
.mfv-book--tone-0 .mfv-book__cover {
	background: linear-gradient(165deg, #1a2748 0%, #10182f 55%, #0a1020 100%);
}
.mfv-book--tone-1 .mfv-book__cover {
	background: linear-gradient(165deg, #243965 0%, #162447 55%, #10182f 100%);
}
.mfv-book--tone-2 .mfv-book__cover {
	background: linear-gradient(165deg, #2c4570 0%, #1a3058 55%, #121f3a 100%);
}
.mfv-book--tone-3 .mfv-book__cover {
	background: linear-gradient(165deg, #334e7a 0%, #1e3360 55%, #152748 100%);
}

.mfv-book__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mfv-book__spine-title {
	display: block;
	padding: 0.75rem 0.6rem;
	color: #f7f1e3;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.mfv-book__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	width: 100%;
	padding: 0.15rem 0.15rem 0;
}

.mfv-book__label {
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	max-width: 100%;
	color: #10182f;
	text-shadow: none;
}

.mfv-book__type {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #5a1f2b;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(90, 31, 43, 0.2);
	border-radius: 999px;
	padding: 0.15rem 0.45rem;
	text-shadow: none;
}

.mfv-book--locked .mfv-book__cover::after {
	content: "Locked";
	position: absolute;
	left: 0.4rem;
	top: 0.4rem;
	z-index: 2;
	padding: 0.18rem 0.4rem;
	border-radius: 3px;
	background: rgba(90, 31, 43, 0.95);
	border: 1px solid #c8a24a;
	color: #f7f1e3;
	font-size: 0.6rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mfv-shelf--admin {
	margin: 0;
}

.mfv-shelf--admin .mfv-book {
	pointer-events: none;
	cursor: default;
}

.mfv-shelf--admin .mfv-book:hover {
	transform: none;
	filter: none;
}

@media (max-width: 640px) {
	.mfv-viewer__title {
		font-size: 1.2rem;
	}

	.mfv-flipbook__book,
	.mfv-flipbook__spread,
	.mfv-flipbook__page {
		min-height: 52vh;
	}

	.mfv-card__actions .mfv-btn {
		width: 100%;
	}

	.mfv-book {
		width: 96px;
	}

	.mfv-book__cover {
		height: 140px;
	}
}
