.mce-content-body [data-macros="msoviewer"] .pdf-layers {
  position: relative;

  .pdf-layer__canvas {
    inset: 0;
    position: absolute; 
  }

  .pdf-layer__text {
    inset: 0;
    position: absolute;
    opacity: 1;
    line-height: 1;

    /* текстовый слой должен быть выше канваса, чтобы юзер взаимодействовал с ним */
    z-index: 5;

    br::selection {
      color: transparent;
    }

    span {
      color: transparent;
      cursor: text;
      position: absolute;
      transform-origin: 0% 0%;
      white-space: pre;
    }

  }

}

#tinymce [data-macros="msoviewer"] {
    display: inline-flex;
    flex-direction: column;
    position: relative;
    width: 100%;

    .macros-edit {
       margin-right: 7px;
    }

    .macros-preview .mso-preview-wrapper {
        margin: 0px 10px;

        .mso-preview-image {
            width: 350px;
            height: 350px;
        }
    }

}

.mce-content-readonly .mso-viewer .macros-preview #viewerPdfContainer {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  overflow: auto;
  position: relative;
}

.mce-content-readonly .mso-viewer .macros-preview .zoom-button-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  width: min-content;
  bottom: 60px;
  opacity: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  /* кнопки должны быть над текстовым слоем */
  z-index: 6;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap:hover .zoom-button-wrap {
  opacity: 1;
}

.mce-content-readonly .mso-viewer .macros-preview .zoom-button-wrap:hover {
  opacity: 1;
}

.mce-content-readonly .mso-viewer .macros-preview .zoom-button {
  cursor: pointer;
  background-color: var(--app-toolbar-bg-color, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap .zoom-button-wrap .zoom-in-button-icon,
.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap .zoom-button-wrap .zoom-out-button-icon {
  margin: 10px;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap {
  position: relative;
}

.mce-content-readonly .mso-viewer .macros-preview #viewerPdfContainer #mso-observed-elem {
  position: absolute;
  height: 50vh;
  width: 100%;
  z-index: -1;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap .mso-button {
  cursor: pointer;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap .selected {
  background-color: var(--color-gray-fff, #fff);
  color: rgb(14, 98, 50);
  text-shadow: rgb(14, 98, 50) -0.5px 0px, rgb(14, 98, 50) 0.5px 0px;
  border-bottom: 4px solid rgb(14, 98, 50);
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap .unselected {
  background-color: rgb(246, 246, 246);
  color: rgb(82, 82, 82);
  text-shadow: none;
  border-bottom: 1px solid rgb(162, 162, 162);
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap #viewerPdfContainer .mso-page-excel .page {
  margin: 0 auto;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap #viewerPdfContainer .mso-page-word .page {
  margin: 0 auto;
  position: relative;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap #viewerPdfContainer .page .textLayer {
  margin: 0 auto;
}

.mce-content-readonly .mso-viewer .macros-preview .mso-plugin-wrap #viewerPdfContainer .page .mso-page-word .annotationLayer {
  margin: 0 auto;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  line-height: 1;
}
