.team-workspace {
  --team-surface: #202128;
  --team-inset: #191a20;
  --team-border: #3b3d46;
  --team-rule: #373841;
  --team-pad: clamp(1rem, 2.1vw, 1.7rem);
}
.team-workspace .team-create {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  flex-shrink: 0; min-height: 2.8rem;
}
.team-directory {
  padding: 0; min-width: 0; border: 1px solid var(--team-border); border-radius: .8rem;
  background: var(--team-surface); color: var(--ink);
}
.team-directory-head {padding: 1.45rem var(--team-pad) 1rem}
.team-directory-head h2 {
  font: 500 clamp(1.85rem,2.6vw,2.3rem)/1 var(--heading);
  text-transform: uppercase; letter-spacing: .015em;
}
.team-directory-head p, .team-empty p {margin-top:.3rem; line-height:1.5; font-size:.94rem; color:var(--muted)}
.team-tabs {
  display: flex; align-items: stretch; gap: clamp(.7rem,2vw,1.6rem);
  padding-inline: var(--team-pad); border-bottom: 1px solid var(--team-border);
}
.team-tabs button {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.9rem;
  padding: .45rem .1rem; border: 0; border-bottom: .18rem solid transparent;
  border-radius: 0; background: transparent; color: #c3c3ca; font-weight: 700; font-size: .92rem;
}
.team-tabs button[aria-pressed="true"] {border-bottom-color:var(--primary); color:#fff}
.team-tabs button:hover {color:#fff}
.team-tabs button span {
  padding: .04rem .4rem; border-radius: .3rem; background: #34353e; color: #d4d4da;
  font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.team-tabs button[aria-pressed="true"] span {background:#522a30; color:#ffb7ba}
.team-toolbar {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: 1rem var(--team-pad);
}
.team-search, #team-game-filter {
  min-height: 2.7rem; border: 1px solid #646570; border-radius: .4rem; background-color: var(--team-inset);
}
.team-search {display:flex; align-items:center; gap:.6rem; width:min(100%,23rem); padding-inline:.8rem; color:var(--muted); cursor:text}
.team-search input {width:100%; min-width:0; min-height:2.55rem; padding:0; border:0; background:transparent; color:var(--ink); font-size:.94rem}
.team-search svg {flex:none}
.team-search input::placeholder {color:#afb0ba; opacity:1}
.team-search:focus-within {outline:.15rem solid #ffd1d2; outline-offset:2px}
.team-search input:focus {outline:none}
#team-game-filter {max-width:100%; padding:.4rem 1rem .4rem .8rem; color:#f0f0f4; font-weight:650; font-size:.91rem; cursor:pointer}
.team-table {width:100%; border:0; border-spacing:0; border-collapse:collapse; text-align:left}
.team-table thead {background:var(--team-inset)}
.team-table thead th {
  padding: .65rem .65rem; border-block:1px solid var(--team-border); color:#b7b8c3;
  font: 750 .7rem/1.4 var(--body); text-transform:uppercase; letter-spacing:.08em;
}
.team-table th:first-child, .team-table td:first-child {padding-left:var(--team-pad)}
.team-table th:last-child, .team-table td:last-child {padding-right:var(--team-pad)}
.team-table th.team-action-title {text-align:right}
.team-table tbody th, .team-table tbody td {padding:.66rem .65rem; border-bottom:1px solid var(--team-rule); vertical-align:middle; font-size:.89rem}
.team-table tbody tr:last-child > * {border-bottom:0}
.team-table tbody th {font-weight:600; min-width:10rem; width:32%}
.team-table tbody tr:focus-within, .team-table tbody tr:hover {background:#272830}
.team-member {display:flex; align-items:center; gap:.75rem}
.team-avatar {
  display:grid; place-items:center; flex:none; width:2.25rem; height:2.25rem;
  border:1px solid #484a56; border-radius:.38rem; background:#31323b; color:#e3e3ec;
  font:700 .85rem/1 var(--body); text-transform:uppercase;
}
.team-avatar.referee {background:#3b3036; border-color:#61464f; color:#f4dce2}
.team-person {min-width:0; gap:.08rem}
.team-person strong {color:#f6f6f9; line-height:1.3; font-size:.96rem; font-weight:800}
.team-person span {color:#babac6; font-size:.79rem; font-weight:550; line-height:1.4}
.team-role-cell {color:#e1e1e7}
.team-game {display:inline-block; margin:.12rem .25rem .12rem 0; padding:.12rem .4rem; border-radius:.24rem; border:1px solid #51525e; color:#d8d8df; font:750 .7rem/1.45 var(--body); white-space:nowrap}
.team-unassigned {color:var(--muted); font-size:.8rem}
.team-state {display:inline-flex; align-items:center; gap:.42rem; color:#bcbcc5; font-size:.83rem; font-weight:650}
.team-state:before {content:""; width:.4rem; height:.4rem; border-radius:50%; background:#a0a1ab}
.team-state.is-active {color:#b1dec7}
.team-state.is-active:before {background:#72bd94}
.team-actions > div {display:flex; align-items:center; justify-content:flex-end; gap:.42rem}
.team-copy, .team-more, .team-recover, .team-preview {
  display:inline-flex; align-items:center; justify-content:center; min-height:2.35rem;
  border:1px solid #595a65; border-radius:.38rem; background:#292a33; color:#eeeef2;
}
.team-copy, .team-recover {min-width:8.6rem; gap:.4rem; padding:.39rem .65rem; font:750 .83rem/1.2 var(--body); white-space:nowrap}
.team-preview {gap:.4rem;padding:.39rem .7rem;font:750 .83rem/1.2 var(--body);background:transparent;white-space:nowrap}
.team-preview svg.icon {width:1rem;height:1rem;color:#e0c9ce}
.team-preview[aria-busy="true"] {cursor:progress}
.team-copy svg {width:1rem; height:1rem; color:#ec9a9d}
.team-copy:hover, .team-more:hover, .team-recover:hover, .team-preview:hover {background:#3b3c48; border-color:#92939e}
.team-copy.is-copied {background:#23362e; color:#c6f2d7; border-color:#537e66}
.team-copy.is-copied svg {color:inherit}
.team-copy[aria-busy="true"] {color:#e2d1d5}
.team-copy[aria-disabled="true"] {cursor:progress}
.team-more {width:2.35rem; min-width:2.35rem; padding:0; background:transparent; border-color:transparent; color:#c6c7d0}
.team-more svg {width:1.15rem; height:1.15rem}
.team-recover {color:#f2babc; background:transparent}
.team-row-error {max-width:18rem; margin:.45rem 0 0 auto; color:#ffb4b7; font-size:.82rem; line-height:1.4}
.team-results {display:flex; align-items:center; gap:1rem; margin-inline-start:auto}
#team-count {margin:0; color:var(--muted); font-size:.85rem; font-variant-numeric:tabular-nums}
#team-clear {min-height:2.75rem}
.team-empty {padding:2rem 1rem; border-top:1px solid var(--team-border); text-align:center}
.team-empty > svg {color:var(--soft-red); margin-bottom:.3rem}
.team-manual-label {display:block; margin:1rem 0 .4rem; font-weight:750}
#team-manual-message {
  display:block; width:100%; min-height:11rem; resize:vertical; padding:.8rem; margin-bottom:1rem;
  border:1px solid var(--input-line); border-radius:.4rem; color:#fff; background:var(--inset);
  font: .95rem/1.5 var(--body); user-select:text;
}
#team-manual-message:focus-visible {outline:.15rem solid #ffd1d2; outline-offset:2px}
@media (max-width: 52rem) {
  .team-workspace .workspace-heading {align-items:flex-start}
  .team-directory-head {padding-top:1.15rem}
  .team-toolbar {align-items:stretch}
  .team-search {flex:1 1 14rem; width:auto}
  #team-game-filter {flex:1 1 10rem}
  .team-table, .team-table tbody {display:block}
  .team-table thead {position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
  .team-table tbody tr {
    display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.38rem .6rem;
    border-top:1px solid var(--team-rule); padding:.9rem var(--team-pad);
  }
  .team-table tbody th, .team-table tbody td, .team-table tbody th:first-child, .team-table tbody td:last-child {display:block; padding:0; border:0; min-width:0; width:auto}
  .team-table tbody th {grid-column:1 / 3; grid-row:1}
  .team-member {gap:.58rem}
  .team-table tbody .team-role-cell {grid-column:1; grid-row:2; font-size:.8rem}
  .team-games {grid-column:2 / -1; grid-row:2}
  .team-state-cell {grid-column:3; grid-row:1; text-align:right}
  .team-table .team-actions {grid-column:1 / -1; grid-row:3}
  .team-actions > div {justify-content:space-between; padding-top:.18rem}
  .team-copy, .team-recover, .team-preview, .team-more {min-height:2.75rem}
  .team-more {min-width:2.75rem}
  .team-copy, .team-recover {flex:1.2 1 0}
  .team-preview {flex:1 1 0}
  .team-copy, .team-recover, .team-preview {min-width:0;white-space:normal}
  .team-more {border-color:var(--team-border)}
}
@media (max-width: 28rem) {
  .team-workspace .workspace-heading {gap:.55rem}
  .team-workspace .workspace-heading .overline {display:none}
  .team-workspace .workspace-heading h1 {font-size:2.5rem}
  .team-directory-head {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0}
  .team-tabs {gap:.7rem}
  .team-tabs button {gap:.27rem; font-size:.85rem}
  .team-tabs button span {padding-inline:.29rem}
  .team-results {width:100%; justify-content:space-between}
}
@media (max-width: 23rem) {
  .team-actions > div {gap:.3rem}
  .team-actions :is(.team-copy,.team-recover,.team-preview) {gap:.25rem;padding:.35rem .25rem;font-size:.78rem}
}
