.bot-settings .bot-admin__body.bot-admin__body--wide {
  max-width: none;
}

.bot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 28px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bot-gallery__item {
  position: relative;
}

.page__content .bot-gallery__bot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: auto;
  color: var(--color-dark);
  font-size: 14px;
  line-height: 1.3;
  text-align: center;

  &:is(a):hover, &:is(a):focus-visible {
    color: var(--bot-admin-button);
    text-decoration: none;

    .bot-gallery__avatar {
      box-shadow: 0 0 0 3px var(--bot-settings-tint);
      transform: translateY(-2px);
    }
  }
}

.bot-gallery__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.15s, box-shadow 0.15s;
}

.bot-gallery__name {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bot-gallery__menu {
  position: absolute;
  top: -4px;
  right: 4px;
}

.bot-gallery__toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  list-style: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;

  &::-webkit-details-marker {
    display: none;
  }

  &:hover, &:focus-visible {
    background-color: var(--bot-settings-field);
  }
}

.bot-gallery__item:hover .bot-gallery__toggle,
.bot-gallery__toggle:focus-visible,
.bot-gallery__menu[open] .bot-gallery__toggle {
  opacity: 1;
}

.bot-gallery__menu[open] .bot-gallery__toggle {
  background-color: var(--bot-settings-field);
}

.bot-gallery__links {
  position: absolute;
  top: 32px;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  border-radius: 10px;
  background-color: var(--color-white);
  box-shadow: 0 8px 24px rgb(24 44 72 / 0.16), 0 0 0 1px rgb(24 44 72 / 0.06);
  text-align: left;
}

.page__content .bot-gallery__links a {
  display: block;
  width: auto;
  padding: 6px 10px;
  line-height: 1.4;
  border-radius: 6px;
  color: var(--color-dark);
  font-size: 14px;

  &:hover, &:focus-visible {
    background-color: var(--bot-settings-tint);
    text-decoration: none;
  }
}

.page__content .bot-gallery__links a.bot-gallery__delete {
  margin-top: 4px;
  color: var(--color-destroy);
}

@media (hover: none) {
  .bot-gallery__toggle {
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .bot-gallery {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 22px 10px;
  }

  .bot-gallery__avatar {
    width: 64px;
    height: 64px;
  }
}
