body.cm-photo-viewer-open {
    overflow: hidden;
}

.cm-profile-photo-viewer[hidden] {
    display: none;
}

.cm-profile-photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 32vw, 430px);
    overflow: hidden;
    background: #050507;
}

.cm-photo-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: #050507;
}

.cm-photo-viewer-stage {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 0;
    place-items: center;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

.cm-photo-viewer-stage img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
}

.cm-photo-viewer-social {
    position: relative;
    z-index: 2;
    min-width: 0;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, .1);
    background: #20212e;
}

.cm-photo-viewer-author {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.cm-photo-viewer-author > img,
.cm-photo-viewer-author > span {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #34364a;
    object-fit: cover;
}

.cm-photo-viewer-author div {
    display: grid;
    gap: 2px;
}

.cm-photo-viewer-author small {
    color: #aeb8c8;
}

.cm-photo-viewer-thread {
    padding: 18px;
}

.cm-photo-viewer-thread[hidden] {
    display: none;
}

.cm-photo-viewer-close,
.cm-photo-viewer-nav {
    position: absolute;
    z-index: 5;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(25, 27, 39, .82);
    cursor: pointer;
    font: inherit;
    font-size: 2rem;
}

.cm-photo-viewer-close {
    top: 16px;
    left: 16px;
}

.cm-photo-viewer-nav {
    top: 50%;
    transform: translateY(-50%);
}

.cm-photo-viewer-prev {
    left: 18px;
}

.cm-photo-viewer-next {
    right: calc(clamp(320px, 32vw, 430px) + 18px);
}

.cm-photo-viewer-dots {
    position: absolute;
    z-index: 5;
    right: clamp(340px, calc(32vw + 20px), 450px);
    bottom: 18px;
    left: 20px;
    display: flex;
    justify-content: center;
    gap: 7px;
}

.cm-photo-viewer-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .42);
    cursor: pointer;
}

.cm-photo-viewer-dot.is-active {
    background: #fff;
    transform: scale(1.25);
}

@media (max-width: 760px) {
    .cm-profile-photo-viewer {
        display: block;
        overflow-y: auto;
        background: #050507;
    }

    .cm-photo-viewer-stage {
        height: min(72vh, 680px);
        min-height: 420px;
    }

    .cm-photo-viewer-stage img {
        height: 100%;
        max-height: none;
    }

    .cm-photo-viewer-social {
        min-height: 28vh;
        border-top: 1px solid rgba(255, 255, 255, .1);
        border-left: 0;
    }

    .cm-photo-viewer-nav {
        display: none;
    }

    .cm-photo-viewer-dots {
        position: absolute;
        top: min(calc(72vh - 30px), 650px);
        right: 16px;
        bottom: auto;
        left: 16px;
    }

    .cm-photo-viewer-close {
        position: fixed;
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
    }

    .cm-photo-viewer-thread {
        padding: 14px;
    }
}
