/* members.css: the Members pattern (@gemboss/ui, unreleased, members.tsx; design "GemBoss Members Pattern", 04/11/2026). Its own
   entry: MembersPage imports it; a plain-HTML page (GemCare) links it beside the core and portal.css (the avatar), and sheet.css
   when it opens a person. Not in gemboss-ui.css (scripts/parts-gate.mjs). README "Members" has the markup.

   The list sits in ListPage's card; the table is the kit's `ui-table` (its 13px, its 8/6 cells, its 12px edge), flush in the card.
   Chips are pills with their count, the one that is on in ink. Status is a 7px dot and a word. A role is a slim kit select per
   scope; read-only, it is the same box drawn dashed. Below a 640px column (a container query on `.gb-members`, so the admin at 768
   beside its rail gets cards too) the table gives way to cards and the chips scroll sideways.
   Tokens only (the `--ui-*` spine, `--gemboss-*` for status colours), so theme-dark.css turns it dark. Whole pixels. Every button
   it draws has its own class with its own hover, so an app's bare `button:hover` cannot paint it. */
.gb-members { container: gb-members / inline-size; }

/* ── The notice line ── */
.gb-members-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-radius: var(--ui-radius-md, 8px);
  font-size: 13px; line-height: 20px;
}
.gb-members-notice--warning { background: var(--gemboss-warning-soft, #fff8e0); color: var(--gemboss-warning, #9a6700); }
.gb-members-notice--info { background: var(--gemboss-accent-soft, #eef0fe); color: var(--gemboss-accent-strong, #3a44de); }
.gb-members-notice__text { flex: 1 1 auto; min-width: 0; }
.gb-members .gb-members-notice__action {
  flex: none; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.gb-members .gb-members-notice__action:active { background: transparent; color: inherit; text-decoration-thickness: 2px; }
@media (hover: hover) { .gb-members .gb-members-notice__action:hover { background: transparent; color: inherit; text-decoration-thickness: 2px; } }
.gb-members .gb-members-notice__action:focus-visible { outline: 2px solid var(--ui-focus, #5661f5); outline-offset: 2px; border-radius: 4px; }

/* ── Chips and search ── */
.gb-members-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.gb-members-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.gb-members .gb-members-chip {
  display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: var(--ui-btn-h, 28px); padding: 0 10px;
  border: 1px solid var(--ui-border, #e5e7ea); border-radius: 999px; background: var(--ui-surface, #fff); color: var(--ui-text-muted, #686b71);
  font: inherit; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.gb-members .gb-members-chip:active { background: var(--ui-surface-2, #eceef2); color: var(--ui-text, #1b1c1e); }
@media (hover: hover) { .gb-members .gb-members-chip:hover { background: var(--ui-surface-2, #eceef2); color: var(--ui-text, #1b1c1e); } }
.gb-members .gb-members-chip:focus-visible { outline: 2px solid var(--ui-focus, #5661f5); outline-offset: 1px; }
.gb-members-chip__n { font-weight: 600; color: var(--ui-text, #1b1c1e); font-variant-numeric: tabular-nums; }
.gb-members .gb-members-chip[aria-pressed="true"] { background: var(--ui-accent, #1b1c1e); border-color: var(--ui-accent, #1b1c1e); color: var(--ui-accent-fg, #fff); }
@media (hover: hover) {
  .gb-members .gb-members-chip[aria-pressed="true"]:hover { background: var(--ui-accent, #1b1c1e); border-color: var(--ui-accent, #1b1c1e); color: var(--ui-accent-fg, #fff); }
}
.gb-members-chip[aria-pressed="true"] .gb-members-chip__n { color: inherit; }
.gb-members-sep { flex: none; width: 1px; height: 18px; margin: 0 4px; background: var(--ui-border, #e5e7ea); }
.gb-members-search { flex: 0 1 240px; min-width: 180px; }

/* ── The table, flush in the card ── */
.gb-members-scroll { overflow-x: auto; max-width: 100%; }
.gb-members-table { min-width: 640px; }
.gb-members-row { cursor: pointer; }
.gb-members-table tbody .gb-members-row--changing,
.gb-members-table tbody .gb-members-row--open { background: var(--ui-accent-soft, #f0f1f4); }
@media (hover: hover) {
  .gb-members-table tbody .gb-members-row--changing:hover { background: var(--ui-accent-soft, #f0f1f4); }
}
.gb-members-table td { white-space: nowrap; }
.gb-members-table .gb-members-person { color: var(--ui-text, #1b1c1e); font-weight: 400; white-space: normal; min-width: 200px; }
.gb-members-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gb-members-who__text { display: grid; min-width: 0; }
.gb-members-who__line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gb-members .gb-members-name {
  min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ui-text-strong, #1b1c1e); font: inherit; font-size: 13px;
  line-height: 20px; font-weight: 600; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.gb-members .gb-members-name:active { background: transparent; color: var(--ui-text-strong, #1b1c1e); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .gb-members .gb-members-name:hover { background: transparent; color: var(--ui-text-strong, #1b1c1e); text-decoration: underline; text-underline-offset: 2px; } }
.gb-members .gb-members-name:focus-visible { outline: 2px solid var(--ui-focus, #5661f5); outline-offset: 2px; border-radius: 4px; }
.gb-members-you {
  flex: none; padding: 0 6px; border-radius: 999px; background: var(--ui-surface-2, #eceef2); color: var(--ui-text-muted, #686b71);
  font-size: 11px; line-height: 16px; font-weight: 500;
}
.gb-members-email { font-size: 12px; line-height: 16px; color: var(--ui-text-muted, #686b71); overflow-wrap: anywhere; }

/* A role: the slim kit select; read-only, the same box dashed with no caret. */
.gb-members-role { min-width: 112px; }
.gb-members-role--ro {
  display: inline-flex; align-items: center; box-sizing: border-box; height: 30px; padding: 0 10px; border: 1px dashed var(--ui-border, #e5e7ea);
  border-radius: var(--ui-radius-md, 8px); background: var(--ui-surface-2, #eceef2); color: var(--ui-text-muted, #686b71); font-size: 12px; cursor: default;
}
.gb-members-role--changing.ui-select { border-color: var(--gemboss-accent, #5661f5); box-shadow: 0 0 0 2px var(--gemboss-accent-soft, #eef0fe); }

.gb-members-status { display: inline-flex; align-items: center; gap: 6px; }
.gb-members-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gemboss-success, #007f5f); }
.gb-members-status--pending .gb-members-dot { background: var(--gemboss-warning, #9a6700); }
.gb-members-status--invited .gb-members-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ui-text-muted, #686b71); }
.gb-members-status--locked .gb-members-dot { background: var(--gemboss-danger, #d72c0d); }
.gb-members-status--locked { color: var(--gemboss-danger-strong, #b42318); }
.gb-members-last { color: var(--ui-text-muted, #686b71); font-variant-numeric: tabular-nums; }
.gb-members-table .gb-members-actions { position: relative; width: 1%; text-align: right; }
.gb-members-rowactions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }

/* The inline confirm of a role change, where the row's ⋯ was (and under the drawer's select). */
/* On a row it floats over the row's end (Last active, the app's last columns) instead of widening its cell, so no column moves while
   a change waits; the row's own tint runs under it. In the drawer it is a line under the select. */
.gb-members-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.gb-members-actions > .gb-members-confirm {
  position: absolute; inset-block: 0; right: 0; flex-wrap: nowrap; justify-content: flex-end; padding: 0 12px 0 24px; white-space: nowrap;
  background: linear-gradient(to right, transparent, var(--ui-accent-soft, #f0f1f4) 16px);
}
.gb-members-confirm__q { color: var(--gemboss-accent-strong, #3a44de); font-weight: 600; }

/* ── Cards, below a 640px column ── */
.gb-members-cards { display: none; margin: 0; padding: 0; list-style: none; }
.gb-members-card { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 0; border-bottom: 1px solid var(--ui-border, #e5e7ea); }
.gb-members-card:last-child { border-bottom: 0; }
.gb-members .gb-members-card__open {
  display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; min-height: 56px; padding: 10px 0 10px 12px; border: 0;
  background: transparent; color: var(--ui-text, #1b1c1e); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.gb-members .gb-members-card__open:active { background: transparent; color: var(--ui-text, #1b1c1e); }
@media (hover: hover) { .gb-members .gb-members-card__open:hover { background: transparent; color: var(--ui-text, #1b1c1e); } }
.gb-members .gb-members-card__open:focus-visible { outline: 2px solid var(--ui-focus, #5661f5); outline-offset: -2px; }
.gb-members-card__text { display: grid; flex: 1 1 auto; min-width: 0; }
.gb-members-card__name { display: flex; align-items: center; gap: 6px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.gb-members-card__meta { font-size: 12px; line-height: 16px; color: var(--ui-text-muted, #686b71); overflow-wrap: anywhere; }
.gb-members-card__go { flex: none; color: var(--ui-text-muted, #686b71); }

@container gb-members (max-width: 640px) {
  .gb-members-scroll { display: none; }
  .gb-members-cards { display: block; }
  .gb-members-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .gb-members-chips::-webkit-scrollbar { display: none; }
  .gb-members-search { flex: 1 1 100%; min-width: 0; }
}

/* ── The drawer (a Sheet) ── */
.gb-members-drawer { display: grid; }
.gb-members-drawer__sec { display: grid; gap: 8px; padding: 0 0 16px; }
.gb-members-drawer__sec + .gb-members-drawer__sec { padding-top: 16px; border-top: 1px solid var(--ui-border, #e5e7ea); }
.gb-members-drawer__h { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ui-text-muted, #686b71); }
.gb-members-kv { display: grid; gap: 8px; margin: 0; font-size: 13px; line-height: 20px; }
.gb-members-kv__row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.gb-members-kv__row > dt { color: var(--ui-text-muted, #686b71); }
.gb-members-kv__row > dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.gb-members-tag { padding: 0 6px; border-radius: 999px; font-size: 11px; line-height: 18px; font-weight: 600; }
.gb-members-tag--ok { background: var(--gemboss-success-soft, #e3f1df); color: var(--gemboss-success-strong, #0a6a4c); }
.gb-members-tag--warn { background: var(--gemboss-warning-soft, #fff8e0); color: var(--gemboss-warning, #9a6700); }
.gb-members-drawer__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.gb-members-drawer .gb-members-btn--danger { color: var(--gemboss-danger-strong, #b42318); }
@media (hover: hover) { .gb-members-drawer .gb-members-btn--danger:hover { background: var(--gemboss-danger-soft, #fff0e9); color: var(--gemboss-danger-strong, #b42318); } }
.gb-members-drawer__slot { padding-top: 16px; border-top: 1px solid var(--ui-border, #e5e7ea); min-width: 0; }

/* ── Invite ── */
.gb-members-tabs { margin: -4px 0 12px; }
.gb-members-panel { display: grid; gap: 8px; }
.gb-members-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gb-members-field { display: grid; gap: 4px; min-width: 0; }
.gb-members-field__label { font-size: 12px; line-height: 16px; color: var(--ui-text-muted, #686b71); }
.gb-members-input { width: 100%; }
.gb-members-note { margin: 0; font-size: 12px; line-height: 16px; color: var(--ui-text-muted, #686b71); }
.gb-members-error { margin: 0; font-size: 12px; line-height: 16px; color: var(--gemboss-danger-strong, #b42318); }
.gb-members-csv { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.gb-members-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.gb-members-check { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--ui-border, #e5e7ea); border-radius: var(--ui-radius-md, 8px); font-size: 12px; }
.gb-members-check__row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; }
.gb-members-check__row + .gb-members-check__row { border-top: 1px solid var(--ui-border, #e5e7ea); }
.gb-members-check__mark { font-weight: 700; color: var(--gemboss-success, #007f5f); }
.gb-members-check__row--skip .gb-members-check__mark { color: var(--gemboss-warning, #9a6700); }
.gb-members-check__what { overflow-wrap: anywhere; }
.gb-members-check__why { font-style: normal; color: var(--ui-text-muted, #686b71); white-space: nowrap; }
@media (max-width: 47.9975em) { .gb-members-form { grid-template-columns: minmax(0, 1fr); } }
