/* Group controls share the v0.6 conversation palette and native dialog. */
.group-notice {
  margin: 8px 16px 0;
  padding: 9px 12px;
  color: #ffe2d0;
  border-left: 2px solid #f5b993;
  font-size: .84rem;
  line-height: 1.45;
}

.rooms [data-room-kind="group"] .room-avatar {
  background: #324f54;
  color: #c8e8dc;
}

#room-icon[data-room-kind="group"] {
  background: #d9e9e2;
  color: #32574d;
}

#modal:has(.group-pane) {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.group-pane { display: grid; min-width: 0; gap: 9px; }
.group-pane > label, .group-subhead { font-weight: 680; }
.group-pane input { margin: 0; min-width: 0; }
.group-subhead { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.group-title { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.group-lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.group-controls { display: flex; gap: 8px; justify-content: end; margin-top: 13px; }
.group-controls button, .group-lookup button { min-height: 44px; }
.group-controls .soft:hover, .group-lookup .soft:hover { background: #ebdfe9; }

.group-candidates:empty, .group-selection:empty { display: none; }
.group-pane:has(.group-selection:empty) .group-subhead { display: none; }
.group-selection { display: flex; flex-wrap: wrap; gap: 5px; }
.group-selection, .group-names { max-block-size: min(30dvh, 12rem); overflow: auto; }
.group-chip { padding: 7px 11px; border-radius: 18px; color: #56364e; background: #f3e2ed; }
.group-chip, .group-names { white-space: normal; overflow-wrap: anywhere; }

.group-person {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 0;
}
.group-person-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e9dce9;
  color: #5e3b57;
  font-size: .82rem;
  font-weight: 750;
}
.group-candidate {
  text-align: left;
  padding: 6px 10px;
  background: #f5eaf0;
  color: #4c3448;
}
.group-candidate:hover, .group-chip:hover { background: #ead7e3; }
.group-plus { margin-left: auto; font-size: 1.2rem; }
.dialog-content .group-roster {
  list-style: none; padding: 0; margin: 5px 0;
  max-block-size: min(46dvh, 24rem); overflow: auto;
}
.group-selection:focus-visible, .group-names:focus-visible, .group-roster:focus-visible { outline-offset: -2px; }
.group-roster .group-person + .group-person { border-top: 1px solid var(--line); }
.group-person-label { flex: 1; min-width: 0; }
.group-person strong { white-space: normal; overflow-wrap: anywhere; font-size: .93rem; }
.group-person-label small { margin-top: 2px; font-size: .76rem; }
.group-remove { background: transparent; color: #8e3553; min-height: 44px; font-size: .84rem; }
.group-remove:hover { background: #f7e7e9; }

@media (max-width: 420px) {
  #modal:has(.group-pane) .dialog-content { padding: 17px; }
  .group-remove { padding-inline: 6px; }
}

.group-controls:has(#group-invite-manage), .group-invite-controls { flex-wrap: wrap; }
.group-invite-state { font-weight: 650; }
.group-member-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.group-permission { font-size: .82rem; min-height: 44px; padding-inline: 9px; }
#group-invite-expiry {
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: inherit;
  font: inherit;
}
@media (max-width: 480px) {
  .group-roster .group-person:has(.group-member-actions) {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 4px 10px;
  }
  .group-member-actions { grid-column: 2; }
}
