/* Аватар + PNG-рамка (паритет с мобильным приложением) */
.avatar-with-frame {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    overflow: visible;
    vertical-align: middle;
    line-height: 0;
}

.avatar-with-frame__photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-with-frame__overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: contain;
    transform: scale(1.06);
}

.avatar-with-frame--ring {
    padding: 2px;
    border-radius: 50%;
    background: var(--story-ring);
    box-sizing: border-box;
}

.avatar-with-frame--ring .avatar-with-frame__photo {
    border: 2px solid var(--bg-card);
    box-sizing: border-box;
}

.avatar-with-frame--post {
    width: 40px;
    height: 40px;
}

.avatar-with-frame--post-collab {
    width: 28px;
    height: 28px;
}

.avatar-with-frame--story {
    width: 100%;
    height: 100%;
}

.avatar-with-frame--story .avatar-with-frame__photo {
    border: 3px solid var(--bg-card);
}

.avatar-with-frame--comment,
.modal-comment-avatar-link > .avatar-with-frame--comment {
    width: 32px;
    height: 32px;
}

/* Ответ на комментарий в модалке (меньше основного) */
.avatar-with-frame--comment-thread,
.modal-comment--thread .modal-comment-avatar-link > .avatar-with-frame {
    width: 26px;
    height: 26px;
}

.avatar-with-frame--comment-post {
    width: 28px;
    height: 28px;
}

.avatar-with-frame--comment-post-thread,
.post-view-comment.ig-comment--thread .ig-comment-avatar-link > .avatar-with-frame {
    width: 24px;
    height: 24px;
}

.avatar-with-frame--comment-sm {
    width: 28px;
    height: 28px;
}

/* Меньший масштаб рамки — ровнее в узком слоте ответа */
.avatar-with-frame--comment-thread .avatar-with-frame__overlay,
.avatar-with-frame--comment-post-thread .avatar-with-frame__overlay {
    transform: scale(1.02);
}

.modal-comment-avatar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: visible;
    align-self: flex-start;
}

.modal-comment--thread .modal-comment-avatar-link {
    width: 26px;
    min-width: 26px;
    height: 26px;
}

.modal-comment--thread .avatar-with-frame__photo.modal-comment-avatar,
.modal-comment .avatar-with-frame__photo.modal-comment-avatar {
    width: 100%;
    height: 100%;
}

.ig-comment-avatar-link > .avatar-with-frame {
    flex-shrink: 0;
}

.post-view-comment.ig-comment--thread .ig-comment-avatar-link {
    width: 24px;
    min-width: 24px;
    height: 24px;
}

.avatar-with-frame--message {
    width: 28px;
    height: 28px;
}

.avatar-with-frame--chat {
    width: 56px;
    height: 56px;
}

.avatar-with-frame--sidebar {
    width: 48px;
    height: 48px;
}

.avatar-with-frame--profile {
    width: 150px;
    height: 150px;
}

.avatar-with-frame--create-post {
    width: 40px;
    height: 40px;
}

.avatar-with-frame--compose {
    width: 44px;
    height: 44px;
}

.avatar-with-frame--notification {
    width: 42px;
    height: 42px;
}

.avatar-with-frame--follower {
    width: 44px;
    height: 44px;
}

.home-pc-sidebar-profile-link .avatar-with-frame--sidebar,
.sidebar-profile-info .avatar-with-frame--sidebar {
    width: 56px;
    height: 56px;
}

.modal-user .avatar-with-frame--post {
    width: 40px;
    height: 40px;
}

.account-switcher-row .avatar-with-frame--compose {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.blocked-users-user .avatar-with-frame--compose {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.avatar-with-frame--search {
    width: 48px;
    height: 48px;
}

/* Истории: кастомная рамка вместо градиентного кольца */
.story-ring.story-ring--custom-frame {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
}

.story-ring.story-ring--custom-frame:hover {
    box-shadow: none !important;
}

.story-ring.story-ring--custom-frame.seen {
    background: transparent !important;
}

.chat-item-avatar .avatar-with-frame {
    width: 100%;
    height: 100%;
}

.message-avatar.avatar-with-frame__photo,
.post-avatar.avatar-with-frame__photo {
    /* класс дублируется на img для обратной совместимости */
}
