/* Ebookifi EPUB Validator (scoped to .ebk-ev); tokens match the Description Formatter */

.ebk-ev {
	--ebk-green: #2d6a2d;
	--ebk-green-dark: #0d2e0d;
	--ebk-green-soft: #eaf3de;
	--ebk-ink: #1c1f1c;
	--ebk-muted: #555b55;
	--ebk-line: #e1e5e1;
	--ebk-line-strong: #c9cfc9;
	--ebk-surface: #ffffff;
	--ebk-canvas: #f6f8f5;
	--ebk-warn: #8a5a00;
	--ebk-warn-soft: #fff5dc;
	--ebk-err: #b02a2a;
	--ebk-err-soft: #fdeeee;
	--ebk-fatal: #7a1414;
	--ebk-info: #1d6a8a;
	--ebk-info-soft: #eaf4f8;
	--ebk-focus: #1d7c82;
	--ebk-radius: 14px;
	--ebk-radius-sm: 8px;
	--ebk-shadow: 0 1px 2px rgba(16, 24, 16, .05), 0 8px 24px rgba(16, 24, 16, .05);
	--ebk-fast: 150ms;
	--ebk-ease: cubic-bezier(.4, 0, .2, 1);
	color: var(--ebk-ink);
	font-size: 15px;
	line-height: 1.55;
	margin: 0 0 32px;
}
.ebk-ev *, .ebk-ev *::before, .ebk-ev *::after { box-sizing: border-box; }
.ebk-ev .screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute; width: 1px; word-wrap: normal;
}
.ebk-ev-noscript { background: var(--ebk-warn-soft); padding: 12px 16px; border-radius: var(--ebk-radius-sm); }
.ebk-ev-icon { flex: 0 0 auto; display: block; }
.ebk-ev-card { background: var(--ebk-surface); border: 1px solid var(--ebk-line); border-radius: var(--ebk-radius); box-shadow: var(--ebk-shadow); }

/* Buttons */
.ebk-ev-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
	font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--ebk-ink); text-decoration: none;
	background: #fff; border: 1px solid var(--ebk-line-strong); border-radius: var(--ebk-radius-sm); cursor: pointer;
	transition: background var(--ebk-fast) var(--ebk-ease), border-color var(--ebk-fast) var(--ebk-ease);
}
.ebk-ev-btn:hover { background: var(--ebk-canvas); border-color: #9aa39a; color: var(--ebk-ink); }
.ebk-ev-btn--primary { background: var(--ebk-green); border-color: var(--ebk-green); color: #fff; }
.ebk-ev-btn--primary:hover { background: var(--ebk-green-dark); border-color: var(--ebk-green-dark); color: #fff; }
.ebk-ev-btn:focus-visible, .ebk-ev-chip:focus-visible, .ebk-ev-code:focus-visible, .ebk-ev select:focus-visible, .ebk-ev-check input:focus-visible {
	outline: 3px solid var(--ebk-focus); outline-offset: 2px;
}

/* File picker */
.ebk-ev-pick { padding: 18px; }
.ebk-ev-drop {
	position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	min-height: 220px; padding: 28px 16px; text-align: center; cursor: pointer;
	background: var(--ebk-canvas); border: 2px dashed var(--ebk-line-strong); border-radius: var(--ebk-radius);
	transition: background var(--ebk-fast) var(--ebk-ease), border-color var(--ebk-fast) var(--ebk-ease);
}
.ebk-ev-drop > .ebk-ev-icon { color: var(--ebk-green); }
.ebk-ev-drop:hover, .ebk-ev-drop.is-over { background: var(--ebk-green-soft); border-color: var(--ebk-green); }
.ebk-ev-drop:focus-within { outline: 3px solid var(--ebk-focus); outline-offset: 2px; }
.ebk-ev-drop-title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.ebk-ev-drop-or { font-size: 13px; color: var(--ebk-muted); }
.ebk-ev-drop-hint { font-size: 13px; color: var(--ebk-muted); }
/* Visually hidden but still focusable, so keyboard users reach the picker. */
.ebk-ev-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.ebk-ev.is-busy .ebk-ev-drop { cursor: progress; opacity: .7; }
.ebk-ev-options { margin-top: 14px; }
.ebk-ev-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.ebk-ev-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ebk-green); flex: 0 0 auto; }
.ebk-ev-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--ebk-muted); }
.ebk-ev-note .ebk-ev-icon { width: 16px; height: 16px; margin-top: 2px; color: var(--ebk-green); }

/* Status line */
.ebk-ev-status { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 12px 16px; border-radius: var(--ebk-radius-sm); background: var(--ebk-info-soft); color: var(--ebk-info); font-weight: 600; }
.ebk-ev-status[hidden] { display: none; }
.ebk-ev-status.is-error { background: var(--ebk-err-soft); color: var(--ebk-err); }
.ebk-ev-spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ebk-ev-spin .8s linear infinite; flex: 0 0 auto; }
.ebk-ev-status.is-busy .ebk-ev-spinner { display: block; }
@keyframes ebk-ev-spin { to { transform: rotate(360deg); } }

