.message-photo-open { display: block; width: min(360px, 100%); max-width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.message-photo-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.message-context .message-photo-open { width: min(220px, 100%); }
.dialog-media-viewer { width: min(1200px, calc(100vw - 24px)); height: calc(100dvh - 24px); max-width: none; max-height: none; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.dialog-media-viewer::backdrop { background: #000c; }
.dialog-media-shell { height: 100%; padding: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; }
.dialog-media-shell header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-media-shell h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; min-width: 0; }
.dialog-media-shell button { min-width: 44px; min-height: 44px; padding: 8px 14px; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.dialog-media-canvas { overflow: auto; min-height: 0; min-width: 0; padding: 12px; background: #171817; border-radius: 10px; }
.dialog-media-canvas img { display: block; margin: auto; max-width: none; max-height: none; object-fit: contain; }
.dialog-media-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.dialog-media-status { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
#attachment-preview { display: block; }
#attachment-list { max-height: 145px; overflow-y: auto; }
.attachment-queue-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.attachment-queue-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.attachment-queue-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
#attachment-remove { width: auto; font-size: 12px; }
@media (max-width: 600px) {
  .dialog-media-viewer { width: 100%; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .dialog-media-shell { padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
}
