.erp-attachment-preview-layer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.erp-attachment-preview-layer[hidden] {
  display: none;
}

.erp-attachment-preview-dialog {
  position: fixed;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 48px rgb(0 0 0 / 28%);
}

.erp-attachment-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #ebeef5;
  color: #303133;
  cursor: move;
  user-select: none;
}

.erp-attachment-preview-dialog.is-dragging .erp-attachment-preview-header {
  cursor: grabbing;
}

.erp-attachment-preview-header strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-attachment-preview-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #909399;
  font: 24px/32px Arial, sans-serif;
  cursor: pointer;
}

.erp-attachment-preview-close:hover,
.erp-attachment-preview-close:focus-visible {
  background: #f5f7fa;
  color: #409eff;
  outline: none;
}

.erp-attachment-preview-body {
  position: relative;
  display: grid;
  min-height: 0;
  overflow: hidden;
  background: #f5f7fa;
}

.erp-attachment-preview-image,
.erp-attachment-preview-pdf {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.erp-attachment-preview-image {
  object-fit: contain;
}

.erp-attachment-preview-image[hidden],
.erp-attachment-preview-pdf[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .erp-attachment-preview-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }
}
