.team-table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-left: 250px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.team-table-wrap:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.team-table-wrap.team-scroll-managed { scrollbar-width: none; }
.team-table-wrap.team-scroll-managed::-webkit-scrollbar { display: none; }

.team-table {
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}

.team-table th, .team-table td { white-space: nowrap; }
.team-table td { padding: 9px 14px; }
.team-table .team-name-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 250px;
  min-width: 250px;
  max-width: 300px;
  white-space: normal;
  background: #fff;
  border-right: 1px solid var(--line);
}

.team-table thead .team-name-cell { z-index: 3; background: #f0f3f0; }
.team-table tbody tr:hover > .team-name-cell { background: #f8faf8; }
.team-table tbody tr:focus-within > .team-name-cell { background: #f1f8f3; }
.team-table-wrap.is-scrolled-horizontal .team-name-cell {
  border-right-color: var(--line-strong);
  box-shadow: 10px 0 12px -10px rgba(23, 32, 27, 0.38);
}

.team-table .team-cell-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: calc(100% + 16px);
  min-height: 36px;
  margin: -3px -8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: inherit;
  font-weight: 500;
  line-height: 1.4;
}

.team-table .team-cell-button:hover {
  border-color: var(--line-strong);
  background: #fff;
}
.team-table .team-cell-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  background: #fff;
}
.team-table .team-cell-button:disabled { cursor: wait; }
.team-table .team-edit-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  margin: 0;
  color: var(--brand);
  opacity: 0;
  transition: opacity 120ms ease;
}
.team-table .team-edit-hint svg { width: 14px; height: 14px; }
.team-table .team-cell-button:hover .team-edit-hint,
.team-table .team-cell-button:focus-visible .team-edit-hint { opacity: 1; }

.team-table .team-name-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  column-gap: 9px;
  row-gap: 3px;
  text-align: left;
  white-space: normal;
}
.team-table .team-name-button strong {
  grid-column: 1;
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.team-table .team-name-button > span:not(.team-edit-hint) {
  grid-column: 1;
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}
.team-table .team-name-button .team-edit-hint { grid-column: 2; grid-row: 1 / span 2; }
.team-table .team-name-cell > span { margin: 0; white-space: normal; }
.team-table .team-name-cell strong { overflow-wrap: anywhere; }
.team-table .team-name-role { margin-top: 3px; color: var(--muted); font-size: 12px; }
.team-table .team-projects-cell { min-width: 170px; max-width: 300px; white-space: normal; line-height: 1.5; }
.team-table .team-access-cell { min-width: 180px; max-width: 260px; }
.team-table .team-access-button strong { display: block; white-space: normal; overflow-wrap: anywhere; }
.team-table .team-access-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.team-edit-note { margin-bottom: 12px; }

.team-table .team-inline-form {
  display: grid;
  gap: 7px;
  min-width: 170px;
  margin: 0;
  white-space: normal;
}
.team-table .team-name-cell .team-inline-form { min-width: 0; }
.team-table .team-inline-form input,
.team-table .team-inline-form select {
  min-width: 0;
  height: 36px;
  padding: 0 9px;
}
.team-table .team-inline-form input[type="checkbox"] { width: 18px; height: 18px; }
.team-table .team-inline-actions { display: flex; align-items: center; gap: 5px; }
.team-table .team-inline-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
}
.team-table .team-inline-actions button[type="submit"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.team-table .team-inline-actions button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.team-table .team-inline-actions svg { width: 16px; height: 16px; }
.team-table .team-inline-error,
.team-table .team-inline-note { display: block; max-width: 280px; font-size: 12px; line-height: 1.4; }
.team-table .team-inline-error { color: var(--red); }
.team-table .team-inline-error:empty { display: none; }
.team-table .team-inline-note { color: var(--muted); }

.team-table-shell {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.team-table-shell.has-horizontal-scroll .team-table-wrap {
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.team-scroll-dock {
  position: sticky;
  bottom: 0;
  width: 100%;
  z-index: 15;
  box-sizing: border-box;
  padding: 5px 7px max(5px, env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line-strong);
  border-radius: 0 0 8px 8px;
  background: #fff;
  box-shadow: 0 -3px 12px rgba(23, 32, 27, 0.12);
}
.team-scroll-native, .team-scroll-probe {
  width: 100%;
  height: 22px;
  overflow-x: scroll;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: auto;
  scrollbar-color: #82948a #edf1ee;
}
.team-scroll-native::-webkit-scrollbar, .team-scroll-probe::-webkit-scrollbar { height: 16px; }
.team-scroll-native::-webkit-scrollbar-track { background: #edf1ee; border-radius: 7px; }
.team-scroll-native::-webkit-scrollbar-thumb {
  min-width: 42px;
  border: 3px solid #edf1ee;
  border-radius: 7px;
  background: #82948a;
}
.team-scroll-native::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.team-scroll-native:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.team-scroll-spacer { height: 1px; pointer-events: none; }
.team-scroll-probe { position: absolute; left: 0; top: 0; width: 32px; visibility: hidden; pointer-events: none; }
.team-scroll-range { display: none; }
.team-scroll-dock.uses-range .team-scroll-native { height: 1px; overflow: hidden; }
.team-scroll-dock.uses-range .team-scroll-range {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--brand);
  cursor: ew-resize;
}
.team-scroll-range:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; box-shadow: none; }

@media (hover: none), (pointer: coarse) {
  .team-table .team-edit-hint { opacity: 0.7; }
  .team-table .team-cell-button { min-height: 42px; }
}
@media (max-width: 760px) {
  .team-table-wrap { scroll-padding-left: 200px; }
  .team-table .team-name-cell { width: 200px; min-width: 200px; max-width: 230px; }
  .team-table td, .team-table th { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .team-table .team-edit-hint { transition: none; }
}
@media print {
  .team-scroll-dock { display: none !important; }
}
