.attachment-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgb(14 29 52 / 54%);
}

.attachment-preview-panel {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid #d9e2ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 72px rgb(17 37 68 / 28%);
}

.attachment-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid #e6ebf2;
}

.attachment-preview-header strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-header > div { display: flex; flex: 0 0 auto; gap: 10px; }
.attachment-preview-header a,
.attachment-preview-header button {
  border: 1px solid #d6e0ec;
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: #245eea;
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.attachment-preview-header button { color: #526174; }

.attachment-preview-body {
  max-height: calc(min(760px, 100vh - 56px) - 58px);
  overflow: auto;
  padding: 20px;
  color: #536174;
  font-size: 13px;
  line-height: 1.75;
}
.attachment-preview-body iframe { display: block; width: 100%; height: 620px; border: 0; }
.attachment-preview-body pre { overflow: auto; margin: 14px 0 0; padding: 16px; border-radius: 8px; background: #f5f8fc; color: #273548; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

@media (max-width: 640px) {
  .attachment-preview-overlay { padding: 12px; }
  .attachment-preview-header { min-height: 54px; padding: 0 12px; gap: 8px; }
  .attachment-preview-header a { display: none; }
  .attachment-preview-body { padding: 12px; }
  .attachment-preview-body iframe { height: 68vh; }
}