/* Result */
.ebk-ev-result { margin-top: 16px; padding: 18px; scroll-margin-top: 90px; }
.ebk-ev-result[hidden] { display: none; }
.ebk-ev-verdict { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: var(--ebk-radius-sm); }
.ebk-ev-result[data-state="pass"] .ebk-ev-verdict { background: var(--ebk-green-soft); }
.ebk-ev-result[data-state="warn"] .ebk-ev-verdict { background: var(--ebk-warn-soft); }
.ebk-ev-result[data-state="fail"] .ebk-ev-verdict, .ebk-ev-result[data-state="fatal"] .ebk-ev-verdict { background: var(--ebk-err-soft); }
.ebk-ev-verdict-icon { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 20px; line-height: 1; }
.ebk-ev-result[data-state="pass"] .ebk-ev-verdict-icon { background: var(--ebk-green); }
.ebk-ev-result[data-state="pass"] .ebk-ev-verdict-icon::before { content: "\2713"; }
.ebk-ev-result[data-state="warn"] .ebk-ev-verdict-icon { background: var(--ebk-warn); }
.ebk-ev-result[data-state="warn"] .ebk-ev-verdict-icon::before { content: "\2713"; }
.ebk-ev-result[data-state="fail"] .ebk-ev-verdict-icon, .ebk-ev-result[data-state="fatal"] .ebk-ev-verdict-icon { background: var(--ebk-err); }
.ebk-ev-result[data-state="fail"] .ebk-ev-verdict-icon::before, .ebk-ev-result[data-state="fatal"] .ebk-ev-verdict-icon::before { content: "!"; }
.ebk-ev-verdict-body { min-width: 0; }
.ebk-ev-verdict-title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--ebk-ink); }
.ebk-ev-verdict-title:focus { outline: none; }
.ebk-ev-verdict-meta { margin: 4px 0 0; font-size: 13px; color: var(--ebk-muted); overflow-wrap: anywhere; }

.ebk-ev-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 6px; }
.ebk-ev-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ebk-ev-filters[hidden] { display: none; }
.ebk-ev-chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600;
	border-radius: 999px; border: 1px solid currentColor; background: #fff; cursor: pointer;
}
.ebk-ev-chip[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
.ebk-ev-chip-count { font-variant-numeric: tabular-nums; }
.ebk-ev-chip--fatal { color: var(--ebk-fatal); }
.ebk-ev-chip--error { color: var(--ebk-err); }
.ebk-ev-chip--warning { color: var(--ebk-warn); }
.ebk-ev-chip--info { color: var(--ebk-info); }
.ebk-ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ebk-ev-group { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ebk-muted); }
.ebk-ev-group select { font: inherit; font-size: 14px; height: 44px; padding: 6px 10px; border: 1px solid var(--ebk-line-strong); border-radius: var(--ebk-radius-sm); background: #fff; color: var(--ebk-ink); }

/* Messages */
.ebk-ev-group-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 15px; font-weight: 700; color: var(--ebk-ink); overflow-wrap: anywhere; }
.ebk-ev-group-count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ebk-canvas); color: var(--ebk-muted); }
.ebk-ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ebk-ev-msg { margin: 0; padding: 12px 14px; border: 1px solid var(--ebk-line); border-left-width: 4px; border-radius: var(--ebk-radius-sm); background: #fff; }
.ebk-ev-msg--fatal { border-left-color: var(--ebk-fatal); }
.ebk-ev-msg--error { border-left-color: var(--ebk-err); }
.ebk-ev-msg--warning { border-left-color: var(--ebk-warn); }
.ebk-ev-msg--info { border-left-color: var(--ebk-info); }
.ebk-ev-msg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ebk-ev-badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 4px; color: #fff; }
.ebk-ev-badge--fatal { background: var(--ebk-fatal); }
.ebk-ev-badge--error { background: var(--ebk-err); }
.ebk-ev-badge--warning { background: var(--ebk-warn); }
.ebk-ev-badge--info { background: var(--ebk-info); }
.ebk-ev-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ebk-ink); background: var(--ebk-canvas); padding: 1px 6px; border-radius: 4px; }
a.ebk-ev-code { display: inline-block; padding: 4px 8px; color: var(--ebk-green); text-decoration: underline; }
.ebk-ev-times { font-size: 12px; font-weight: 700; color: var(--ebk-muted); }
.ebk-ev-msg-text { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.ebk-ev-where { margin: 4px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ebk-muted); overflow-wrap: anywhere; }
.ebk-ev-tip { margin: 6px 0 0; font-size: 14px; color: var(--ebk-green-dark); }
.ebk-ev-empty { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--ebk-radius-sm); background: var(--ebk-canvas); }
.ebk-ev-more { margin-top: 12px; }

