.thumbnail__max {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5) inset;
}
.thumbnail__max-content {
    position: fixed;
    top: 10%;
    left: 50%;
    margin-left: -250px;
    z-index: 9999;
    background: #fff;
    width: 500px;
}
.thumbnail__max.show {
    display: block;
}
.thumbnail__max-close {
    position: absolute;
    right: 0;
    top: -25px;
    font-size: 20px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}
.thumbnail__max-item {
    max-width: 100%;
    margin: auto;
    display: block;
}
.thumbnail__min {
    margin: 10px 30px 15px 0;
    display: flex;
}
.thumbnail__min-item {
    display: block;
    cursor: zoom-in;
    max-width: 100%;
}

.document-viewer__thumbnails {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.document-viewer__thumbnail {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 4px;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 11px;
    cursor: zoom-in;
}

.document-viewer__thumbnail-image {
    display: block;
    height: 28px;
    max-height: 30px;
    width: auto;
}

.document-viewer {
    position: fixed;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: min(760px, calc(100vw - 24px));
    height: min(80vh, 800px);
    max-width: 100vw;
    max-height: 100vh;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 20%);
    overflow: hidden;
}

.document-viewer--opaque {
    background: #fff;
}

.document-viewer[hidden],
.document-viewer__image[hidden],
.document-viewer__canvas[hidden],
.document-viewer__pdf[hidden],
.document-viewer__transparency[hidden] {
    display: none;
}

.document-viewer__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.document-viewer__header.is-dragging {
    cursor: grabbing;
}

.document-viewer__header .btn-close {
    --bs-btn-close-focus-shadow: none;
}

.document-viewer__title {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.document-viewer__toolbar {
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.document-viewer__toolbar button {
    cursor: pointer;
}

.document-viewer__transparency {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: default;
}

.document-viewer__transparency input {
    width: 100px;
}

.document-viewer__viewport {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.document-viewer__canvas {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.document-viewer__image {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    max-width: none;
    opacity: .8;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.document-viewer__viewport.is-panning .document-viewer__image {
    cursor: grabbing;
}

.document-viewer__resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    cursor: nwse-resize;
    touch-action: none;
    user-select: none;
}

.document-viewer__file {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.document-viewer__pdf {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.document-viewer__pdf-image {
    flex: 1 1 auto;
    min-height: 0;
}

.document-viewer__pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 24px 4px 8px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.document-viewer__pdf-status {
    padding: 8px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.document-viewer__pdf-status:empty {
    display: none;
}
