/* shared skeleton: reset, tooltip, copy toast, a11y floor.
   colours come from each sample's own stylesheet via custom properties. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Rounded', system-ui, sans-serif; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus, #fff);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- tooltip: one floating node, moved by shared.js ---- */
.tip {
  position: fixed; top: 0; left: 0; z-index: 90;
  padding: 7px 11px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--tip-fg, #03273f);
  background: var(--tip-bg, #fff);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 130ms ease;
}
.tip.on { opacity: 1; }
.tip::after {
  content: '';
  position: absolute;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--tip-bg, #fff);
  top: 100%;
}
.tip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--tip-bg, #fff);
}

/* ---- copy button + toast ---- */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor;
       stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.copy .ico-check, .copy.done .ico-copy { display: none; }
.copy.done .ico-check { display: block; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--toast-fg, #03273f);
  background: var(--toast-bg, #fff);
  border-radius: 999px;
  box-shadow: 0 10px 34px rgb(0 0 0 / 0.28);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms cubic-bezier(.2,.8,.3,1);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .ico { width: 18px; stroke-width: 2.4; color: var(--toast-tick, #1b9e5a); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
