.profile-photo, .profile-photo-preview {
    padding: 2px;
    border-radius: 50%;
    background: rgb(0 0 0 / 12.5%);
}

@media (prefers-color-scheme: dark) {
    .profile-photo, .profile-photo-preview { background: rgb(255 255 255 / 12.5%); }
}

.profile-photo {
    --photo-size: 32px;
    display: inline-grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    width: var(--photo-size);
    height: var(--photo-size);
    flex: 0 0 var(--photo-size);
    vertical-align: middle;
    color: white;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.profile-photo-large { --photo-size: 128px; font-size: 40px; }
.profile-photo > * { grid-area: 1 / 1; border-radius: 50%; }
.profile-photo-initials { display: grid; place-items: center; background: var(--accent-blue); box-shadow: var(--accent-edge); }
.profile-photo img { width: 100%; height: 100%; object-fit: contain; }
.profile-photo img[hidden] { display: none; }
.profile-identity { display: inline-flex; align-items: center; gap: 8px; }
.account-avatar:has(.profile-photo) { padding: 6px; width: 44px; height: 44px; background: transparent; }
/* Hover matches the open state, so releasing a press never flashes back to full opacity. */
.account-avatar:hover > .profile-photo, .account-menu[open] > .account-avatar > .profile-photo { opacity: 0.75; }
.account-menu > .account-avatar:active > .profile-photo { opacity: 0.5; }
.profile-photo-editor { margin-block: 28px; }
.profile-photo-preview { width: 128px; height: 128px; }
.profile-photo-preview:has(canvas[hidden]) { display: none; }
.profile-photo-preview canvas { display: block; width: 100%; height: 100%; border-radius: 50%; }
/* A known photo keeps a quiet placeholder until its pixels arrive. */
.profile-photo:has(img:not([hidden])) .profile-photo-initials { background: var(--hover-background); color: transparent; }
