/* Organization people — styling for org-people.js, org-people-assignments.js and org-people-bulk.js. Existing tokens
   only, no new colour literals (sys_design-system.md) — CSS/tokens.css already resolves everything here for both
   themes; nothing in this file redefines a token. The pane is a Team settings pane (section cards) that borrows the
   admin console's work-band order: header, toolbar, selection bar, rows with dividers. */

/* These buttons are the shared `.a-btn.sm` (26px on the ladder, DS-73): the height, padding and type overrides this pane carried to
   beat the dialog's `.btn.small` are gone with that rule. `align-self:center` stays: the row centres everything else. */
.alt-app #adminModal .org-people-band-head button.a-btn.sm,
.alt-app #adminModal .org-people-selection button.a-btn.sm,
.alt-app #adminModal .org-people-detail button.a-btn.sm,
.alt-app #adminModal .org-people-invites-list button.a-btn.sm,
.alt-app #adminModal .org-people-filters button.a-btn.sm{
  align-self:center;
}

/* ---------- The Invite card's added controls ----------
   Role and Invite-to sit in the box's own `.add-row` (alt-team.css wraps and shrinks it); the outcome list of an
   Organization-only run sits under the actions, and is unpainted until it has something to list (4f). */
.alt-app #adminModal .invite-field{ display:inline-flex; align-items:center; gap:6px; flex:0 0 auto; }
.alt-app #adminModal .invite-field-l{ font-size:var(--a-fs-ctl-sm); color:var(--text-dim); font-weight:600; }
.alt-app #adminModal .invite-field select{ min-width:0; }
.alt-app #adminModal .invite-row{ flex-wrap:wrap; }
.alt-app #adminModal .invite-results:empty{ display:none; }
.alt-app #adminModal .invite-results{ margin-top:8px; display:flex; flex-direction:column; gap:6px; }
.alt-app #adminModal .org-people-invite-fail{
  font-size:var(--a-fs-ctl-sm); line-height:var(--a-lh-ui); color:var(--text-dim);
  padding:6px 4px 6px 10px; border-left:3px solid var(--red-text);
}

/* The license badge is a block line below the row (not edge-pinned) because the row now wraps;
   absent from the DOM entirely until org-people.js has a number to show
   (orgPeopleBuildLicenseBadge()), so no placeholder variant is needed. */
.alt-app .org-people-license{
  display:block; margin:0 0 10px; font-size:var(--a-fs-ctl-sm); font-weight:600; color:var(--text-dim);
}

/* ---------- The work band's header: People, how many, then the trailing actions ---------- */
.alt-app .org-people-band-head{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  padding:0 0 8px; margin:0 0 8px; border-bottom:1px solid var(--border-soft);
}
.alt-app .org-people-band-title{ font-size:var(--a-fs-16); font-weight:700; color:var(--text); }
.alt-app .org-people-band-count{ font-size:var(--a-fs-ctl-sm); color:var(--text-dim); }
.alt-app .org-people-band-spacer{ flex:1 1 auto; }
/* The band's own status line: nothing drawn while it is empty (a hollow bordered box would say something is wrong). */
.alt-app #adminModal .org-people-status-line{ margin:0 0 8px; }
.alt-app #adminModal .org-people-status-line:empty{ display:none; }

/* ---------- Denial and load-failure states ----------
   Distinct from each other and from the plain `.empty-state` for an empty roster (alt-team.css);
   extra classes win on specificity. Left-aligned: it is a sentence to read. */
.alt-app #adminModal .empty-state.denied,
.alt-app #adminModal .empty-state.load-error{
  text-align:left; padding:14px 16px; margin:0 0 8px;
  border:1px solid var(--border-soft); border-left-width:3px; border-radius:var(--radius-sm);
  background:var(--panel-2); color:var(--text-dim); font-size:var(--a-fs-ctl);
}
/* Denied — a permission boundary, not a fault; `--yellow` is this pane's attention tone. */
.alt-app #adminModal .empty-state.denied{ border-left-color:var(--yellow); }
/* Load-error — an actual fault the reader may retry; `--red-text` matches `.org-people-menu-item.danger`. */
.alt-app #adminModal .empty-state.load-error{ border-left-color:var(--red-text); }
/* Unavailable: neither denial nor fault — the capability isn't deployed yet, so neutral. */
.alt-app #adminModal .empty-state.unavailable{ border-left-color:var(--border-soft); color:var(--text-faint); }

/* Nested inside `.org-people-invites`'s own panel, these three flatten to a left accent instead
   of a second box-in-a-box — width/style reset, never border-left-color, so the three colour
   rules above keep deciding the hue. Unchanged everywhere else these classes are used (the
   roster's own denial above keeps its full bordered box). */
.alt-app #adminModal .org-people-invites .empty-state.denied,
.alt-app #adminModal .org-people-invites .empty-state.load-error,
.alt-app #adminModal .org-people-invites .empty-state.unavailable{
  padding:6px 4px 6px 10px; margin:0; background:transparent; border-radius:0;
  border-top:0; border-right:0; border-bottom:0; border-left-width:3px; border-left-style:solid;
}

