.diapobox-wrap {
    width: 100%;
    margin: 0 0 12px 0;
}

.diapobox-title {
    text-align: center;
    font-size: 8pt;
    color: #000;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.diapobox-empty {
    text-align: center;
    color: #000;
    font-size: 9pt;
    padding: 8px 0;
}

.diapobox-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.diapobox-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
}

.diapobox-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.diapobox-overlay {
    position: fixed;
    z-index: 999999;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    display: none;
    flex-direction: column;
    touch-action: pan-y;
}

.diapobox-overlay:fullscreen,
.diapobox-overlay:-webkit-full-screen,
.diapobox-overlay:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.diapobox-overlay.is-open {
    display: flex;
}

.diapobox-fixed-topright {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 1000001;
    display: flex;
    align-items: center;
    gap: 10px;
}

.diapobox-counter {
    min-width: 74px;
    padding: 7px 12px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    text-align: center;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
}

.diapobox-topbar {
    flex: 0 0 auto;
    padding: 10px 90px 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    word-break: break-word;
}

.diapobox-stage {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 10px;
}

.diapobox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    -webkit-user-drag: none;
    user-select: none;
}

.diapobox-stage.is-zoomed {
    justify-content: flex-start;
    align-items: flex-start;
}

.diapobox-stage.is-zoomed img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

.diapobox-toolbar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.28);
}

.diapobox-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 46px;
    height: 46px;
    line-height: 1;
    border-radius: 23px;
    cursor: pointer;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
    box-sizing: border-box;
}

.diapobox-btn:hover,
.diapobox-btn:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-decoration: none;
}

.diapobox-close {
    appearance: none;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.diapobox-close:hover,
.diapobox-close:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.diapobox-hide-print .diapobox-print-btn {
    display: none;
}

.diapobox-hide-download .diapobox-download-btn {
    display: none;
}

@media (max-width: 767px) {
    .diapobox-fixed-topright {
        top: 8px;
        right: 8px;
        gap: 8px;
    }

    .diapobox-counter {
        min-width: 66px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .diapobox-close {
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .diapobox-topbar {
        font-size: 14px;
        padding: 8px 64px 8px 10px;
    }

    .diapobox-toolbar {
        gap: 6px;
        padding: 10px 8px;
    }

    .diapobox-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}
