.button-wrapper {
  display: flex;
  flex-flow: row nowrap;
  gap: 12px;

  min-height: 40px;
  margin-right: 12px;

  .edit-button {
    cursor: pointer;

    padding: 0 30px;

    font-size: var(--default-font-size);
    line-height: 24px;
    color: var(--color-href);

    opacity: 1;
    background-color: var(--color-gray-fff);
    border: 1px solid var(--color-href);
    border-radius: 5px;
    outline: transparent 0 none;

    transition: opacity 0.2s ease;

    &:hover {
      opacity: 0.7;
    }
  }

  .favorite-button {
    display: flex;
    align-items: center;
  }
}

.toolbar-dashboard {
  display: flex;

  /* grid-template-columns: 1fr 270px repeat(1, 40px); */
  align-items: center;
  justify-content: flex-end;

  width: 100%;
  margin-top: 20px;
}

.dashboard-wrapper {
  scrollbar-gutter: stable;

  overflow-y: auto;

  height: calc(100vh - 45px);
  margin-top: 3px;
  padding-right: 40px;

  &.displaced {
    height: calc(100vh - 95px); // delme
  }

  .editor-design-mode {
    display: flex;
    flex-flow: row nowrap;
    gap: 24px;

    app-cmf-dashboard-editor {
      flex-grow: 1;
    }

    .gadgets-panel {
      overflow: hidden auto;
      width: 0;
      padding-left: 12px;

      &.opened {
        overflow-y: auto;
        width: 400px;
        max-height: calc(100vh - 140px);
        border-left: 2px solid var(--color-gray-aaa);
      }
    }
  }
}

.dashboard-content {
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;

  width: 100%;
  height: 100%;

  .plug-wrapper {
    position: absolute;
    top: 45%;
    transform: translate(0, -50%);

    display: flex;
    flex-flow: column nowrap;
    align-items: center;

    .header {
      font-size: 20px;
    }

    .text {
      font-size: 14px;
    }
  }
}

.settings-button {
  display: flex;
  align-items: center;
  justify-content: center;

  app-cmf-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
  }
}

.more-menu-wrap {
  display: flex;
  flex-flow: column nowrap;

  .more-menu-item,
  .more-menu-item:link,
  .more-menu-item:visited {
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 0 8px;

    line-height: 24px;
    color: var(--default-color);

    opacity: 1;

    transition: opacity 0.2s ease;

    &:hover {
      opacity: 0.8;
    }
  }
}

.dashboard-header {
  font: var(--default-font-h1);
  color: var(--wiki-font-h1-color);
}

.layout-menu-wrapper {
  display: flex;
  flex-flow: row nowrap;
  gap: 6px;

  .layout-menu-button {
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 24px;
    padding-top: 4px;

    background-color: var(--menu-bg-color);
    border: none;
    border-radius: 5px;

    transition: background-color 0.2s ease;

    &:hover {
      background-color: var(--color-gray-eee);
    }

    &.active {
      background-color: var(--icons-color-default);
    }
  }
}

// с :host не работает(( поэтому такой длинный класснейм
::ng-deep.dashboard-layout-mat-menu-panel {
  min-height: auto !important;

  .mat-menu-content {
    padding: 3px 6px;

    .layout-menu-button {
      app-cmf-icon {
        width: 24px;
        height: 24px;
      }
    }
  }
}

.macros-panel {
  display: inline-flex;
  flex-flow: column nowrap;
  width: 100%;

  &.dashboard-panel {
    border-top: 5px solid #3f82d8;
    border-radius: 5px;
    box-shadow: 0 3px 3px 0 #a2a2a2a6;

    .panel-header {
      display: flex;
      flex-flow: row nowrap;
      padding: 12px;

      .header-title {
        display: flex;
        flex-flow: row nowrap;
        flex-grow: 1;
        align-items: center;
        justify-content: flex-start;

        font-size: 16px;
        font-weight: bold;
        line-height: 24px;
      }

      .header-resize {
        cursor: nesw-resize;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 24px;
        height: 24px;
      }

      .header-drag {
        cursor: grab;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 24px;
        height: 24px;
      }
    }
  }
}

.toolbar-pen {
  cursor: pointer;

  padding: 0 10px;

  background-color: var(--app-toolbar-bg-color);
  border: 1px solid transparent;
  border-radius: 5px;

  transition:
    color 0.2s ease,
    background-color 0.2s ease;

  &.active {
    background-color: var(--accent-color-bg);
    border: 1px solid rgb(0 0 0 / 12%);
  }
}

:host ::ng-deep .cmf-dashboard-editor .tox .tox-editor-container .tox-editor-header {
  position: fixed;
  top: 5px;

  height: 1px;

  visibility: hidden;
  opacity: 0;

  transition:
    height 0.2s ease,
    opacity 0.2s ease,
    visibility 0.2s ease;
}

:host ::ng-deep .cmf-dashboard-editor {
  &.displaced {
    .tox .tox-editor-container .tox-editor-header {
      top: 60px;
    }
  }
}

:host ::ng-deep .document-editor-active .cmf-dashboard-editor .tox .tox-editor-container .tox-editor-header {
  height: 40px;
  visibility: visible;
  opacity: 1;
}
