:root {
    --librazo-accent: #1689c8;
    --librazo-accent-strong: #086fae;
    --librazo-surface: #ffffff;
    --librazo-surface-soft: #f4f7fb;
    --librazo-border: #dce3ec;
    --librazo-text: #172033;
    --librazo-muted: #667085;
}

html.librazo-modal-open,
body.librazo-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.librazo-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Biblioteca y pestañas de bimestres. */
.librazo-library {
    color: var(--librazo-text);
    width: 100%;
}

.librazo-bimester-tabs {
    display: flex;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 0 0 20px;
    padding: 5px;
    overflow-x: auto;
    background: #eef3f8;
    border: 1px solid var(--librazo-border);
    border-radius: 14px;
    scrollbar-width: thin;
}

.librazo-bimester-tab {
    appearance: none;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 18px;
    color: #475467;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.librazo-bimester-tab:hover {
    color: var(--librazo-accent-strong);
    background: rgba(255, 255, 255, 0.65);
}

.librazo-bimester-tab.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--librazo-accent), var(--librazo-accent-strong));
    box-shadow: 0 5px 14px rgba(8, 111, 174, 0.22);
}

.librazo-bimester-tab:focus-visible,
.librazo-book-button:focus-visible,
.librazo-icon-button:focus-visible,
.librazo-page-button:focus-visible,
.miniatura-container:focus-visible {
    outline: 3px solid #67c7ff;
    outline-offset: 3px;
}

.librazo-bimester-panel[hidden] {
    display: none !important;
}

.librazo-book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 20px;
    padding: 2px;
}

.librazo-book {
    min-width: 0;
    margin: 0;
}

.librazo-book-button {
    appearance: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 9px;
    overflow: hidden;
    color: var(--librazo-text);
    text-align: left;
    background: var(--librazo-surface);
    border: 1px solid var(--librazo-border);
    border-radius: 16px;
    box-shadow: 0 5px 16px rgba(16, 24, 40, 0.07);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.librazo-book-button:hover {
    transform: translateY(-4px);
    border-color: #8bcff2;
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.13);
}

.librazo-book-cover {
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    place-items: center;
    background: linear-gradient(145deg, #e9f6fd, #d8edf8);
    border-radius: 11px;
}

.librazo-book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
}

.librazo-book-button:hover .librazo-book-cover img {
    transform: scale(1.025);
}

.librazo-book-placeholder {
    display: grid;
    width: 68px;
    aspect-ratio: 4 / 5;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    place-items: center;
    background: linear-gradient(145deg, var(--librazo-accent), var(--librazo-accent-strong));
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(8, 111, 174, 0.2);
}

.librazo-book-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 11px 4px 4px;
}

.librazo-book-title {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.librazo-book-action {
    color: var(--librazo-accent-strong);
    font-size: 13px;
    font-weight: 650;
}

/* Visor a pantalla completa. */
.librazo-viewer {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: none;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    color: #f7f9fc;
    background: #161a20;
    isolation: isolate;
}

#librazoModal,
#librazoModal *,
#librazoModal *::before,
#librazoModal *::after {
    box-sizing: border-box;
}

.librazo-viewer-shell {
    display: grid;
    grid-template-rows: auto 3px minmax(0, 1fr) auto;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.librazo-viewer-toolbar {
    position: relative;
    z-index: 20;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-height: 60px;
    padding: 8px 14px;
    color: #f8fafc;
    background: rgba(20, 24, 31, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(14px);
}

.librazo-toolbar-primary,
.librazo-toolbar-actions {
    display: flex;
    gap: 9px;
    align-items: center;
    min-width: 0;
}

.librazo-toolbar-actions {
    justify-content: flex-end;
}

.librazo-document-heading {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.librazo-document-heading strong {
    font-size: 14px;
}

.librazo-document-heading span {
    overflow: hidden;
    max-width: min(32vw, 360px);
    color: #aeb8c7;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.librazo-page-status {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    min-height: 36px;
    padding: 6px 14px;
    color: #d8dee8;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
}

.librazo-page-status strong {
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

#librazoModal button.librazo-icon-button,
#librazoModal button.librazo-page-button {
    appearance: none !important;
    display: inline-grid !important;
    flex: 0 0 auto !important;
    float: none !important;
    padding: 0 !important;
    color: #eef2f7 !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    place-items: center !important;
    cursor: pointer !important;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

#librazoModal button.librazo-icon-button {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    border-radius: 11px !important;
}

#librazoModal button.librazo-icon-button > svg,
#librazoModal button.librazo-page-button > svg {
    display: none !important;
}

#librazoModal button.librazo-icon-button::before,
#librazoModal button.librazo-page-button::before {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
    content: '' !important;
    background-color: currentColor !important;
    background-image: none !important;
    -webkit-mask-repeat: no-repeat !important;
    -webkit-mask-position: center !important;
    -webkit-mask-size: contain !important;
    mask-repeat: no-repeat !important;
    mask-position: center !important;
    mask-size: contain !important;
}

#librazoModal #verminiaturas::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h3v3H4V5Zm5 0h11v3H9V5ZM4 10.5h3v3H4v-3Zm5 0h11v3H9v-3ZM4 16h3v3H4v-3Zm5 0h11v3H9v-3Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h3v3H4V5Zm5 0h11v3H9V5ZM4 10.5h3v3H4v-3Zm5 0h11v3H9v-3ZM4 16h3v3H4v-3Zm5 0h11v3H9v-3Z'/%3E%3C/svg%3E") !important;
}

