/* WhatsApp media aspect guard v76
   Never stretch chat media. The image intrinsic ratio is the source of truth. */
html[data-social-app="whatsapp"] .bubble.media .media-wrap{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:auto!important;
}
html[data-social-app="whatsapp"] .bubble.media .media-wrap>img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-width:100%!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center!important;
  aspect-ratio:auto!important;
}

/* A natural-size marker is added by JS after the image loads. Explicit aspect
   ratio gives browsers and screenshot clones a stable layout before repaint. */
html[data-social-app="whatsapp"] .bubble.media .media-wrap>img[data-yappy-media-ratio]{
  aspect-ratio:var(--yappy-media-ratio)!important;
}

/* Composer preview should also preserve source proportions instead of cropping
   or stretching portrait screenshots. */
html[data-social-app="whatsapp"] .card-modal img[data-yappy-upload-preview]{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-height:55vh!important;
  object-fit:contain!important;
}
