.build-team { padding-bottom: 3rem; }
.build-team .team-eyebrow { color: var(--accent); font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.build-team h1 { margin: .65rem 0 .9rem; color: var(--ink); font-size: clamp(1.75rem, 7vw, 2.3rem); font-weight: 800; line-height: 1.16; letter-spacing: -.04em; }
.build-team h1 span { color: var(--heading); }
.build-team .team-intro { max-width: 38ch; font-size: .9rem; line-height: 1.75; text-wrap: pretty; }
.team-invite { margin: 2rem .5rem 0; text-align: left; }
.team-invite > h2 { font-size: 1rem; }
.team-invite > p { max-width: none; }
.team-share-field { margin-top: 1.2rem; }
.team-share-field label { display: block; margin-bottom: .5rem; color: var(--ink-soft); font-size: .72rem; font-weight: 700; }
.team-share-row { position: relative; display: flex; align-items: center; gap: .6rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.team-share-row input { width: 100%; min-width: 0; padding: .5rem 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: .78rem; user-select: text; }
.team-share-row input.team-code { font-size: .95rem; font-weight: 800; letter-spacing: .1em; }
.team-copy { flex: none; display: grid; place-items: center; min-width: 3.7rem; min-height: 2.3rem; padding: .6rem .9rem; border: 0; border-radius: .7rem; background: var(--tint); color: var(--accent); font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; }
.team-copy:hover { color: var(--ink); }
.team-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Touching the field lights its underline rather than drawing a hard box
   around it. The lit line lies exactly on the row's own hairline, so nothing
   shifts when it appears, and it is what replaces the outline below -- the two
   belong together. */
.team-share-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(127, 168, 255, 0) 0%, var(--accent) 30%,
    #CFE0FF 50%, var(--accent) 70%, rgba(127, 168, 255, 0) 100%);
  background-size: 220% 100%;
  background-position: 50% 0;
  box-shadow: 0 0 10px rgba(127, 168, 255, .6), 0 0 22px rgba(127, 168, 255, .3);
  opacity: 0;
  transform: scaleX(.35);
  transition: opacity .18s var(--ease), transform .34s var(--ease);
  pointer-events: none;
}

.team-share-row:focus-within::after {
  opacity: 1;
  transform: scaleX(1);
  /* One sweep on arrival, then it settles. A light running up and down the
     field for as long as someone is copying a link would be a distraction. */
  animation: team-shine .85s var(--ease) 1;
}

@keyframes team-shine {
  from { background-position: -110% 0; }
  to { background-position: 50% 0; }
}

/* The line still lights, it simply arrives rather than travelling. */
@media (prefers-reduced-motion: reduce) {
  .team-share-row::after { transition: opacity .18s linear; transform: scaleX(1); }
  .team-share-row:focus-within::after { animation: none; }
}

/* Safe only because the lit underline above is the visible focus state. */
.team-share-row input:focus-visible { outline: none; }
.team-share-action { position: relative; margin-top: 1.4rem; }
.team-share { width: 100%; }
.build-team .team-share-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.build-team .team-invite-note { margin-top: .75rem; font-size: .72rem; }
.team-optional { color: var(--ink-soft); font-weight: 500; }
.team-code-result { margin: .55rem 0 0; color: var(--accent); font-size: .78rem; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
.team-code-result:empty { display: none; }
.team-code-result[data-state="error"] { color: var(--red-deep); }
:root:not([data-theme="light"]) .team-code-result[data-state="error"] { color: #ff9299; }
.team-copy.is-copied { color: #4ade80; background: rgba(74,222,128,.1); }
.team-copy-toast { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 5; max-width: 100%; padding: 10px 14px; border-radius: 10px; background: #4ade80; color: #07351c; font-size: 12px; font-weight: 800; line-height: 1.4; box-shadow: 0 5px 18px rgba(0,0,0,.18); pointer-events: none; animation: team-toast-in .2s ease-out both; }
.team-copy-toast::after { content: ""; position: absolute; right: 28px; top: 100%; border: 6px solid transparent; border-top-color: #4ade80; border-bottom: 0; }
.team-copy-toast[data-state="error"] { background: var(--card); color: var(--ink); }
.team-copy-toast[data-state="error"]::after { border-top-color: var(--card); }
.team-tick { display: block; flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.team-tick path { stroke-dasharray: 24; stroke-dashoffset: 0; }
.team-tick.is-drawing path { animation: team-tick-draw .34s cubic-bezier(.65,0,.35,1) forwards; }
.team-tick[hidden], [data-feedback-label][hidden], .team-copy-toast[hidden] { display: none; }
@keyframes team-toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes team-tick-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .team-copy-toast, .team-tick.is-drawing path { animation: none; } }