#librazoModal #librazoFitBt::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9V4h5v2H6v3H4Zm11-5h5v5h-2V6h-3V4ZM6 15v3h3v2H4v-5h2Zm14 0v5h-5v-2h3v-3h2ZM9 9h6v6H9V9Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9V4h5v2H6v3H4Zm11-5h5v5h-2V6h-3V4ZM6 15v3h3v2H4v-5h2Zm14 0v5h-5v-2h3v-3h2ZM9 9h6v6H9V9Z'/%3E%3C/svg%3E") !important;
}

#librazoModal #fullscreenBt::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9V4h5v2H6v3H4Zm11-5h5v5h-2V6h-3V4ZM6 15v3h3v2H4v-5h2Zm14 0v5h-5v-2h3v-3h2Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9V4h5v2H6v3H4Zm11-5h5v5h-2V6h-3V4ZM6 15v3h3v2H4v-5h2Zm14 0v5h-5v-2h3v-3h2Z'/%3E%3C/svg%3E") !important;
}

#librazoModal.librazo-viewer.is-fullscreen #fullscreenBt::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4v5H4V7h3V4h2Zm6 0h2v3h3v2h-5V4ZM4 15h5v5H7v-3H4v-2Zm11 0h5v2h-3v3h-2v-5Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4v5H4V7h3V4h2Zm6 0h2v3h3v2h-5V4ZM4 15h5v5H7v-3H4v-2Zm11 0h5v2h-3v3h-2v-5Z'/%3E%3C/svg%3E") !important;
}

#librazoModal #cerrarModal::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6.7 5.3 5.3 5.29 5.3-5.3 1.4 1.42-5.29 5.3 5.3 5.29-1.42 1.4-5.3-5.29-5.29 5.3-1.4-1.42 5.29-5.3-5.3-5.29 1.42-1.4Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6.7 5.3 5.3 5.29 5.3-5.3 1.4 1.42-5.29 5.3 5.3 5.29-1.42 1.4-5.3-5.29-5.29 5.3-1.4-1.42 5.29-5.3-5.3-5.29 1.42-1.4Z'/%3E%3C/svg%3E") !important;
}

#librazoModal button.librazo-icon-button:hover:not(:disabled),
#librazoModal button.librazo-page-button:hover:not(:disabled) {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.17) !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
}

#librazoModal button.librazo-icon-button:disabled,
#librazoModal button.librazo-page-button:disabled {
    opacity: 0.35 !important;
    cursor: default !important;
}

#librazoModal button.librazo-close-button {
    color: #172033 !important;
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}

#librazoModal button.librazo-close-button:hover:not(:disabled) {
    color: #ffffff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.librazo-icon-contract {
    display: none;
}

.librazo-viewer.is-fullscreen .librazo-icon-expand {
    display: none;
}

.librazo-viewer.is-fullscreen .librazo-icon-contract {
    display: block;
}

.librazo-zoom-control {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    color: #cfd6e1;
    font-size: 17px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
}

#zoomBt {
    width: clamp(80px, 10vw, 145px);
    margin: 0;
    accent-color: #4db9f0;
    cursor: pointer;
}

#librazoZoomValue {
    min-width: 42px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.librazo-progress {
    position: relative;
    z-index: 25;
    grid-row: 2;
    width: 100%;
    height: 3px;
    overflow: hidden;
    appearance: none;
    color: #39b9f5;
    background: #2b3440;
    border: 0;
}

.librazo-progress[hidden] {
    visibility: hidden;
}

.librazo-progress::-webkit-progress-bar {
    background: #2b3440;
}

.librazo-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #23a8ea, #71d6ff);
    transition: width 160ms ease;
}

.librazo-progress::-moz-progress-bar {
    background: linear-gradient(90deg, #23a8ea, #71d6ff);
}

.librazo-viewer-stage {
    position: relative;
    grid-row: 3;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 30%, rgba(72, 86, 104, 0.45), transparent 44%),
        #252a31;
}

.librazo-book-viewport {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: #687386 #242a31;
    scrollbar-width: thin;
    touch-action: none;
}