/* The fourth state this section can show ("Checking…", "No outstanding invitations.") brought
   into the same left-aligned, compact rhythm as its three siblings above, reusing this
   section's own row padding. `:not()`-scoped so it can never also match .denied/.load-error/
   .unavailable — the four are mutually exclusive by construction. */
.alt-app #adminModal .org-people-invites .empty-state:not(.denied):not(.load-error):not(.unavailable){
  text-align:left; padding:8px 4px;
}

/* ---------- THE FILTER ROW'S OWN BOX — owner, 2026-09-24; UN-MERGED FROM INVITES, 2026-09-25 ---------- */
/* Wraps only the roster's filter/search row now — the invitations panel moved into `#inviteBody`
   (team_board.html's "Invite people" card, orgPeopleMountInvitesSection()) so its own fold hides
   it too; the filter row stayed because "find a person" must never be foldable. */
.alt-app .org-people-panel{
  margin:0 0 10px; padding:9px 11px;
  background:var(--panel-2); border:1px solid var(--border-soft); border-radius:var(--radius-sm);
}
/* ---------- §39 — OUTSTANDING INVITATIONS ---------- */
/* Its own box, mounted inside `#inviteBody` after `.invite-panel`. `:not(:empty)` is load-bearing:
   orgPeopleBuildInvitesSection() returns childless when the reader may not administer invites,
   and an unconditional box would paint an empty bordered rectangle for exactly that reader
   (Definition of Done 4f). */
