.team-directory-page-actions,
.team-directory-tools,
.team-directory-sections,
.team-directory-sections button {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-directory-page-actions { flex-wrap: wrap; }
.team-directory-page-actions button,
.team-directory-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
#pageActions .team-directory-page-actions i { margin: 0; }

.card.team-directory {
  container: team-directory / inline-size;
  padding: 0;
  background: #10111b;
  border-color: #292b3d;
}
.team-directory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid #2b2c40;
}
.team-directory-sections { gap: 16px; }
.team-directory-sections button {
  position: relative;
  justify-content: center;
  min-height: 62px;
  padding: 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #a3a3b8;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.team-directory-sections button:hover { color: #f3edff; }
.team-directory-sections button:focus-visible { outline-offset: -3px; }
.team-directory-sections button i { font-size: 17px; }
.team-directory-sections button[aria-pressed="true"] { color: #d4c5ff; }
.team-directory-sections button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #a98dff;
}
.team-directory-count {
  padding: 2px 7px;
  border-radius: 999px;
  background: #222336;
  color: #c3c2d5;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.team-directory-sections button[aria-pressed="true"] .team-directory-count {
  background: #30254d;
  color: #dacdff;
}
.team-directory-tools { flex: none; }
.team-directory-tools [hidden] { display: none; }
.team-directory-search {
  position: relative;
  display: flex;
  align-items: center;
  color: #a4a2bd;
}
.team-directory-search i {
  position: absolute;
  left: 11px;
  font-size: 16px;
  pointer-events: none;
}
.team-directory-search input {
  width: 218px;
  min-height: 38px;
  padding: 7px 11px 7px 34px;
  color: #f5f3ff;
  background: #171825;
  border: 1px solid #303146;
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
}
.team-directory-search input::placeholder { color: #a5a4ba; }

.team-directory-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
}
.team-directory-table th {
  height: 39px;
  padding: 6px 10px;
  color: #aaaabd;
  background: #141521;
  border-bottom: 1px solid #27283a;
  font-size: 11px;
  font-weight: 700;
}
.team-directory-table th:nth-child(1) { width: 29%; }
.team-directory-table th:nth-child(2) { width: 23%; }
.team-directory-table th:nth-child(3) { width: 19%; }
.team-directory-table th:nth-child(4) { width: 15%; }
.team-directory-table th:last-child { width: 58px; }
.team-directory-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #232436;
  font-size: 13px;
}
.team-directory-table :is(th, td):first-child { padding-left: 18px; }
.team-directory-table :is(th, td):last-child { padding-right: 18px; }
.team-directory-table tr:last-child td { border-bottom: 0; }
.team-directory-table tbody tr:hover { background: #171827; }

.team-directory-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.team-directory-avatar,
.team-directory-position,
.team-directory-empty-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid #493767;
  border-radius: 11px;
  color: #dfceff;
  background: linear-gradient(145deg, #392b55, #231d39);
  font: 700 13px 'Space Grotesk', sans-serif;
}
.team-directory-identity, .team-directory-role-info, .team-directory-rating {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.team-directory-identity b {
  color: #f7f3ff;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.team-directory-identity b i { margin-left: 4px; color: #a595d0; font-size: 11px; }
.team-directory-profile:hover b { color: #d4c2ff; }
.team-directory-profile:hover b i { color: #d4c2ff; }
.team-directory-identity small,
.team-directory-role-info small,
.team-directory-rating > small,
.team-directory-muted {
  color: #a09fb6;
  font-size: 11px;
}
.team-directory-identity small {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.team-directory-role {
  --role-color: #a88dff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--role-color) 26%, #232336);
  border-radius: 7px;
  background: color-mix(in srgb, var(--role-color) 11%, #151522);
  color: color-mix(in srgb, var(--role-color) 45%, #f3edff);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.team-directory-role i {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.team-directory-rating b {
  color: #f7d494;
  font-size: 13px;
  white-space: nowrap;
}
.team-directory-rating b small { color: #a9a7bb; font-size: 11px; font-weight: 500; }
.team-directory-date { color: #c0bfd1; font-variant-numeric: tabular-nums; }
.team-directory-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #634334;
  border-radius: 7px;
  color: #ffca9a;
  background: #30211e;
  font-size: 12px;
  font-weight: 700;
}
.team-directory-actions { text-align: right; }
.team-directory-more {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #303146;
  border-radius: 8px;
  color: #c6c4db;
  background: #181928;
  font-size: 18px;
}
.team-directory-more:hover,
.team-directory-more[aria-expanded="true"] { border-color: #665089; color: #eee4ff; background: #29223d; }
.team-directory-menu {
  position: fixed;
  inset: auto;
  width: min(203px, calc(100vw - 16px));
  margin: 0;
  padding: 5px;
  border: 1px solid #3e3b53;
  border-radius: 11px;
  background: #1a1b29;
  box-shadow: 0 10px 30px #0009;
}
.team-directory-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 37px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e8e4f4;
  text-align: left;
  font-size: 12px;
}
.team-directory-menu button i { font-size: 16px; }
.team-directory-menu button:hover { background: #2b2b41; }
.team-directory-menu button:focus-visible { outline-offset: -2px; }
.team-directory-menu button:last-child { margin-top: 3px; }
button.team-directory-danger { color: #ff9ba9; }
button.team-directory-danger:hover { color: #ffc2ca; background: #392334; }

.team-directory-roles { margin: 0; padding: 0; list-style: none; }
.team-directory-roles li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 10px 18px;
  border-bottom: 1px solid #242537;
}
.team-directory-roles li:last-child { border-bottom: 0; }
.team-directory-role-info { overflow-wrap: anywhere; font-size: 13px; }
.team-directory-roles .ghost { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; }
.team-directory-position { width: 34px; height: 34px; }

.team-directory-empty {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 39px 16px;
  text-align: center;
}
.team-directory-empty-icon { margin-bottom: 2px; font-size: 19px; }
.team-directory-empty p { margin: 0; color: #a09fb6; font-size: 12px; }
.team-directory-mobile-label { display: none; }
.team-directory-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@container team-directory (max-width: 720px) {
  .team-directory-toolbar { flex-wrap: wrap; gap: 10px; padding-bottom: 12px; }
  .team-directory-sections { flex: 0 0 100%; border-bottom: 1px solid #27283a; }
  .team-directory-sections button { min-height: 47px; }
  .team-directory-tools, .team-directory-search, .team-directory-search input { width: 100%; }
  .team-directory-table { display: block; }
  .team-directory-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .team-directory-table tbody { display: block; }
  .team-directory-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas: "person person actions" "rank score score" "date warnings warnings";
    align-items: start;
    gap: 12px 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #232436;
  }
  .team-directory-table tbody tr:last-child { border-bottom: 0; }
  .team-directory-table tbody td { display: grid; justify-items: start; gap: 4px; padding: 0 !important; border: 0; }
  .team-directory-person { grid-area: person; }
  .team-directory-actions { grid-area: actions; }
  .team-directory-rank { grid-area: rank; }
  .team-directory-score { grid-area: score; }
  .team-directory-date { grid-area: date; }
  .team-directory-warnings { grid-area: warnings; }
  .team-directory-mobile-label { display: block; color: #a09fb6; font-size: 10px; font-weight: 600; }
}
@container team-directory (max-width: 390px) {
  .team-directory-toolbar, .team-directory-roles li { padding-inline: 12px; }
  .team-directory-sections { justify-content: space-between; gap: 2px; }
  .team-directory-sections button { gap: 4px; padding-inline: 2px; font-size: 11px; }
  .team-directory-sections button i { display: none; }
  .team-directory-count { padding: 2px 5px; font-size: 10px; }
  .team-directory-table tbody tr { padding-inline: 12px; }
}

.team-rank-guide {
  padding: 14px 18px;
  border-bottom: 1px solid #242537;
  background: #141521;
}
.team-rank-guide b { font-size: 13px; }
.team-rank-guide p { margin: 4px 0 0; color: #a09fb6; font-size: 12px; }
.team-directory-roles li {
  position: relative;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
}
.team-rank-handle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 36px;
  border-radius: 6px;
  color: #9a95b1;
  font-size: 20px;
  user-select: none;
}
.team-rank-handle[data-rank-handle] { cursor: grab; touch-action: none; }
.team-rank-handle[data-rank-handle]:hover { background: #262139; color: #d4c5ff; }
.team-rank-handle i { pointer-events: none; }
.team-rank-arrows { display: flex; gap: 4px; }
.team-rank-arrows button { font-size: 14px; }
.team-rank-arrows button:disabled { opacity: .38; cursor: default; }
.team-directory-roles[aria-busy="true"] { cursor: progress; }
.team-rank-dragging { opacity: .5; }
.team-directory-roles li[data-drop-edge]::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 12px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: #b397ff;
  box-shadow: 0 0 10px #8c70ff85;
  pointer-events: none;
}
.team-directory-roles li[data-drop-edge="before"]::after { top: -1px; }
.team-directory-roles li[data-drop-edge="after"]::after { bottom: -1px; }

@container team-directory (max-width: 480px) {
  .team-rank-guide { padding-inline: 12px; }
  .team-directory-roles li { column-gap: 6px; }
  .team-directory-roles li .ghost { width: 34px; justify-content: center; padding-inline: 0; }
  .team-directory-roles li .ghost span { display: none; }
  .team-rank-handle { width: 18px; font-size: 17px; }
}
.team-rank-drag-preview {
  position: fixed;
  z-index: 40;
  max-width: min(220px, calc(100vw - 16px));
  padding: 6px 10px;
  border: 1px solid #7a62ae;
  border-radius: 8px;
  background: #28213d;
  box-shadow: 0 6px 18px #0007;
  color: #f3eaff;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
