/* CLAUDE 10-20: Account > Team (team.js). Graphite: hairline rows, no boxes, one primary per area (Invite, or Accept on
   an invite for you), green only for state (the "can post" switch). Uses the control primitives of controls.css. */

.tm .page-head {
  display: block;
  margin-bottom: var(--s-5);
  text-align: left;
}
.tm .page-sub {
  margin: var(--s-1) 0 0;
  color: var(--c-fg-2);
}
.tm-sec {
  max-width: 560px;
  margin-bottom: var(--s-6);
}
.tm-sec h3 {
  margin: 0 0 var(--s-3);
  color: var(--c-fg);
  font-size: var(--t-body);
  font-weight: 600;
}
.tm-frozen {
  max-width: 560px;
  margin: 0 0 var(--s-5);
  color: var(--c-fg);
  font-size: var(--t-body);
}

/* the workspace switch: the segmented control, its options as wide as their names */
.tm-pick {
  max-width: 100%;
  overflow-x: auto;
}

/* the invite: the field and its button on one line, the hint under it */
.tm-invite {
  margin-bottom: var(--s-4);
}
.tm-invite-row {
  display: flex;
  gap: var(--s-2);
}
.tm-invite-row .m-field {
  flex: 1;
  min-width: 0; /* 16 px on a phone comes from phone.css (iOS WebKit zooms into a smaller field) */
}
.tm-invite .m-err {
  margin: var(--s-2) 0 0;
}
.tm-hint {
  margin: var(--s-2) 0 0;
  color: var(--c-fg-3);
  font-size: var(--t-label);
}

/* a person or an invite: the name and a quiet line at the left, the actions at the right, a hairline under it */
.tm-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  min-height: 52px;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--c-line);
}
.tm-who {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--c-fg-2);
  font-size: var(--t-body);
}
.tm-who b {
  overflow: hidden;
  color: var(--c-fg);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-who small {
  overflow: hidden;
  color: var(--c-fg-3);
  font-size: var(--t-label);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-row.is-frozen .tm-who b,
.tm-row.is-pending .tm-who b {
  color: var(--c-fg-2);
}
.tm-acts {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--s-3);
}
.tm-post {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-fg-2);
  font-size: var(--t-label);
  cursor: pointer;
}
.tm-acts .m-btn.text.tm-armed {
  color: var(--c-danger);
}
.tm-skel {
  height: 52px;
  border-radius: var(--r-sm);
}

.tm-fine {
  max-width: 560px;
  margin: 0;
  color: var(--c-fg-3);
  font-size: var(--t-label);
}
.tm-fine a {
  color: var(--c-fg-2);
  text-underline-offset: 3px;
}

/* the top bar while working in a team's workspace: which one, one tap to the Team page */
.tm-chip {
  max-width: 220px;
  min-height: 28px;
  padding: 0 var(--s-3);
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-fg);
  font-size: var(--t-label);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.tm-chip[hidden] {
  display: none;
}
body.in-team #topUpgrade {
  display: none; /* the plan is the team owner's: a member upgrades their own from their own workspace */
}
@media (hover: hover) and (pointer: fine) {
  .tm-chip:hover {
    background: var(--c-raised);
  }
}
.tm-chip:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .tm-chip {
    display: none; /* the phone shows the team on its Account sheet's Team row instead */
  }
  .tm-row {
    min-height: var(--h-touch);
  }
  .tm-acts {
    margin-left: auto; /* beside the name when it fits, under it at the right when it doesn't */
  }
}
