.search-attachment-popup {
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 5000;
}

.search-attachment-dialog {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 92vh;
  max-width: 1100px;
  overflow: hidden;
  width: min(1100px, 96vw);
}

.search-attachment-header {
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 14px 10px 20px;
}

.search-attachment-header strong {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.search-attachment-close {
  align-items: center;
  background: #dc2626;
  border: 0;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 27px;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  width: 38px;
}

.search-attachment-viewer {
  align-items: center;
  background: #0f172a;
  display: flex;
  justify-content: center;
  min-height: 260px;
  overflow: auto;
}

.search-attachment-viewer img,
.search-attachment-viewer video {
  display: block;
  max-height: calc(92vh - 58px);
  max-width: 100%;
  object-fit: contain;
}

.search-attachment-viewer iframe {
  background: #fff;
  border: 0;
  height: calc(92vh - 58px);
  min-height: 500px;
  width: 100%;
}

@media (max-width: 640px) {
  .search-attachment-popup {
    padding: 8px;
  }

  .search-attachment-dialog {
    max-height: 96vh;
    width: 100%;
  }

  .search-attachment-viewer iframe {
    height: calc(96vh - 58px);
    min-height: 360px;
  }
}
