.emg-term {
  display: inline-block;
  position: relative;
}

.emg-term::after {
  content: " ";
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  transition-property: opacity, visibility;
  visibility: hidden;
}

.emg-term.show-tooltip::after {
  opacity: 1;
  visibility: visible;
}

.emg-term.tooltip-bottom::after {
  top: 100%;
  bottom: auto;
  -webkit-transform: translateX(-50%) rotate(180deg);
      -ms-transform: translateX(-50%) rotate(180deg);
          transform: translateX(-50%) rotate(180deg);
}

.emg-term.tooltip-bottom .emg-tooltip {
  padding-top: 10px;
  padding-bottom: 0;
  top: calc(100% - 1px);
  bottom: auto;
}

.emg-term.tooltip-bottom .emg-tooltip__close {
  top: -2px;
}

.emg-tooltip {
  color: initial;
  width: 300px;
  max-width: 90vw;
  opacity: 0;
  padding-bottom: 10px;
  position: absolute;
  bottom: calc(100% - 1px);
  left: 50%;
  text-decoration: none;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  transition-property: opacity, visibility;
  visibility: hidden;
}

.emg-tooltip__inner {
  background-color: #fff;
  border: 1px solid #fff;
  box-shadow: 0 7px 30px rgba(0, 0, 0, 0.25);
  min-height: 80px;
  padding: 15px;
}

.emg-tooltip__inner::before {
  content: "";
  -webkit-animation-name: loading;
          animation-name: loading;
  -webkit-animation-duration: .7s;
          animation-duration: .7s;
  -webkit-animation-iteration-count: infinite;
          animation-iteration-count: infinite;
  background-color: #999;
  border-radius: 100%;
  box-shadow: -15px 0 0 #999, 15px 0 0 #999;
  height: 10px;
  width: 10px;
  margin-top: -5px;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate3d(-50%, -50%, 0);
          transform: translate3d(-50%, -50%, 0);
}

.tooltip-loaded .emg-tooltip__inner::before {
  display: none;
}

.emg-tooltip__title {
  font-weight: bold;
}

.emg-tooltip__close {
  background-color: #000;
  border-radius: 100px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-align-content: center;
      -ms-flex-line-pack: center;
          align-content: center;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  height: 25px;
  width: 25px;
  position: absolute;
  top: -12.5px;
  right: -12.5px;
}

.emg-tooltip__close::before {
  content: "+";
  color: #fff;
  line-height: 0;
  -webkit-align-self: center;
      -ms-flex-item-align: center;
              -ms-grid-row-align: center;
          align-self: center;
  font-size: 33px;
  -webkit-transform: rotate(45deg) translate3d(0, 1px, 0);
          transform: rotate(45deg) translate3d(0, 1px, 0);
}

@media (min-width: 1025px), (hover: hover) {
  .emg-tooltip__close {
    display: none;
  }
}

.emg-tooltip__close:active {
  background-color: #444;
}

.show-tooltip .emg-tooltip {
  opacity: 1;
  visibility: visible;
}

@-webkit-keyframes loading {
  0% {
    box-shadow: -15px 0 0 #999, 15px 0 0 #999;
  }
  25% {
    box-shadow: -15px 0 0 rgba(153, 153, 153, 0), 15px 0 0 #999;
  }
  50% {
    background-color: rgba(153, 153, 153, 0);
  }
  75% {
    box-shadow: -15px 0 0 #999, 15px 0 0 rgba(153, 153, 153, 0);
  }
}

@keyframes loading {
  0% {
    box-shadow: -15px 0 0 #999, 15px 0 0 #999;
  }
  25% {
    box-shadow: -15px 0 0 rgba(153, 153, 153, 0), 15px 0 0 #999;
  }
  50% {
    background-color: rgba(153, 153, 153, 0);
  }
  75% {
    box-shadow: -15px 0 0 #999, 15px 0 0 rgba(153, 153, 153, 0);
  }
}
