/* Keep captions readable independently of a portrait image's intrinsic width. */
html body #root#root .chat-shell:has(.chat-context-strip.direct) .chat-message.photo316:not(.photo24-tile .chat-message)>div{
 width:280px!important;max-width:86%!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important;
}
html body #root#root .chat-shell:has(.chat-context-strip.direct) .chat-message.photo316:not(.photo24-tile .chat-message) .social-photo-message{
 display:block!important;width:100%!important;max-width:100%!important;height:auto!important;max-height:300px!important;object-fit:contain!important;margin:0!important;
}
/* Album cells scale the entire photo, including the top and bottom edges. */
html body #root#root .chat-shell .photo24-tile .chat-message.photo316 .social-photo-message{
 object-fit:contain!important;
}
/* Groups use display:contents; spacing must belong to the actual message. */
html body #root#root .chat-shell:has(.chat-context-strip.direct) .chat-message:not(.photo24-tile .chat-message){margin-bottom:12px!important}
html.mw230 body #root#root .chat-shell .chat-message:not(.photo24-tile .chat-message){margin-bottom:14px!important}
html.mw230 body #root#root .chat-shell .photo24-album{margin-top:0!important;margin-bottom:14px!important}
/* Mobile incoming responses remain visibly distinct from outgoing green bubbles. */
html.mw230 body #root#root .chat-shell .welly-surface28{
 background:linear-gradient(135deg,rgba(20,48,56,.94),rgba(12,31,39,.94))!important;
}
