.profile-media-block {
    padding: 18px 20px;
    border-bottom: 1px solid #e9e5dc;
    background: #fffdf8;
}

.profile-avatar-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.profile-avatar,
.profile-gallery-thumb {
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #e5ebe7;
    color: #315b4f;
    border: 1px solid #c9d0cb;
}

.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
}

.profile-avatar img,
.profile-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-initials {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.profile-avatar .avatar-initials {
    font-size: 1.65rem;
}

.profile-avatar-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.profile-media-label {
    color: #69706b;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-avatar-copy strong {
    overflow-wrap: anywhere;
}

.profile-avatar-copy small,
.profile-gallery-heading span,
.profile-gallery-item small,
.profile-gallery-empty {
    color: #69706b;
}

.photo-version-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
    padding: 3px;
    width: fit-content;
    max-width: 100%;
    border: 1px solid #d8d4ca;
    border-radius: 7px;
    background: #f5f2eb;
}

.photo-version-button {
    appearance: none;
    border: 0;
    border-radius: 5px;
    padding: 5px 7px;
    background: transparent;
    color: #5f665f;
    font: inherit;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}

.photo-version-button:hover,
.photo-version-button:focus-visible {
    background: #e8ece8;
    color: #274b41;
    outline: none;
}

.photo-version-button.is-active {
    background: #315b4f;
    color: #fff;
    box-shadow: 0 1px 3px rgba(35, 55, 48, 0.18);
}

.profile-gallery-section {
    margin-top: 18px;
}

.profile-gallery-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 9px;
    font-size: 0.8rem;
}

.profile-gallery-heading span {
    font-size: 0.72rem;
}

.profile-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.profile-gallery-item {
    min-width: 0;
    margin: 0;
    border: 1px solid #ddd8cd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.profile-gallery-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    border-bottom: 1px solid #e4e0d7;
    border-radius: 0;
}

.profile-gallery-thumb .avatar-initials {
    font-size: 1.15rem;
}

.profile-gallery-item figcaption {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
}

.profile-gallery-item strong {
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.profile-gallery-item small {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.64rem;
}

.profile-gallery-item .photo-version-switcher {
    margin-top: 5px;
}

.profile-gallery-empty {
    margin: 0;
    font-size: 0.78rem;
}

@media (max-width: 900px) {
    .profile-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .profile-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-version-button {
        padding: 5px 6px;
        font-size: 0.62rem;
    }
}
