/* Team and Roles & approvals, two Settings pages.
   Loaded after ds/css/tokens.css and ds/css/app.css; ds already draws the
   rows (.row, .member-row, .member-name), tags, status dots, role columns
   (.role-grid, .role-card) and the panel. Only what it does not say lives
   here. */

/* ————— Team: one list, members then invitations ————— */
.team-grid,
.team-row {
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) 96px 24px;
  column-gap: var(--space-12);
}
.team-row .member-name > span:last-child { min-width: 0; }
.team-row .mn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-chev { display: flex; justify-content: flex-end; color: var(--text-faint); }
.team-row:hover .team-chev { color: var(--text-default); }
.team-list .list-pagination { margin-top: var(--space-8); }
.team-empty { margin: 0; }
.team-panel-title { min-width: 0; }
.team-panel-title h2 { overflow-wrap: anywhere; }
.team-role-field { margin-top: var(--space-24); }
/* The panel foot that asks before removing someone: the question on its own
   line, the two answers under it. */
.team-confirm-text {
  flex-basis: 100%;
  margin: 0 0 var(--space-4);
  font-size: var(--text-13);
  color: var(--text-default);
  line-height: 1.45;
}
.team-invite-form .field:last-of-type { margin-bottom: var(--space-12); }
.team-invite-form > .hint { margin: 0; }
@media (max-width: 640px) {
  .team-grid { display: none; }
  /* A phone keeps who and whether they have joined; the role is one tap away. */
  .team-row { grid-template-columns: minmax(0, 1fr) auto 16px; }
  .team-row > :nth-child(2) { display: none; }
}

/* ————— Roles & approvals ————— */
.roles-body { gap: var(--space-40); padding-inline-start: 0; }
.roles-own {
  margin: 0;
  max-width: 62ch;
  font-size: var(--text-14);
  line-height: 1.6;
  color: var(--text-default);
}
.roles-own strong { color: var(--text-strong); font-weight: var(--w-medium); }
.roles-block,
.roles-approvals { display: grid; gap: var(--space-12); min-width: 0; }
.roles-block > .set-group-head,
.roles-sub-head .set-group-head { margin: 0; }
.roles-list .role-card { padding-bottom: var(--space-12); }
.roles-list .role-count:empty { display: none; }
.roles-list .role-count { margin-top: var(--space-6); }
.roles-you { margin-inline-start: var(--space-6); font-weight: var(--w-body); vertical-align: 1px; }

/* The matrix: no borders, an ink check for yes, one word for a scope, a
   faint dot for no, and the viewer's column on a quiet ground. */
.roles-table-wrap { overflow-x: auto; min-width: 0; }
.roles-table { width: 100%; min-width: 540px; border-collapse: separate; border-spacing: 0; }
.roles-table th,
.roles-table td {
  padding: var(--space-10) var(--space-8);
  border: 0;
  font-size: var(--text-12);
  font-weight: var(--w-body);
  text-align: center;
  vertical-align: middle;
}
.roles-table thead th { color: var(--text-subtle); }
.roles-table tbody th { text-align: left; font-size: var(--text-13); color: var(--text-default); padding-inline-start: 0; }
.roles-table td { color: var(--text-default); }
.roles-table td .icon { color: var(--text-strong); vertical-align: middle; }
.roles-table .is-you { background: var(--bg-hover); }
.roles-table thead th.is-you { color: var(--text-strong); font-weight: var(--w-medium); border-radius: var(--r-control) var(--r-control) 0 0; }
.roles-table tbody tr:last-child td.is-you { border-radius: 0 0 var(--r-control) var(--r-control); }
.roles-no {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
  vertical-align: middle;
}
.roles-legend { margin: var(--space-8) 0 0; }

/* On a phone the matrix is one fold per role, yours open. */
.roles-accordion { display: none; }
@media (max-width: 640px) {
  .roles-table-wrap { display: none; }
  .roles-accordion { display: grid; gap: var(--space-2); }
}
.roles-fold > summary {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: var(--text-13);
  color: var(--text-default);
}
.roles-fold > summary::-webkit-details-marker { display: none; }
.roles-fold-chev { margin-inline-start: auto; display: inline-flex; color: var(--text-faint); }
.roles-fold[open] > summary .roles-fold-chev { color: var(--text-default); }
.roles-fold > .def-group { padding-bottom: var(--space-12); }

/* Approvals as a ladder: each rung a range and who clears it. */
.roles-sub-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); }
.roles-ladder { display: grid; }
.ladder-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  margin: 0;
  padding: var(--space-12) 0;
  font-size: var(--text-13);
}
.ladder-range { color: var(--text-default); font-variant-numeric: tabular-nums; }
.ladder-who { color: var(--text-subtle); text-align: right; }
.roles-notes { max-width: 62ch; }
.al-blurb { margin: 0 0 var(--space-20); }
