/* share.js: who has access to a project or folder. One column like v1's
 * "Who has access": the invite row on top, then the people, then how they
 * get in. Faces, names and tags reuse people.css's rules. */
.share-dialog {
  width: min(34rem, calc(100vw - 2 * var(--sv-space-4)));
  max-width: none;
  max-height: min(44rem, calc(100dvh - 2 * var(--sv-space-4)));
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--sv-surface-raised);
  color: var(--sv-ink);
  border: var(--sv-hairline-w) solid var(--sv-hairline);
  border-radius: 12px;
  box-shadow: var(--sv-shadow-lg);
}
.share-dialog:not([open]) { display: none; }
.share-dialog::backdrop { background: rgb(0 0 0 / 0.32); }
.share-head { display: flex; align-items: flex-start; gap: var(--sv-space-2); padding: var(--sv-space-4) var(--sv-space-3) var(--sv-space-3) var(--sv-space-5); }
.share-titles { flex: 1; min-width: 0; }
.share-kicker { margin: 0 0 2px; color: var(--sv-ink-tertiary); font-size: var(--ui-meta); letter-spacing: var(--sv-tracking-caps); text-transform: uppercase; }
.share-title { margin: 0; font-size: var(--sv-text-h4); font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.share-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: var(--sv-space-4); align-content: start; padding: var(--sv-space-1) var(--sv-space-5) var(--sv-space-5); }
.share-invite { display: grid; gap: var(--sv-space-2); }
.share-invite-row { display: flex; gap: var(--sv-space-2); }
.share-invite-row .share-email { flex: 1; min-width: 0; }
.share-invite-row :is(input, select, button) { min-height: 40px; font-size: var(--ui-text); }
.share-mail-opt { display: flex; align-items: center; gap: var(--sv-space-2); color: var(--sv-ink-secondary); font-size: var(--ui-meta); cursor: pointer; }
.share-mail-opt input { margin: 0; width: 16px; height: 16px; accent-color: var(--sv-ink); }
/* Our own chevron, inset like the text: the native arrow hugs the edge. */
.share-role {
  appearance: none;
  padding: 0 calc(var(--sv-space-3) + 18px) 0 var(--sv-space-3);
  background: var(--sv-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right var(--sv-space-3) center / 14px;
  font-size: var(--ui-text);
  cursor: pointer;
}
.share-role:hover { border-color: var(--sv-hairline-strong); }
.share-section { display: grid; gap: var(--sv-space-1); }
.share-heading { margin: 0; color: var(--sv-ink-tertiary); font-size: var(--ui-meta); font-weight: 500; letter-spacing: var(--sv-tracking-caps); text-transform: uppercase; }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: var(--sv-hairline-w) solid var(--sv-hairline); }
.share-row { display: flex; align-items: center; gap: var(--sv-space-3); min-height: 52px; padding: var(--sv-space-1) 0; border-bottom: var(--sv-hairline-w) solid var(--sv-hairline); }
.share-row .people-face { width: 30px; height: 30px; font-size: 11px; }
.share-row .people-face.share-team { background: var(--sv-ink); color: var(--sv-surface); }
.share-row .people-face.share-team .icon { width: 15px; height: 15px; }
.share-tail { flex: none; display: flex; align-items: center; gap: var(--sv-space-1); }
.share-tail .share-role { min-height: 32px; }
button.share-remove { width: 32px; min-height: 32px; padding: 0; color: var(--sv-ink-tertiary); }
button.share-remove:hover { color: var(--sv-danger); }
.share-note { margin: 0; color: var(--sv-ink-tertiary); font-size: var(--ui-meta); line-height: 1.45; }
.share-foot { display: flex; align-items: center; gap: var(--sv-space-3); padding-top: var(--sv-space-3); border-top: var(--sv-hairline-w) solid var(--sv-hairline); }
.share-foot .share-note { flex: 1; }
button.share-copy { flex: none; }
/* people.js's card: the way from a chat to its project's access. */
button.people-project { width: 100%; justify-content: flex-start; margin-top: var(--sv-space-2); min-height: 36px; }
button.people-project .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .share-dialog { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .share-head { padding-left: var(--sv-space-4); }
  .share-body { padding: 0 var(--sv-space-4) var(--sv-space-4); }
  .share-invite-row { flex-wrap: wrap; }
  .share-invite-row .share-email { flex-basis: 100%; }
  .share-invite-row .share-role { flex: 1; }
  /* Touch browsers zoom the page when a field under 16px takes focus. */
  .share-invite-row :is(input, select) { font-size: 16px; }
  .share-row .people-face { display: none; }
  .share-foot { flex-direction: column; align-items: stretch; }
}
