
.sft-copy-btn {
  flex: none;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-width: 24px;
  min-height: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.sft-copy-btn:hover {
  color: var(--sft-contact-accent, #0e7490);
}

.sft-copy-btn:active {
  transform: scale(0.94);
}

.sft-copy-btn.is-copied:active,
.sft-copy-btn.is-copy-failed:active {
  transform: none;
}

.sft-copy-btn:focus-visible {
  outline: 2px solid var(--sft-contact-accent, #0e7490);
  outline-offset: 2px;
}

.sft-copy-btn__icon {
  display: inline-flex;
}

.sft-copy-btn__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Copy glyph and check glyph occupy the same slot; only one is ever shown. */
.sft-copy-btn__icon--done {
  display: none;
}

.sft-copy-btn.is-copied .sft-copy-btn__icon--copy,
.sft-copy-btn.is-copy-failed .sft-copy-btn__icon--copy {
  display: none;
}

.sft-copy-btn.is-copied .sft-copy-btn__icon--done {
  display: inline-flex;
}

.sft-copy-btn.is-copied,
.sft-copy-btn.is-copy-failed {
  z-index: 6;
}

.sft-copy-btn.is-copied {
  color: #15803d;
  border-color: #86efac;
  background: #f0fdf4;
}

.sft-copy-btn.is-copy-failed {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Failed state falls back to the copy glyph, so re-show it. */
.sft-copy-btn.is-copy-failed .sft-copy-btn__icon--copy {
  display: inline-flex;
}

.sft-copy-btn__flash {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 7;
  transform: translate(-50%, 4px);
  padding: 5px 10px;
  border-radius: 5px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.28);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.sft-copy-btn.is-copied .sft-copy-btn__flash,
.sft-copy-btn.is-copy-failed .sft-copy-btn__flash {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.sft-copy-btn--inline {
  border-radius: 5px;
  vertical-align: middle;
  margin-left: 2px;
  background: transparent;
  border-color: transparent;
  color: #94a3b8;
}

.sft-copy-btn--inline .sft-copy-btn__icon svg {
  width: 14px;
  height: 14px;
}

/* The email row is a flex row with a 6px gap; pull the icon back so it sits
   as close to the address as the phone icons sit to their numbers. */
.sft-contact-emails__item .sft-copy-btn--inline {
  margin-left: -2px;
}

.sft-contact-emails__item .sft-copy-btn {
  position: relative;
  z-index: 2;
}

.sft-contact-emails__item .sft-copy-btn.is-copied,
.sft-contact-emails__item .sft-copy-btn.is-copy-failed {
  z-index: 6;
}

@media (prefers-reduced-motion: reduce) {

  .sft-copy-btn,
.sft-copy-btn__flash {
    transition: none;
  }

  .sft-copy-btn:active {
    transform: none;
  }

  .sft-copy-btn__flash {
    transform: translate(-50%, 0);
  }
}

/* Screen-reader-only announcement region (one per page, in the footer). */
.sft-copy-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {

  .sft-copy-btn {
    display: none;
  }
}
