.attachment-preview-dialog {
  width: min(1400px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--workspace-card, #fff);
  color: var(--workspace-foreground, #292a2e);
  box-shadow: 0 25px 80px #12203640;
  font: 14px/1.5 var(--workspace-font, system-ui, sans-serif);
}
.attachment-preview-dialog::backdrop { background: #14243bbf; }
.attachment-preview-header { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.attachment-preview-header h2 { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 16px; }
.attachment-preview-header a { flex-shrink: 0; color: var(--workspace-brand, #0c66e4); text-decoration: underline; }
.attachment-preview-header button { flex-shrink: 0; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: var(--workspace-hover, #f0f3f6); color: var(--workspace-foreground, #44546f); font-size: 26px; cursor: pointer; }
.attachment-preview-header button:hover { background: var(--workspace-border, #dfe3e8); }
.attachment-preview-header :is(a, button):focus-visible { outline: 2px solid #388bff; outline-offset: 3px; }
.attachment-preview-body { display: grid; place-items: center; padding: 16px; background: var(--workspace-background, #eef2f6); }
.attachment-preview-body img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 140px); object-fit: contain; }
.attachment-preview-body [hidden] { display: none; }
.attachment-preview-body p { margin: 16px; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .attachment-preview-header { flex-wrap: wrap; gap: 8px; }
  .attachment-preview-header h2 { flex-basis: calc(100% - 52px); }
  .attachment-preview-header a { order: 1; flex-basis: 100%; font-size: 13px; }
  .attachment-preview-body { padding: 8px; }
  .attachment-preview-body img { max-height: calc(100dvh - 168px); }
}

.attachment-preview-body iframe { width: 100%; height: 72dvh; border: 0; background: var(--workspace-card, #fff); }
