/*
 * Ember management surfaces, generation 2.
 *
 * This file intentionally uses an isolated class namespace. The dashboard has
 * several historical style layers, so Admin and People must not inherit their
 * layout from projects-head, admin-company, team-row, or observability cards.
 */

.mg2-page,
.mg2-drawer-layer {
  --mg2-canvas: #f4f6f9;
  --mg2-surface: #ffffff;
  --mg2-subtle: #f8fafc;
  --mg2-ink: #18202f;
  --mg2-text: #394457;
  --mg2-muted: #687386;
  --mg2-faint: #8a94a6;
  --mg2-line: #dfe4eb;
  --mg2-line-strong: #cbd3df;
  --mg2-accent: #2563eb;
  --mg2-accent-strong: #1d4ed8;
  --mg2-accent-soft: #eef3fe;
  --mg2-success: #16865c;
  --mg2-success-soft: #e9f7f0;
  --mg2-warning: #a76000;
  --mg2-warning-soft: #fff7e3;
  --mg2-danger: #bd2d24;
  --mg2-danger-soft: #fff1ef;
  --mg2-radius-sm: 8px;
  --mg2-radius-md: 12px;
  --mg2-radius-lg: 16px;
  --mg2-shadow-drawer: -16px 0 48px rgba(15, 23, 42, .16);
}

.mg2-page {
  width: min(1360px, 100%);
  min-width: 0;
  margin-inline: auto;
  padding: 32px clamp(16px, 2.4vw, 32px) 64px;
  color: var(--mg2-text);
  color-scheme: light;
  font-family: var(--mra-font-ui, "Roboto Flex", system-ui, sans-serif);
}

.mg2-admin-page,
.mg2-people-page {
  display: grid;
  align-content: start;
  gap: 0;
}

.mg2-page *,
.mg2-drawer-layer * {
  min-width: 0;
}

.mg2-pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.mg2-pagehead h1 {
  margin: 3px 0 0;
  color: var(--mg2-ink);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.mg2-pagehead p {
  max-width: 66ch;
  margin: 8px 0 0;
  color: var(--mg2-muted);
  font-size: 14px;
  line-height: 1.5;
}

.mg2-kicker {
  color: var(--mg2-accent-strong);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.mg2-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mg2-button,
.mg2-drawer :is(.btn, .ide-btn-lite) {
  min-height: 38px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--mg2-line-strong);
  border-radius: 9px;
  padding: 8px 13px;
  color: var(--mg2-ink);
  background: var(--mg2-surface);
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.mg2-button:hover:not(:disabled),
.mg2-drawer :is(.btn, .ide-btn-lite):hover:not(:disabled) {
  border-color: #aeb8c7;
  background: var(--mg2-subtle);
}

.mg2-button.primary,
.mg2-drawer .btn-primary {
  border-color: var(--mg2-accent);
  color: #fff;
  background: var(--mg2-accent);
}

.mg2-button.primary:hover:not(:disabled),
.mg2-drawer .btn-primary:hover:not(:disabled) {
  border-color: var(--mg2-accent-strong);
  background: var(--mg2-accent-strong);
}

.mg2-button.danger,
.mg2-drawer :is(.btn, .ide-btn-lite).danger {
  border-color: #efc5c1;
  color: var(--mg2-danger);
  background: var(--mg2-surface);
}

.mg2-button.danger:hover:not(:disabled),
.mg2-drawer :is(.btn, .ide-btn-lite).danger:hover:not(:disabled) {
  border-color: #e9aaa4;
  background: var(--mg2-danger-soft);
}

.mg2-button.icon-only {
  width: 38px;
  padding-inline: 0;
}

.mg2-button.quiet {
  min-height: 30px;
  border-color: transparent;
  padding: 5px 8px;
  color: var(--mg2-muted);
  background: transparent;
  font-size: 11.5px;
}

.mg2-button.quiet:hover:not(:disabled) {
  border-color: var(--mg2-line);
  color: var(--mg2-ink);
  background: var(--mg2-subtle);
}

.mg2-button:disabled,
.mg2-drawer :is(.btn, .ide-btn-lite):disabled {
  cursor: not-allowed;
  opacity: .48;
}

.mg2-button:focus-visible,
.mg2-tab:focus-visible,
.mg2-drawer-close:focus-visible,
.mg2-page :is(input, select, textarea):focus-visible,
.mg2-drawer :is(input, select, textarea):focus-visible {
  outline: 3px solid rgba(37, 99, 235, .18);
  outline-offset: 1px;
}

/* A status line, not a row of dashboard cards. */
.mg2-summary {
  display: flex;
  align-items: stretch;
  min-height: 54px;
  margin-bottom: 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-block: 1px solid var(--mg2-line);
  scrollbar-width: none;
}

.mg2-summary::-webkit-scrollbar,
.mg2-tabs::-webkit-scrollbar {
  display: none;
}

.mg2-summary-item {
  min-width: 0;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 7px;
  padding: 15px 22px;
  border-left: 1px solid var(--mg2-line);
  color: var(--mg2-muted);
  font-size: 12px;
  white-space: nowrap;
}

.mg2-summary-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.mg2-summary-item strong,
.mg2-summary-item b {
  color: var(--mg2-ink);
  font-family: var(--mra-font-num, "Geist", system-ui, sans-serif);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mg2-summary-item small {
  color: var(--mg2-faint);
  font-size: 10.5px;
}

.mg2-summary-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 15px 0 15px 22px;
  color: var(--mg2-success);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mg2-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mg2-warning);
  box-shadow: 0 0 0 3px rgba(167, 96, 0, .12);
}

.mg2-summary-status.is-on .mg2-status-dot {
  background: var(--mg2-success);
  box-shadow: 0 0 0 3px rgba(22, 134, 92, .12);
}

.mg2-summary-status > div {
  display: grid;
  gap: 2px;
}

.mg2-summary-status strong {
  color: var(--mg2-ink);
  font-size: 12px;
}

.mg2-summary-status small {
  color: var(--mg2-muted);
  font-size: 10.5px;
  font-weight: 500;
}

/* One horizontal task switcher replaces the stacked Admin accordions. */
.mg2-tabs {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-bottom: 1px solid var(--mg2-line);
  scrollbar-width: none;
}

.mg2-tab {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 0 1px;
  color: var(--mg2-muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.mg2-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
}

.mg2-tab:hover {
  color: var(--mg2-ink);
}

.mg2-tab.active,
.mg2-tab.is-active,
.mg2-tab[aria-selected="true"] {
  color: var(--mg2-accent-strong);
}

.mg2-tab.active::after,
.mg2-tab.is-active::after,
.mg2-tab[aria-selected="true"]::after {
  background: var(--mg2-accent);
}

.mg2-surface {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--mg2-line);
  border-radius: var(--mg2-radius-md);
  background: var(--mg2-surface);
  box-shadow: none;
}

.mg2-surface-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--mg2-line);
}

