@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
    --lime: #B9E523; --lime-hover: #C9F03F; --ink: #171B18; --surface: #F4F6EF; --muted: #5C6359; --line: #DDE2D6;
}
* { box-sizing: border-box; }
html, body.lb-body { margin: 0; height: 100%; background: var(--surface); color: var(--ink); font-family: "Manrope", system-ui, sans-serif; }
.lb { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.lb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.lb-bar { display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.lb-logo img { display: block; height: 30px; width: auto; }
.lb-title { display: flex; flex-direction: column; line-height: 1.15; padding-left: 20px; border-left: 1px solid var(--line); }
.lb-title strong { font-size: 15px; font-weight: 800; }
.lb-title span { font-size: 13px; color: var(--muted); }
.lb-sec select { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 34px 8px 16px; appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
    background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.lb-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.lb-back { color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.lb-back:hover { text-decoration: underline; }
.lb-cta { background: var(--lime); color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; padding: 10px 18px; border-radius: 999px; }
.lb-cta:hover { background: var(--lime-hover); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 24px; overflow: hidden; }
.lb-frame { width: min(100%, calc((100dvh - 170px) * 1.714)); max-width: 1500px; }
.lb-frame { transition: transform .6s ease; }
.lb-frame.is-cover { transform: translateX(-25%); }
.lb-frame.is-back { transform: translateX(25%); }
@media (prefers-reduced-motion: reduce) { .lb-frame { transition: none; } }
.lb-page { background: #fff; }
.lb-page img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.lb-page img:not([src]) { background: #fff radial-gradient(circle, var(--line) 0 6px, transparent 7px) center / 100% 100% no-repeat; }
.lb-empty { max-width: 520px; text-align: center; font-size: 16px; }
.lb-empty a { color: var(--ink); font-weight: 700; }

.lb-ctrl { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px 14px; }
.lb-btn { font: inherit; font-size: 18px; font-weight: 700; min-width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.lb-btn:hover:not(:disabled) { border-color: var(--ink); }
.lb-btn:disabled { opacity: .35; cursor: default; }
.lb-btn-text { font-size: 14px; padding: 0 18px; }
.lb-num { font-size: 14px; color: var(--muted); white-space: nowrap; }
.lb-num input { font: inherit; font-weight: 700; color: var(--ink); width: 64px; text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; -moz-appearance: textfield; }
.lb-num input::-webkit-inner-spin-button, .lb-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.lb-zoom { position: fixed; inset: 0; z-index: 100; background: rgba(23, 27, 24, .94); overflow: auto; padding: 64px 16px 32px; }
.lb-zoom[hidden] { display: none; }
.lb-zoom-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lb-zoom-pages img { display: block; width: min(100%, 1800px); height: auto; background: #fff; }
.lb-zoom-close { position: fixed; top: 14px; right: 16px; font: inherit; font-size: 14px; font-weight: 800; background: var(--lime); color: var(--ink); border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer; }

@media (max-width: 900px) {
    .lb-title, .lb-back { display: none; }
    .lb-bar { gap: 12px; padding: 10px 16px; }
    .lb-sec { min-width: 0; flex: 1; }
    .lb-sec select { width: 100%; }
    .lb-actions { margin-left: 0; }
}
/* Por debajo de 592px el libro pasa a una sola página. */
@media (max-width: 591px) {
    .lb-stage { padding: 12px 16px; }
    .lb-frame { width: min(100%, calc((100dvh - 190px) * .857)); }
    .lb-logo img { height: 24px; }
    .lb-cta { padding: 9px 14px; font-size: 13px; }
    .lb-ctrl { gap: 8px; }
}
@media (max-width: 420px) {
    .lb-logo, .lb-num-label { display: none; }
}
