.tktty-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1;
}

.tktty-help__button {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .58;
  font: 700 12px/16px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  cursor: help;
  box-shadow: none;
}

.tktty-help__button:hover,
.tktty-help__button:focus-visible,
.tktty-help.is-open .tktty-help__button {
  opacity: 1;
}

.tktty-help__button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.tktty-help__popup {
  position: absolute;
  z-index: 9999;
  left: 50%;
  bottom: calc(100% + 10px);
  width: min(320px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(4px);
  padding: 12px 13px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 10px;
  background: #fff;
  color: #222;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  font: 400 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.tktty-help__popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: #fff;
  border-right: 1px solid rgba(0,0,0,.14);
  border-bottom: 1px solid rgba(0,0,0,.14);
  transform: translateY(-5px) rotate(45deg);
}

.tktty-help.is-open .tktty-help__popup,
.tktty-help:hover .tktty-help__popup,
.tktty-help:focus-within .tktty-help__popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tktty-help__popup strong,
.tktty-help__text,
.tktty-help__link {
  display: block;
}

.tktty-help__popup strong {
  margin-bottom: 5px;
  font-weight: 700;
}

.tktty-help__text {
  margin-bottom: 7px;
}

.tktty-help__link {
  width: max-content;
  max-width: 100%;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 767px) {
  .tktty-help {
    margin-left: 5px;
  }

  .tktty-help__button {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 12px;
    line-height: 18px;
  }

  .tktty-help__popup {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 18px;
    width: auto;
    max-width: none;
    transform: translateY(8px);
  }

  .tktty-help__popup::after {
    display: none;
  }

  .tktty-help.is-open .tktty-help__popup,
  .tktty-help:focus-within .tktty-help__popup {
    transform: translateY(0);
  }

  /* Touch devices should open on tap, not sticky :hover. */
  @media (hover: none) {
    .tktty-help:hover .tktty-help__popup:not(:focus-within) {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    .tktty-help.is-open .tktty-help__popup {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
  }
}