/* Metadata and "how it was made" sections (shared with the Metadata Checker) */
.ebk-ev-extra:empty, .ebk-ev-next:empty { display: none; }
.ebk-ev-section { margin-top: 18px; border: 1px solid var(--ebk-line); border-radius: var(--ebk-radius-sm); background: #fff; }
.ebk-ev-section-title {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 48px; padding: 12px 16px;
	font-size: 16px; font-weight: 700; cursor: pointer; list-style-position: inside;
}
.ebk-ev-section-title:focus-visible { outline: 3px solid var(--ebk-focus); outline-offset: 2px; border-radius: var(--ebk-radius-sm); }
.ebk-ev-section-sub { font-size: 13px; font-weight: 500; color: var(--ebk-muted); }
.ebk-ev-section > :not(summary) { margin-left: 16px; margin-right: 16px; }
.ebk-ev-section > :last-child { margin-bottom: 16px; }
.ebk-ev-meta-group { margin: 14px 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ebk-muted); }
.ebk-ev-checks .ebk-ev-meta-group:first-child { margin-top: 18px; }
.ebk-ev-meta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ebk-ev-meta { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid var(--ebk-line); border-radius: var(--ebk-radius-sm); background: #fff; }
.ebk-ev-meta-status { flex: 0 0 72px; text-align: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 6px; border-radius: 4px; }
.ebk-ev-meta--ok .ebk-ev-meta-status { background: var(--ebk-green-soft); color: var(--ebk-green-dark); }
.ebk-ev-meta--error .ebk-ev-meta-status { background: var(--ebk-err); color: #fff; }
.ebk-ev-meta--warning .ebk-ev-meta-status { background: var(--ebk-warn-soft); color: var(--ebk-warn); }
.ebk-ev-meta--info .ebk-ev-meta-status { background: var(--ebk-info-soft); color: var(--ebk-info); }
.ebk-ev-meta--error { border-left: 4px solid var(--ebk-err); }
.ebk-ev-meta--warning { border-left: 4px solid var(--ebk-warn); }
.ebk-ev-meta-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ebk-ev-meta-label { font-weight: 600; }
.ebk-ev-meta-value { overflow-wrap: anywhere; }
.ebk-ev-meta-note { font-size: 14px; color: var(--ebk-muted); }
.ebk-ev-meta-foot { margin: 12px 0 0; padding: 10px 12px; font-size: 14px; border-radius: var(--ebk-radius-sm); background: var(--ebk-info-soft); }
.ebk-ev-prod-made { margin: 4px 0 10px; }
.ebk-ev-prod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ebk-ev-prod { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 10px 12px; border-left: 4px solid var(--ebk-warn); border-radius: var(--ebk-radius-sm); background: var(--ebk-warn-soft); }
.ebk-ev-prod span { font-size: 14px; color: var(--ebk-ink); }
.ebk-ev-prod-clean { margin: 4px 0 0; color: var(--ebk-green-dark); }

/* What to do next */
.ebk-ev-next { margin-top: 20px; }
.ebk-ev-next-inner { display: grid; gap: 12px; }
.ebk-ev-step { padding: 16px 18px; border-radius: var(--ebk-radius-sm); background: var(--ebk-canvas); border: 1px solid var(--ebk-line); }
.ebk-ev-step-title { margin: 0 0 6px; font-size: 17px; line-height: 1.35; font-weight: 700; color: var(--ebk-ink); }
.ebk-ev-step p { margin: 0 0 8px; }
.ebk-ev-step-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ebk-ev-step--fix { background: var(--ebk-err-soft); border-color: #f2c9c9; }
.ebk-ev-step--reformat { background: var(--ebk-warn-soft); border-color: #f0dca8; }
.ebk-ev-step--ready { background: var(--ebk-green-soft); border-color: #cfe3b8; }

.ebk-ev-credit { margin: 12px 0 0; font-size: 13px; color: var(--ebk-muted); }
.ebk-ev-credit a { color: var(--ebk-green); text-decoration: underline; }

@media (max-width: 600px) {
	.ebk-ev-pick, .ebk-ev-result { padding: 14px; }
	.ebk-ev-drop { min-height: 180px; }
	.ebk-ev-actions { width: 100%; }
	.ebk-ev-actions .ebk-ev-btn { flex: 1 1 auto; }
	.ebk-ev-group { width: 100%; }
	.ebk-ev-group select { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
	.ebk-ev-spinner { animation-duration: 2.4s; }
	.ebk-ev *, .ebk-ev *::before, .ebk-ev *::after { transition: none !important; }
}
