/* Epaper One Reader Styles */
.epo-reader {
	--epo-r-bg: #1a1a2e;
	--epo-r-surface: #16213e;
	--epo-r-toolbar: #0f3460;
	--epo-r-text: #e8e8e8;
	--epo-r-accent: #e94560;
	--epo-r-border: #2a2a4a;
	--epo-r-thumb-w: 120px;
}

.epo-reader.epo-light,
.epo-reader-theme-shell.epo-light .epo-reader {
	--epo-r-bg: #f0f2f5;
	--epo-r-surface: #ffffff;
	--epo-r-toolbar: #ffffff;
	--epo-r-text: #1a1a2e;
	--epo-r-border: #e2e8f0;
}

.epo-reader-body { margin: 0; padding: 0; overflow: hidden; background: var(--epo-r-bg); color: var(--epo-r-text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.epo-reader-body.epo-light { background: #f0f2f5; color: #1a1a2e; }

.epo-reader { display: flex; flex-direction: column; height: var(--epo-reader-h, 100dvh); width: 100%; max-width: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--epo-r-text); background: var(--epo-r-bg); --epo-reader-h: 100dvh; min-height: 0; overflow: hidden; box-sizing: border-box; }

/* Loading */
.epo-reader-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; }
.epo-spinner { width: 40px; height: 40px; border: 3px solid var(--epo-r-border); border-top-color: var(--epo-r-accent); border-radius: 50%; animation: epo-spin .8s linear infinite; }
@keyframes epo-spin { to { transform: rotate(360deg); } }

/* Toolbar */
.epo-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--epo-r-toolbar); border-bottom: 1px solid var(--epo-r-border); flex-shrink: 0; z-index: 100; }
.epo-toolbar-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.epo-toolbar-brand img { height: 32px; width: auto; }
.epo-toolbar-brand h1 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epo-toolbar-brand span { font-size: 12px; color: #94a3b8; }
.epo-toolbar-edition-meta { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.epo-toolbar-edition-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epo-toolbar-edition-date { font-size: 12px; color: #94a3b8; }
.epo-reader-theme-shell .epo-toolbar-edition-title,
.epo-reader-theme-shell .epo-toolbar-edition-date { color: inherit; }
.epo-toolbar-btn { background: transparent; border: 1px solid var(--epo-r-border); color: var(--epo-r-text); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 4px; transition: background .15s; }
.epo-toolbar-btn:hover { background: rgba(255,255,255,.08); }
.epo-toolbar-btn.active { background: var(--epo-r-accent); border-color: var(--epo-r-accent); color: #fff; }
.epo-toolbar-btn svg { width: 16px; height: 16px; fill: currentColor; }
.epo-page-info { font-size: 13px; padding: 0 8px; white-space: nowrap; }
.epo-zoom-display { font-size: 12px; min-width: 40px; text-align: center; }

/* Main layout */
.epo-main { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* Thumbnails */
.epo-thumbs { width: var(--epo-r-thumb-w); background: var(--epo-r-surface); border-right: 1px solid var(--epo-r-border); overflow-y: auto; flex-shrink: 0; transition: width .2s; }
.epo-thumbs.hidden { width: 0; overflow: hidden; }
.epo-thumb { padding: 8px; cursor: pointer; border-bottom: 1px solid var(--epo-r-border); transition: background .15s; }
.epo-thumb:hover, .epo-thumb.active { background: rgba(233,69,96,.15); }
.epo-thumb img { width: 100%; height: auto; border-radius: 2px; display: block; }
.epo-thumb span { display: block; text-align: center; font-size: 11px; margin-top: 4px; color: #94a3b8; }

/* Viewport + page fit — explicit pixel dimensions from JS (no transform scale) */
.epo-viewport {
	flex: 1 1 0;
	min-height: 0;
	min-width: 0;
	width: 100%;
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	overflow: hidden;
	position: relative;
	background: var(--epo-r-bg);
	touch-action: pan-x pan-y;
}
.epo-viewport.epo-viewport--zoomed {
	overflow: auto !important;
	-webkit-overflow-scrolling: touch;
	align-items: flex-start;
	justify-content: flex-start;
	cursor: grab;
	overscroll-behavior: contain;
	touch-action: none;
}
.epo-viewport.epo-viewport--panning { cursor: grabbing; user-select: none; touch-action: none; }
.epo-viewport:not(.epo-viewport--ready) .epo-flipbook .epo-page img.epo-page-image,
.epo-viewport:not(.epo-viewport--ready) .epo-scroll-view .epo-page img.epo-page-image { opacity: 0; }
.epo-viewport.epo-viewport--ready .epo-flipbook .epo-page img.epo-page-image,
.epo-viewport.epo-viewport--ready .epo-scroll-view .epo-page img.epo-page-image { opacity: 1; }

.epo-flipbook {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	box-sizing: border-box;
	padding: 6px;
	margin: 0 auto;
	flex: 0 0 auto;
	transform-origin: 0 0;
}
.epo-flipbook .epo-page {
	flex: 0 0 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	box-shadow: 0 4px 20px rgba(0,0,0,.4);
	background: #fff;
	line-height: 0;
	overflow: hidden;
}
.epo-flipbook .epo-page.single { flex: 0 0 auto; }
.epo-flipbook .epo-page:not(.single) { flex: 0 0 auto; }

/* Theme isolation — override Foxiz/Elementor img rules */
.epo-reader .epo-viewport img.epo-page-image,
.epo-reader .epo-flipbook img.epo-page-image,
.epo-reader .epo-scroll-view img.epo-page-image,
.epo-reader-theme-shell .epo-reader img.epo-page-image {
	display: block !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	vertical-align: top !important;
	object-fit: fill !important;
	object-position: top left !important;
	user-select: none;
	-webkit-user-drag: none;
	max-width: none !important;
	max-height: none !important;
}

/* Mobile flipbook: full-width column, vertical scroll — no height-constrained contain */
.epo-viewport.epo-viewport--mobile-fit {
	overflow-x: hidden !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
	align-items: stretch !important;
	justify-content: flex-start !important;
}
/* When zoomed: unlock both axes so drag/pan can reach page edges */
.epo-viewport.epo-viewport--zoomed,
.epo-viewport.epo-viewport--mobile-fit.epo-viewport--zoomed {
	overflow: auto !important;
	overflow-x: auto !important;
	overflow-y: auto !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	touch-action: none;
	cursor: grab;
	overscroll-behavior: contain;
}
.epo-viewport.epo-viewport--mobile-fit.epo-viewport--zoomed .epo-flipbook {
	width: max-content !important;
	max-width: none !important;
	min-width: 100%;
}
.epo-viewport.epo-viewport--mobile-fit.epo-viewport--zoomed .epo-flipbook .epo-page,
.epo-viewport.epo-viewport--mobile-fit.epo-viewport--zoomed .epo-flipbook .epo-page.single {
	width: auto !important;
	max-width: none !important;
}
.epo-viewport.epo-viewport--mobile-fit.epo-viewport--zoomed .epo-flipbook .epo-page img.epo-page-image {
	width: auto !important;
	max-width: none !important;
	height: auto !important;
}
.epo-viewport.epo-viewport--mobile-fit .epo-flipbook {
	width: 100% !important;
	height: auto !important;
	padding: 0 !important;
	gap: 0 !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	align-self: flex-start !important;
}
.epo-viewport.epo-viewport--mobile-fit .epo-flipbook .epo-page,
.epo-viewport.epo-viewport--mobile-fit .epo-flipbook .epo-page.single {
	width: 100% !important;
	max-width: 100% !important;
	flex: none !important;
	height: auto !important;
	align-self: flex-start !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	box-shadow: none;
	overflow: visible !important;
}
.epo-viewport.epo-viewport--mobile-fit .epo-flipbook .epo-page img.epo-page-image {
	width: 100% !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: none !important;
	object-fit: contain !important;
	object-position: top left !important;
}
.epo-page { position: relative; box-shadow: 0 4px 20px rgba(0,0,0,.4); background: #fff; }
.epo-page img.epo-page-image { display: block; user-select: none; -webkit-user-drag: none; }

.epo-scroll-view {
	width: 100%;
	height: 100%;
	overflow-y: auto;
	padding: 12px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

/* Grid view */
.epo-grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 20px; width: 100%; height: 100%; overflow-y: auto; align-content: start; }
.epo-grid-view .epo-page { cursor: pointer; }
.epo-grid-view .epo-page img { max-width: 100%; max-height: 300px; object-fit: contain; }

/* Slider */
.epo-slider { display: none; }

/* Progress bar */
.epo-reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--epo-r-accent); z-index: 200; transition: width .3s; }

/* Fullscreen */
.epo-reader:fullscreen .epo-toolbar { position: fixed; top: 0; left: 0; right: 0; }
.epo-reader:fullscreen .epo-main { padding-top: 52px; }

/* Archive */
.epo-archive-body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f7fafc; color: #2d3748; }
.epo-archive-wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.epo-archive-header { text-align: center; padding: 32px 0; border-bottom: 3px solid var(--epo-primary, #1a365d); margin-bottom: 24px; }
.epo-archive-logo { max-height: 80px; margin-bottom: 16px; }
.epo-archive-header h1 { font-size: 32px; margin: 0 0 8px; color: var(--epo-primary, #1a365d); }
.epo-archive-desc { color: #718096; max-width: 600px; margin: 0 auto; }
.epo-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.epo-archive-card { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s; }
.epo-archive-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.epo-archive-type { display: inline-block; font-size: 11px; text-transform: uppercase; background: #edf2f7; padding: 2px 8px; border-radius: 4px; color: #718096; margin-bottom: 8px; }
.epo-archive-card strong { display: block; font-size: 16px; margin-bottom: 4px; }
.epo-archive-date, .epo-archive-pages { display: block; font-size: 13px; color: #718096; }
.epo-archive-pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }
.epo-archive-pagination a { padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 4px; text-decoration: none; color: #2d3748; }
.epo-archive-pagination a.current { background: #2b6cb0; color: #fff; border-color: #2b6cb0; }
.epo-archive-footer { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #e2e8f0; color: #a0aec0; font-size: 13px; }

/* Breadcrumbs */
.epo-breadcrumbs { font-size: 13px; padding: 8px 0; margin-bottom: 16px; }
.epo-breadcrumbs a { color: #2b6cb0; text-decoration: none; }
.epo-bc-sep { margin: 0 6px; color: #a0aec0; }

/* Shortcodes */
.epo-shortcode-grid, .epo-shortcode-archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.epo-edition-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.epo-edition-link { display: block; padding: 16px; text-decoration: none; color: inherit; }
.epo-edition-paper { font-size: 11px; text-transform: uppercase; color: #718096; }
.epo-edition-title { display: block; font-size: 16px; margin: 4px 0; }
.epo-edition-date, .epo-edition-pages { font-size: 13px; color: #a0aec0; }
.epo-shortcode-newspapers { display: flex; flex-wrap: wrap; gap: 16px; }
.epo-newspaper-link { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none; color: inherit; }
.epo-newspaper-link img { height: 40px; width: auto; }
.epo-shortcode-empty { color: #a0aec0; font-style: italic; }

.epo-modal {
	--epo-r-bg: #1a1a2e;
	--epo-r-surface: #16213e;
	--epo-r-toolbar: #0f3460;
	--epo-r-text: #e8e8e8;
	--epo-r-accent: #e94560;
	--epo-r-border: #2a2a4a;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.epo-modal.epo-light {
	--epo-r-bg: #f0f2f5;
	--epo-r-surface: #ffffff;
	--epo-r-toolbar: #ffffff;
	--epo-r-text: #1a1a2e;
	--epo-r-border: #e2e8f0;
}
.epo-modal-content { background:var(--epo-r-surface); padding:0; border-radius:12px; max-width:min(520px, 100%); width:100%; max-height:min(92dvh, calc(100vh - 32px)); overflow:hidden; position:relative; display:flex; flex-direction:column; margin:auto; color:var(--epo-r-text); }
.epo-clip-modal-content { max-width:min(560px, 100%); }
.epo-clip-modal-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 16px 0; flex-shrink:0; border-bottom:1px solid var(--epo-r-border); }
.epo-clip-modal-header h3 { margin:0; }
.epo-clip-modal-body { overflow-y:auto; padding:16px; flex:1 1 auto; min-height:0; display:flex; flex-direction:column; gap:10px; -webkit-overflow-scrolling:touch; }
.epo-clip-modal-close { margin-left:auto; flex-shrink:0; }
body.epo-modal-open,
body.epo-clip-modal-open { overflow:hidden !important; }
#epo-share-links { display:flex; flex-direction:column; gap:14px; }
.epo-share-preview {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid var(--epo-r-border, #334155);
	border-radius: 12px;
	overflow: hidden;
	background: var(--epo-r-surface, #1e293b);
}
.epo-share-preview-image {
	display: block;
	width: 100%;
	max-height: 280px;
	object-fit: cover;
	object-position: top center;
	background: #0f172a;
}
.epo-share-preview-meta {
	padding: 12px 14px 8px;
}
.epo-share-preview-title {
	display: block;
	font-size: 15px;
	line-height: 1.35;
	color: var(--epo-r-text, #f8fafc);
	margin-bottom: 4px;
}
.epo-share-preview-desc {
	margin: 0 0 6px;
	font-size: 13px;
	line-height: 1.4;
	color: #94a3b8;
}
.epo-share-preview-domain {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #64748b;
}
.epo-share-preview-url {
	display: block;
	padding: 10px 14px 12px;
	font-size: 12px;
	line-height: 1.4;
	word-break: break-all;
	color: #22c55e;
	text-decoration: none;
	border-top: 1px solid var(--epo-r-border, #334155);
	background: rgba(0,0,0,.15);
}
.epo-share-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.epo-share-qr { max-width: 140px; border-radius: 8px; }
#epo-clip-preview { max-width:100%; width:100%; height:auto; max-height:min(42vh, 360px); display:block; margin:0 auto; object-fit:contain; flex-shrink:0; }
.epo-clip-actions { display:flex; flex-direction:column; gap:10px; width:100%; margin-top:0; }
.epo-crop-mode { cursor:crosshair; touch-action:none; }
.epo-crop-mode.epo-viewport,
.epo-viewport.epo-crop-mode { overflow: hidden; touch-action: none; }
.epo-crop-overlay { position:absolute; inset:0; z-index:50; }
.epo-crop-hint { position:absolute; top:10px; left:50%; transform:translateX(-50%); background:rgba(0,0,0,.7); color:#fff; padding:6px 12px; border-radius:4px; font-size:12px; pointer-events:none; }
.epo-crop-rect { position:absolute; border:2px dashed var(--epo-r-accent); background:rgba(233,69,96,.15); pointer-events:none; }
.epo-clip-url-input { width:100%; padding:8px; margin:8px 0; border:1px solid var(--epo-r-border); border-radius:6px; background:var(--epo-r-surface); color:var(--epo-r-text); font-size:12px; }
.epo-clip-format-picker { display:flex; gap:6px; margin-bottom:8px; flex-wrap:wrap; }
.epo-clip-share-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(104px, 1fr)); gap:8px; margin:0; width:100%; }
.epo-clip-share-btn { display:inline-flex; align-items:center; justify-content:center; padding:8px 10px; border-radius:6px; border:none; font-size:12px; font-weight:600; text-decoration:none; cursor:pointer; color:#fff; min-width:0; width:100%; box-sizing:border-box; text-align:center; }
.epo-clip-share-btn--facebook { background:#1877f2; }
.epo-clip-share-btn--twitter { background:#1da1f2; }
.epo-clip-share-btn--whatsapp { background:#25d366; }
.epo-clip-share-btn--email { background:#ea580c; }
.epo-clip-share-btn--telegram { background:#0088cc; }
.epo-clip-share-btn--linkedin { background:#0a66c2; }
.epo-clip-share-btn--open, .epo-clip-share-btn--copy { background:var(--epo-r-accent); color:#fff; }
.epo-clip-share-loading { font-size:12px; opacity:.7; }
.epo-clip-mobile-share { display:none; align-items:center; gap:8px; margin-left:auto; }
.epo-clip-mobile-share-btn {
	display:inline-flex; align-items:center; justify-content:center; gap:6px;
	border:none; border-radius:8px; padding:8px 12px; font-size:13px; font-weight:600; cursor:pointer; color:#fff;
}
.epo-clip-mobile-share-btn--whatsapp { background:#25d366; }
.epo-clip-mobile-share-btn--native { background:var(--epo-r-accent,#e94560); min-width:40px; padding:8px 10px; }
.epo-share-icon { display:block; }
.epo-mobile-actions-btn--whatsapp { background:#25d366; border-color:#25d366; color:#fff; display:inline-flex; align-items:center; justify-content:center; padding:6px 9px; }
.epo-mobile-actions-btn--native { display:inline-flex; align-items:center; justify-content:center; }
.epo-whatsapp-icon { display:block; }
.epo-col-default { width:72px; text-align:center; }
.epo-default-template-toggle { display:inline-flex; align-items:center; justify-content:center; margin:0; cursor:pointer; }
.epo-modal-content { max-width:min(520px, 94vw); margin:0 auto; }
.epo-search-form { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.epo-search-form input, .epo-search-form select { padding:8px 12px; border:1px solid #e2e8f0; border-radius:6px; }
.epo-ai-modal { max-width:560px; }
.epo-ai-summary-text { line-height:1.6; margin:12px 0; white-space:pre-wrap; }
.epo-ai-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.epo-ai-tag { background:rgba(233,69,96,.15); color:var(--epo-r-accent); padding:4px 10px; border-radius:999px; font-size:12px; }
.epo-archive-calendar { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-bottom:24px; }
.epo-cal-day { padding:8px; text-align:center; border-radius:4px; font-size:13px; }
.epo-cal-day.has-edition { background:#bee3f8; cursor:pointer; font-weight:600; }
.epo-cal-day.has-edition a { color:#2b6cb0; text-decoration:none; }
.epo-calendar-widget { max-width:360px; margin-bottom:20px; }
.epo-cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.epo-cal-header button { background:var(--epo-r-accent,#e94560); color:#fff; border:none; border-radius:4px; width:32px; height:32px; cursor:pointer; }
.epo-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.epo-cal-dow { font-size:11px; font-weight:600; text-align:center; color:#718096; }
.epo-cal-day { padding:8px 4px; text-align:center; border-radius:4px; font-size:13px; border:1px solid #edf2f7; }
.epo-cal-day.empty { border-color:transparent; }
.epo-cal-day.has-edition { background:#bee3f8; cursor:pointer; font-weight:600; color:#2b6cb0; }
.epo-inline-help { font-size:12px; color:#718096; margin:8px 0 16px; }
.epo-edition-snippet { display:block; font-size:12px; color:#4a5568; margin-top:4px; }
.epo-search-modal { min-width:min(480px,90vw); }
.epo-search-bar { display:flex; gap:8px; margin-bottom:12px; }
.epo-search-bar input { flex:1; padding:8px 12px; border:1px solid #e2e8f0; border-radius:6px; }
.epo-search-results { max-height:320px; overflow-y:auto; }
.epo-search-hit { display:block; padding:10px; border-bottom:1px solid #edf2f7; text-decoration:none; color:inherit; }
.epo-search-hit:hover { background:#f7fafc; }
.epo-search-hit span { display:block; font-size:12px; color:#4a5568; margin-top:4px; }
.epo-checkbox-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:8px; }
.epo-reader-ads-sidebar { width:160px; flex-shrink:0; padding:8px; }
.epo-mobile-actions { display: none; }
.epo-reader-footer { flex-shrink: 0; width: 100%; box-sizing: border-box; border-top: 1px solid var(--epo-r-border); background: var(--epo-r-surface); }
.epo-reader-ads-footer { text-align: center; padding: 8px 16px; flex-shrink: 0; }
.epo-related-papers { flex-shrink: 0; padding: 10px 16px; width: 100%; box-sizing: border-box; }
.epo-related-papers-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; margin: 0 0 8px; text-align: center; }
.epo-related-papers-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; width: 100%; }
.epo-related-paper-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--epo-r-border); border-radius: 8px; text-decoration: none; color: var(--epo-r-text); font-size: 13px; background: var(--epo-r-bg); transition: background 0.15s; }
.epo-related-paper-link:hover { background: rgba(233,69,96,.1); }
.epo-related-paper-link img { height: 24px; width: auto; max-width: 48px; object-fit: contain; }
.epo-toolbar-ads { display:flex; gap:8px; align-items:center; margin-left:auto; }
.epo-ad { margin:8px 0; text-align:center; }
.epo-ad-label { display:block; font-size:10px; color:#a0aec0; text-transform:uppercase; margin-bottom:4px; }
.epo-ad img { max-width:100%; height:auto; border-radius:4px; }
.epo-ad-modal-content { max-width:min(520px,92vw); }

/* Mobile toolbar hidden on desktop */
.epo-mobile-toolbar { display: none; }

/* Crop tool */
.epo-crop-overlay { position:absolute; inset:0; z-index:60; pointer-events:none; touch-action:none; }
.epo-crop-mode .epo-crop-overlay { pointer-events:auto; }
.epo-crop-hint { position:absolute; top:12px; left:50%; transform:translateX(-50%); background:rgba(0,0,0,.75); color:#fff; padding:6px 14px; border-radius:6px; font-size:13px; z-index:61; pointer-events:none; }
.epo-crop-rect { position:absolute; border:2px dashed var(--epo-r-accent); background:rgba(233,69,96,.12); box-shadow:0 0 0 9999px rgba(0,0,0,.35); pointer-events:auto; cursor:move; touch-action:none; will-change:left,top,width,height; }
.epo-crop-dim { position:absolute; top:-22px; left:0; background:var(--epo-r-accent); color:#fff; font-size:11px; padding:2px 6px; border-radius:4px; white-space:nowrap; pointer-events:none; }
.epo-crop-handle { position:absolute; width:14px; height:14px; background:#fff; border:2px solid var(--epo-r-accent); border-radius:2px; pointer-events:auto; touch-action:none; z-index:2; }
.epo-crop-handle--nw { top:-8px; left:-8px; cursor:nwse-resize; }
.epo-crop-handle--n { top:-8px; left:50%; margin-left:-7px; cursor:ns-resize; }
.epo-crop-handle--ne { top:-8px; right:-8px; cursor:nesw-resize; }
.epo-crop-handle--e { top:50%; right:-8px; margin-top:-7px; cursor:ew-resize; }
.epo-crop-handle--se { bottom:-8px; right:-8px; cursor:nwse-resize; }
.epo-crop-handle--s { bottom:-8px; left:50%; margin-left:-7px; cursor:ns-resize; }
.epo-crop-handle--sw { bottom:-8px; left:-8px; cursor:nesw-resize; }
.epo-crop-handle--w { top:50%; left:-8px; margin-top:-7px; cursor:ew-resize; }
.epo-crop-rail {
	position: absolute;
	top: 0;
	right: -44px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	pointer-events: auto;
}
.epo-crop-rail-btn {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 6px;
	background: #1e293b;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.epo-crop-rail-btn[data-action="crop-create"] { background: #ea580c; }
.epo-crop-rail-btn[data-action="crop-download"] { background: #16a34a; }
.epo-crop-template-preview { display: none !important; }
.epo-crop-bar { position: fixed; bottom: env(safe-area-inset-bottom, 0); left: 0; right: 0; z-index: 200; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--epo-r-toolbar); border-top: 1px solid var(--epo-r-border); box-sizing: border-box; }
.epo-reader-theme-shell .epo-crop-bar { position: sticky; bottom: 0; left: auto; right: auto; z-index: 120; }
.epo-crop-bar--hidden { display: none; }
.epo-crop-header {
	display: none;
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 95;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 8px 12px;
	background: var(--epo-r-surface, #1e293b);
	border-bottom: 1px solid var(--epo-r-border);
	box-sizing: border-box;
	flex-shrink: 0;
}
.epo-crop-header:not(.epo-crop-header--hidden) { display: flex; }
.epo-crop-header-label {
	margin-right: auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--epo-r-text, #e2e8f0);
}
.epo-crop-header-btn {
	appearance: none;
	border: 1px solid var(--epo-r-border, rgba(255,255,255,.18));
	background: transparent;
	color: var(--epo-r-text, #fff);
	border-radius: 8px;
	padding: 7px 10px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.epo-crop-header-btn--primary { background: var(--epo-r-accent, #e94560); border-color: transparent; }
.epo-crop-header-btn:disabled { opacity: .45; cursor: not-allowed; }
.epo-crop-title--needed { outline: 2px solid var(--epo-r-accent, #e94560); border-color: var(--epo-r-accent, #e94560); }
.epo-viewport.epo-viewport--live-zoom { overflow: hidden !important; }
.epo-viewport.epo-viewport--live-zoom .epo-flipbook,
.epo-viewport.epo-viewport--live-zoom .epo-scroll-view { transform-origin: center center; }
.epo-crop-size { font-size: 12px; color: #94a3b8; min-width: 80px; }
.epo-crop-title { flex: 1; min-width: 140px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--epo-r-border); background: var(--epo-r-surface); color: var(--epo-r-text); }
.epo-crop-preview-wrap { width: 56px; height: 56px; border-radius: 4px; overflow: hidden; border: 1px solid var(--epo-r-border); flex-shrink: 0; }
.epo-crop-live-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.epo-btn-primary { background: var(--epo-r-accent); color: #fff; border-color: var(--epo-r-accent); }

/* Theme shell — reader sits below WordPress theme header/footer */
.epo-reader-theme-shell {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
}

.epo-reader-theme-shell .epo-reader {
	height: var(--epo-reader-h, 100dvh);
	min-height: 0;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	border-top: 1px solid var(--epo-r-border, #e2e8f0);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.epo-reader-theme-shell.epo-light .epo-reader,
.epo-reader-theme-shell .epo-reader.epo-light {
	--epo-r-bg: #f5f5f5;
	--epo-r-surface: #ffffff;
	--epo-r-toolbar: #ffffff;
	--epo-r-text: #1a1a2e;
	--epo-r-border: #e2e8f0;
}

/* Do not let plugin a11y modes override theme header when embedded in theme */
.epo-reader-theme-shell .epo-reader.epo-a11y-contrast {
	--epo-r-bg: #000;
	--epo-r-text: #fff;
	--epo-r-border: #fff;
	--epo-r-accent: #ffff00;
}

/* Mobile */
@media (max-width: 768px) {
	.epo-reader-theme-shell { width: 100%; overflow-x: hidden; }
	.epo-reader-theme-shell .epo-reader { width: 100%; max-width: 100%; margin: 0 auto; height: var(--epo-reader-h, 100dvh); min-height: 0; }
	.epo-reader-ads-sidebar { display: none !important; width: 0 !important; padding: 0 !important; }
	.epo-mobile-actions {
		display: flex !important;
		align-items: center;
		justify-content: flex-end;
		gap: 6px;
		padding: 6px 10px;
		background: var(--epo-r-surface);
		border-bottom: 1px solid var(--epo-r-border);
		flex-shrink: 0;
	}
	.epo-mobile-actions-page {
		margin-right: auto;
		font-size: 13px;
		font-weight: 600;
		color: var(--epo-r-text);
		white-space: nowrap;
	}
	.epo-mobile-actions-btn {
		background: transparent;
		border: 1px solid var(--epo-r-border);
		color: var(--epo-r-text);
		padding: 6px 10px;
		border-radius: 6px;
		cursor: pointer;
		font-size: 14px;
		line-height: 1;
		min-width: 36px;
	}
	.epo-mobile-actions-btn.active,
	.epo-mobile-actions-btn.is-active {
		background: var(--epo-r-accent, #e94560);
		border-color: transparent;
		color: #fff;
	}
	.epo-mobile-actions-btn--native svg { display:block; }
	.epo-clip-modal-header { flex-wrap:wrap; padding-bottom:8px; }
	.epo-clip-mobile-share { display:flex !important; width:100%; justify-content:flex-end; order:3; padding-top:8px; }
	.epo-clip-mobile-share[hidden] { display:none !important; }
	.epo-clip-modal-header h3 { flex:1 1 auto; }
	.epo-clip-modal-close { order:2; }
	.epo-crop-active .epo-mobile-actions {
		display: flex !important;
	}
	.epo-main { width: 100%; flex: 1; min-height: 0; padding-bottom: 0; }
	.epo-toolbar {
		flex-wrap: nowrap;
		justify-content: space-between;
		padding: 4px 8px;
		gap: 6px;
	}
	.epo-toolbar > .epo-toolbar-btn,
	.epo-toolbar > .epo-page-info,
	.epo-toolbar > .epo-zoom-display,
	.epo-toolbar > .epo-lang-switch,
	.epo-toolbar > .epo-toolbar-ads,
	.epo-toolbar > button[data-action="toggle-thumbs"] { display: none !important; }
	.epo-toolbar-edition-meta { margin-right: 0; flex: 1; min-width: 0; }
	.epo-toolbar-edition-title { font-size: 13px; }
	.epo-slider { display: none; }
	.epo-thumbs { display: none; }
	.epo-thumbs.epo-thumbs--drawer:not(.hidden) {
		display: flex;
		position: fixed;
		bottom: calc(52px + env(safe-area-inset-bottom, 0px));
		left: 0;
		right: 0;
		width: 100%;
		height: 64px;
		overflow-x: auto;
		overflow-y: hidden;
		border-right: none;
		border-top: 1px solid var(--epo-r-border);
		z-index: 95;
		background: var(--epo-r-surface);
	}
	.epo-thumbs.hidden { display: none; }
	.epo-thumb { flex-shrink: 0; width: 52px; padding: 4px; }
	.epo-flipbook { width: 100%; max-width: 100%; height: auto; min-height: 0; margin: 0; padding: 0; align-self: flex-start; }
	.epo-viewport { width: 100%; max-width: 100%; flex: 1 1 0; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; align-items: flex-start !important; justify-content: flex-start !important; }
	.epo-viewport.epo-viewport--mobile-fit .epo-flipbook .epo-page img.epo-page-image {
		width: 100% !important;
		height: auto !important;
		max-width: 100% !important;
		max-height: none !important;
		object-fit: contain !important;
		object-position: top left !important;
	}
	.epo-reader-theme-shell .epo-reader .epo-viewport img.epo-page-image,
	.epo-reader-theme-shell .epo-reader .epo-flipbook img.epo-page-image {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		max-height: none !important;
		object-fit: contain !important;
		object-position: top left !important;
	}
	.epo-viewport.epo-viewport--zoomed {
		overflow: auto !important;
		align-items: flex-start !important;
		justify-content: flex-start !important;
		touch-action: none;
	}
	.epo-scroll-view { width: 100%; padding: 12px; box-sizing: border-box; }
	.epo-mobile-toolbar {
		display: flex !important;
		align-items: center;
		justify-content: space-around;
		gap: 2px;
		padding: 6px 4px;
		padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
		background: var(--epo-r-toolbar);
		border-top: 1px solid var(--epo-r-border);
		flex-shrink: 0;
		z-index: 100;
		position: relative;
	}
	.epo-mobile-toolbar-btn {
		flex: 1;
		min-width: 36px;
		max-width: 52px;
		background: transparent;
		border: 1px solid var(--epo-r-border);
		color: var(--epo-r-text);
		padding: 10px 2px;
		border-radius: 8px;
		cursor: pointer;
		font-size: 15px;
		line-height: 1;
	}
	.epo-mobile-toolbar-btn.active { background: var(--epo-r-accent); border-color: var(--epo-r-accent); color: #fff; }
	.epo-mobile-page { font-size: 11px; font-weight: 600; min-width: 40px; text-align: center; color: var(--epo-r-text); flex-shrink: 0; }
	.epo-reader-footer { display: none; }
	.epo-crop-bar { padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; flex-wrap: nowrap; overflow-x: auto; }
	.epo-crop-bar .epo-crop-title { flex: 1 1 auto; min-width: 100px; max-width: none; }
	.epo-crop-bar .epo-crop-size { min-width: 64px; flex-shrink: 0; }
	.epo-crop-bar .epo-toolbar-btn { flex-shrink: 0; white-space: nowrap; padding: 6px 10px; font-size: 12px; }
	.epo-modal-content { width: calc(100vw - 24px); max-width: 520px; }
	#epo-clip-preview { max-height: min(38vh, 300px); margin: 0 auto; }
}

/* Accessibility */
.epo-skip-link { position: absolute; left: -9999px; top: 0; z-index: 9999; padding: 12px 20px; background: #fff; color: #000; font-weight: 600; }
.epo-skip-link:focus { left: 8px; top: 8px; outline: 3px solid var(--epo-r-accent); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.epo-a11y-focus .epo-toolbar-btn:focus, .epo-a11y-focus .epo-lang-switch:focus { outline: 3px solid #fbbf24; outline-offset: 2px; }
.epo-a11y-contrast { --epo-r-bg: #000; --epo-r-text: #fff; --epo-r-border: #fff; --epo-r-accent: #ffff00; }
.epo-a11y-motion * { animation: none !important; transition: none !important; }
.epo-preview-banner { background: #f59e0b; color: #1a1a2e; text-align: center; padding: 8px 16px; font-size: 13px; font-weight: 600; }
.epo-access-denied { max-width: 480px; margin: 10vh auto; padding: 32px; text-align: center; background: var(--epo-r-surface); border-radius: 12px; }
.epo-access-denied .epo-btn-primary, .epo-access-denied .epo-btn-secondary { display: inline-block; margin: 8px; padding: 10px 20px; border-radius: 6px; text-decoration: none; }
.epo-btn-primary { background: var(--epo-r-accent); color: #fff; }
.epo-btn-secondary { border: 1px solid var(--epo-r-border); color: var(--epo-r-text); }
.epo-lang-switch { background: var(--epo-r-surface); color: var(--epo-r-text); border: 1px solid var(--epo-r-border); border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.epo-notice-box { padding: 16px; background: #f0f6fc; border-left: 4px solid #2271b1; margin: 16px 0; }
.epo-notice-warning { background: #fff8e5; border-left-color: #dba617; }
