/* The Team page. */
.team { padding: 22px 24px 18px; display: grid; gap: 16px; }
.team-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.team-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.team-head p { color: var(--ink-2); font-size: 16px; margin-top: 4px; }
.search-people { width: min(360px, 100%); height: 48px; }
.team-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.trow { display: grid; grid-template-columns: minmax(280px, 1fr) repeat(4, 130px) 190px; align-items: center; min-height: 64px; }
.trow > * { padding: 0 12px; }
.thead { min-height: 56px; background: var(--surface-2); color: var(--ink-2); font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); }
.thead .tc { text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: normal; }
.trow-account, .trow-override { border-top: 1px solid var(--line-soft); cursor: pointer; }
.thead + .trow { border-top: 0; }
.trow-account:hover, .trow-override:hover { background: var(--surface-2); }
.trow.is-selected { background: var(--blue-wash); }
.tr-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tr-name { font-size: 18px; font-weight: 650; }
.tr-chev { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; color: var(--ink-2); transform: rotate(-90deg); flex: none; }
.tr-chev.is-open { transform: none; }
.tr-chev:hover { background: var(--surface-3); }
.tr-chev-gap { width: 32px; flex: none; }
.chip-tag { padding: 5px 14px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); font-size: 14px; }
.trow-override { min-height: 62px; }
.trow-override .tr-who { padding-left: 46px; }
.tr-tree { position: relative; width: 26px; height: 62px; flex: none; margin: 0 -4px 0 -8px; }
.tr-tree::before { content: ""; position: absolute; left: 6px; top: 0; height: 31px; width: 18px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 8px; }
.trow-override:not(.is-last) .tr-tree::after { content: ""; position: absolute; left: 6px; top: 31px; bottom: 0; border-left: 2px solid var(--line); }
.tr-handle { color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.tc { text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 500; }
.tc-active { color: var(--st-blue-text); font-weight: 600; }
.tc-blocked { color: var(--st-orange-text); }
.tc-failed { color: var(--st-red-text); }
.tc-done { color: var(--st-green-text); }
.tc.is-zero { color: var(--ink); }
.tc-when { color: var(--ink); font-size: 16px; }
.team-none { padding: 24px; color: var(--ink-2); }

.avatar.av-0 { background: #d6e4ff; color: #0d52c4; }
.avatar.av-1 { background: #e7dcfb; color: #5d27a8; }
.avatar.av-2 { background: #cfeee0; color: #0d6b30; }
.avatar.av-3 { background: #ffe0ee; color: #a3185b; }
.avatar.av-4 { background: #ffe7c7; color: #8f5200; }
.avatar.av-5 { background: #cdeff0; color: #0a6a62; }
:root[data-theme="dark"] .avatar.av-0 { background: #1b2e57; color: #a8c9ff; }
:root[data-theme="dark"] .avatar.av-1 { background: #34205a; color: #d9b8ff; }
:root[data-theme="dark"] .avatar.av-2 { background: #12361f; color: #8ee5b0; }
:root[data-theme="dark"] .avatar.av-3 { background: #4a1636; color: #ffb3d6; }
:root[data-theme="dark"] .avatar.av-4 { background: #3d2d0c; color: #ffd48a; }
:root[data-theme="dark"] .avatar.av-5 { background: #0f3a36; color: #8fe6dc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar.av-0 { background: #1b2e57; color: #a8c9ff; }
  :root:not([data-theme="light"]) .avatar.av-1 { background: #34205a; color: #d9b8ff; }
  :root:not([data-theme="light"]) .avatar.av-2 { background: #12361f; color: #8ee5b0; }
  :root:not([data-theme="light"]) .avatar.av-3 { background: #4a1636; color: #ffb3d6; }
  :root:not([data-theme="light"]) .avatar.av-4 { background: #3d2d0c; color: #ffd48a; }
  :root:not([data-theme="light"]) .avatar.av-5 { background: #0f3a36; color: #8fe6dc; }
}

.team-detail { display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(160px, .8fr) minmax(160px, .8fr) minmax(260px, 1.6fr); align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 12px; padding: 18px 8px; }
.d-who { display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.d-names { display: grid; gap: 2px; }
.d-name { font-size: 26px; font-weight: 750; letter-spacing: -.01em; }
.d-handle { color: var(--ink-2); font-size: 17px; }
.d-cell { display: grid; gap: 4px; padding: 4px 24px; border-left: 1px solid var(--line-soft); }
.d-label { color: var(--ink-2); font-size: 15px; }
.d-cell b { font-size: 19px; font-weight: 500; }
.d-sub { color: var(--ink-2); font-size: 16px; }
.team-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--ink-2); font-size: 15px; padding: 0 4px; }

/* The table needs about 990 px; narrower columns fit it down to 860, where it stacks as it does on a phone. */
@container page (max-width: 1060px) {
  .trow { grid-template-columns: minmax(220px, 1fr) repeat(4, 96px) 150px; }
}

@container page (max-width: 860px) {
  .team { padding: 14px; border-radius: 12px; }
  .team-head h1 { font-size: 30px; }
  .trow { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "who who who who" "a b f d" "when when when when"; min-height: 0; padding: 10px 0; row-gap: 6px; }
  .thead { display: none; }
  .trow .tr-who { grid-area: who; }
  .trow .tc-when { grid-area: when; color: var(--ink-2); font-size: 14px; }
  .tc::before { display: block; font-size: 11px; font-weight: 500; color: var(--ink-2); text-align: center; text-transform: uppercase; letter-spacing: .04em; }
  .tc-active::before { content: "Active"; } .tc-blocked::before { content: "Blocked"; } .tc-failed::before { content: "Failed"; } .tc-done::before { content: "Done"; }
  .team-detail { grid-template-columns: 1fr 1fr; row-gap: 12px; padding: 14px 4px; }
  .d-who, .d-wide { grid-column: 1 / -1; }
  .d-cell { border-left: 0; padding: 4px 18px; }
  .tr-handle { display: none; }
  .trow-override .tr-who { padding-left: 28px; }
}
