/*
 * 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: 0 1 320px;
  min-width: 240px;
  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;
  flex: 1 1 0;
  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 {
  flex: 0 0 auto;
  margin-right: 3px;
  color: var(--mg2-faint);
  font-size: 10px;
  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 {
  flex: 0 0 auto;
  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)
    /* Wide enough for Manage plus the owner-only Impersonate button. */
    200px;
  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;
  gap: 6px;
}

.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;
}

/* Organisation limits: three groups, each numbers + a hard / soft / default
   control, one save. Reuses the editor's field, label and unit styles. */
.mg2-drawer .admin-limits { gap: 0; padding: 0; }
.mg2-drawer .admin-limits > .admin-esec-head { padding: 15px 18px 12px; }
.mg2-drawer .admin-limit { display: grid; gap: 12px; padding: 14px 18px 16px; border-top: 1px solid var(--mg2-line, #dfe4eb); }
.mg2-drawer .admin-limit-head h4 { margin: 0; color: var(--mg2-ink, #18202f); font-size: 12.5px; font-weight: 750; }
.mg2-drawer .admin-limit-head p { margin: 3px 0 0; color: var(--mg2-muted, #687386); font-size: 11px; line-height: 1.45; }
.mg2-drawer .admin-limit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mg2-drawer .admin-limit-grid input[type="date"], .mg2-drawer .admin-limit-grid input[type="text"] { min-height: 42px; }
.mg2-drawer .admin-limit-mode { display: grid; gap: 6px; }
.mg2-drawer .admin-limit-mode small { color: var(--mg2-faint, #8a94a6); font-size: 10.5px; line-height: 1.4; }
.mg2-drawer .admin-mode { display: inline-flex; width: max-content; max-width: 100%; border: 1px solid var(--mg2-line-strong, #cbd3df); border-radius: 9px; overflow: hidden; background: var(--mg2-surface, #fff); }
.mg2-drawer .admin-mode button { min-height: 32px; padding: 0 11px; border: 0; background: transparent; color: var(--mg2-muted, #687386); font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.mg2-drawer .admin-mode button + button { border-left: 1px solid var(--mg2-line, #dfe4eb); }
.mg2-drawer .admin-mode button:hover { color: var(--mg2-ink, #18202f); }
.mg2-drawer .admin-mode button.on { background: var(--mg2-accent-soft, #eef3fe); color: var(--mg2-accent-strong, #1d4ed8); }
.mg2-drawer .admin-mode button.on.hard { background: var(--mg2-danger-soft, #fff1ef); color: #98271f; }
.mg2-drawer .admin-mode button:disabled { cursor: default; opacity: .6; }
.mg2-drawer .admin-limit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--mg2-line, #dfe4eb); background: var(--mg2-subtle, #f8fafc); }
.mg2-drawer .admin-limit-note { flex: 1 1 100%; color: var(--mg2-faint, #8a94a6); font-size: 10.5px; line-height: 1.4; }
.admin-org-pill.ws { color: var(--mg2-text, #394457); }
.admin-org-modes { flex: 1 1 100%; color: var(--mg2-faint, #8a94a6); font-size: 10.5px; }
@media (max-width: 720px) {
  .mg2-drawer .admin-limit-grid { grid-template-columns: minmax(0, 1fr); }
}

.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;
}

/* adminOnly rows (Red): the checkbox IS the provisioning action — say so. */
.mg2-drawer .admin-modelchk .admin-restricted {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.45);
  border-radius: 999px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: 1px;
}

.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%;
    min-width: 0;
  }

  .mg2-org-actions {
    width: 100%;
    flex-basis: 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%;
  }
}

/* OpenCoder learning ------------------------------------------------- */
/* Documentation-first Learning pages, flat wiki style: hierarchy comes from
   type scale, whitespace, and hairlines — not nested cards. The only filled
   surfaces are code (needs a reading ground) and functional notices. */
.learning-page {
  --learn-ink: #18202f;
  --learn-text: #3a4557;
  --learn-muted: #5b6678;
  --learn-faint: #8a93a5;
  --learn-line: #e7ebf1;
  --learn-soft: #f6f8fb;
  --learn-blue: #2f5fd7;
  --learn-blue-soft: #eef3ff;
  --learn-red: #be4037;
  --learn-red-soft: #fff1ef;
  --learn-amber: #9d6508;
  --learn-amber-soft: #fff6dc;
  --learn-green: #197759;
  color: var(--learn-text);
  color-scheme: light;
  font-family: var(--mra-font-ui, "Roboto Flex", system-ui, sans-serif);
  width: min(1280px, 100%);
  min-width: 0;
  margin-inline: auto;
  padding: 30px clamp(16px, 3vw, 40px) 70px;
  font-size: 14px;
  line-height: 1.62;
}

/* Shell: quiet subnav rail + one page ----------------------------------- */
.learn-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.learn-subnav {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 18px;
}

.learn-subnav-head h2 {
  margin: 3px 0 0;
  color: var(--learn-ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.learn-subnav nav {
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--learn-line);
}

.learn-subnav-item {
  display: grid;
  gap: 1px;
  margin-left: -1px;
  border: 0;
  border-left: 2px solid transparent;
  padding: 7px 0 7px 14px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.learn-subnav-item strong {
  color: var(--learn-muted);
  font-size: 13.5px;
  font-weight: 600;
}

.learn-subnav-item small {
  color: var(--learn-faint);
  font-size: 11.5px;
  line-height: 1.4;
}

.learn-subnav-item:hover strong { color: var(--learn-ink); }

.learn-subnav-item.is-active { border-left-color: var(--learn-blue); }
.learn-subnav-item.is-active strong { color: var(--learn-blue); font-weight: 700; }

/* Page head -------------------------------------------------------------- */
.learn-page-body { min-width: 0; }

.learn-page-head { margin-bottom: 26px; }

.learn-page-head.has-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.learn-page-head h1 {
  margin: 6px 0 0;
  color: var(--learn-ink);
  font-size: clamp(25px, 2.4vw, 31px);
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.learn-page-head p {
  margin: 10px 0 0;
  max-width: 72ch;
  color: var(--learn-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.learn-kicker,
.learn-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--learn-blue);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Quickstart — flat hero, no cards --------------------------------------- */
.learn-quickstart {
  margin: 0 0 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--learn-line);
}

.learn-quickstart > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.learn-quickstart h2 {
  margin: 5px 0 0;
  color: var(--learn-ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.learn-quickstart-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--learn-faint);
  font-size: 12.5px;
}

.learn-quickstart-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px clamp(18px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-quickstart-steps > li { display: flex; gap: 12px; }

.learn-qs-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--learn-blue);
  color: #fff;
  font-size: 11.5px;
  font-weight: 720;
}

.learn-quickstart-steps strong {
  display: block;
  color: var(--learn-ink);
  font-size: 14.5px;
  font-weight: 680;
}

.learn-quickstart-steps p {
  margin: 4px 0 0;
  color: var(--learn-muted);
  font-size: 13px;
  line-height: 1.55;
}

.learn-qs-code {
  display: block;
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--learn-soft);
  color: var(--learn-ink);
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Surface chooser — two quiet columns ------------------------------------ */
.learn-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px clamp(24px, 4vw, 56px);
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--learn-line);
}

.learn-path-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--learn-blue-soft);
  color: var(--learn-blue);
}

.learn-path h3 {
  margin: 10px 0 0;
  color: var(--learn-ink);
  font-size: 15.5px;
  font-weight: 700;
}

.learn-path > p {
  margin: 6px 0 0;
  color: var(--learn-muted);
  font-size: 13.5px;
  line-height: 1.58;
}

.learn-path ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.learn-path li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--learn-text);
  font-size: 13px;
  line-height: 1.5;
}

.learn-path li > svg { flex: 0 0 auto; margin-top: 3px; color: var(--learn-green); }

.learn-path-action,
.learn-feature-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--learn-blue);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
}

.learn-path-action:hover,
.learn-feature-action:hover { text-decoration: underline; }

/* "On this page" — one quiet line ---------------------------------------- */
.learn-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 8px;
}

.learn-toc > span {
  color: var(--learn-faint);
  font-size: 12.5px;
  font-weight: 650;
}

.learn-toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: learn-toc;
}

.learn-toc li { counter-increment: learn-toc; font-size: 13px; }

.learn-toc li::before {
  content: counter(learn-toc);
  margin-right: 5px;
  color: var(--learn-faint);
  font-size: 11.5px;
  font-weight: 650;
}

.learn-jump {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--learn-blue);
  font: inherit;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.learn-jump:hover { text-decoration: underline; }

/* Feature sections — prose separated by air, not borders ----------------- */
.learn-feature-list { display: grid; margin-top: 4px; }

.learn-feature {
  padding: 30px 0 32px;
  border-bottom: 1px solid var(--learn-line);
  scroll-margin-top: 18px;
}

.learn-feature:last-child { border-bottom: 0; }

.learn-feature > header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.learn-feature-number {
  color: var(--learn-faint);
  font-size: 12px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.learn-feature h2 {
  margin: 0;
  color: var(--learn-ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.015em;
  outline: none;
}

.learn-feature > p {
  margin: 0;
  max-width: 72ch;
  color: var(--learn-text);
  font-size: 14px;
  line-height: 1.62;
}

.learn-feature-steps {
  margin: 14px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  max-width: 70ch;
  color: var(--learn-text);
  font-size: 14px;
  line-height: 1.58;
}

/* Code — the one intentional surface ------------------------------------- */
.learn-snippet {
  margin: 16px 0 0;
  max-width: 860px;
  border-radius: 9px;
  background: var(--learn-soft);
  overflow: hidden;
}

.learn-snippet figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 0;
  color: var(--learn-faint);
  font-size: 12px;
  font-weight: 600;
}

.learn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--learn-faint);
  font: inherit;
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
}

.learn-copy:hover { color: var(--learn-blue); }

.learn-snippet pre {
  margin: 0;
  padding: 10px 14px 13px;
  overflow-x: auto;
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 13px;
  line-height: 1.58;
  color: var(--learn-ink);
}

/* Chips: term — meaning lines, code tokens only -------------------------- */
.learn-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px 32px;
  margin: 16px 0 0;
  max-width: 900px;
}

.learn-chips > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 9px;
  min-width: 0;
}

.learn-chips dt {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--learn-soft);
  color: var(--learn-ink);
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12px;
  font-weight: 600;
}

.learn-chips dd {
  margin: 0;
  min-width: 0;
  color: var(--learn-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Example prompts -------------------------------------------------------- */
.learn-examples {
  margin: 16px 0 0;
  max-width: 70ch;
  border-left: 2px solid var(--learn-line);
  padding-left: 16px;
}

.learn-examples-label {
  color: var(--learn-faint);
  font-size: 12.5px;
  font-weight: 650;
}

.learn-examples ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.learn-examples li {
  color: var(--learn-muted);
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.55;
}

/* Callouts: a left rule, not a filled banner ----------------------------- */
.learn-callout {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 0;
  max-width: 70ch;
  padding: 2px 0 2px 14px;
  border-left: 3px solid;
  font-size: 13.5px;
  line-height: 1.58;
}

.learn-callout > svg { flex: 0 0 auto; margin-top: 3px; }
.learn-callout strong { font-weight: 700; margin-right: 2px; }
.learn-callout.is-tip { border-color: var(--learn-blue); color: var(--learn-text); }
.learn-callout.is-tip > svg, .learn-callout.is-tip strong { color: var(--learn-blue); }
.learn-callout.is-warn { border-color: var(--learn-amber); color: var(--learn-text); }
.learn-callout.is-warn > svg, .learn-callout.is-warn strong { color: var(--learn-amber); }

/* Section heads between blocks ------------------------------------------- */
.learn-section-head { margin: 34px 0 12px; }

.learn-section-head.is-secondary { margin-top: 40px; }

.learn-section-head h2,
.learn-section-head h3 {
  margin: 4px 0 0;
  color: var(--learn-ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.learn-section-head p {
  margin: 7px 0 0;
  max-width: 72ch;
  color: var(--learn-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* Tables: rules only — no fills, no outer frame -------------------------- */
.learn-feature-table-wrap {
  overflow-x: auto;
}

.learn-feature-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.learn-feature-table thead th {
  color: var(--learn-faint);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  padding: 8px 18px 8px 0;
  border-bottom: 2px solid var(--learn-line);
  white-space: nowrap;
}

.learn-feature-table tbody th,
.learn-feature-table tbody td {
  padding: 11px 18px 11px 0;
  border-bottom: 1px solid var(--learn-line);
  vertical-align: top;
  text-align: left;
  line-height: 1.55;
}

.learn-feature-table tbody tr:last-child th,
.learn-feature-table tbody tr:last-child td { border-bottom: 0; }

.learn-feature-table tbody th {
  color: var(--learn-ink);
  font-weight: 650;
  white-space: nowrap;
}

.learn-feature-table tbody td { color: var(--learn-text); }

.learn-feature-table td small,
.learn-feature-table td strong { display: block; }
.learn-feature-table td strong { color: var(--learn-ink); font-weight: 650; }
.learn-feature-table td small { margin-top: 2px; color: var(--learn-faint); font-size: 12px; }

.learn-reference-table td code {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12px;
  color: var(--learn-ink);
  background: var(--learn-soft);
  border-radius: 5px;
  padding: 1px 7px;
  white-space: nowrap;
}

/* Analytics -------------------------------------------------------------- */
.learn-analytics-table tbody td { white-space: nowrap; }
.learn-analytics-table tbody td:first-child { white-space: normal; }

.learn-person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.learn-person-cell strong { display: block; color: var(--learn-ink); font-weight: 650; }
.learn-person-cell small { display: block; margin-top: 1px; color: var(--learn-faint); font-size: 12px; }

.learn-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--learn-blue-soft);
  color: var(--learn-blue);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .02em;
}

.learn-muted { color: var(--learn-faint); }

.learn-surface { color: var(--learn-muted); font-size: 12.5px; }

.learn-warn { color: var(--learn-amber) !important; }

/* Sortable headers reuse the shared .mg2-sort button; the hover accent is
   scoped here because --mg2-accent is not defined on the learning page. */
.learn-analytics-table thead th { padding-right: 12px; }
.learn-analytics-table .mg2-sort:hover,
.learn-analytics-table .mg2-sort:focus-visible { color: var(--learn-blue); }

.learn-expand {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--learn-faint);
  cursor: pointer;
}

.learn-expand svg { transition: transform .14s ease; }
.learn-expand[aria-expanded="true"] svg { transform: rotate(90deg); }
.learn-expand:hover { color: var(--learn-blue); background: var(--learn-soft); }

.learn-person-row { cursor: default; }
.learn-person-row.is-expanded td { border-bottom: 0; }

/* Expanded person detail --------------------------------------------------- */
.learn-detail-row > td {
  padding: 0 0 18px 34px;
  border-bottom: 1px solid var(--learn-line);
}

.learn-detail {
  display: grid;
  gap: 18px;
  padding: 6px 0 0;
}

.learn-detail h4 {
  margin: 0 0 7px;
  color: var(--learn-faint);
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

.learn-detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px clamp(22px, 3vw, 44px);
}

.learn-chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-chiplist li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--learn-line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--learn-text);
  font-size: 12.5px;
}

.learn-chiplist li b { color: var(--learn-faint); font-weight: 620; }

.learn-chiplist li code {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12px;
  color: var(--learn-ink);
}

.learn-spark {
  width: min(340px, 100%);
  height: 44px;
  display: block;
}

.learn-spark rect { fill: var(--learn-line); }
.learn-spark rect.has-turns { fill: var(--learn-blue); }

.learn-sessions-table { font-size: 13px; }
.learn-sessions-table tbody td { white-space: nowrap; }
.learn-sessions-table tbody td.learn-session-title { white-space: normal; }

.learn-session-title { min-width: 220px; max-width: 460px; }
.learn-session-title strong { overflow-wrap: anywhere; }

.learn-empty.compact { padding: 20px 14px; gap: 6px; }
.learn-empty.compact strong { font-size: 13.5px; }

/* Input history: the member's own prompts inside one conversation ---------- */
.learn-session-title { display: flex; align-items: flex-start; gap: 6px; }
.learn-session-expand { width: 20px; height: 20px; margin-top: 1px; }

.learn-inputs-row > td {
  padding: 0 0 16px 26px;
  border-bottom: 1px solid var(--learn-line);
}

.learn-inputs-row h4 {
  margin: 8px 0 7px;
  color: var(--learn-faint);
  font-size: 12px;
  font-weight: 650;
}

.learn-inputs {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-input-meta {
  display: block;
  margin-bottom: 3px;
  color: var(--learn-faint);
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.learn-input-text {
  max-height: 240px;
  overflow-y: auto;
  border-left: 3px solid var(--learn-blue-soft);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  background: var(--learn-soft);
  color: var(--learn-text);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.learn-input-clip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  color: var(--learn-faint);
  font-size: 11.5px;
}

/* Highlights: the conversations a manager should open first ---------------- */
.learn-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.learn-highlight {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  border: 1px solid var(--learn-line);
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.learn-highlight:hover { border-color: var(--learn-blue); }

.learn-highlight-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--learn-faint);
  font-size: 11.5px;
  font-weight: 650;
}

.learn-highlight.is-failures .learn-highlight-kicker { color: var(--learn-amber); }

.learn-highlight strong {
  color: var(--learn-ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.learn-highlight small { color: var(--learn-faint); font-size: 12px; }

.learn-highlight-stat {
  color: var(--learn-blue);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Toolbar buttons ---------------------------------------------------------- */
.learn-toggle,
.learn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--learn-line);
  border-radius: 999px;
  padding: 6px 13px;
  background: #fff;
  color: var(--learn-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 620;
  cursor: pointer;
}

.learn-toggle:hover,
.learn-export:hover:not(:disabled) { border-color: var(--learn-blue); color: var(--learn-blue); }

.learn-toggle.is-on {
  border-color: var(--learn-blue);
  background: var(--learn-blue-soft);
  color: var(--learn-blue);
}

.learn-export:disabled { opacity: .5; cursor: default; }

.learn-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px clamp(26px, 4vw, 54px);
  margin: 4px 0 22px;
  padding: 16px 0;
  border-top: 1px solid var(--learn-line);
  border-bottom: 1px solid var(--learn-line);
}

.learn-summary-item strong {
  display: block;
  color: var(--learn-ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.learn-summary-item span {
  display: block;
  margin-top: 1px;
  color: var(--learn-muted);
  font-size: 12.5px;
  font-weight: 620;
}

.learn-summary-item small {
  display: block;
  color: var(--learn-faint);
  font-size: 12px;
}

/* Toolbar + context controls -------------------------------------------- */
.learn-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
}

.learn-search {
  display: flex;
  flex: 1 1 320px;
  max-width: 400px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--learn-line);
  padding: 0 2px;
  color: var(--learn-faint);
}

.learn-search:focus-within { border-bottom-color: var(--learn-blue); }

.learn-search input {
  flex: 1;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--learn-ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}

.learn-toolbar-note { color: var(--learn-faint); font-size: 12.5px; }

.learn-context-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 12px;
}

.learn-context-field { display: grid; gap: 4px; }

.learn-context-field > span {
  color: var(--learn-faint);
  font-size: 12px;
  font-weight: 620;
}

.learn-context-field select {
  border: 1px solid var(--learn-line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  color: var(--learn-ink);
  font: inherit;
  font-size: 13px;
}

.learn-refresh {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid var(--learn-line);
  border-radius: 7px;
  color: var(--learn-muted);
  background: #fff;
  cursor: pointer;
}

.learn-refresh:hover { color: var(--learn-blue); border-color: var(--learn-blue); }

/* Notices (functional, keep a surface) ----------------------------------- */
.learn-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--learn-soft);
  color: var(--learn-text);
  font-size: 13px;
}

.learn-note.error { background: var(--learn-red-soft); color: var(--learn-red); }
.learn-note.warning { background: var(--learn-amber-soft); color: var(--learn-amber); }

/* Empty / loading states -------------------------------------------------- */
.learn-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 18px;
  color: var(--learn-muted);
  text-align: center;
  font-size: 13.5px;
}

.learn-empty strong { color: var(--learn-ink); font-size: 15px; font-weight: 680; }
.learn-empty.error { color: var(--learn-red); }

.learn-retry {
  border: 1px solid var(--learn-line);
  border-radius: 7px;
  padding: 7px 15px;
  background: #fff;
  color: var(--learn-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
}

.learn-retry:hover { border-color: var(--learn-blue); color: var(--learn-blue); }

/* Screen-reader helper ---------------------------------------------------- */
.learning-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 900px) {
  .learn-shell { grid-template-columns: 1fr; }
  .learn-subnav { position: static; }
  .learn-subnav nav { display: flex; flex-wrap: wrap; gap: 2px 18px; border-left: 0; }
  .learn-subnav-item { border-left: 0; border-bottom: 2px solid transparent; padding: 6px 0; }
  .learn-subnav-item.is-active { border-bottom-color: var(--learn-blue); }
  .learn-subnav-item small { display: none; }
  .learn-page-head.has-controls { flex-direction: column; align-items: flex-start; }
  .learn-toolbar { flex-direction: column; align-items: stretch; }
  .learn-search { flex: none; max-width: none; }
  .learn-context-controls { flex-wrap: wrap; align-items: flex-end; }
}

@media (max-width: 520px) {
  .learning-page { padding-inline: 12px; }
  .learn-summary { gap: 14px 26px; }
}

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

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

/* Roles & permissions — capability tick-boxes per MRA role.
   Reuses the mg2 surface/typography; only the card + tick grid are new. */
.rp-list { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 2px; }

.rp-card {
  border: 1px solid var(--mg2-line, #e3e6ea);
  border-radius: 12px;
  background: var(--mg2-surface-bg, #fff);
  padding: 14px 16px 16px;
}
.rp-card.is-dirty { border-color: var(--mg2-accent, #2f6feb); box-shadow: 0 0 0 1px var(--mg2-accent, #2f6feb) inset; }

.rp-cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rp-cardhead h3 { margin: 0 0 4px; font-size: 0.98rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rp-cardhead p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.78rem; }
.rp-actions { display: flex; gap: 8px; flex-shrink: 0; }

.rp-tag {
  border-radius: 999px; padding: 2px 9px; font-size: 0.72rem; font-weight: 600;
  background: var(--mg2-chip-bg, #eef1f5); color: var(--mg2-fg-2, #464c54);
}
.rp-tag.custom { background: #e7f0ff; color: #22509c; }
.rp-state { font-size: 0.75rem; color: var(--mg2-fg-3, #6b727b); }
.rp-state.mapped { color: #1f7a43; font-weight: 600; }
.rp-count { font-size: 0.75rem; color: var(--mg2-fg-3, #6b727b); }

.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }

.rp-group { margin: 0; border: 1px solid var(--mg2-soft-line, #eceff3); border-radius: 10px; padding: 8px 11px 10px; }
.rp-group legend {
  padding: 0 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--mg2-fg-3, #6b727b);
  display: flex; flex-direction: column; gap: 1px;
}
.rp-group legend small { font-weight: 500; letter-spacing: 0; text-transform: none; opacity: 0.85; }

.rp-tick { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; cursor: pointer; }
.rp-tick input { margin-top: 2px; accent-color: var(--mg2-accent, #2f6feb); }
.rp-tick span { display: flex; flex-direction: column; min-width: 0; }
.rp-tick strong { font-size: 0.82rem; font-weight: 600; }
.rp-tick small { font-size: 0.72rem; color: var(--mg2-fg-3, #6b727b); }
.rp-tick input:disabled, .rp-tick input:disabled + span { opacity: 0.55; cursor: default; }

@media (max-width: 720px) {
  .rp-grid { grid-template-columns: 1fr; }
  .rp-actions { width: 100%; }
}
.rp-hint {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--mg2-chip-bg, #eef1f5);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--mg2-fg-2, #464c54);
}
.rp-card.is-system { background: var(--mg2-chip-bg, #eef1f5); }
.rp-card.is-system .rp-cardhead h3 { font-family: inherit; }
