/* People tab, the people table of a workspace page, the people drawers and Add person (people.js), and the
   Workspaces page (workspaces.js). */
.people-tab { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.people-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.people-head-words { flex: 1 1 260px; min-width: 0; }
.people-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.people-text { margin: 0; font-size: 13px; line-height: 20px; color: var(--secondary); }
.people-applies { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; line-height: 20px; color: var(--secondary); }
.people-applies::before { content: ""; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--info-icon) center / contain no-repeat; mask: var(--info-icon) center / contain no-repeat; }
.people-list-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.people-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.people-search { flex: 0 1 320px; }
.people-removed { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--secondary); }
.people-list { display: flex; flex-direction: column; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); list-style: none; }
.people-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 12px 12px 16px; }
.people-row + .people-row { border-top: 1px solid var(--border); }
.people-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--subtle); color: var(--secondary); font-size: 13px; font-weight: 600; }
.people-avatar.invited { border: 1px dashed var(--border-strong); background: var(--card); }
.people-words { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.people-name { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.people-you { display: inline-block; white-space: nowrap; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--subtle); color: var(--secondary); font-size: 12px; font-weight: 500; }
.people-what { font-size: 13px; line-height: 20px; color: var(--secondary); overflow-wrap: anywhere; }
.people-roles { color: var(--muted); }
.people-state { flex: none; }
.people-no-menu { flex: none; width: var(--control-h); }
.people-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; line-height: 20px; color: var(--secondary); }
.people-note svg { flex: none; margin-top: 2px; }
.people-note .text-button { min-height: 0; padding: 0; margin-left: 4px; }
.people-company { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.people-company-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--subtle); color: var(--secondary); }
.people-company-words { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; font-size: 14px; color: var(--text); }
.people-delivery { font-size: 13px; }
/* Drawers */
.people-field { display: flex; flex-direction: column; gap: 8px; }
.people-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.people-label { font-size: 13px; font-weight: 600; color: var(--text); }
.people-fieldset { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.people-fieldset:first-child { margin-top: 0; }
.people-legend { margin: 0 0 4px; padding: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.people-fieldset .env-choice-list { margin-top: 0; }
.people-add-detail { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.people-add-detail:empty { display: none; }
.people-roles-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.people-role { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--field-border); border-radius: var(--radius-control); background: var(--card); font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.people-role:has(input:checked) { border-color: var(--selected-border); background: var(--selected-bg); }
.people-check { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; margin-top: 12px; font-size: 13px; line-height: 20px; color: var(--text); font-weight: 400; }
.people-check input { flex: none; margin-top: 2px; }
.people-more summary { font-size: 13px; }
.people-copy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.people-copy input { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 13px; }
.people-copy-tools { display: flex; gap: 8px; }
/* Workspaces page */
.ws-page { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ws-heading { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text); }
.ws-approvals { display: flex; flex-direction: column; gap: 12px; }
.ws-approval-list { display: flex; flex-direction: column; margin: 0; padding: 0; border: 1px solid #D9D6FE; border-radius: var(--radius-card); background: #FAF5FF; list-style: none; }
.ws-approval { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px; }
.ws-approval + .ws-approval { border-top: 1px solid #E9D7FE; }
.ws-approval-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: #F3E8FF; color: #6B21A8; }
.ws-approval-words { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; font-size: 13px; color: var(--secondary); }
.ws-approval-words strong { font-size: 14px; color: var(--text); }
.ws-list-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ws-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ws-search { flex: 0 1 320px; margin-left: auto; }
.ws-results { font-size: 13px; color: var(--secondary); }
.ws-list { display: flex; flex-direction: column; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); list-style: none; }
.ws-list-section { --ws-columns: 36px minmax(0, 1fr) 140px 160px 150px 148px 44px; }
/* Every row shares one set of fixed columns, top aligned: the name, the figures and the controls sit on one first line of 36px. */
.ws-row { display: grid; grid-template-columns: var(--ws-columns); align-items: start; gap: 12px 16px; min-height: 68px; padding: 16px 12px 16px 16px; }
.ws-cols { display: grid; grid-template-columns: var(--ws-columns); gap: 0 16px; padding: 0 13px 0 17px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--secondary); }
.ws-cols > span:nth-child(1) { grid-column: 3; }
.ws-row + .ws-row { border-top: 1px solid var(--border); }
.ws-row-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--subtle); color: var(--secondary); }
.ws-row-words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ws-row-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 36px; }
.ws-row-name { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ws-row-note { font-size: 12px; line-height: 16px; color: var(--warn-text, #7A5900); }
.ws-row-fact { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; padding-top: 8px; font-size: 13px; line-height: 20px; color: var(--secondary); white-space: nowrap; }
.ws-row-figure { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ws-row-link { color: var(--text); font-weight: 600; text-decoration: none; }
.ws-row-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ws-row-none { color: var(--muted); font-weight: 500; }
.ws-views { margin: -8px 0 24px; }
.people-team { max-width: none; }
.ws-row-meter { grid-column: 1 / -1; display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--subtle); overflow: hidden; }
.ws-row-meter > span { display: block; height: 100%; border-radius: 2px; background: #E0701F; }
.ws-row > button, .ws-row > .ws-people-link { min-height: var(--control-h-compact); height: var(--control-h-compact); padding: 0 12px; font-size: 13px; }
.ws-people-link { border-radius: 8px; text-decoration: none; }
.ws-row > .ui-menu-wrap { margin-top: -4px; }
/* A workspace's people page: the way back to all workspaces sits above the page header. */
.ws-back { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin-top: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--active-text); text-decoration: none; }
.ws-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.ws-back[hidden] { display: none; }
.ws-back + .page-header { margin-top: 0; }
@media (max-width: 1100px) {
  .ws-cols { display: none; }
  .ws-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .ws-row-fact { padding-top: 0; }
  .ws-row-fact { grid-column: 2; grid-row: auto; }
  .ws-row-fact + .ws-row-fact { grid-column: 3 / -1; }
}
@media (max-width: 600px) {
  .people-row { flex-wrap: wrap; padding: 12px; }
  .people-words { flex: 1 1 0; }
  .people-row > .ui-menu-wrap, .people-no-menu { order: 2; }
  .people-state { order: 3; margin-left: 48px; }
  .people-row::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .people-search, .ws-search { flex: 1 1 100%; margin-left: 0; }
  .ws-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px; }
  .ws-row-fact, .ws-row-fact + .ws-row-fact { grid-column: 2 / -1; }
  .ws-row > button.secondary, .ws-row > .ws-people-link { grid-column: 2 / -1; justify-self: start; }
  .ws-row > .ui-menu-wrap { grid-column: 3; grid-row: 1; }
  .ws-approval > button { flex: 1 1 100%; }
}
/* Login changes kept on the page: staged rows, the save bar and the save results */
.people-row-staged { background: #FFFBF5; }
.people-row-deleted .people-name { text-decoration: line-through; color: var(--secondary); }
.people-row-deleted .people-avatar { opacity: .6; }
.people-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px 12px 16px; border: 1px solid #F5C9A6; border-radius: var(--radius-card); background: #FFF8F2; }
.people-savebar.alert { border-color: #FCA5A5; background: #FEF2F2; }
.people-savebar-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--card); color: #B4500A; }
.people-savebar.alert .people-savebar-icon { color: var(--danger); }
.people-savebar-words { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px; min-width: 0; font-size: 13px; line-height: 20px; color: var(--secondary); }
.people-savebar-words strong { font-size: 14px; color: var(--text); }
.people-savebar-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.people-results { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.people-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.people-results-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.people-results-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.people-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; line-height: 20px; color: var(--secondary); }
.people-result > svg { flex: none; color: var(--muted); }
.people-result.complete > svg { color: #15803D; }
.people-result.failed > svg { color: var(--danger); }
.people-result-words { display: flex; flex-wrap: wrap; gap: 0 8px; flex: 1 1 240px; min-width: 0; }
.people-result-name { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.people-result.failed .people-result-state { color: var(--danger); }
.people-result > button { min-height: var(--control-h-compact); height: var(--control-h-compact); padding: 0 12px; font-size: 13px; }
@media (max-width: 600px) {
  .people-savebar-tools { flex: 1 1 100%; }
  .people-savebar-tools > button { flex: 1 1 0; }
}
/* A product role in plain words with its id in grey beside it. */
.people-role-words { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.people-role-id { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.people-add-retry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; font-size: 13px; color: var(--secondary); }
.people-add-retry > button { min-height: var(--control-h-compact); height: var(--control-h-compact); padding: 0 12px; font-size: 13px; }
.people-roles-set { min-width: 0; margin: 0; padding: 0; border: 0; }
.people-roles-set > legend { margin-bottom: 8px; padding: 0; }
/* The people of a workspace as a table (its own page). On a phone each person becomes one block. */
.people-table-wrap { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.people-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 20px; }
.people-table thead th { height: 44px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--page); color: var(--secondary); font-size: 12px; line-height: 16px; font-weight: 600; text-align: left; white-space: nowrap; }
.people-table thead th:first-child { border-top-left-radius: 11px; }
.people-table thead th:last-child { border-top-right-radius: 11px; }
.people-table tbody th, .people-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--secondary); font-weight: 400; text-align: left; vertical-align: middle; }
.people-table tbody tr:last-child > * { border-bottom: 0; }
.people-table th.people-col-person { min-width: 240px; }
.people-table td.people-col-seen { white-space: nowrap; font-variant-numeric: tabular-nums; }
.people-table .people-col-tools { width: 1%; padding-right: 12px; text-align: right; }
.people-table td.people-col-tools { padding-top: 8px; padding-bottom: 8px; }
.people-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.people-tr-removed .people-name { color: var(--secondary); }
.people-edit-row > td { padding: 16px; background: var(--page); }
.people-table tbody tr.people-edit-row:last-child > td { border-radius: 0 0 11px 11px; }
.people-edit { display: flex; flex-direction: column; gap: 12px; max-width: 880px; }
.people-edit .people-fieldset { margin: 0; }
.people-edit .error:empty { display: none; }
.people-edit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.people-edit-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.people-edit-tools > button { min-height: var(--control-h-compact); height: var(--control-h-compact); padding: 0 16px; font-size: 13px; }
@media (max-width: 700px) {
  .people-table, .people-table tbody { display: block; }
  .people-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .people-table tr.people-tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border-bottom: 1px solid var(--border); }
  .people-table tbody tr:last-child { border-bottom: 0; }
  .people-table tr.people-tr > * { display: block; padding: 0; border: 0; }
  .people-table th.people-col-person { flex: 1 1 0; min-width: 0; }
  .people-table td.people-col-tools { flex: none; width: auto; padding: 0; }
  .people-table td.people-col-role { flex: 1 1 100%; order: 3; padding-left: 46px; }
  .people-table td.people-col-state { order: 4; margin-left: 46px; }
  .people-table td.people-col-seen { order: 5; flex: 1 1 100%; min-width: 0; padding-left: 46px; white-space: normal; }
  .people-table td.people-col-seen[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; }
  .people-table tr.people-edit-row { display: block; border-bottom: 1px solid var(--border); }
  .people-table tr.people-edit-row > td { display: block; padding: 12px; border: 0; }
  .people-edit-tools { flex: 1 1 100%; }
  .people-edit-tools > button { flex: 1 1 0; }
}
.ws-approval-list { border-color: var(--border); background: var(--card); }

/* Workspaces list: the name takes the larger share, the three figures share the rest evenly, actions hug the right */
.ws-list-section { --ws-columns: 36px minmax(220px, 1.4fr) minmax(150px, 1fr) minmax(130px, 1fr) minmax(110px, 1fr) 136px 44px; }
.ws-cols > span:nth-child(1) { grid-column: 1 / 3; }
.ws-cols > span:nth-child(2) { grid-column: 3; }
.ws-row-fact .ws-row-meter { max-width: 180px; }
.ws-cols { padding-top: 0; padding-bottom: 4px; }
/* Medium widths: name with its actions on the first line, the three figures side by side under the name */
@media (min-width: 601px) and (max-width: 1100px) {
  .ws-row { grid-template-columns: 36px repeat(3, minmax(0, 1fr)) auto 44px; row-gap: 8px; }
  .ws-row > .ws-row-icon { grid-column: 1; grid-row: 1; }
  .ws-row > .ws-row-words { grid-column: 2 / 5; grid-row: 1; }
  .ws-row > button.secondary, .ws-row > .ws-people-link { grid-column: 5; grid-row: 1; }
  .ws-row > .ui-menu-wrap { grid-column: 6; grid-row: 1; margin-top: 0; }
  .ws-row-fact, .ws-row-fact + .ws-row-fact { grid-row: 2; grid-column: auto; padding-top: 0; }
  .ws-row > :nth-child(3) { grid-column: 2; }
  .ws-row > :nth-child(4) { grid-column: 3; }
  .ws-row > :nth-child(5) { grid-column: 4; }
}
/* The page header keeps the same distance under the refresh strip as on every other page; the way back, when shown,
   takes that place and the header follows it closely. */
.ws-back[hidden] + .page-header { margin-top: 20px; }
.ws-back { margin-top: 16px; }
