:root {
    --profile-card-radius: 12px;
    --profile-card-initial-size: 2.25rem;
    --profile-card-media-inset: var(--vm-space-sm);
    --profile-preview-backdrop: rgb(8 24 20 / .84);
    --profile-preview-duration: 160ms;
}
.profile-card,
.vm-cluster-grid .profile-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--vm-border);
    border-radius: var(--profile-card-radius);
    background: var(--vm-paper);
    color: var(--vm-ink);
}
.profile-card__media {
    position: relative;
    width: calc(100% - 2 * var(--profile-card-media-inset));
    aspect-ratio: 1;
    flex: none;
    margin: var(--profile-card-media-inset) var(--profile-card-media-inset) 0;
    overflow: hidden;
    border-radius: var(--vm-radius);
    background: var(--vm-paper-soft);
}
.profile-card__photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.profile-card__photo > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile-card__photo:disabled { opacity: 1; cursor: default; }
.profile-card__photo:focus-visible,
.vm-page .profile-card__photo:focus-visible { outline: 3px solid var(--vm-focus); outline-offset: -5px; }
.profile-card__photo > img[hidden], .profile-card__photo[hidden] { display: none; }
.profile-card__fallback { position: absolute; inset: 0; height: 100%; min-height: 0; padding: var(--vm-space-md); }
.profile-card .profile-card__initials { font-size: var(--profile-card-initial-size); }
.profile-card__body { padding: var(--vm-space-md) var(--vm-space-md) var(--vm-space-lg); min-width: 0; }
.profile-card__name,
.vm-page .profile-card__name { margin: 0; color: var(--vm-heading); font-size: var(--vm-text-lg); font-weight: 650; line-height: 1.4; text-wrap: balance; overflow-wrap: anywhere; }
.profile-card__role { margin: var(--vm-space-xs) 0 0; color: var(--vm-muted); font-size: var(--vm-text-sm); font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.profile-card__description { margin: var(--vm-space-2xs) 0 0; color: var(--vm-muted); font-size: var(--vm-text-sm); line-height: 1.6; overflow-wrap: anywhere; }
.profile-preview { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: var(--vm-space-md); border: 0; background: var(--profile-preview-backdrop); color: var(--vm-viewer-ink); grid-template-rows: 48px minmax(0, 1fr) auto; gap: var(--vm-space-sm); opacity: 1; transition: opacity var(--profile-preview-duration) ease-out; }
.profile-preview[open] { display: grid; }
.profile-preview {
    padding: max(var(--vm-space-md), env(safe-area-inset-top)) max(var(--vm-space-md), env(safe-area-inset-right)) max(var(--vm-space-md), env(safe-area-inset-bottom)) max(var(--vm-space-md), env(safe-area-inset-left));
}
.profile-preview::backdrop { background: transparent; }
.profile-preview.is-opening, .profile-preview.is-closing { opacity: 0; }
.profile-preview__toolbar { display: flex; justify-content: flex-end; }
.profile-preview .profile-preview__close { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--vm-viewer-focus); border-radius: var(--vm-radius); color: var(--vm-viewer-ink); background: var(--vm-viewer-control); cursor: pointer; }
.profile-preview__close:hover { background: var(--vm-viewer-hover); }
.profile-preview__close:focus-visible { outline: 3px solid var(--vm-viewer-focus); outline-offset: 3px; }
.profile-preview__stage { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.profile-preview__image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; background: var(--vm-paper); }
.profile-preview__image[hidden], .profile-preview__status[hidden] { display: none; }
.profile-preview .profile-preview__title { margin: 0; color: var(--vm-viewer-ink); text-align: center; font-size: var(--vm-text-md); font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.profile-preview__status { max-width: 45ch; margin: 0; text-align: center; color: var(--vm-viewer-ink); font-size: var(--vm-text-md); line-height: 1.6; }
@media (max-width: 40rem) {
    .profile-card__media:has(> .profile-card__fallback.is-visible) { aspect-ratio: auto; min-height: 8rem; max-height: none; }
    .profile-card__media > .profile-card__fallback.is-visible { position: relative; inset: auto; height: auto; min-height: 8rem; }
}
@media (prefers-reduced-motion: reduce) { .profile-preview, .profile-preview::backdrop { transition: none; } }
