  /* ---- groups: the tabs, a group's page, a member's page, profiles, invitations, Your groups ---- */
  /* the group tabs under the menu's header, and the open group's name. */
  .group-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
  .group-tab { width: 34px; height: 34px; border-radius: var(--r-round); border: 2px solid var(--line-strong); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
  .group-tab.g1 { border-color: var(--accent); } .group-tab.g2 { border-color: var(--ok-text); } .group-tab.g3 { border-color: var(--danger); }
  .group-tab.g4 { border-style: dashed; border-color: var(--accent); } .group-tab.g5 { border-style: dashed; border-color: var(--ok-text); }
  .group-tab[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent); }
  .group-tab.add { border-style: dashed; color: var(--ink-soft); }
  .group-tab.has-icon { padding: 0; } /* the group's icon, round, in place of the letter */
  .group-tab-icon { display: block; width: 100%; height: 100%; border-radius: var(--r-round); object-fit: cover; }
  .group-name { margin: 8px 0 4px; font-family: var(--display); font-size: 15px; color: var(--ink); }
  .group-name:empty { display: none; }
  /* the Group page and the links under the group's name. */
  #groupPage { display: none; }
  body.group-open #groupPage { display: block; }
  /* the group's page and its edit view (Edit group): each shows only its own parts (data-views, in the markup) */
  #groupPage[data-view="page"] [data-views]:not([data-views~="page"]),
  #groupPage[data-view="edit"] [data-views]:not([data-views~="edit"]) { display: none; }
  /* a member's own page, opened from their name on the Group page */
  #memberPage { display: none; }
  body.member-open #memberPage { display: block; }
  /* a wide page for its banner; its few lines stay at a reading width under it */
  #memberPage > :not(.page-hero) { max-width: 72ch; }
  .gp-count { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }
  .gp-count:empty { display: none; }
  /* who's on: your status under the count, Your status opening its box; a member's words under their name. */
  .gp-me { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; }
  .gp-me[hidden], .gp-on[hidden] { display: none; }
  .gp-me-words { min-width: 0; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
  .gp-states { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
  .gp-states [aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
  .gp-on { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
  #mbHero .on-dot { position: absolute; left: 82px; bottom: -40px; width: 14px; height: 14px; border-width: 3px; }
  .mb-tags { margin: 0 0 4px; }
  .mb-links { margin: 0 0 12px; padding-left: 18px; }
  /* whatever is hidden on these pages stays hidden, whatever its own display */
  #groupPage [hidden], #memberPage [hidden], #groupProfileForm [hidden] { display: none !important; }
  .gpr-crop { margin: 8px 0; }
  .gpr-frame { position: relative; width: 200px; height: 200px; overflow: hidden; border-radius: var(--r-round); border: var(--bw) var(--bs) var(--line-strong); background: var(--card); touch-action: none; cursor: grab; }
  .gpr-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .gpr-frame img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
  .gpr-crop input[type=range] { width: 200px; }
  .group-links { display: flex; gap: 12px; margin: 0 0 6px; }
  .group-links .link-btn { min-height: 32px; font-size: 13px; }
  .gp-list { list-style: none; margin: 0; padding: 0; }
  .gp-member { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: var(--bw) var(--bs) var(--line); }
  .gp-member .gp-name { font-weight: 600; color: var(--ink); }
  .gp-who { flex: 1 1 12em; min-width: 0; display: flex; flex-direction: column; gap: 2px; } /* the name, its pronouns and tags, the email under */
  .gp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .gp-email { overflow-wrap: anywhere; }
  /* profiles on the Group page */
  .gp-member button.gp-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
  .gp-pic { width: 28px; height: 28px; border-radius: var(--r-round); object-fit: cover; border: var(--bw) var(--bs) var(--line); flex: none; }
  .gp-pic-big { width: 88px; height: 88px; }
  .gp-pronouns { font-size: 12px; color: var(--ink-soft); }
  .gp-about { white-space: pre-wrap; margin: 0 0 12px; color: var(--ink); }
  .gpr-pic-row { display: flex; gap: 12px; align-items: center; }
  .gpr-pic-row.placing { padding-left: 100px; } /* the hidden picture's 88px and the gap, while the crop is open */
  /* the group chat, and invitations under the tabs. */
  .gp-chat { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
  .gp-msg { padding: 6px 0; border-top: var(--bw) var(--bs) var(--line); color: var(--ink); overflow-wrap: anywhere; }
  .gp-msg strong { color: var(--ink); }
  /* your own message: click or tap it for Edit and Take back; taken back, a gray line for everyone */
  .gp-own { cursor: pointer; border-radius: var(--r-xs); }
  .gp-own:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
  .gp-own-row { margin-top: 6px; }
  .gp-own-edit { margin-top: 4px; }
  .gp-own-edit textarea { display: block; width: 100%; box-sizing: border-box; margin-bottom: 6px; font: inherit; color: var(--ink); background: var(--card); border: var(--bw) var(--bs) var(--field-border); border-radius: var(--r-sm); padding: 6px 8px; resize: vertical; }
  .gp-gone-line { color: var(--muted); font-style: italic; font-size: 13.5px; }
  /* a module's invitation in the group chat: its mark and name, its words, then Join or what became of it */
  .gp-invite { margin-top: 6px; padding: 10px 12px; border: var(--bw) var(--bs) var(--line-strong); border-radius: var(--r-lg); background: var(--paper); }
  .gp-invite-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .gp-invite-head .app-icon { flex: none; width: 28px; height: 28px; font-size: 13px; border-radius: var(--r-md); }
  .gp-invite-text { margin: 6px 0 8px; }
  .gp-invite-state { display: inline-block; align-self: center; color: var(--ink-soft); font-weight: 600; }
  .gp-chat-send { display: flex; gap: 8px; margin-top: 10px; }
  .gp-chat-send input { flex: 1 1 auto; min-width: 0; }
  /* a dot on a group's tab for new messages, and Leave / Hide, and Edit group's Delete. */
  .group-tab { position: relative; }
  .group-tab.has-new::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: var(--r-round); background: var(--accent); border: 2px solid var(--rail); }
  .gp-leave { margin-top: 24px; }
  .group-invites { margin: 4px 0 8px; padding: 10px 12px; background: var(--accent-soft); border: var(--bw) var(--bs) var(--accent); border-radius: var(--r); }
  .group-invites[hidden] { display: none; }
  .group-invite p { margin: 0 0 6px; font-size: 13.5px; color: var(--ink); }
  .group-invite .tag { display: inline-block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); border: var(--bw) var(--bs) var(--line-strong); border-radius: var(--r-xs); padding: 0 6px; } /* Put off */
  .group-invites .row-buttons { margin-top: 0; }
  .group-invites .btn-primary, .group-invites .btn-secondary { min-height: 36px; padding: 6px 10px; font-size: 13px; }
  .gpr-frame.wide { width: 300px; height: 100px; border-radius: var(--r-md); max-width: 100%; }
  /* a banner is saved at 3:1 and a phone shows it all; a wide window shows about its middle band, so the rest is washed */
  .gpr-frame.wide::before, .gpr-frame.wide::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; z-index: 1; background: var(--crop-wash); pointer-events: none; }
  .gpr-frame.wide::before { top: 0; border-bottom: var(--bw) dashed var(--ink-soft); }
  .gpr-frame.wide::after { bottom: 0; border-top: var(--bw) dashed var(--ink-soft); }
  #groupsPage { display: none; }
  body.groups-open #groupsPage { display: block; }
  .gp-member .tag { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); border: var(--bw) var(--bs) var(--line-strong); border-radius: var(--r-xs); padding: 1px 6px; }
  .gp-member .tag.on { color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
  #groupSheet, .gs-more { display: none; }
  .gs-more { position: relative; flex: none; width: 36px; height: 36px; border-radius: var(--r-round); border: var(--bw) dashed var(--line-strong); background: none; color: var(--ink-soft); cursor: pointer; padding: 0; place-items: center; margin-left: auto; }
  .gs-more svg { width: 18px; height: 18px; }
  .gsh-h { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 18px 0 8px; }
  .gsh-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; background: none; border: 0; border-bottom: var(--bw) var(--bs) var(--line); padding: 6px 2px; font: inherit; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; }
  .gsh-list button[aria-current="true"] { font-weight: 600; color: var(--accent-text); }
  .gsh-list .gs-item { pointer-events: none; }
  #groupSheet .btn-secondary { min-height: 44px; padding: 8px 14px; border-radius: var(--r); font-size: 14px; font-weight: 500; }
  #groupSheet .row-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
  /* Hidden groups in Your groups, with Show again */
  .gsh-hidden[hidden], #groupSheetHiddenTitle[hidden] { display: none; }
  .gsh-row { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: var(--bw) var(--bs) var(--line); padding: 4px 2px; }
  .gsh-name { flex: 1 1 auto; min-width: 0; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
  @media (max-width: 820px) {
    .gs-more { display: inline-grid; }
    #groupSheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow-y: auto; z-index: 25; background: var(--paper); color: var(--ink); border-top: var(--bw) var(--bs) var(--line-strong); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-panel); padding-bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
    body.groups-sheet-open #groupSheet { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
    .gsh-body { padding: 4px 18px 8px; }
    body #groupSheet .drawer-head { padding-top: 16px; } /* a sheet at the bottom: no top inset */
  }
  @media (min-width: 821px) {
    .gs-more { display: inline-grid; margin: 0; }
    #groupSheet { display: block; position: fixed; top: 0; bottom: 0; left: var(--slim-w, 76px); width: 360px; max-width: calc(100vw - var(--slim-w, 76px)); z-index: 25; overflow-y: auto; background: var(--paper); color: var(--ink); border-right: var(--bw) var(--bs) var(--line-strong); box-shadow: var(--shadow-panel); transform: translateX(-110%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
    body.groups-sheet-open #groupSheet { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
    .gsh-body { padding: 4px 22px 16px; }
  }
  @media (max-width: 820px) {
    .gp-chat-send input, .gp-chat-send button { min-height: 44px; } /* the group chat's send row, here and on its page */
  }