.mg2-surface-head h2,
.mg2-surface-head h3 {
  margin: 0;
  color: var(--mg2-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.mg2-surface-head p,
.mg2-surface-head small {
  display: block;
  margin: 3px 0 0;
  color: var(--mg2-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.mg2-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mg2-line);
  background: var(--mg2-subtle);
}

.mg2-search {
  min-height: 38px;
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  gap: 8px;
  max-width: 440px;
  border: 1px solid var(--mg2-line-strong);
  border-radius: 9px;
  padding: 0 11px;
  color: var(--mg2-ink);
  background: var(--mg2-surface);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.mg2-search > svg {
  flex: 0 0 auto;
  color: var(--mg2-faint);
}

.mg2-search input {
  min-height: 36px;
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--mg2-ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.mg2-search input:focus-visible {
  outline: 0;
}

.mg2-search input::placeholder {
  color: var(--mg2-faint);
}

.mg2-search:focus-within {
  border-color: var(--mg2-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.mg2-org-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.mg2-org-actions::-webkit-scrollbar {
  display: none;
}

.mg2-org-actions > span {
  margin-right: 3px;
  color: var(--mg2-faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mg2-org-actions .mg2-button small {
  min-width: 18px;
  border-radius: 999px;
  padding: 2px 5px;
  color: var(--mg2-muted);
  background: #e9edf3;
  font-size: 9.5px;
  text-align: center;
}

.mg2-org-actions .mg2-org-filter {
  flex: 0 0 auto;
  border-color: transparent;
}

.mg2-org-actions .mg2-org-filter.is-active {
  border-color: #b9ccfb;
  color: var(--mg2-accent-strong);
  background: var(--mg2-accent-soft);
}

.mg2-org-actions .mg2-org-filter.is-active small {
  color: var(--mg2-accent-strong);
  background: #dce7ff;
}

.mg2-count,
.mg2-filter-note {
  color: var(--mg2-muted);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.mg2-count {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef1f5;
}

.mg2-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #cddbf8;
  border-radius: var(--mg2-radius-sm);
  color: #36577d;
  background: #f5f8ff;
  font-size: 12.5px;
  line-height: 1.45;
}

.mg2-notice.success {
  border-color: #bfe1d1;
  color: #126847;
  background: var(--mg2-success-soft);
}

.mg2-notice.danger,
.mg2-notice.error,
.mg2-notice.is-error {
  border-color: #efc5c1;
  color: #98271f;
  background: var(--mg2-danger-soft);
}

.mg2-notice > button {
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  margin: -4px -5px -4px auto;
  border: 0;
  border-radius: 7px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
}

.mg2-notice > button:hover {
  background: rgba(15, 23, 42, .06);
}

.mg2-empty {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 28px 20px;
  color: var(--mg2-muted);
  text-align: center;
  font-size: 13px;
}

.mg2-empty strong {
  color: var(--mg2-ink);
  font-size: 15px;
}

/* Admin account table ------------------------------------------------ */
.admin2-table,
.people2-table {
  width: 100%;
  overflow: hidden;
}

.admin2-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.45fr)
    minmax(120px, .8fr)
    minmax(110px, .7fr)
    minmax(170px, 1fr)
    minmax(160px, .9fr)
    minmax(110px, .65fr)
    88px;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 11px 16px;
  border-top: 1px solid var(--mg2-line);
  color: var(--mg2-text);
  font-size: 13px;
}

.admin2-row:first-child {
  border-top: 0;
}

.admin2-row.head {
  min-height: 40px;
  padding-block: 8px;
  color: var(--mg2-faint);
  background: var(--mg2-subtle);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mg2-sort {
  min-width: 0;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 3px 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.mg2-sort span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg2-sort i {
  color: #2563eb;
  font-size: 13px;
  font-style: normal;
  line-height: 1;
}

.mg2-sort:hover,
.mg2-sort:focus-visible {
  color: var(--mg2-accent);
}

.mg2-sort:focus-visible {
  border-radius: 4px;
  outline: 2px solid color-mix(in srgb, var(--mg2-accent) 35%, transparent);
  outline-offset: 2px;
}

.admin2-row:not(.head):hover,
.people2-row:not(.head):hover {
  background: #fbfcfe;
}

.admin2-row.is-selected,
.people2-row.is-selected {
  box-shadow: inset 3px 0 0 var(--mg2-accent);
  background: var(--mg2-accent-soft);
}

.admin2-row.is-disabled,
.people2-row.is-disabled {
  opacity: .62;
}

.admin2-account,
.people2-person {
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
}

.admin2-account .admin-ava,
.people2-person .team-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  font-size: 11.5px;
}

.admin2-account strong,
.people2-person strong,
.people2-person .team-name {
  display: block;
  overflow: hidden;
  color: var(--mg2-ink);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin2-company,
.admin2-account small,
.admin2-account em,
.people2-person small,
.people2-person .team-mail {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--mg2-muted);
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin2-company button {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  padding: 5px 7px;
  color: var(--mg2-text);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.admin2-company button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin2-company button:hover {
  color: var(--mg2-accent-strong);
  background: var(--mg2-accent-soft);
}

.admin2-company-label {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 5px 7px;
  color: var(--mg2-text);
  font-size: 12px;
  font-weight: 650;
}

.admin2-company-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Organisation management table ------------------------------------ */
.admin-org-table {
  width: 100%;
  overflow: hidden;
}

.admin-org-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(110px, .55fr) minmax(190px, 1fr) minmax(170px, .9fr) 170px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 12px 16px;
  border-top: 1px solid var(--mg2-line);
  color: var(--mg2-text);
  font-size: 12.5px;
}

.admin-org-row:first-child { border-top: 0; }
.admin-org-row:not(.head):hover { background: #fbfcfe; }

.admin-org-row.head {
  min-height: 40px;
  padding-block: 8px;
  color: var(--mg2-faint);
  background: var(--mg2-subtle);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.admin-org-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.admin-org-identity > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--mg2-accent-strong); background: var(--mg2-accent-soft); }
.admin-org-identity > div { min-width: 0; }
.admin-org-identity strong { display: block; overflow: hidden; color: var(--mg2-ink); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.admin-org-identity small { display: block; margin-top: 3px; overflow: hidden; color: var(--mg2-faint); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.admin-org-members { display: flex; align-items: baseline; gap: 5px; color: var(--mg2-muted); }
.admin-org-members strong { color: var(--mg2-ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.admin-org-members small { display: block; color: var(--mg2-faint); }
.admin-org-pills { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.admin-org-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 7px; color: var(--mg2-muted); background: #eef1f5; font-size: 10.5px; }
.admin-org-pill b { color: var(--mg2-text); font-weight: 750; text-transform: capitalize; }
.admin-org-pill.seats { color: var(--mg2-accent-strong); background: var(--mg2-accent-soft); }
.admin-org-none { color: var(--mg2-faint); font-size: 11.5px; }
.admin-org-action { display: flex; justify-content: flex-end; }
.admin-org-action .mg2-button { min-height: 36px; white-space: nowrap; }

.admin2-access,
.admin2-subscription,
.admin2-activity,
.people2-role,
.people2-activity {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin2-access,
.admin2-subscription {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.admin2-access small,
.admin2-subscription small,
.admin2-activity small,
.people2-role small,
.people2-activity small,
.people2-usage small {
  overflow: hidden;
  color: var(--mg2-muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin2-subscription .admin-planpill,
.admin2-access .admin-role,
.people2-role :is(.team-role, .team-plan) {
  max-width: 100%;
  display: inline-flex;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 3px 8px;
  color: #445064;
  background: #eef1f5;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.admin2-access .admin-role.owner,
.people2-role .team-role.owner,
.people2-role .team-role.admin {
  color: var(--mg2-accent-strong);
  background: var(--mg2-accent-soft);
}

.admin2-usage,
.people2-usage {
  display: grid;
  gap: 5px;
}

.admin2-usage .admin-usage {
  width: 100%;
  gap: 4px;
}

.admin2-usage .admin-uline {
  grid-template-columns: 20px minmax(42px, 1fr) 32px;
  gap: 5px;
}

.admin2-usage .admin-ubar {
  height: 5px;
  background: #e8edf4;
}

.admin2-activity,
.people2-activity {
  color: var(--mg2-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.people2-activity {
  display: grid;
  align-content: center;
  gap: 3px;
}

.people2-activity small {
  display: block;
}

.admin2-action,
.people2-action {
  display: flex;
  justify-content: flex-end;
}

.admin2-action .mg2-button,
.people2-action .mg2-button {
  width: auto;
  min-height: 36px;
  padding: 7px 11px;
}

.admin2-mobilemeta,
.people2-mobilemeta {
  display: none;
}

/* People list -------------------------------------------------------- */
.people2-row {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.45fr)
    130px
    minmax(200px, 1.4fr)
    150px
    120px
    88px;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 11px 16px;
  border-top: 1px solid var(--mg2-line);
  color: var(--mg2-text);
  font-size: 13px;
}

.people2-row:first-child {
  border-top: 0;
}

.people2-row.head {
  min-height: 40px;
  padding-block: 8px;
  color: var(--mg2-faint);
  background: var(--mg2-subtle);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.people2-work {
  overflow: hidden;
  color: var(--mg2-text);
  font-size: 12.5px;
  line-height: 1.4;
}

.people2-work .team-ai,
.people2-work .team-ai-head {
  min-width: 0;
}

.people2-work .team-ai-focus,
.people2-work > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep the list scannable; full generated tasks belong in the drawer. */
.people2-work .team-ai-tasks {
  display: none;
}

.people2-usage {
  color: var(--mg2-ink);
  font-family: var(--mra-font-num, "Geist", system-ui, sans-serif);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.people2-usage .team-spark {
  width: 100%;
  max-width: 130px;
  height: 18px;
  margin-top: 2px;
}

.people2-usage strong,
.people2-activity strong {
  display: block;
  overflow: hidden;
  color: var(--mg2-ink);
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people2-controls {
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--mg2-line);
  background: transparent;
}

.people2-controls .obs-windows {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--mg2-line);
  border-radius: 9px;
  background: var(--mg2-subtle);
}

.people2-controls .obs-windows button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 5px 11px;
  color: var(--mg2-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.people2-controls .obs-windows button.active,
.people2-controls .obs-windows button[aria-pressed="true"] {
  color: var(--mg2-ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.people2-controlmeta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--mg2-muted);
  font-size: 11.5px;
}

/* The People renderer still supplies the existing metric data markup. Make it
 * the same quiet, one-line summary used by the new management system. */
.mg2-people-page .team-stat-rail {
  display: flex;
  align-items: stretch;
  min-height: 54px;
  margin: 0 0 8px;
  overflow-x: auto;
  border-width: 1px 0;
  border-color: var(--mg2-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.mg2-people-page .team-stat-rail::-webkit-scrollbar {
  display: none;
}

.mg2-people-page .team-stat-rail .dash-stat {
  min-width: 126px;
  flex: 1 0 auto;
  padding: 12px 18px;
  border: 0;
  border-left: 1px solid var(--mg2-line);
  background: transparent;
}

.mg2-people-page .team-stat-rail .dash-stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.mg2-people-page .team-stat-rail .dash-stat dt {
  color: var(--mg2-faint);
  font-size: 10px;
}

.mg2-people-page .team-stat-rail .dash-stat dd {
  margin-top: 4px;
  color: var(--mg2-ink);
  font-size: 19px;
}

.mg2-people-page .obs-hero-strip,
.mg2-people-page .team-zero-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 0;
  border: 0;
  color: var(--mg2-muted);
  background: transparent;
  font-size: 11.5px;
}

.mg2-people-page .team-orgfilters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding: 1px 0;
  scrollbar-width: none;
}

.mg2-people-page .team-orgfilters::-webkit-scrollbar {
  display: none;
}

.mg2-people-page .team-orgchip {
  flex: 0 0 auto;
  border-color: var(--mg2-line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--mg2-muted);
  background: #fff;
  box-shadow: none;
  font-size: 11.5px;
}

.mg2-people-page .team-orgchip:hover {
  transform: none;
  border-color: #aeb8c7;
  box-shadow: none;
}

.mg2-people-page .team-orgchip.on {
  border-color: var(--mg2-accent);
  color: #fff;
  background: var(--mg2-accent);
  box-shadow: none;
}

.people2-surface .people2-tabs {
  margin: 0;
  padding-inline: 16px;
}

.people2-surface .team-panel {
  border: 0;
  border-radius: 0;
  padding: 16px;
  background: transparent;
}

.people2-surface .team-listhead {
  min-height: 38px;
  margin-bottom: 10px;
}

.people2-surface .team-listhead .ide-btn-lite {
  min-height: 34px;
  border: 1px solid var(--mg2-line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--mg2-ink);
  background: #fff;
  box-shadow: none;
  font-size: 11.5px;
}

/* Read-only rosters use old row markup; remove its forced 680px mobile width. */
.mg2-people-page .team-list {
  overflow: visible;
}

.mg2-people-page .team-row {
  min-width: 0;
  border-radius: 0;
  border-width: 1px 0 0;
}

.mg2-people-page .team-row:first-child {
  border-top: 0;
}

.mg2-operation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px;
  margin-top: 18px;
}

.mg2-operation-grid > .mg2-surface {
  margin-top: 0;
}

.mg2-operation-grid > .mg2-surface:only-child {
  grid-column: 1 / -1;
}

/* Legacy data renderers can live inside an active operation panel, but their
 * old card chrome is removed so the panel remains one coherent surface. */
.mg2-operation :is(.admin-esec, .admin-audit-list, .admin-checklist) {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mg2-operation .admin-hostline,
.mg2-operation .admin-alertactive,
.mg2-operation > .admin-audit-none {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--mg2-line);
}

.mg2-operation .admin-alertactive {
  border-width: 0 0 1px;
  border-radius: 0;
  color: #805000;
  background: var(--mg2-warning-soft);
}

.mg2-operation .admin-esec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  padding: 18px 16px 20px;
}

.mg2-operation .admin-esec-title,
.mg2-operation .admin-eactions {
  grid-column: 1 / -1;
}

.mg2-operation .admin-erow {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1.2fr) auto;
  align-items: center;
  gap: 8px 10px;
}

.mg2-operation .admin-erow > label,
.mg2-operation .admin-erow > .admin-elabel {
  min-width: 0;
  flex: none;
  color: var(--mg2-muted);
  font-size: 12px;
  font-weight: 700;
}

.mg2-operation :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.mg2-operation .admin-erow input[type="number"],
.mg2-operation .admin-webhook {
  width: 100%;
  max-width: none;
  min-height: 38px;
  border: 1px solid var(--mg2-line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--mg2-ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.mg2-operation .admin-eactions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
}

.mg2-operation :is(.btn, .ide-btn-lite) {
  min-height: 36px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--mg2-line-strong);
  border-radius: 9px;
  padding: 7px 11px;
  color: var(--mg2-ink);
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.mg2-operation .btn-primary {
  border-color: var(--mg2-accent);
  color: #fff;
  background: var(--mg2-accent);
}

.mg2-operation :is(.btn, .ide-btn-lite).danger {
  border-color: #efc5c1;
  color: var(--mg2-danger);
  background: #fff;
}

.mg2-operation .admin-vmrow {
  grid-template-columns: minmax(0, 1.6fr) 1.15fr 1fr 124px;
  padding: 12px 16px;
}

.admin-vmtools {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-top: 1px solid var(--mg2-line);
  background: var(--mg2-subtle);
}

.admin-vmtools > span {
  margin-left: auto;
  color: var(--mg2-muted);
  font-size: 12px;
  font-weight: 650;
}

.admin-vmtools .mg2-button.danger {
  border-color: #efc5c1;
  color: var(--mg2-danger);
}

.admin-vmselect {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.admin-vmselect > input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--mg2-accent);
}

.admin-vmselect > span {
  min-width: 0;
  display: grid;
}

.mg2-operation .admin-audit-row {
  padding: 10px 16px;
}

.mg2-operation .admin-checklist {
  padding: 16px;
  border-top: 1px solid #f0d496;
  color: #805000;
  background: var(--mg2-warning-soft);
}

.mg2-operation .admin-checklist pre {
  max-width: 100%;
  overflow-x: auto;
}

/* Drawer ------------------------------------------------------------- */
.mg2-drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  justify-content: flex-end;
  color: var(--mg2-text, #394457);
  font-family: var(--mra-font-ui, "Roboto Flex", system-ui, sans-serif);
}

.mg2-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, .34);
  backdrop-filter: blur(2px);
  cursor: default;
}

.mg2-drawer {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 40px));
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--mg2-line, #dfe4eb);
  color: var(--mg2-text, #394457);
  background: var(--mg2-surface, #fff);
  box-shadow: var(--mg2-shadow-drawer, -16px 0 48px rgba(15, 23, 42, .16));
  animation: mg2-drawer-in 160ms ease-out;
}

@keyframes mg2-drawer-in {
  from { transform: translateX(18px); opacity: .7; }
  to { transform: translateX(0); opacity: 1; }
}

.mg2-drawer-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
  background: var(--mg2-surface, #fff);
}

.mg2-drawer-identity {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 11px;
}

.mg2-drawer-identity > div,
.mg2-drawer-identity > span:last-child {
  min-width: 0;
}

.mg2-drawer-identity strong {
  display: block;
  overflow: hidden;
  color: var(--mg2-ink, #18202f);
  font-size: 15px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg2-drawer-identity h2 {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--mg2-ink, #18202f);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg2-drawer-identity p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--mg2-muted, #687386);
  font-size: 11.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg2-drawer-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--mg2-accent-strong, #1d4ed8);
  background: var(--mg2-accent-soft, #eef3fe);
}

.mg2-drawer-context {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 14px 18px;
  overflow: hidden;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
  color: var(--mg2-muted, #687386);
  background: var(--mg2-subtle, #f8fafc);
  font-size: 11.5px;
  line-height: 1.4;
}

.mg2-drawer-context strong {
  color: var(--mg2-ink, #18202f);
  font-size: 12.5px;
}

.mg2-drawer-context span {
  overflow-wrap: anywhere;
}

.mg2-drawer-close {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--mg2-muted, #687386);
  background: transparent;
  cursor: pointer;
}

.mg2-drawer-close:hover {
  border-color: var(--mg2-line, #dfe4eb);
  color: var(--mg2-ink, #18202f);
  background: var(--mg2-subtle, #f8fafc);
}

.mg2-drawer-close:focus-visible {
  border-color: #b9c8e8;
  outline: 2px solid rgba(37, 99, 235, .2);
  outline-offset: 1px;
}

.mg2-drawer-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--mg2-surface, #fff);
}

.admin2-drawer .mg2-drawer-body {
  background: #f4f6f9;
}

/* Flatten the existing Admin editor inside the new drawer. */
.mg2-drawer .admin-editor {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mg2-drawer .admin-conote,
.mg2-drawer .mg2-drawer-context + .admin-conote {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #dbe6fb;
  border-radius: 10px;
  color: #36577d;
  background: #f5f8ff;
  font-size: 12px;
}

.mg2-drawer .admin-seats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
  border-radius: 0;
  background: transparent;
}

.mg2-drawer .admin-seats-title {
  flex: 1 0 100%;
  color: var(--mg2-faint, #8a94a6);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
}

.mg2-drawer .admin-seat {
  display: grid;
  grid-template-columns: auto 60px;
  align-items: center;
  gap: 4px 7px;
  color: var(--mg2-muted, #687386);
  font-size: 11.5px;
}

.mg2-drawer .admin-seat input {
  width: 60px;
  min-height: 34px;
  grid-row: 1 / span 2;
  grid-column: 2;
}

.mg2-drawer .admin-seat em {
  color: var(--mg2-faint, #8a94a6);
  font-size: 10px;
  font-style: normal;
}

.mg2-drawer .admin-esec {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--mg2-line, #dfe4eb);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.mg2-drawer .admin-esec-head {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}

.mg2-drawer .admin-esec-title {
  color: var(--mg2-ink, #18202f);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: none;
}

.mg2-drawer .admin-esec-head p {
  margin: 0;
  color: var(--mg2-muted, #687386);
  font-size: 11.5px;
  line-height: 1.4;
}

.mg2-drawer .admin-erow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.mg2-drawer .admin-erow + .admin-erow {
  padding-top: 15px;
  border-top: 1px solid #eef1f5;
}

.mg2-drawer .admin-erow > label,
.mg2-drawer .admin-erow > .admin-elabel {
  min-width: 0;
  flex: none;
  color: var(--mg2-muted, #687386);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .025em;
}

.mg2-drawer .admin-erow > :nth-child(2) {
  min-width: 0;
}

.mg2-drawer .admin-subscription-grid {
  display: grid;
  gap: 18px;
}

.mg2-drawer .admin-field,
.mg2-drawer .admin-custom-models {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.mg2-drawer .admin-field-label {
  color: var(--mg2-muted, #687386);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .025em;
}

.mg2-drawer .admin-cap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mg2-drawer .admin-field small {
  color: var(--mg2-faint, #8a94a6);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.mg2-drawer .admin-input-with-unit {
  position: relative;
  display: block;
}

.mg2-drawer .admin-input-with-unit input[type="number"] {
  min-height: 42px;
  padding-right: 42px;
  font-variant-numeric: tabular-nums;
}

.mg2-drawer .admin-input-with-unit > b {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--mg2-faint, #8a94a6);
  font-size: 10px;
  font-weight: 750;
  transform: translateY(-50%);
  pointer-events: none;
}

.mg2-drawer :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.mg2-drawer .admin-erow input[type="number"],
.mg2-drawer .admin-webhook {
  width: 100%;
  max-width: none;
  min-height: 38px;
  border: 1px solid var(--mg2-line-strong, #cbd3df);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--mg2-ink, #18202f);
  background: #fff;
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.mg2-drawer :is(input, select, textarea):focus {
  border-color: var(--mg2-accent, #2563eb);
}

.mg2-drawer input[type="checkbox"],
.mg2-drawer input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--mg2-accent, #2563eb);
}

.mg2-drawer .admin-unit {
  color: var(--mg2-faint, #8a94a6);
  font-size: 11px;
}

.mg2-drawer .admin-chips,
.mg2-drawer .team-manage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mg2-drawer .admin-chip {
  min-height: 34px;
  width: auto;
  border: 1px solid var(--mg2-line-strong, #cbd3df);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--mg2-muted, #687386);
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

.mg2-drawer .admin-chip:hover:not(:disabled) {
  border-color: #aeb8c7;
  color: var(--mg2-ink, #18202f);
}

.mg2-drawer .admin-chip.on,
.mg2-drawer .admin-chip[aria-pressed="true"] {
  border-color: var(--mg2-accent, #2563eb);
  color: #fff;
  background: var(--mg2-accent, #2563eb);
}

.mg2-drawer .admin-models {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.mg2-drawer .admin-modelchk {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--mg2-text, #394457);
  font-size: 12px;
}

.mg2-drawer .admin-modelchk > input {
  margin-top: 3px;
}

.mg2-drawer .admin-modelchk > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mg2-drawer .admin-modelchk strong {
  color: var(--mg2-ink, #18202f);
  font-size: 12px;
}

.mg2-drawer .admin-modelchk small {
  color: var(--mg2-muted, #687386);
  font-size: 10.5px;
  line-height: 1.35;
}

.mg2-drawer :is(.admin-projects, .admin-tokrow, .admin-tokitem) {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.mg2-drawer .admin-toklist {
  width: 100%;
  display: grid;
  gap: 8px;
}

.mg2-drawer .admin-tokitem {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "device suffix action"
    "meta meta action";
  gap: 3px 10px;
  padding: 11px 12px;
  border: 1px solid var(--mg2-line, #dfe4eb);
  border-radius: 10px;
  background: var(--mg2-subtle, #f8fafc);
}

.mg2-drawer .admin-tokitem > span:first-child {
  grid-area: device;
  color: var(--mg2-ink, #18202f);
  font-size: 12px;
  font-weight: 700;
}

.mg2-drawer .admin-tokitem > .admin-mono,
.mg2-drawer .admin-tokitem > em {
  grid-area: meta;
}

.mg2-drawer .admin-tokitem > .admin-mono {
  display: block;
  grid-area: suffix;
  align-self: center;
  color: var(--mg2-faint, #8a94a6);
  font-size: 10.5px;
}

.mg2-drawer .admin-tokitem > .btn {
  grid-area: action;
  align-self: center;
}

.mg2-drawer .admin-proj {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--mg2-line, #dfe4eb);
  background: var(--mg2-subtle, #f8fafc);
  text-overflow: ellipsis;
}

.mg2-drawer .admin-ownernote,
.mg2-drawer .admin-tokitem em {
  color: var(--mg2-muted, #687386);
  font-size: 11px;
  line-height: 1.4;
}

.mg2-drawer .admin-warnline {
  border: 1px solid #f0d496;
  color: #805000;
  background: var(--mg2-warning-soft, #fff7e3);
}

.mg2-drawer .admin-eactions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 68px;
  margin: auto -16px 0;
  padding: 13px 16px;
  border-top: 1px solid var(--mg2-line, #dfe4eb);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, .06);
  backdrop-filter: blur(8px);
}

.mg2-drawer .admin-eactions .admin-espacer {
  flex: 1 1 auto;
}

.mg2-drawer .admin-shortcut {
  min-width: 24px;
  border: 1px solid #d6dce5;
  border-radius: 5px;
  padding: 2px 5px;
  color: var(--mg2-faint, #8a94a6);
  background: #f6f8fa;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .08);
  font: 650 9.5px/1.2 var(--mra-font-ui, "Roboto Flex", system-ui, sans-serif);
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.mg2-drawer .btn-primary .admin-shortcut {
  border-color: rgba(255, 255, 255, .28);
  color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
}

/* Flatten existing People detail and invite markup in the same drawer. */
.mg2-drawer .team-detail {
  padding: 0;
  border: 0;
  background: transparent;
}

.mg2-drawer .team-drawer-work {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
}

.mg2-drawer .team-drawer-work h3 {
  margin: 0;
  color: var(--mg2-ink, #18202f);
  font-size: 12.5px;
  font-weight: 750;
}

.mg2-drawer .team-drawer-work .team-ai {
  display: grid;
  gap: 8px;
}

.mg2-drawer .team-drawer-work .team-ai-focus {
  overflow: visible;
  white-space: normal;
}

.mg2-drawer .team-drawer-work .team-ai-tasks {
  margin: 0;
  padding-left: 18px;
}

.mg2-drawer .team-dgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px 18px 12px;
}

.mg2-drawer .team-dcol {
  min-width: 0;
  padding: 16px 12px 12px 0;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
}

.mg2-drawer .team-dcol:nth-child(even) {
  padding-right: 0;
  padding-left: 12px;
}

.mg2-drawer .team-dcol h4 {
  margin: 0 0 9px;
  color: var(--mg2-faint, #8a94a6);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.mg2-drawer .team-drow {
  gap: 10px;
  color: var(--mg2-muted, #687386);
  font-size: 12px;
}

.mg2-drawer .team-drow b {
  color: var(--mg2-ink, #18202f);
}

.mg2-drawer .team-qbar {
  height: 5px;
  background: #e8edf4;
}

.mg2-drawer :is(.team-manage, .team-perms) {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
  margin: 0;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
  background: transparent;
}

.mg2-drawer :is(.team-manage, .team-perms) > label {
  color: var(--mg2-faint, #8a94a6);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mg2-drawer .team-manage > em,
.mg2-drawer .team-perms > em {
  grid-column: 2;
  color: var(--mg2-muted, #687386);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.mg2-drawer .team-manage > .grow,
.mg2-drawer .team-perms > .grow {
  display: none;
}

.mg2-drawer .team-manage > .ide-btn-lite {
  grid-column: 2;
  justify-self: start;
}

/* Keep member role controls in stable, named regions. The generic two-column
   form grid above is intentionally retained for permissions, but a member
   heading is longer than a form label and must never share its 96px column. */
.mg2-drawer .team-manage {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "heading actions"
    "roles actions";
  align-items: center;
  gap: 10px 18px;
}

.mg2-drawer .team-manage-heading {
  grid-area: heading;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.mg2-drawer .team-manage-title {
  margin: 0;
  color: var(--mg2-ink, #18202f);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.mg2-drawer .team-manage-heading > em {
  color: var(--mg2-muted, #687386);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.mg2-drawer .team-manage-chips {
  grid-area: roles;
  min-width: 0;
}

.mg2-drawer .team-manage-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Subscription control is a first-class People action, separate from role and
   account mutations. Plan tiles keep availability and the current plan legible
   without turning the drawer into a dense billing form. */
.mg2-drawer .team-subscription {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--mg2-line, #dfe4eb);
  background: linear-gradient(145deg, #fbfcff 0%, #f7f9fd 100%);
}

.mg2-drawer .team-subscription-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.mg2-drawer .team-subscription-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e4ff;
  border-radius: 9px;
  color: var(--mg2-accent, #2563eb);
  background: #edf3ff;
}

.mg2-drawer .team-subscription-head .mg2-kicker {
  margin: 0 0 2px;
  color: var(--mg2-accent, #2563eb);
}

.mg2-drawer .team-subscription-head h3 {
  margin: 0;
  color: var(--mg2-ink, #18202f);
  font-size: 13px;
  font-weight: 750;
}

.mg2-drawer .team-current-plan {
  border: 1px solid #c8d8ff;
  border-radius: 999px;
  padding: 4px 9px;
  color: #1d4ed8;
  background: #eef4ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.mg2-drawer .team-subscription > p {
  margin: 0;
  color: var(--mg2-muted, #687386);
  font-size: 11.5px;
  line-height: 1.45;
}

.mg2-drawer .team-plan-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.mg2-drawer .team-plan-option {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--mg2-line-strong, #cbd3df);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--mg2-text, #394457);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.mg2-drawer .team-plan-option:hover:not(:disabled) {
  border-color: #9db7f4;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .09);
  transform: translateY(-1px);
}

.mg2-drawer .team-plan-option.is-current {
  border-color: #8eacf2;
  background: #f1f5ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
  opacity: 1;
}

.mg2-drawer .team-plan-option:disabled:not(.is-current) {
  border-style: dashed;
  opacity: .52;
  cursor: not-allowed;
}

.mg2-drawer .team-plan-check {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6dce6;
  border-radius: 50%;
  color: #fff;
  background: #fff;
}

.mg2-drawer .team-plan-option.is-current .team-plan-check {
  border-color: var(--mg2-accent, #2563eb);
  background: var(--mg2-accent, #2563eb);
}

.mg2-drawer .team-plan-option strong,
.mg2-drawer .team-plan-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg2-drawer .team-plan-option strong {
  color: var(--mg2-ink, #18202f);
  font-size: 12px;
  font-weight: 750;
  text-transform: capitalize;
}

.mg2-drawer .team-plan-option small {
  margin-top: 3px;
  color: var(--mg2-faint, #8a94a6);
  font-size: 9.5px;
}

.mg2-drawer .team-subscription-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mg2-muted, #687386);
  font-size: 10.5px;
  line-height: 1.35;
}
.mg2-drawer .team-permrow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--mg2-line, #dfe4eb);
}

.mg2-drawer .team-permrow > .grow,
.mg2-drawer .team-dactions > .grow {
  display: none;
}

.mg2-drawer .team-permproj {
  min-width: 0;
  overflow: hidden;
  color: var(--mg2-ink, #18202f);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg2-drawer .team-dactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 20px;
}

.mg2-drawer .team-dmeta {
  min-width: 0;
  flex: 1 1 100%;
  overflow-wrap: anywhere;
}

.mg2-drawer .team-invite {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 20px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mg2-drawer .team-invite-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 12px;
}

.mg2-drawer .team-invite-grid label {
  display: grid;
  gap: 5px;
  color: var(--mg2-muted, #687386);
  font-size: 11px;
  font-weight: 700;
}

.mg2-drawer .team-invite-grid :is(input, select) {
  min-width: 0;
}

.mg2-drawer .team-invite-grid > button {
  grid-column: 1 / -1;
  justify-self: start;
}

.mg2-drawer .team-invite-quota {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--mg2-border, #dce2ea);
  border-radius: var(--mg2-radius-sm, 8px);
  color: var(--mg2-muted, #687386);
  background: var(--mg2-canvas, #f7f9fc);
  font-size: 12px;
}

.mg2-drawer .team-invite-quota.full {
  border-color: #efc3c3;
  color: #a12b2b;
  background: #fff2f2;
}

.mg2-drawer .team-invite-result {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #bfe1d1;
  border-radius: var(--mg2-radius-sm, 8px);
  color: #126847;
  background: var(--mg2-success-soft, #e9f7f0);
  font-size: 12px;
}

.mg2-drawer .team-invite-result code {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 1140px) and (min-width: 761px) {
  .admin2-row {
    grid-template-columns: minmax(220px, 1.45fr) 110px minmax(150px, 1fr) 120px 88px;
  }

  .admin2-row.head > :nth-child(2),
  .admin2-row.head > :nth-child(5),
  .admin2-company,
  .admin2-usage {
    display: none;
  }

  .people2-row {
    grid-template-columns: minmax(220px, 1.45fr) 120px minmax(140px, 1fr) 120px 88px;
  }

  .people2-row.head > :nth-child(3),
  .people2-work {
    display: none;
  }
}

@media (max-width: 760px) {
  .mg2-page {
    padding: 24px 16px 48px;
  }

  .mg2-pagehead {
    gap: 16px;
    margin-bottom: 18px;
  }

  .mg2-pagehead h1 {
    font-size: 28px;
  }

  .mg2-head-actions {
    flex-wrap: wrap;
  }

  .mg2-summary {
    min-height: 50px;
    margin-inline: -16px;
    margin-bottom: 14px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
  }

  .mg2-summary-item,
  .mg2-summary-status {
    min-width: 132px;
    padding: 13px 16px;
    scroll-snap-align: start;
  }

  .mg2-summary-item:first-child {
    padding-left: 0;
  }

  .mg2-summary-status {
    margin-left: 0;
    border-left: 1px solid var(--mg2-line);
  }

  .mg2-tabs {
    gap: 20px;
    margin-inline: -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
  }

  .mg2-tab {
    min-height: 44px;
  }

  .mg2-surface {
    margin-top: 14px;
    border-radius: 10px;
  }

  .mg2-surface-head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 13px 14px;
  }

  .mg2-toolbar {
    flex-wrap: wrap;
    padding: 11px 14px;
  }

  .mg2-search {
    max-width: none;
    flex-basis: 100%;
  }

  .mg2-org-actions {
    width: 100%;
    margin-left: 0;
  }

  .mg2-operation-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
  }

  .mg2-operation .admin-esec {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-inline: 14px;
  }

  .mg2-operation .admin-esec-title,
  .mg2-operation .admin-eactions {
    grid-column: 1;
  }

  .mg2-operation .admin-vmrow {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    padding-inline: 14px;
  }

  .mg2-operation .admin-vmrow > :nth-child(3) {
    grid-column: 1;
  }

  .mg2-operation .admin-vmrow > :nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  .admin-vmtools {
    flex-wrap: wrap;
  }

  .admin-vmtools > span {
    width: 100%;
    margin-left: 0;
    order: -1;
  }

  .mg2-operation .admin-audit-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 7px 10px;
    padding-inline: 14px;
  }

  .mg2-operation .admin-audit-detail {
    grid-column: 1 / -1;
  }

  .people2-controls {
    align-items: flex-start;
  }

  .people2-controlmeta {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .mg2-people-page .team-stat-rail {
    margin-inline: -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
  }

  .mg2-people-page .team-stat-rail .dash-stat {
    min-width: 132px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .people2-surface .people2-tabs {
    padding-inline: 14px;
  }

  .people2-surface .team-panel {
    padding: 14px;
  }

  .people2-surface .team-listhead {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mg2-people-page .team-row-main.roster {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar identity role"
      "avatar identity activity";
    gap: 4px 10px;
    min-width: 0;
    padding: 12px 0;
  }

  .mg2-people-page .team-row-main.roster > .team-avatar {
    grid-area: avatar;
  }

  .mg2-people-page .team-row-main.roster > .team-id {
    grid-area: identity;
  }

  .mg2-people-page .team-row-main.roster > :nth-child(3) {
    grid-area: role;
    justify-self: end;
  }

  .mg2-people-page .team-row-main.roster > .last {
    grid-area: activity;
    max-width: 112px;
    justify-self: end;
  }

  .mg2-people-page .team-cardhead {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mg2-people-page .team-lbrow {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank name tokens"
      ". bar bar";
    gap: 5px 8px;
    padding-block: 7px;
  }

  .mg2-people-page .team-lbrank { grid-area: rank; }
  .mg2-people-page .team-lbname { grid-area: name; }
  .mg2-people-page .team-lbbar { grid-area: bar; }
  .mg2-people-page .team-lbtok { grid-area: tokens; }
  .mg2-people-page .team-lbprompts,
  .mg2-people-page .team-lbsub { display: none; }

  .admin2-row.head,
  .people2-row.head {
    display: none;
  }

  .admin2-row,
  .people2-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity action"
      "meta meta";
    gap: 8px 12px;
    min-height: 0;
    padding: 13px 14px;
  }

  .admin-org-row.head { display: none; }
  .admin-org-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "identity action" "members members" "plans seats"; gap: 9px 12px; min-height: 0; padding: 14px; }
  .admin-org-identity { grid-area: identity; }
  .admin-org-members { grid-area: members; }
  .admin-org-pills:nth-of-type(3) { grid-area: plans; }
  .admin-org-pills:nth-of-type(4) { grid-area: seats; justify-content: flex-end; }
  .admin-org-action { grid-area: action; }

  .admin2-account,
  .people2-person {
    grid-area: identity;
  }

  .admin2-action,
  .people2-action {
    grid-area: action;
    align-self: center;
  }

  .admin2-mobilemeta,
  .people2-mobilemeta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding-left: 47px;
    overflow: hidden;
    color: var(--mg2-muted);
    font-size: 11.5px;
    line-height: 1.35;
  }

  .admin2-mobilemeta > *,
  .people2-mobilemeta > * {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin2-company,
  .admin2-access,
  .admin2-subscription,
  .admin2-usage,
  .admin2-activity,
  .people2-role,
  .people2-work,
  .people2-usage,
  .people2-activity {
    display: none;
  }

  .admin2-account strong,
  .people2-person strong,
  .people2-person .team-name {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .mg2-page {
    padding-inline: 12px;
  }

  .mg2-pagehead {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .mg2-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .mg2-head-actions .mg2-button:not(.icon-only) {
    flex: 1 1 auto;
  }

  .mg2-summary,
  .mg2-tabs {
    margin-inline: -12px;
    padding-inline: 12px;
    scroll-padding-inline: 12px;
  }

  /* All four admin destinations fit in one stable row in English. Longer
     translations still scroll, but no tab is left half-clipped by excess gap. */
  .mg2-tabs {
    justify-content: space-between;
    gap: 0;
    padding-inline: 8px;
    scroll-padding-inline: 8px;
  }

  .mg2-tab {
    gap: 5px;
    font-size: 11.5px;
  }

  /* The enforcement state used to be the fourth item in a horizontal rail,
     entirely off-canvas on phones. Keep the three counts compact, then give
     the actionable status its own contained row. */
  .mg2-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .mg2-summary-item,
  .mg2-summary-status {
    min-width: 0;
    padding: 12px 8px;
  }

  .mg2-summary-item {
    justify-content: center;
  }

  .mg2-summary-status {
    grid-column: 1 / -1;
    margin-left: 0;
    padding-inline: 12px;
    border-top: 1px solid var(--mg2-line);
    border-left: 0;
    white-space: normal;
  }

  .mg2-summary-status > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  .mg2-people-page .team-stat-rail {
    margin-inline: -12px;
    padding-inline: 12px;
    scroll-padding-inline: 12px;
  }

  .mg2-surface-head,
  .mg2-toolbar,
  .admin2-row,
  .people2-row {
    padding-inline: 12px;
  }

  .admin2-mobilemeta,
  .people2-mobilemeta {
    padding-left: 47px;
  }

  .mg2-drawer-backdrop {
    display: none;
  }

  .mg2-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
    box-shadow: none;
  }

  .mg2-drawer-head {
    min-height: 66px;
    padding: 11px 12px;
  }

  .admin2-drawer .admin-editor {
    padding: 12px 12px 0;
  }

  .mg2-drawer .admin-cap-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg2-drawer .admin-esec,
  .mg2-drawer .team-invite {
    padding: 18px 14px;
  }

  .mg2-operation .admin-erow {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .mg2-operation .admin-unit {
    margin-top: -2px;
  }

  .mg2-operation .admin-eactions {
    align-items: stretch;
    flex-direction: column;
  }

  .mg2-operation .admin-eactions :is(.btn, .ide-btn-lite) {
    width: 100%;
  }

  .mg2-drawer .admin-erow {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .mg2-drawer .admin-erow > label:empty,
  .mg2-drawer .admin-erow > .admin-elabel:empty {
    display: none;
  }

  .mg2-drawer .admin-unit {
    margin-top: -2px;
  }

  .mg2-drawer .admin-models,
  .mg2-drawer .team-dgrid,
  .mg2-drawer .team-invite-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg2-drawer .team-dgrid {
    padding-inline: 14px;
  }

  .mg2-drawer .team-dcol,
  .mg2-drawer .team-dcol:nth-child(even) {
    padding: 14px 0;
  }

  .mg2-drawer :is(.team-manage, .team-perms) {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 14px;
  }

  .mg2-drawer .team-manage {
    grid-template-areas:
      "heading"
      "roles"
      "actions";
    align-items: start;
  }

  .mg2-drawer .team-manage-actions {
    justify-content: flex-start;
  }

  .mg2-drawer .team-manage > em,
  .mg2-drawer .team-perms > em,
  .mg2-drawer .team-manage > .ide-btn-lite {
    grid-column: 1;
  }

  .mg2-drawer .team-subscription {
    padding: 16px 14px;
  }

  .mg2-drawer .team-plan-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg2-drawer .team-permrow {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg2-drawer .team-permrow .ide-btn-lite {
    justify-self: start;
  }

  .mg2-drawer .team-invite-grid > button {
    width: 100%;
  }

  .mg2-drawer .admin-eactions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-inline: -12px;
    padding: 11px 14px;
  }

  .mg2-drawer .admin-eactions .admin-espacer {
    display: none;
  }

  .mg2-drawer .admin-eactions .btn-primary {
    grid-column: 1 / -1;
  }

  .mg2-drawer .admin-eactions :is(.btn, .ide-btn-lite) {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg2-drawer {
    animation: none;
  }

  .mg2-button,
  .mg2-tab {
    transition: none;
  }
}
