.document-source-link {
  display: none !important;
}

.intro-body img[src*="/dialogs/attachment/fileTypeImages/"],
.m-intro-content img[src*="/dialogs/attachment/fileTypeImages/"],
.article .post img[src*="/dialogs/attachment/fileTypeImages/"],
.article .content img[src*="/dialogs/attachment/fileTypeImages/"] {
  display: inline-block !important;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 4px 0 0 !important;
  object-fit: contain !important;
  vertical-align: middle !important;
}

.pdf-inline-preview {
  width: 100%;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #dce7ea;
  border-radius: 6px;
  background: #f5f8f9;
  box-shadow: 0 6px 20px rgba(20, 66, 78, .08);
}

.pdf-inline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid #dce7ea;
  background: #f5f8f9;
  font-size: 14px;
  line-height: 1.5;
}

.pdf-inline-title {
  min-width: 0;
  overflow: hidden;
  color: #344f58;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-inline-pages {
  width: 100%;
  padding: 12px;
  background: #dfe5e7;
}

.pdf-inline-loading,
.pdf-inline-error {
  min-height: 130px;
  padding: 48px 20px;
  color: #647982;
  background: #f8fafb;
  text-align: center;
}

.pdf-inline-error {
  color: #a33b3b;
  background: #fff8f8;
}

.pdf-inline-page {
  width: 100%;
  margin: 0 auto 12px;
  text-align: center;
}

.pdf-inline-page:last-child {
  margin-bottom: 0;
}

.pdf-inline-page canvas,
.pdf-inline-page svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 45, 55, .14);
}

@media (max-width: 767px) {
  .pdf-inline-preview {
    margin: 14px 0;
    border-radius: 4px;
  }

  .pdf-inline-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 9px 10px;
  }

  .pdf-inline-title {
    width: 100%;
  }

  .pdf-inline-pages {
    padding: 6px;
  }

  .pdf-inline-page {
    margin-bottom: 6px;
  }
}

.office-inline-preview {
  width: 100%;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #dce7ea;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(20, 66, 78, .08);
}

.office-inline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid #dce7ea;
  background: #f5f8f9;
  font-size: 14px;
  line-height: 1.5;
}

.office-inline-title {
  min-width: 0;
  overflow: hidden;
  color: #344f58;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-inline-open {
  flex: 0 0 auto;
  color: #147d8c !important;
  text-decoration: none !important;
}

.office-inline-open:hover {
  color: #0b5964 !important;
  text-decoration: underline !important;
}

.office-inline-body {
  max-height: none;
  overflow: visible;
  color: #263d45;
  background: #fff;
}

.office-inline-message {
  min-height: 130px;
  padding: 48px 20px;
  color: #647982;
  text-align: center;
}

.office-inline-message.is-error {
  color: #a33b3b;
  background: #fff8f8;
}

.office-word-content {
  padding: 32px 40px;
  line-height: 1.8;
}

.office-word-content img {
  max-width: 100%;
  height: auto;
}

.office-word-content table,
.office-sheet-view table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.office-word-content th,
.office-word-content td,
.office-sheet-view th,
.office-sheet-view td {
  padding: 7px 10px;
  border: 1px solid #cfdcdf;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}

.office-sheet-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 10px 0;
  border-bottom: 1px solid #dce7ea;
  background: #f7fafb;
}

.office-sheet-tab {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  color: #526b74;
  background: transparent;
  cursor: pointer;
}

.office-sheet-tab.is-active {
  border-color: #dce7ea;
  color: #147d8c;
  background: #fff;
}

.office-sheet-view {
  overflow-x: auto;
  overflow-y: visible;
  padding: 14px;
}

@media (max-width: 767px) {
  .office-inline-preview {
    margin: 14px 0;
    border-radius: 4px;
  }

  .office-inline-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 9px 10px;
  }

  .office-inline-title {
    width: 100%;
  }

  .office-word-content {
    padding: 20px 16px;
  }
}
