.dmm-viewer {
    --dmm-max-width: 790px;
    --dmm-height: 293px;
    --dmm-page-ratio: .7071;
    width: 100%;
    max-width: var(--dmm-max-width);
    margin: 1.25rem auto;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dmm-stage {
    position: relative;
    width: 100%;
    height: var(--dmm-height);
    min-height: 220px;
    overflow: hidden;
    background: #eef0f2;
    border: 1px solid #d6d9dc;
    border-radius: 8px;
    box-sizing: border-box;
    touch-action: pan-y;
    overscroll-behavior: contain;
    outline: none;
}

.dmm-height-auto .dmm-stage {
    height: auto;
    aspect-ratio: var(--dmm-page-ratio);
    min-height: 280px;
    max-height: 90vh;
}

.dmm-stage:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border: 0;
    border-radius: 0;
    background: #dfe3e7;
    touch-action: none;
    overscroll-behavior: none;
}

.dmm-track {
    height: 100%;
    display: flex;
    transition: transform 260ms ease;
    will-change: transform;
}

.dmm-slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px 42px 28px;
}

.dmm-page-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .16);
    transform-origin: center center;
    will-change: transform;
}

.dmm-stage.is-zoomed .dmm-track { transition: none; }
.dmm-stage.is-zoomed .dmm-page-wrap { cursor: grab; }
.dmm-stage.is-zoomed .dmm-page-wrap:active { cursor: grabbing; }

.dmm-canvas {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
}

.dmm-annotation-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.dmm-pdf-link {
    position: absolute;
    display: block;
    pointer-events: auto;
    cursor: pointer;
    background: rgba(10, 102, 194, 0);
    outline: none;
}

.dmm-pdf-link:hover,
.dmm-pdf-link:focus-visible {
    background: rgba(10, 102, 194, .10);
    box-shadow: inset 0 0 0 1px rgba(10, 102, 194, .42);
}

.dmm-page-spinner {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #62686d;
    background: #fff;
    font-size: 12px;
    text-align: center;
}

.dmm-page-spinner[hidden] { display: none !important; }

.dmm-loading {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 24px;
    text-align: center;
    background: #eef0f2;
    color: #4d5155;
    font-size: 14px;
    line-height: 1.45;
}

.dmm-loading[hidden] { display: none !important; }
.dmm-loading span { font-size: 13px; color: #656b70; }

.dmm-nav {
    position: absolute;
    z-index: 5;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    color: #1f2328;
    box-shadow: 0 1px 5px rgba(0,0,0,.18);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.dmm-prev { left: 10px; }
.dmm-next { right: 10px; }
.dmm-nav:disabled { opacity: .28; cursor: default; }
.dmm-nav:not(:disabled):hover { background: #fff; }

.dmm-bottom-bar {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 7px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dmm-counter {
    min-width: 54px;
    padding: 4px 9px;
    border-radius: 13px;
    background: rgba(32, 35, 38, .78);
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.dmm-fullscreen {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(32, 35, 38, .78);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.dmm-download-row { margin-top: 10px; text-align: center; }
.dmm-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid #0a66c2;
    border-radius: 20px;
    color: #0a66c2 !important;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
}
.dmm-download:hover { background: #eef6ff; }
.dmm-download-icon { width: 18px; height: 18px; fill: currentColor; }

.dmm-viewer.is-error .dmm-nav,
.dmm-viewer.is-error .dmm-bottom-bar,
.dmm-viewer:not(.is-ready) .dmm-nav,
.dmm-viewer:not(.is-ready) .dmm-bottom-bar { opacity: 0; pointer-events: none; }

@media (max-width: 600px) {
    .dmm-stage { border-radius: 5px; }
    .dmm-slide { padding: 14px 32px 28px; }
    .dmm-nav { width: 32px; height: 42px; font-size: 22px; }
    .dmm-prev { left: 5px; }
    .dmm-next { right: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .dmm-track { transition: none; }
}
