#major-publishing-actions.pdfp-has-preview {
  flex-wrap: wrap;
  gap: 8px;
}

#major-publishing-actions.pdfp-has-preview #publishing-action {
  order: 1;
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: normal;
}

#major-publishing-actions.pdfp-has-preview #delete-action {
  order: 2;
  flex: 1 1 100%;
  line-height: 1.5;
  text-align: center;
}

#major-publishing-actions.pdfp-has-preview #publishing-action .spinner {
  display: none;
}

#major-publishing-actions.pdfp-has-preview #publishing-action .spinner.is-active {
  display: block;
  margin: 0;
  order: 3;
}

#major-publishing-actions.pdfp-has-preview #publishing-action #publish,
#major-publishing-actions.pdfp-has-preview #publishing-action .pdfp-preview-trigger {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  border-radius: 0;
  line-height: 34px;
  font-size: 13px;
  font-weight: 500;
  vertical-align: middle;
  text-align: center;
}

#major-publishing-actions.pdfp-has-preview #publishing-action #publish {
  order: 2;
}

.wp-core-ui .button.pdfp-preview-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  order: 1;
  color: #146ef5;
  border: 1px solid #146ef5;
  background: #fff;
  box-shadow: none;
}

.wp-core-ui .button.pdfp-preview-trigger[hidden] {
  display: none;
}

.wp-core-ui .button.pdfp-preview-trigger:hover,
.wp-core-ui .button.pdfp-preview-trigger:focus {
  color: #0b50b8;
  border-color: #0b50b8;
  background: #f0f6ff;
  box-shadow: none;
}

.wp-core-ui .button.pdfp-preview-trigger:focus-visible {
  outline: 2px solid #146ef5;
  outline-offset: 1px;
}

.pdfp-preview-trigger svg {
  flex: none;
  width: 15px;
  height: 15px;
}

body.pdfp-preview-open {
  overflow: hidden;
}

.pdfp-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 160000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

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

.pdfp-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pdfp-preview-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1280px, 100%);
  height: min(900px, 100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pdfp-preview-modal.is-open .pdfp-preview-backdrop,
.pdfp-preview-modal.is-open .pdfp-preview-dialog {
  opacity: 1;
  transform: none;
}

.pdfp-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid #e2e4e7;
  flex: none;
}

.pdfp-preview-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.pdfp-preview-status {
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  color: #50575e;
  background: #f0f0f1;
}

.pdfp-preview-status:empty {
  display: none;
}

.pdfp-preview-status[data-state="ready"] {
  color: #08703a;
  background: #e6f6ec;
}

.pdfp-preview-status[data-state="ready"]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #08a143;
  vertical-align: 1px;
}

.pdfp-preview-status[data-state="error"] {
  color: #b32d2e;
  background: #fcf0f1;
}

.pdfp-preview-devices {
  display: inline-flex;
  margin: 0 auto;
  padding: 3px;
  gap: 2px;
  background: #f0f0f1;
  border-radius: 8px;
}

.pdfp-preview-device,
.pdfp-preview-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #50575e;
  cursor: pointer;
}

.pdfp-preview-device:hover,
.pdfp-preview-icon-btn:hover {
  color: #1d2327;
  background: rgba(0, 0, 0, 0.05);
}

.pdfp-preview-device.is-active {
  color: #146ef5;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.pdfp-preview-device:focus-visible,
.pdfp-preview-icon-btn:focus-visible {
  outline: 2px solid #146ef5;
  outline-offset: 1px;
}

.pdfp-preview-actions {
  display: inline-flex;
  gap: 4px;
}

.pdfp-preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 16px;
  background: #f0f2f5;
  overflow: auto;
}

.pdfp-preview-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: width 0.2s ease;
}

.pdfp-preview-stage[data-device="tablet"] .pdfp-preview-viewport {
  width: 820px;
  max-width: 100%;
  flex: none;
}

.pdfp-preview-stage[data-device="mobile"] .pdfp-preview-viewport {
  width: 390px;
  max-width: 100%;
  flex: none;
}

#pdfp-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pdfp-preview-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
}

.pdfp-preview-modal.is-loading .pdfp-preview-loading {
  display: flex;
}

.pdfp-preview-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dbe6fb;
  border-top-color: #146ef5;
  border-radius: 50%;
  animation: pdfp-preview-spin 0.8s linear infinite;
}

@keyframes pdfp-preview-spin {
  to {
    transform: rotate(360deg);
  }
}

.pdfp-preview-note {
  flex: none;
  margin: 0;
  padding: 8px 20px;
  font-size: 12px;
  color: #646970;
  border-top: 1px solid #e2e4e7;
}

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

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

  .pdfp-preview-devices {
    display: none;
  }

  .pdfp-preview-head {
    justify-content: space-between;
  }

  .pdfp-preview-stage {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdfp-preview-backdrop,
  .pdfp-preview-dialog,
  .pdfp-preview-viewport {
    transition: none;
  }
}
