button[data-chat-photo] { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
body:has(.chat-photo-viewer[open]) { overflow: hidden; }
dialog.chat-photo-viewer[open] {
  position: fixed; inset: 0; display: grid; place-items: center;
  box-sizing: border-box; margin: 0; width: 100%; height: 100%; height: 100dvh;
  max-width: none; max-height: none; padding: 0; border: 0;
  overflow: hidden; background: #121212; color: white;
}
.chat-photo-viewer::backdrop { background: #121212; }
dialog.chat-photo-viewer img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; }
dialog.chat-photo-viewer button {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  padding: 8px 16px; min-height: 44px; border-radius: 24px; border: 1px solid #fff8;
  background: #171717ed; color: white; font: inherit; cursor: pointer;
}