.librazo-viewer-shell.is-zoomed .librazo-book-viewport {
    cursor: grab;
}

.librazo-book-viewport.is-panning {
    cursor: grabbing !important;
    user-select: none;
}

.librazo-book-scroll {
    display: grid;
    box-sizing: border-box;
    width: max-content;
    min-width: 100%;
    height: max-content;
    min-height: 100%;
    padding: 24px 64px;
    place-items: center;
    transition: padding 180ms ease;
}

.librazo-viewer-shell.is-zoomed .librazo-book-scroll {
    padding: max(32px, 20vh) max(72px, 20vw);
}

#revista {
    position: relative;
    flex: 0 0 auto;
    margin-block: 0;
}

.librazo-pagina {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(22, 32, 51, 0.06);
}

.librazo-pagina canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    opacity: 0;
    filter: blur(var(--librazo-protection-blur, 0));
    transition: opacity 180ms ease, filter 120ms linear;
    user-select: none;
    -webkit-user-drag: none;
}

.librazo-pagina.is-rendered canvas {
    opacity: 1;
}

.librazo-pagina:not(.is-rendered)::before {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    content: '';
    border: 3px solid #dce6ee;
    border-top-color: var(--librazo-accent);
    border-radius: 50%;
    animation: librazo-spin 800ms linear infinite;
}

.librazo-pagina.has-error::before {
    width: auto;
    height: auto;
    margin: 0;
    color: #b42318;
    content: '!';
    font-size: 26px;
    font-weight: 800;
    border: 0;
    animation: none;
    transform: translate(-50%, -50%);
}

#librazoModal button.librazo-page-button {
    position: absolute !important;
    z-index: 30;
    top: 50% !important;
    bottom: auto !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: -36px 0 0 !important;
    background-color: rgba(17, 21, 27, 0.78) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(10px);
    transform: none !important;
}

#librazoModal button.librazo-page-button-prev {
    right: auto !important;
    left: 14px !important;
}

#librazoModal button.librazo-page-button-next {
    right: 14px !important;
    left: auto !important;
}

#librazoModal #prevBt::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m15.4 5.4-1.4-1.4-8 8 8 8 1.4-1.4L8.8 12l6.6-6.6Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m15.4 5.4-1.4-1.4-8 8 8 8 1.4-1.4L8.8 12l6.6-6.6Z'/%3E%3C/svg%3E") !important;
}

#librazoModal #nextBt::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8.6 18.6 1.4 1.4 8-8-8-8-1.4 1.4 6.6 6.6-6.6 6.6Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8.6 18.6 1.4 1.4 8-8-8-8-1.4 1.4 6.6 6.6-6.6 6.6Z'/%3E%3C/svg%3E") !important;
}

.librazo-magnifier {
    --librazo-lens-x: 0px;
    --librazo-lens-y: 0px;
    position: fixed;
    z-index: 45;
    top: 0;
    left: 0;
    width: clamp(238px, 18vw, 282px);
    aspect-ratio: 1;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    background: #ffffff;
    border: 3px solid rgba(255, 255, 255, 0.94);
    border-radius: 16px;
    box-shadow:
        0 0 0 2px rgba(48, 62, 80, 0.82),
        0 18px 50px rgba(0, 0, 0, 0.42),
        inset 0 0 26px rgba(30, 50, 70, 0.13);
    pointer-events: none;
    transform: translate3d(var(--librazo-lens-x), var(--librazo-lens-y), 0) scale(0.94);
    transform-origin: center;
    transition: opacity 110ms ease, transform 140ms ease, visibility 140ms;
    will-change: transform, opacity;
}

.librazo-magnifier::after {
    position: absolute;
    inset: 8px;
    content: '';
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: inherit;
    box-shadow: inset 12px 14px 22px rgba(255, 255, 255, 0.12);
}

.librazo-magnifier.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translate3d(var(--librazo-lens-x), var(--librazo-lens-y), 0) scale(1);
}

#librazoMagnifierCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.librazo-interaction-hint {
    position: absolute;
    z-index: 35;
    bottom: 18px;
    left: 50%;
    max-width: calc(100% - 120px);
    padding: 9px 14px;
    visibility: hidden;
    color: #f3f7fb;
    font-size: 12px;
    font-weight: 650;
    text-align: center;
    background: rgba(14, 18, 23, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
    backdrop-filter: blur(10px);
}

.librazo-interaction-hint.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0);
}

