/* Use copy-text-host on the text/button container to reveal its copy control. */
.copy-text-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: text-bottom;
  align-self: flex-start;
  white-space: normal;
}
.copy-text-button {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}
.copy-text-host:hover .copy-text-button,
.copy-text-host:focus-within .copy-text-button,
.copy-text-control:hover .copy-text-button,
.copy-text-control:focus-within .copy-text-button,
.copy-text-control[data-feedback] .copy-text-button {
  opacity: 1;
}
.copy-text-button:hover,
.copy-text-button:focus-visible {
  background: rgb(127 127 127 / 16%);
}
.copy-text-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
.copy-text-tooltip {
  position: absolute;
  z-index: 50;
  right: 0;
  bottom: calc(100% + 0.25rem);
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  background: #1e293b;
  color: #fff;
  font: 500 12px/1.4 system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
.copy-text-tooltip-below .copy-text-tooltip {
  top: calc(100% + 0.25rem);
  bottom: auto;
}
.copy-text-button:hover + .copy-text-tooltip,
.copy-text-button:focus-visible + .copy-text-tooltip,
.copy-text-control[data-feedback] .copy-text-tooltip {
  opacity: 1;
}
@media (hover: none), (pointer: coarse) {
  .copy-text-button { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .copy-text-button { transition: none; }
}
