/* Compact message-local image gallery: four thumbnails at most, with all
   image links retained in the DOM for the existing swipe/keyboard viewer. */
.pc-message-attachments .pc-image-gallery,
.pc-message-content .pc-inline-image-gallery {
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:112px;
 gap:4px;width:min(320px,calc(100vw - 104px));max-width:100%;overflow:hidden;border-radius:11px;
}
.pc-image-gallery > a:nth-of-type(n+5){display:none!important}
.pc-message-attachments .pc-image-gallery > .pc-message-image,
.pc-message-content .pc-inline-image-gallery > .pc-rich-image-link {
 position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;
 max-width:none;max-height:none;margin:0;overflow:hidden;border-radius:6px;
}
.pc-image-gallery .pc-message-image img,
.pc-image-gallery .pc-rich-image {
 display:block;width:100%;height:100%;min-width:0;min-height:0;
 max-width:none;max-height:none;object-fit:cover;
}
.pc-image-gallery .pc-message-image:not(.loaded):not(.failed) .pc-image-placeholder {
 position:absolute;inset:0;width:100%;min-width:0;height:100%;
}
.pc-image-gallery .pc-rich-image-caption {
 position:absolute;bottom:0;left:0;right:0;z-index:1;
 margin:0;padding:15px 7px 5px;color:white;font-size:11px;line-height:1.2;
 background:linear-gradient(transparent,rgba(13,30,39,.7));
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.pc-image-gallery .pc-gallery-more {
 position:absolute;inset:0;z-index:2;display:grid;place-items:center;
 background:rgba(12,32,40,.65);color:#fff;font-size:24px;font-weight:750;
}
@media(max-width:380px){
 .pc-message-attachments .pc-image-gallery,
 .pc-message-content .pc-inline-image-gallery {grid-auto-rows:100px}
}

.pc-messages .pc-image-gallery .pc-rich-image-caption,.pc-messages .pc-image-gallery .pc-gallery-more{color:#fff!important}
