.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, .42fr);
  gap: 1.5rem;
  align-items: start;
}
.team-layout > *, .team-person > div, .team-task-heading > div { min-width: 0; }
.team-role-note { color: var(--muted); font-size: .9375rem; }
.team-panel { padding: clamp(1.2rem, 3vw, 2rem); }
.team-panel > h2:first-child { margin-top: 0; }
.team-panel h2 { margin-bottom: .6rem; }
.team-panel p { overflow-wrap: anywhere; }
.team-list, .team-comments, .team-task-list { display: grid; gap: 1rem; }
.team-member, .team-invite, .team-task, .team-comment { min-width: 0; padding: 1.25rem; }
.team-member-heading, .team-task-heading, .team-invite-heading, .team-person {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .9rem;
}
.team-person { justify-content: start; align-items: center; }
.team-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .75rem;
  flex: 0 0 auto;
  background: var(--green-soft);
  color: var(--ink);
  font-weight: 650;
  text-transform: uppercase;
}
.team-person strong, .team-person span, .team-invite-heading strong { display: block; overflow-wrap: anywhere; }
.team-person .team-role-note, .team-invite .team-role-note { margin-top: .25rem; }
.team-inline-actions, .team-actions, .team-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.team-inline-actions { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.team-inline-actions form, .team-actions form { margin: 0; }
.team-role-form { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; }
.team-role-form .field { margin: 0; min-width: 10rem; }
.team-role-form label { display: block; margin-bottom: .35rem; font-size: .875rem; font-weight: 600; }
.team-role-form select { max-width: 100%; min-height: 2.6rem; }
.team-danger {
  color: #92422f;
  border-color: #d7aaa0;
  background: transparent;
  box-shadow: none;
}
.team-danger:hover { background: #fbefeb; border-color: #b97868; }
.team-role-list { display: grid; gap: .85rem; margin: 1rem 0 0; }
.team-role-list > div { padding-top: .85rem; border-top: 1px solid var(--line); }
.team-role-list dt { font-weight: 650; }
.team-role-list dd { margin: .25rem 0 0; color: var(--muted); font-size: .9375rem; }
.team-empty { padding: 1.7rem; border: 1px dashed var(--line); border-radius: 12px; }
.team-empty h2, .team-empty h3 { margin: 0 0 .5rem; }
.team-empty p { margin: 0; color: var(--muted); }
.team-task h2 { margin: .8rem 0 .55rem; font-size: 1.25rem; overflow-wrap: anywhere; }
.team-task h2 a { color: var(--ink); }
.team-task-question { margin: 0 0 1rem; color: var(--muted); overflow-wrap: anywhere; }
.team-task-meta, .team-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.25rem;
  margin: 0;
}
.team-task-meta dt, .team-detail-meta dt { color: var(--muted); font-size: .875rem; }
.team-task-meta dd, .team-detail-meta dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.team-task .team-actions { margin-top: 1.1rem; }
.team-due-overdue { color: #92422f; font-weight: 600; }
.team-step-note { padding: 1rem 1.2rem; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 0 8px 8px 0; }
.team-step-note p { margin: .4rem 0 0; }
.team-status-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin: .25rem 0 1.1rem; }
.team-status-summary .badge { font-size: .9375rem; }
.team-comments { margin-top: 1.25rem; }
.team-comment-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .4rem 1rem; }
.team-comment-heading time { color: var(--muted); font-size: .875rem; }
.team-comment-body { margin-top: .7rem; overflow-wrap: anywhere; }
.team-comment-body p:last-child { margin-bottom: 0; }
.team-review { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.team-review p { margin: .4rem 0; }
.team-form-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.team-form-section h3 { margin-top: 0; }
.team-invitation { max-width: 48rem; margin: 0 auto; }
.team-invitation .team-detail-meta { margin: 1.3rem 0; }
.team-invitation .team-actions { margin-top: 1.25rem; }
.team-layout input:not([type="checkbox"]):not([type="radio"]), .team-layout select, .team-layout textarea,
.team-invitation input:not([type="checkbox"]):not([type="radio"]) { width: 100%; max-width: 100%; box-sizing: border-box; }
.team-layout textarea { min-height: 7rem; resize: vertical; }
.team-layout .button, .team-invitation .button { white-space: normal; text-align: center; }
.team-readonly-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.team-readonly-fields :disabled { opacity: 1; color: var(--ink); cursor: default; }
.context-layout.team-readonly-layout { grid-template-columns: minmax(0, 1fr); }
.team-source-entries { margin: 1rem 0; }
.team-source-entries > div { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.team-source-entries dd { overflow-wrap: anywhere; }
.team-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: 1.25rem; }
@media screen {
  html[data-theme="dark"] .team-danger { color: #f1b4a5; border-color: #9a6357; }
  html[data-theme="dark"] .team-danger:hover { background: #412b27; border-color: #c58778; }
  html[data-theme="dark"] .team-due-overdue { color: #f1b4a5; }
}
@media (max-width: 1050px) { .team-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .team-member-heading, .team-invite-heading, .team-task-heading { flex-direction: column; }
  .team-role-form, .team-role-form .field { width: 100%; min-width: 0; }
  .team-role-form .button { width: 100%; }
  .team-task-meta, .team-detail-meta { grid-template-columns: minmax(0, 1fr); }
  .team-inline-actions { align-items: stretch; }
  .team-inline-actions form { width: 100%; }
  .team-inline-actions form > .button { width: 100%; }
  .team-invitation { width: 100%; }
}
