/* Copy button (CopyButton): the demo's copy feedback (endpoint-ui.js `copyButton`: check icon and "Copied") plus, at operator
   request (2026-11-05), a success-mark ring that fades over the last 0.4 s. Labels share one grid cell, so the button keeps
   its width between "Copy" and "Copied"; only a failure may widen it. */
.copy-btn [data-when] { display: none; }
.copy-btn[data-copy-state="idle"] > .copy-ico[data-when="idle"],
.copy-btn[data-copy-state="copied"] > .copy-ico[data-when="copied"],
.copy-btn[data-copy-state="failed"] > .copy-ico[data-when="failed"] { display: inline-flex; }
.copy-text { display: inline-grid; }
.copy-text > [data-when="idle"], .copy-text > [data-when="copied"] { display: block; grid-area: 1 / 1; visibility: hidden; }
.copy-btn[data-copy-state="idle"] .copy-text > [data-when="idle"],
.copy-btn[data-copy-state="copied"] .copy-text > [data-when="copied"] { visibility: visible; }
.copy-btn[data-copy-state="failed"] .copy-text > [data-when] { display: none; }
.copy-btn[data-copy-state="failed"] .copy-text > [data-when="failed"] { display: block; visibility: visible; }

/* Sizes: compact is square at the kit's 32.5 and 27px; inline sits in a line of text, ghost until used. */
.btn.copy-btn.compact { width: 32.5px; padding: 0; }
.btn.small.copy-btn.compact { width: 27px; }
.btn.copy-btn.inline { height: 22px; margin-left: 4px; padding: 0 6px; gap: 5px; border-radius: 6px; font-size: 11.5px; vertical-align: middle; }
.btn.copy-btn.inline.compact { width: 22px; padding: 0; }
.btn.copy-btn.inline:not(.is-copied):not(.is-failed) { border-color: transparent; background: transparent; color: var(--ink-3); }
.btn.copy-btn.inline:hover { background: var(--sunken); color: var(--ink); }
.btn.copy-btn.inline:active { transform: none; }

/* Feedback: the ring appears at once, then fades back to the button's own border over 0.4 s. */
.btn.copy-btn.is-copied {
  border-color: var(--ok-mark); color: var(--ok); transition: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok-mark) 20%, transparent);
}
.copy-btn.bare.is-copied {
  color: var(--ok-mark); transition: none;
  box-shadow: inset 0 0 0 1px var(--ok-mark), 0 0 0 3px color-mix(in oklab, var(--ok-mark) 24%, transparent);
}
.copy-btn.is-failed { color: var(--crit); transition: none; }
.copy-btn.is-fading { transition: border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), color 0.4s var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .copy-btn.is-fading { transition: none; }
}
