/* Filled portrait frames; preserve saved Showcase positioning and upload crop geometry. */
:root body :is(.cmh-performer-photo:not(.cmh-performer-photo--words), .sc-directory-art:has(>img), .people-photo:has(>img)) {
  aspect-ratio:4/5;
  min-width:0;
  overflow:hidden;
}
:root body :is(.cmh-performer-photo, .sc-directory-art, .people-photo)>img {
  display:block;
  width:100%;height:100%;
  min-width:0;min-height:0;max-width:100%;max-height:none;
  object-fit:cover;object-position:50% 50%;
  transform:none;
}
/* A hover must not cut into the photograph after it has been framed. */
:root body :is(.cmh-performer:hover .cmh-performer-photo, .sc-directory-card-link:hover .sc-directory-art)>img {transform:none}
:root body .sc-world .sc-dossier-portrait>img {
  display:block;width:100%;height:auto;aspect-ratio:4/5;
  max-height:none;object-fit:cover;object-position:50% 50%;
  border-radius:9px 9px 0 0;
}
/* Very tall originals must remain complete; no automatic central crop. */
:root body :is(.cmh-performer-photo,.sc-directory-art,.people-photo)>img[data-portrait-tall],
:root body .sc-world .sc-dossier-portrait>img[data-portrait-tall] {
  object-fit:contain;
}
/* Keep an explicitly positioned Showcase portrait in its chosen frame. */
:root body .sc-world[data-sc-portrait-framed] .sc-dossier-portrait>img {
  aspect-ratio:4/5;height:auto;max-height:none;
  object-fit:cover;object-position:center var(--sc-crop,50%);
}
:root body .sc-world .sc-dossier-portrait figcaption {
  position:static;inset:auto;padding:12px 14px;background:var(--sc-panel);
  color:var(--sc-ink);border-radius:0 0 9px 9px;
}
:root body :is(.xp-avatar,.xp-today-avatar,.avatar,.profile-orbit,.welcome-profile-photo) {
  flex-shrink:0;aspect-ratio:1;overflow:hidden;
  /* Grid avatars need a full frame track, not the image's intrinsic ratio. */
  grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);
}
:root body :is(.xp-avatar,.xp-today-avatar,.avatar,.profile-orbit,.welcome-profile-photo)>img {
  display:block;flex:0 0 100%;width:100%;height:100%;
  min-width:0;min-height:0;max-width:none;max-height:none;
  object-fit:cover;object-position:50% 50%;border-radius:inherit;
}
/* Saved square crops are unchanged by object-position. Never override the
   inline geometry used while a member is framing a new upload. */
:root body .pw-workspace .xp-portrait-preview>img:not([style]),
:root body .pw-share-field img {
  display:block;object-fit:cover;object-position:50% 50%;
}
@media(max-width:600px) {
  :root body .sc-world .sc-dossier-portrait>img {max-height:none}
  :root body .sc-world[data-sc-portrait-framed] .sc-dossier-portrait>img {max-height:none}
}
