.file-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-file {
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font-weight: 750;
}

.preview-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 28, 95, 0.72);
  backdrop-filter: blur(6px);
}

.preview-dialog {
  position: relative;
  width: min(960px, 100%);
  height: min(760px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 30px 100px rgba(6, 28, 95, 0.3);
}

.preview-head {
  width: auto;
  height: auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.preview-head h2 {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.preview-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.preview-content {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: var(--paper);
}

.preview-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--white);
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.preview-actions a {
  text-decoration: none;
}

@media (max-width: 780px) {
  .preview-modal {
    padding: 0;
  }

  .preview-dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}