.alt-app .org-people-invites:not(:empty){
  margin:10px 0 0; padding:9px 11px;
  background:var(--panel-2); border:1px solid var(--border-soft); border-radius:var(--radius-sm);
}
.alt-app .org-people-invites-head{
  font-size:var(--a-fs-ctl-sm); font-weight:700; text-transform:uppercase; letter-spacing:.4px;
  color:var(--text-faint); margin:0 0 6px;
}
.alt-app .org-people-invites-list{ display:flex; flex-direction:column; }
.alt-app .org-people-invite-row{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:8px 4px; border-bottom:1px solid var(--border-soft); font-size:var(--a-fs-ctl);
}
.alt-app .org-people-invite-email{ flex:2 1 200px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.alt-app .org-people-invite-role{ flex:0 0 auto; color:var(--text-dim); font-size:var(--a-fs-ctl-sm); }
.alt-app .org-people-invite-status{ flex:0 0 auto; color:var(--text-dim); font-size:var(--a-fs-ctl-sm); min-width:120px; }
.alt-app .org-people-invite-expiry{ flex:0 0 auto; color:var(--text-faint); font-size:var(--a-fs-ctl-sm); }
.alt-app .org-people-invite-actions{ margin-left:auto; display:flex; gap:6px; }

@media (max-width:520px){
  .alt-app .org-people-invite-row{ flex-direction:column; align-items:stretch; gap:4px; }
  .alt-app .org-people-invite-actions{ margin-left:0; }
  /* Measured (org-people-drive.py): stacked to a column, these items don't shrink to the
     container's cross size on their own, so width:100% is needed to actually fill it — same fix
     as `.org-people-filters` below, same reason. */
  .alt-app .org-people-invite-email,
  .alt-app .org-people-invite-role,
  .alt-app .org-people-invite-status,
  .alt-app .org-people-invite-expiry,
  .alt-app .org-people-invite-actions{ width:100%; }
  .alt-app .org-people-invite-actions{ flex-wrap:wrap; }
}

/* ---------- The toolbar: search first, then labelled filters, Clear and the shown count ---------- */
.alt-app .org-people-filters{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 8px;
}
/* The filter controls are dressed by the dialog (`.alt-app #adminModal select`/
   `input[type=search]`, alt-team.css) — those win on specificity over anything declared here, so
   nothing is restated. Only the search field's own row-sharing is this pane's to set. */
.alt-app .org-people-filters input[type="search"]{ flex:1 1 180px; min-width:120px; }
.alt-app .org-people-filter{ display:inline-flex; align-items:center; gap:6px; flex:0 0 auto; }
.alt-app .org-people-filter-l{ font-size:var(--a-fs-ctl-sm); font-weight:600; color:var(--text-dim); }
.alt-app .org-people-shown{ font-size:var(--a-fs-ctl-sm); color:var(--text-dim); }
.alt-app .org-people-shown:empty{ display:none; }

/* ---------- The selection bar: only while somebody is ticked ---------- */
.alt-app .org-people-selection{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 10px; padding:8px 10px;
  font-size:var(--a-fs-ctl-sm); color:var(--text-dim);
  background:var(--accent-soft); border:1px solid var(--border-soft); border-radius:var(--radius-sm);
}
.alt-app .org-people-selection-count{ font-weight:700; color:var(--text); }
.alt-app .org-people-selection-note{ font-size:var(--a-fs-ctl-sm); color:var(--text-dim); }

/* The add-to composer: "Add to [teams] as [role] · [boards] · [groups] · Apply". Wraps as a unit; its status
   line takes a row of its own and does not exist until it has something to say. */
.alt-app .org-people-composer{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:1 1 auto; min-width:0;
}
.alt-app .org-people-composer-field{ flex:0 1 150px; min-width:120px; }
.alt-app #adminModal .org-people-composer-role{ flex:0 0 auto; height:30px; padding:0 10px; }
.alt-app .org-people-composer-status{ flex:1 1 100%; margin:0; }
.alt-app .org-bulk-label{ font-size:var(--a-fs-ctl); }

/* ---------- The table: a fixed-track grid, rows separated by dividers, no cards inside cards ---------- */
.alt-app .org-people-table{ display:flex; flex-direction:column; width:100%; }
.alt-app .org-people-row{
  display:grid;
  /* ☐ · Person (name over address) · Teams · Boards · Groups · Role · Status · ⌄ . The Role track is the widest
     flexible one after Person because "Organization Owner" sits beside the role chip. */
  grid-template-columns:28px minmax(120px,3fr) 52px 56px 56px minmax(150px,2.6fr) 84px 36px;
  gap:4px 10px; align-items:center; padding:8px 4px; border-bottom:1px solid var(--border-soft);
}
.alt-app .org-people-row:hover{ background:var(--panel-2); }
.alt-app .org-people-row.is-open{ background:var(--panel-2); }
.alt-app .org-people-head{
  position:sticky; top:0; z-index:1; background:var(--panel);
  padding:2px 4px 6px; font-size:var(--a-fs-11); text-transform:uppercase; letter-spacing:.4px;
  color:var(--text-faint); font-weight:700; border-bottom:1px solid var(--border-soft);
}
.alt-app .org-people-head:hover{ background:var(--panel); }
.alt-app .org-people-row > [role="cell"]{ font-size:var(--a-fs-ctl); color:var(--text); min-width:0; }
.alt-app .org-people-row > [data-col="teams"],
.alt-app .org-people-row > [data-col="boards"],
.alt-app .org-people-row > [data-col="groups"]{ color:var(--text-dim); font-variant-numeric:tabular-nums; }
.alt-app .org-people-row > [data-col="role"]{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.alt-app .org-people-head > [data-col="role"]{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Name over address; the name is a button (it opens the detail) dressed as the name, not as a control. */
.alt-app .org-people-who{ display:flex; flex-direction:column; align-items:flex-start; gap:1px; }
.alt-app .org-people-name-btn{
  max-width:100%; padding:0; border:0; background:none; font:inherit; font-weight:600; color:var(--text);
  text-align:left; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.alt-app .org-people-name-btn:hover{ color:var(--accent-text); }
.alt-app .org-people-email{
  max-width:100%; font-size:var(--a-fs-ctl-sm); color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* Dormant filter on (org-people-dormant.js): the last sign-in, a third line in the same quiet voice as the address. */
.alt-app .org-people-signin{ max-width:100%; font-size:var(--a-fs-ctl-sm); color:var(--text-faint); white-space:nowrap; }

/* The role chip is `.a-chip` (the shape); this says only what is particular here. A chip that opens a menu carries a
   caret so it reads as one; a quiet one is dim; "Organization Owner" is its own badge beside the role. */
.alt-app .org-people-role{ max-width:100%; }
.alt-app button.org-people-role::after{ content:"▾"; font-size:var(--a-fs-11); margin-left:3px; opacity:.8; }
.alt-app button.org-people-role:disabled{ opacity:.6; cursor:progress; }
.alt-app .org-people-role.is-muted{ color:var(--text-faint); }
.alt-app .org-people-owner-badge{
  border-color:var(--accent); color:var(--accent-text); background:var(--accent-soft);
}

.alt-app .org-people-status{ font-size:var(--a-fs-ctl-sm); color:var(--text-dim); }
.alt-app .org-people-status.active{ color:var(--green-text); }
.alt-app .org-people-status.inactive{ color:var(--text-faint); }
/* `--warn-text`, not `--yellow` — this line is TEXT, and sys_design-system.md §1 rule 4
   requires the text role for warning text while fills keep `--yellow`. */
.alt-app .org-people-status.pending{ color:var(--warn-text); }

.alt-app .org-people-foot{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:10px;
  font-size:var(--a-fs-ctl-sm); color:var(--text-dim);
}

/* ---------- The row detail: Teams, Boards and groups, Account ----------
   It opens under the row, full width, on the row's own tint. Three sections side by side while there is room. */
.alt-app .org-people-expand{ min-width:var(--a-ctl-sm); padding:0 6px; }
.alt-app .org-people-detail{
  grid-column:1 / -1; min-width:0; display:grid; grid-template-columns:repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap:14px 20px;
  margin:6px 0 2px; padding:12px 14px;
  background:var(--panel); border:1px solid var(--border-soft); border-radius:var(--radius-sm);
}
.alt-app .org-people-detail-sec{ min-width:0; display:flex; flex-direction:column; gap:6px; }
.alt-app .org-people-detail-h{
  font-size:var(--a-fs-11); font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--text-faint);
}
.alt-app .org-people-detail-body{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.alt-app .org-people-detail-note{ font-size:var(--a-fs-ctl-sm); color:var(--text-dim); line-height:var(--a-lh-ui); }
.alt-app .org-people-detail-counts{ display:none; font-size:var(--a-fs-ctl-sm); color:var(--text-dim); }
.alt-app .org-people-detail-team{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.alt-app .org-people-detail-team-name{
  flex:1 1 120px; min-width:0; font-size:var(--a-fs-ctl); font-weight:600; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.alt-app .org-people-detail-pick{ display:flex; align-items:center; gap:8px; }
.alt-app .org-edit-field-row{ margin:0; }
.alt-app .org-people-detail-actions{ display:flex; flex-wrap:wrap; gap:6px; }
.alt-app .org-people-detail-why{ margin:0; padding-left:16px; font-size:var(--a-fs-ctl-sm); line-height:var(--a-lh-ui); color:var(--text-faint); }

/* The menus (role chip, add-as): mounted inside multiSelectHost() — inherits that host's layer-sweep
   exemption, so no positioning rule is needed here beyond `.cfg-popover`'s own. */
.alt-app .org-people-menu{ display:flex; flex-direction:column; min-width:200px; max-width:min(340px, 92vw); padding:4px; }
.alt-app .org-people-menu-item{
  display:flex; align-items:center; gap:6px; width:100%; text-align:left; padding:7px 10px; border:0; background:none;
  border-radius:var(--radius-sm); color:var(--text); font-size:var(--a-fs-ctl); cursor:pointer;
}
.alt-app .org-people-menu-item:hover:not(:disabled),
.alt-app .org-people-menu-item:focus-visible{ background:var(--panel-2); }
.alt-app .org-people-menu-item:disabled{ color:var(--text-faint); cursor:not-allowed; }
.alt-app .org-people-menu-item.danger{ color:var(--red-text); }
.alt-app .org-people-menu-item.is-checked{ font-weight:600; }
.alt-app .org-people-menu-check{ flex:0 0 14px; text-align:center; color:var(--accent-text); }

/* ≤1023px: Boards and Groups columns step aside (their counts move into the detail), and the toolbar wraps with
   search on a line of its own. ≤600px: a row is two lines — name and role chip, then email and status — and the
   composer stacks. */
@media (max-width:1023px){
  .alt-app .org-people-row{ grid-template-columns:28px minmax(150px,3fr) 52px minmax(170px,2.6fr) 84px 36px; }
  .alt-app .org-people-row > [data-col="boards"],
  .alt-app .org-people-row > [data-col="groups"]{ display:none; }
  .alt-app .org-people-detail-counts{ display:block; }
  .alt-app .org-people-filters input[type="search"]{ flex:1 1 100%; }
}
@media (max-width:600px){
  .alt-app .org-people-row{
    grid-template-columns:28px minmax(0,1.3fr) minmax(0,1fr); gap:2px 8px; padding:10px 4px;
  }
  .alt-app .org-people-row > [data-col="teams"]{ display:none; }
  .alt-app .org-people-row > [role="cell"]:nth-child(1){ grid-column:1; grid-row:1; }
  .alt-app .org-people-row > [data-col="who"]{ grid-column:2; grid-row:1 / span 2; }
  .alt-app .org-people-row > [data-col="role"]{ grid-column:3; grid-row:1; justify-content:flex-end; }
  .alt-app .org-people-row > [data-col="status"]{ grid-column:3; grid-row:2; text-align:right; }
  .alt-app .org-people-row > [data-col="more"]{ grid-column:1; grid-row:2; }
  .alt-app .org-people-head{ display:none; }
  /* nowrap: a wrapping column container sizes each line to its widest item's max-content, so the line (and every control stacked in
     it) is wider than the pane; one unwrapped column is the container's own width. */
  .alt-app .org-people-filters{ flex-direction:column; flex-wrap:nowrap; align-items:stretch; }
  .alt-app .org-people-filter{ justify-content:space-between; min-width:0; }
  /* The label keeps its width and the select takes the rest of the row: a 100%-wide select beside its label is wider than the
     row (label + gap + 100%), and the 32px ladder control no longer shrinks to fit on its own. */
  .alt-app .org-people-filter select{ flex:1 1 0; width:auto; min-width:0; }
  .alt-app .org-people-filters input[type="search"]{ width:100%; flex:0 0 auto; }
  .alt-app .org-people-selection{ flex-direction:column; align-items:stretch; }
  .alt-app .org-people-composer{ flex-direction:column; align-items:stretch; }
  .alt-app .org-people-composer-field{ flex:1 1 auto; }
  .alt-app .org-people-detail{ grid-template-columns:1fr; }
}

/* ================= PERMISSIONS BY ROLE — reference matrix and its triggers =========
   Styles JS/components/permissions-matrix-dialog.js, opened from the People header. No z-index:
   JS/core/layers.js stacks it above the launching dialog. Cell states differ by shape, not hue; the Organization
   axis uses a left border, not a second accent. */

/* ---------- the trigger, in both host dialogs ---------- */

/* A flex host lets the trigger reach its edge via
   margin-left:auto; the bulk dialog wants it directly after the role <select> instead — a
   modifier, not part of the base. */
body.alt-app .pmx-trigger-end{ margin-left:auto; }
body.alt-app .pmx-trigger-ic{
  display:inline-flex; width:14px; height:14px; flex:0 0 auto;
}
body.alt-app .pmx-trigger-ic svg{ width:14px; height:14px; display:block; }
body.alt-app .pmx-trigger-t{ white-space:nowrap; }

/* ---------- the dialog shell ---------- */

/* A pre-JS fallback, not the answer (sys_design-system.md §12 rule 5) — sizeSettingsDialog()
   writes an inline width the instant the dialog opens, which always outranks this rule. What
   this controls is the one frame before that JS runs, matching sizeSettingsDialog()'s own
   maxW so the card doesn't visibly widen afterward. */
body.alt-app .settings-modal.pmx-modal{ width:min(980px, 100%); }
/* ---------- The frozen block scales with window height ----------
   Gaps and pads are `clamp(floor, Nvh, ceiling)` (as in CSS/components.css) so the scroller below keeps its space on
   short windows. The floor is held by permissions-matrix-geometry-probe.py, not `min-height`, because `.pmx-body` is
   overflow:hidden and would clip. Weigh anything added to the frozen block against its 300px ceiling. */
body.alt-app .pmx-body{ gap:clamp(8px, 1.3vh, 12px); }
body.alt-app .settings-modal-body.pmx-body{ padding:clamp(10px, 1.8vh, var(--a-4)); }

/* ---------- The frozen block: what stays pinned ----------
   Title, subtitle, column header, role selector, legend and rules disclosure stay in view while
   rows scroll. Each view owns its scroll region and they never nest: `.pmx-tablewrap` and
   `.pmx-roleview` are siblings and only one is visible. */
body.alt-app .pmx-body{ overflow:hidden; min-height:0; }
body.alt-app .pmx-body > *{ flex:0 0 auto; }
body.alt-app .pmx-body > .pmx-tablewrap,
body.alt-app .pmx-body > .pmx-roleview{ flex:1 1 auto; min-height:0; }
body.alt-app .pmx-body > .pmx-sub{ margin:0; }
/* `.a-callout`'s own bottom margin would double up with this flex gap. Scoped to
   `.pmx-roleview`, where pmxBuildReadCallout() actually mounts it now, not `.pmx-body`. */
body.alt-app .pmx-roleview > .a-callout{ margin-bottom:0; }

/* ---------- the role selector ---------- */

/* auto-fit down to a horizontal strip, not a second row — matches the wireframe's own phone
   breakpoint: the row stays one card tall and scrolls sideways instead of adding a row height
   to the frozen block on every narrow viewport. */
body.alt-app .pmx-roles{
  display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px;
}
body.alt-app .pmx-role{
  display:flex; align-items:flex-start; gap:9px; min-width:0;
  padding:clamp(6px, 1.1vh, 10px);
  border:1px solid var(--border-soft); border-radius:var(--radius);
  background:var(--panel-2); text-align:left; font:inherit; color:inherit; cursor:pointer;
}
body.alt-app .pmx-role:hover{ border-color:var(--border-strong); }
body.alt-app .pmx-role.active{
  border-color:var(--accent); background:var(--accent-soft);
  box-shadow:0 0 0 1px var(--accent) inset;
}
body.alt-app .pmx-role-org{ border-left:3px solid var(--border-strong); }
body.alt-app .pmx-role-ic{
  flex:0 0 auto; width:30px; height:30px; display:grid; place-items:center;
  border-radius:var(--radius-sm); background:var(--panel); color:var(--text-dim);
}
body.alt-app .pmx-role.active .pmx-role-ic{ color:var(--accent-text); }
body.alt-app .pmx-role-ic svg{ width:16px; height:16px; }
body.alt-app .pmx-role-bd{ min-width:0; display:flex; flex-direction:column; gap:2px; }
body.alt-app .pmx-role-axis{
  font-size:var(--a-fs-11); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color:var(--text-faint);
}
body.alt-app .pmx-role-name{ font-size:var(--a-fs-ctl); font-weight:700; color:var(--text); }
body.alt-app .pmx-role-text{
  margin:2px 0 0; font-size:var(--a-fs-11); line-height:var(--a-lh-ui); color:var(--text-dim);
}

/* ---------- the legend and the "Role rules" disclosure ---------- */

body.alt-app .pmx-legend-row{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
}
body.alt-app .pmx-legend{
  display:flex; flex-wrap:wrap; align-items:center; gap:11px; color:var(--text-dim);
}
body.alt-app .pmx-legend-item{ display:inline-flex; align-items:center; gap:5px; font-size:var(--a-fs-11); }
body.alt-app .pmx-legend-t{ white-space:nowrap; }
/* The trigger, the rules toggle and the two disclosure buttons are the shared `.a-btn.sm` (flex, gap and type come from it). */
body.alt-app .pmx-rules-btn{ margin-left:auto; }
body.alt-app .pmx-rules-ic svg{ width:14px; height:14px; }
/* Open state: `aria-expanded` is the sole source of truth (a disclosure toggle carries it, not
   `aria-pressed`). Same accent wash as `html .repeat-info[aria-expanded="true"]`
   (task-editor-panel.css), `.okr-donut-info` (okr.css) and `html .btn.active`. */
body.alt-app .pmx-rules-btn[aria-expanded="true"]{
  border-color:var(--accent); color:var(--accent-text); background:var(--accent-soft);
}
/* Reuses `.pmx-foots`' list treatment plus its own container chrome, so the disclosure reads as one contained panel.
   Compound selector on purpose: the element carries both classes (pmxBuildRulesPanel()) and `.pmx-foots` below sets
   `padding` shorthand, which at equal specificity would override this frame regardless of file order. */
body.alt-app .pmx-foots.pmx-rules-panel{
  margin:0; padding:10px 12px 10px 28px;
  border:1px solid var(--border-soft); border-radius:var(--radius-sm); background:var(--panel-2);
}

/* ---------- the view switch ---------- */

/* `.a-tabs`' own bottom border and padding are for a full-width strip; cleared here, where it
   sits among several controls in the frozen block rather than as a page's section nav. */
body.alt-app .pmx-viewtabs{ border-bottom:0; padding:0; }
body.alt-app .pmx-viewtabs .a-tab svg{ width:15px; height:15px; }

/* ---------- the role view ---------- */

body.alt-app .pmx-roleview{
  overflow-y:auto; overflow-x:hidden; position:relative;
  display:flex; flex-direction:column; gap:clamp(7px, 1.1vh, 10px);
  border:1px solid var(--border-soft); border-radius:var(--radius-sm);
  padding:clamp(7px, 1.2vh, 10px);
}
/* Without this, a scroll-container child (`.pmx-cats`) is the only one whose automatic minimum
   size is 0, so it alone absorbs all the shrink pressure in this tall flex column and gets
   crushed to near-zero height — proven by mutation: removing this line reproduces it. */
body.alt-app .pmx-roleview > *{ flex:0 0 auto; }
/* `display:flex`/`grid` here must outrank the UA `[hidden]{display:none}` (the extra class
   wins), or toggling `hidden` leaves the role-view toolbar over the comparison table. */
body.alt-app .pmx-roleview[hidden],
body.alt-app .pmx-cards[hidden]{ display:none; }

/* The search field: `.a-search`/`.a-search-ico` place the icon; `.settings-modal
   input[type="search"]` draws the border/ground/ring. This input deliberately doesn't carry
   `.a-input` (that would pull in its `--a-ctl` height too), so the icon's left padding is
   restated here, scoped to just this input. */
body.alt-app .pmx-search{ display:block; }
body.alt-app .pmx-search input[type="search"]{ width:100%; padding-left:30px !important; }

/* One row, scrolled, never wrapped — wrapping cost a second line in the scroller most starved
   for height on a phone. */
body.alt-app .pmx-cats{ display:flex; flex-wrap:nowrap; overflow-x:auto; gap:6px; padding-bottom:2px; }
body.alt-app .pmx-cat-chip{ flex:0 0 auto; }
/* `.a-chip` caps itself at 170px with an ellipsis, measured for a short tag or name — this
   pane's category labels are full sentence fragments, so max-width/overflow are overridden here
   only, keeping every other chip in the app at its usual 170px. */
body.alt-app .pmx-cat-chip{ max-width:none; overflow:visible; }
body.alt-app .pmx-cat-chip.on{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent-text); }

body.alt-app .pmx-rv-head{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding-top:2px; border-top:1px solid var(--border-soft);
}
body.alt-app .pmx-rv-who{ display:flex; align-items:center; gap:8px; min-width:0; }
body.alt-app .pmx-rv-who-ic{
  flex:0 0 auto; width:26px; height:26px; display:grid; place-items:center;
  border-radius:var(--radius-sm); background:var(--panel-2); color:var(--text-dim);
}
body.alt-app .pmx-rv-who-ic svg{ width:14px; height:14px; }
body.alt-app .pmx-rv-who-bd{ display:flex; flex-direction:column; gap:1px; min-width:0; }
body.alt-app .pmx-rv-who-name{ font-size:var(--a-fs-ctl-sm); font-weight:700; color:var(--text); }
body.alt-app .pmx-rv-who-count{ font-size:var(--a-fs-11); color:var(--text-faint); }
body.alt-app .pmx-rv-counts{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-left:auto;
  font-size:var(--a-fs-11); color:var(--text-dim);
}
body.alt-app .pmx-count{ display:inline-flex; align-items:center; gap:4px; }
body.alt-app .pmx-count-n{ font-weight:700; font-variant-numeric:tabular-nums; }
body.alt-app .pmx-count-yes .pmx-count-n{ color:var(--green-text); }
body.alt-app .pmx-count-cond .pmx-count-n{ color:var(--green-text); }
body.alt-app .pmx-count-no .pmx-count-n,
body.alt-app .pmx-count-na .pmx-count-n{ color:var(--text-faint); }

body.alt-app .pmx-cards{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:8px;
}
body.alt-app .pmx-card{
  display:flex; gap:10px; min-width:0;
  padding:11px; border:1px solid var(--border-soft); border-radius:var(--radius); background:var(--panel-2);
}
body.alt-app .pmx-card-ic{
  flex:0 0 auto; width:32px; height:32px; display:grid; place-items:center;
  border-radius:var(--radius-sm); background:var(--panel); color:var(--text-dim);
}
body.alt-app .pmx-card-ic svg{ width:16px; height:16px; }
body.alt-app .pmx-card-bd{ min-width:0; display:flex; flex-direction:column; gap:6px; flex:1 1 auto; }
body.alt-app .pmx-card-title{ margin:0; font-size:var(--a-fs-ctl); font-weight:700; color:var(--text); }
body.alt-app .pmx-status{ display:inline-flex; align-items:center; gap:6px; }
body.alt-app .pmx-status-t{ font-size:var(--a-fs-ctl-sm); font-weight:600; }
body.alt-app .pmx-status-yes,
body.alt-app .pmx-status-cond{ color:var(--green-text); }
body.alt-app .pmx-status-no,
body.alt-app .pmx-status-na{ color:var(--text-faint); }
/* `.pmx-note`, the table's own condition style, reused verbatim on a <p> here. */
body.alt-app .pmx-card .pmx-note{ margin:0; }
/* A long condition shows four lines until the reader asks for the rest (pmxCard()). The measured
   cost of not clamping: a 427px card row, so no complete card at scroll-top at 1440x900. */
body.alt-app .pmx-card .pmx-note-clamp{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; line-clamp:4; overflow:hidden;
}

/* The enforcement disclosure and "Show full condition" are `.a-btn.sm.ghost`; they only sit at the start of their column. */
body.alt-app .settings-modal .pmx-tech-btn,
body.alt-app .settings-modal .pmx-more-btn{ align-self:flex-start; }
body.alt-app .pmx-tech-ic svg{ width:13px; height:13px; }
body.alt-app .pmx-tech-panel{
  margin-top:2px; padding:8px 10px; border:1px solid var(--border-soft); border-radius:var(--radius-sm);
  background:var(--panel);
}
body.alt-app .pmx-tech-line{ margin:0; font-size:var(--a-fs-11); line-height:var(--a-lh-ui); color:var(--text-dim); }
body.alt-app .pmx-tech-line + .pmx-tech-line{ margin-top:3px; }
body.alt-app .pmx-tech-line b{ color:var(--text); font-weight:600; }

/* `.a-empty` already carries padding and centring; a border is added because this is the first
   use of it that doesn't already sit inside a panel with its own edge. */
body.alt-app .pmx-rv-empty{ border:1px dashed var(--border-soft); border-radius:var(--radius); }

/* ---------- the comparison table ("Compare roles") ----------
   Unchanged from the previous design — `.pmx-roleview` is the redesign's own scroller and never
   nests inside this one (see the frozen-block note above). */

/* The wide table scrolls inside itself, never the dialog. Both axes are set explicitly because
   `overflow-x:auto` alone computes overflow-y to auto too. `position:relative` anchors the
   absolutely-positioned `.a-sr` span in every cell (see alt-shell.css). Focusable: it is this
   view's one scroll region. */
body.alt-app .pmx-tablewrap{
  overflow:auto; position:relative;
  border:1px solid var(--border-soft); border-radius:var(--radius-sm);
}
body.alt-app .pmx-tablewrap:focus-visible{ outline:2px solid var(--focus-ring); outline-offset:1px; }

body.alt-app .pmx-table{
  width:100%; min-width:720px; border-collapse:collapse;
  font-size:var(--a-fs-ctl); line-height:var(--a-lh-ui); color:var(--text);
}
/* No wash behind the column headers — the mockup's hierarchy spends that signal on the group
   rows instead, which are what a reader navigates by. */
/* Sticky on the cells, not `<thead>` — the broadly-supported spelling. Needs an opaque ground
   (`--panel`, the modal's own surface) or rows scroll through it. The rule underneath is an
   inset shadow rather than border-bottom, because a collapsed border belongs to the table grid
   under border-collapse and vanishes once the cell goes sticky. */
body.alt-app .pmx-table .pmx-h{
  position:sticky; top:0; z-index:1;
  background:var(--panel); color:var(--text-dim);
  font-size:var(--a-fs-ctl-sm); font-weight:600; text-align:center;
  padding:9px 8px; box-shadow:inset 0 -1px 0 var(--border);
}
/* Layout only, so this wins the header's own first-cell geometry without also taking its
   font-weight down to a row's — the weight is set on `.pmx-row > .pmx-what` instead. */
body.alt-app .pmx-table .pmx-what{
  text-align:left; vertical-align:top;
  width:42%; min-width:290px; padding:9px 12px;
}
/* The four role columns split what the capability column leaves (42% + 4×14.5% = 100), measured
   against the mockup so "Organization Owner" doesn't wrap to two lines. */
body.alt-app .pmx-table .pmx-h-role{ width:14.5%; }
/* The boundary between the two role axes (`organization_memberships.org_role` and
   `team_users.role`, which sys_product-rules.md forbids merging) is drawn with a left border so
   the fourth column reads as a different question without a sentence. */
body.alt-app .pmx-table .pmx-org{ border-left:1px solid var(--border); }

body.alt-app .pmx-tbody + .pmx-tbody{ border-top:1px solid var(--border); }
/* Full-strength 12px text, not a faint label — the mockup's group band reads as a section
   heading because it is one. */
body.alt-app .pmx-grouphead{
  text-align:left; background:var(--panel-2); color:var(--text);
  font-size:var(--a-fs-ctl-sm); font-weight:700; text-transform:uppercase; letter-spacing:.04em;
  padding:14px 12px 8px;
}
body.alt-app .pmx-row > .pmx-what,
body.alt-app .pmx-row > .pmx-cell{ border-top:1px solid var(--border-soft); }
body.alt-app .pmx-row > .pmx-what{ font-weight:600; }
body.alt-app .pmx-cap{ display:block; color:var(--text); }
/* The condition sits under the capability it qualifies — "sometimes" with no "when" is less
   than a plain no. Reused verbatim on the role-view cards (`.pmx-card .pmx-note` above). */
body.alt-app .pmx-note{
  display:block; margin-top:3px; font-size:var(--a-fs-ctl-sm); line-height:var(--a-lh-ui); color:var(--text-dim);
}

body.alt-app .pmx-cell{
  text-align:center; vertical-align:top; padding:9px 8px; position:relative;
}
/* 22px at a 6px radius, the wireframe's own measured geometry — a rounded square, not a circle.
   Shared by the table, the legend and the role-view cards; one mark, drawn once. */
body.alt-app .pmx-mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:var(--a-r-sm);
  font-size:var(--a-fs-ctl-sm); font-weight:700; line-height:var(--a-lh-ctl);
}
/* Four states, four shapes — filled ring, dashed ring, no ring, dotted ring — told apart with
   colour removed, per sys_design-system.md. */
body.alt-app .pmx-yes{
  background:var(--green-soft); border:1.5px solid var(--green-text); color:var(--green-text);
}
body.alt-app .pmx-cond{
  background:transparent; border:1.5px dashed var(--green-text); color:var(--green-text);
}
body.alt-app .pmx-no{
  background:transparent; border:0; color:var(--text-faint);
}
body.alt-app .pmx-na{
  background:transparent; border:1.5px dotted var(--text-faint); color:var(--text-faint);
}

/* ---------- "Role rules" list content (reused footnotes) ---------- */

body.alt-app .pmx-foots{
  margin:0; padding:0 0 0 18px;
  font-size:var(--a-fs-ctl-sm); line-height:var(--a-lh-ui); color:var(--text-dim);
}
body.alt-app .pmx-foot-item + .pmx-foot-item{ margin-top:4px; }

/* ---------- narrow widths ---------- */

/* The role cards become a one-row horizontal strip, copied from the wireframe's own phone
   breakpoint rather than left to wrap to 2x2. */
@media (max-width:720px){
  body.alt-app .pmx-roles{ display:flex; overflow-x:auto; padding-bottom:2px; }
  body.alt-app .pmx-role{ flex:0 0 200px; }
  body.alt-app .pmx-cards{ grid-template-columns:1fr; }
}

/* The table keeps its 720px floor and scrolls inside `.pmx-tablewrap`. At phone height the
   frozen block can starve `.pmx-roleview`, so the legend is forced to one line and role card
   descriptions are dropped (the callout already says it). */
@media (max-width:520px){
  body.alt-app .pmx-table .pmx-what{ min-width:240px; padding:9px 10px; }
  body.alt-app .pmx-table{ min-width:660px; }
  body.alt-app .pmx-rules-btn{ margin-left:0; }
  body.alt-app .pmx-rv-counts{ margin-left:0; }
  body.alt-app .pmx-roleview > .a-callout{ padding:8px 10px; }
  body.alt-app .pmx-roleview > .a-callout p{ line-height:var(--a-lh-ui); }
  body.alt-app .pmx-role-text{ display:none; }
  body.alt-app .pmx-body{ gap:9px; }
  /* `.pmx-legend` is one non-shrinking flex child of `.pmx-legend-row`, so the row's own wrap
     can't help it; `display:contents` un-nests its items so all five (four legend items plus
     the button) wrap together and fill each line before starting the next. */
  body.alt-app .pmx-legend{ display:contents; }
}

/* ---------- Short windows ----------
   Same trade as the width block above (drop the role description), on height. 720px is where
   the scroller's share falls away; ordinary laptop windows are unaffected. */
@media (max-height:720px){
  body.alt-app .pmx-role-text{ display:none; }
}

/* The temp-password dialog must paint above Settings (same fix as admin.html's #tempPwOverlay).
   Both share `.modal-overlay` and `--z-dialog`, and ties resolve by DOM order, which put
   Settings on top (sys_design-system.md §11b). It only ever opens over Settings, so a fixed
   outranking token is enough. */
#tempPwOverlay{ z-index:var(--z-alert); }

/* ---------- Boards and groups labels (the row detail) ----------
   One label class serves both rows. */
.alt-app .org-edit-label{
  font-size:var(--a-fs-ctl-sm);
  color:var(--text-dim);
  flex:0 0 auto;
}