.librazo-viewer-message {
    position: absolute;
    z-index: 15;
    top: 50%;
    left: 50%;
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: min(90%, 420px);
    padding: 14px 18px;
    color: #f8fafc;
    font-size: 14px;
    background: rgba(14, 18, 23, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
    transform: translate(-50%, -50%);
    backdrop-filter: blur(12px);
}

.librazo-viewer-message[hidden] {
    display: none !important;
}

.librazo-viewer-message.is-error {
    color: #ffe4e0;
    background: rgba(126, 28, 20, 0.92);
}

.librazo-viewer-message.is-error .librazo-spinner {
    display: none;
}

.librazo-retry-button {
    appearance: none;
    padding: 7px 11px;
    color: #7d1d17;
    font-size: 12px;
    font-weight: 750;
    background: #ffffff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.librazo-retry-button[hidden] {
    display: none !important;
}

.librazo-spinner {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: librazo-spin 700ms linear infinite;
}

@keyframes librazo-spin {
    to { transform: rotate(360deg); }
}

.librazo-thumbnail-drawer {
    position: relative;
    z-index: 24;
    grid-row: 4;
    min-width: 0;
    background: rgba(20, 24, 31, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.18);
}

#miniaturas {
    gap: 12px;
    align-items: stretch;
    width: 100%;
    height: 132px;
    padding: 10px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-color: #667286 #20262e;
    scrollbar-width: thin;
}

#miniaturas.mostrar-miniaturas {
    display: flex !important;
}

#miniaturas.ocultar-miniaturas {
    display: none !important;
}

.librazo-thumbnail-spacer {
    display: block;
    flex: 0 0 0;
    height: 1px;
    pointer-events: none;
}

.miniatura-container {
    appearance: none;
    position: relative;
    display: grid;
    flex: 0 0 82px;
    min-width: 0;
    padding: 4px;
    overflow: hidden;
    background: #343b46;
    border: 2px solid transparent;
    border-radius: 9px;
    place-items: center;
    cursor: pointer;
    transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.miniatura-container:hover {
    background: #414a57;
    transform: translateY(-2px);
}

.miniatura-container.is-active {
    background: #eaf7fe;
    border-color: #42bdf7;
}

.miniatura-container canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    opacity: 0;
    object-fit: contain;
    background: #ffffff;
    border-radius: 4px;
    transition: opacity 160ms ease;
}

.miniatura-container.is-rendered canvas {
    opacity: 1;
}

.numero-pagina {
    position: absolute;
    top: 4px;
    left: 4px;
    display: grid;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    background: rgba(9, 14, 20, 0.88);
    border-radius: 6px;
    place-items: center;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
    .librazo-viewer-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 56px;
        padding: 7px 9px;
    }

    .librazo-page-status {
        position: absolute;
        bottom: -44px;
        left: 50%;
        z-index: 31;
        min-height: 32px;
        color: #ffffff;
        background: rgba(17, 21, 27, 0.82);
        transform: translateX(-50%);
        backdrop-filter: blur(8px);
    }

    .librazo-document-heading {
        display: none;
    }

    .librazo-zoom-control {
        min-height: 38px;
        padding-inline: 8px;
    }

    #zoomBt {
        width: clamp(64px, 18vw, 96px);
    }

    .librazo-book-scroll {
        padding: 20px 42px;
    }

    .librazo-viewer-shell.is-zoomed .librazo-book-scroll {
        padding: max(28px, 16vh) max(54px, 16vw);
    }

    #librazoModal button.librazo-page-button {
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 58px !important;
        min-height: 58px !important;
        max-height: 58px !important;
        margin-top: -29px !important;
        border-radius: 11px !important;
    }

    #librazoModal button.librazo-page-button-prev {
        right: auto !important;
        left: 4px !important;
    }

    #librazoModal button.librazo-page-button-next {
        right: 4px !important;
        left: auto !important;
    }

    #miniaturas {
        height: 112px;
        padding: 8px;
    }

    .miniatura-container {
        flex-basis: 68px;
    }
}

@media (max-width: 520px) {
    .librazo-book-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .librazo-bimester-tabs {
        width: 100%;
        margin-bottom: 14px;
    }

    .librazo-bimester-tab {
        padding-inline: 14px;
        font-size: 13px;
    }

    #librazoModal button.librazo-icon-button {
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
    }

    .librazo-book-scroll {
        padding-inline: 30px;
    }

    .librazo-viewer-shell.is-zoomed .librazo-book-scroll {
        padding-inline: max(40px, 12vw);
    }

    .librazo-zoom-control {
        gap: 5px;
    }

    #zoomBt {
        width: 58px;
    }

    #librazoZoomValue {
        min-width: 36px;
        font-size: 11px;
    }

    .librazo-magnifier {
        width: 204px;
    }

    .librazo-interaction-hint {
        bottom: 12px;
        max-width: calc(100% - 80px);
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .librazo-book-button,
    .librazo-book-cover img,
    .librazo-icon-button,
    .librazo-page-button,
    .miniatura-container,
    .librazo-pagina canvas,
    .librazo-magnifier,
    .librazo-interaction-hint,
    .librazo-book-scroll {
        transition: none !important;
    }
}
