/* ============================================================
   group-picker.css — Vybor uchastnikov dlya grupp.
   Polnoekrannyj overlay (sozdanie gruppy / dobavlenie uchastnikov).
   Palitra cherez --aya-* peremennye s hex-folbekom, temnaya tema
   cherez body.dark-theme override (kak v contact-info.css).
   ============================================================ */

.aya-gp-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--aya-grey-bg, #eef0f2);
  color: var(--text, #1a1d21);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity .22s ease;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.aya-gp-overlay.aya-gp-show { opacity: 1; }

body.dark-theme .aya-gp-overlay {
  background: #0d1117;
  color: var(--text, #e6edf3);
}

/* ---------- Shapka ---------- */
.aya-gp-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px 8px;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--border, #e6e8eb);
}
body.dark-theme .aya-gp-header {
  background: var(--panel, #1c2128);
  border-bottom-color: var(--border, #30363d);
}
.aya-gp-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--text, #1a1d21);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
}
body.dark-theme .aya-gp-close { color: var(--text, #e6edf3); }
.aya-gp-close:active { background: var(--aya-grey-bg, #eef0f2); }
body.dark-theme .aya-gp-close:active { background: rgba(255, 255, 255, .08); }
.aya-gp-close .ic { width: 22px; height: 22px; }

.aya-gp-title {
  flex: 1 1 auto;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #1a1d21);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.dark-theme .aya-gp-title { color: var(--text, #e6edf3); }

.aya-gp-confirm {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--aya-teal, #1a6b82);
  font-size: 16px;
  font-weight: 600;
  padding: 8px 8px;
  cursor: pointer;
  border-radius: 8px;
}
.aya-gp-confirm:active { opacity: .6; }
.aya-gp-confirm:disabled {
  color: var(--aya-grey, #8a9499);
  opacity: .55;
  cursor: default;
}
.aya-gp-confirm.aya-gp-busy { opacity: .5; pointer-events: none; }

/* ---------- Pole nazvaniya gruppy ---------- */
.aya-gp-namewrap {
  flex: 0 0 auto;
  padding: 12px 16px 4px;
  background: var(--panel, #fff);
}
body.dark-theme .aya-gp-namewrap { background: var(--panel, #1c2128); }
.aya-gp-name {
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #1a1d21);
  padding: 6px 0;
  border-bottom: 2px solid var(--aya-teal, #1a6b82);
}
body.dark-theme .aya-gp-name { color: var(--text, #e6edf3); }
.aya-gp-name::placeholder { color: var(--aya-grey, #8a9499); font-weight: 400; }

/* ---------- Poisk ---------- */
.aya-gp-searchwrap {
  flex: 0 0 auto;
  padding: 10px 12px;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--border, #e6e8eb);
}
body.dark-theme .aya-gp-searchwrap {
  background: var(--panel, #1c2128);
  border-bottom-color: var(--border, #30363d);
}
.aya-gp-search {
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  border-radius: 10px;
  background: var(--aya-grey-bg, #eef0f2);
  color: var(--text, #1a1d21);
  font-size: 16px;
  padding: 10px 14px;
  -webkit-appearance: none;
  appearance: none;
}
body.dark-theme .aya-gp-search {
  background: #252c34;
  color: var(--text, #e6edf3);
}
.aya-gp-search::placeholder { color: var(--aya-grey, #8a9499); }

/* ---------- Polosa vybrannyh (chipy) ---------- */
.aya-gp-selbar {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--border, #e6e8eb);
}
body.dark-theme .aya-gp-selbar {
  background: var(--panel, #1c2128);
  border-bottom-color: var(--border, #30363d);
}
.aya-gp-selbar[hidden] { display: none; }
.aya-gp-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  background: var(--aya-teal, #1a6b82);
  color: #fff;
  border-radius: 9999px;
  padding: 6px 8px 6px 12px;
  font-size: 14px;
  max-width: 180px;
}
.aya-gp-chip:active { opacity: .8; }
.aya-gp-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aya-gp-chip-x {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
}
.aya-gp-chip-x .ic { width: 14px; height: 14px; }

/* ---------- Spisok kontaktov ---------- */
.aya-gp-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.aya-gp-loading,
.aya-gp-empty {
  text-align: center;
  color: var(--aya-grey, #8a9499);
  font-size: 15px;
  padding: 40px 16px;
}

.aya-gp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text, #1a1d21);
  position: relative;
}
body.dark-theme .aya-gp-item { color: var(--text, #e6edf3); }
.aya-gp-item:active { background: rgba(0, 0, 0, .04); }
body.dark-theme .aya-gp-item:active { background: rgba(255, 255, 255, .06); }
.aya-gp-item.aya-gp-disabled {
  opacity: .5;
  cursor: default;
}
.aya-gp-item.aya-gp-disabled:active { background: transparent; }

/* Razdelitel' (ot teksta, posle avatara) */
.aya-gp-item::after {
  content: "";
  position: absolute;
  left: 64px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border, #eef0f2);
}
body.dark-theme .aya-gp-item::after { background: #30363d; }
.aya-gp-item:last-child::after { display: none; }

.aya-gp-ava {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--aya-teal, #1a6b82), var(--aya-petrol, #005f6d));
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}
.aya-gp-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

.aya-gp-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aya-gp-name {
  font-size: 16px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aya-gp-sub {
  font-size: 13px;
  color: var(--aya-grey, #8a9499);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Checkbox (krug) sprava */
.aya-gp-box {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--aya-grey, #8a9499);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.aya-gp-box .ic { width: 16px; height: 16px; }
.aya-gp-item.aya-gp-checked .aya-gp-box {
  background: var(--aya-teal, #1a6b82);
  border-color: var(--aya-teal, #1a6b82);
  color: #fff;
}
.aya-gp-item.aya-gp-disabled .aya-gp-box { display: none; }
