/* BM3 uses a fixed cover grid even when the file URL is uncropped. */
body .bm-msg-stack__bubbles:has(.bm-image-grid) {
	width: 100% !important;
}

body .bm-msg-body:has(.bm-image-grid),
body .bm-msg-main:has(.bm-image-grid),
body .bm-image-grid {
	width: 100% !important;
	max-width: 100% !important;
}

body .bm-image-grid {
	grid-template-columns: minmax(0, 1fr) !important;
	grid-template-rows: auto !important;
	height: auto !important;
	max-height: none !important;
	/* ponytail: release BM's gallery ratio; normal flow reserves all image rows. */
	aspect-ratio: auto !important;
	overflow: visible !important;
}

body .bm-image-grid > .bm-image-tile {
	grid-column: auto !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	aspect-ratio: auto !important;
	overflow: visible !important;
}

body .bm-image-grid > .bm-image-tile > img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	object-fit: contain !important;
}
