/* ══════════════════════════════════════════
   SHARE SHEET — Partage façon WhatsApp
   ══════════════════════════════════════════ */

.ss-overlay {
  position: fixed; inset: 0;
  z-index: 999998; /* sous les toasts (1000000), au-dessus du reste */
  background: rgba(0,0,0,0);
  display: flex; align-items: flex-end; justify-content: center;
  transition: background .22s ease;
}
.ss-overlay.ss-visible { background: rgba(0,0,0,.5); }
.ss-overlay.ss-visible .ss-sheet { transform: translateY(0); }

.ss-sheet {
  width: 100%; max-width: 520px;
  background: var(--bg-card, #0e1628);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 35px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  height: 82vh; max-height: 82vh;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.ss-handle {
  width: 42px; height: 5px; border-radius: 999px;
  background: rgba(120,120,120,.35);
  margin: 10px auto 8px; flex-shrink: 0;
}

/* Aperçu du contenu partagé */
.ss-preview-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.ss-preview-thumb {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  background: var(--bg-card2);
}
.ss-preview-thumb-empty { background: var(--grad-brand); }
.ss-preview-info { flex: 1; min-width: 0; }
.ss-preview-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--blue-glow); }
.ss-preview-title { font-size: 13px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-preview-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-close-btn {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-card2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; border: none;
}

/* Recherche */
.ss-search-wrap {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 14px; padding: 10px 14px;
  background: var(--bg-input); border: 1.5px solid var(--border); border-radius: 999px;
  flex-shrink: 0;
}
.ss-search-input { flex: 1; background: none; border: none; color: var(--text-1); font-size: 14px; outline: none; }
.ss-search-input::placeholder { color: var(--text-3); }

/* Zone scrollable */
.ss-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.ss-loading, .ss-empty { text-align: center; padding: 30px 16px; color: var(--text-3); font-size: 13px; }
.ss-perm-hint { margin: 6px 14px; padding: 10px 12px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); border-radius: 12px; font-size: 12px; color: var(--orange); }

.ss-section { margin-bottom: 6px; }
.ss-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 16px 6px;
}
.ss-list { display: flex; flex-direction: column; }

.ss-contact-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; cursor: pointer;
  transition: background .12s;
}
.ss-contact-row:active, .ss-contact-row.ss-selected { background: var(--bg-hover); }

.ss-contact-av { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; position: relative; }
.ss-contact-av-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ss-contact-av-fallback {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--blue); color: white; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.ss-online::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; background: var(--green); border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.ss-contact-info { flex: 1; min-width: 0; }
.ss-contact-name { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-contact-sub  { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ss-contact-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); transition: .15s;
}
.ss-contact-check.ss-checked {
  background: var(--blue); border-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 12px;
}

.ss-invite-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--grad-brand); color: white; border: none; flex-shrink: 0;
}

/* Partage externe */
.ss-external-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 4px 16px 8px; -webkit-overflow-scrolling: touch; }
.ss-external-scroll::-webkit-scrollbar { display: none; }
.ss-external-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; cursor: pointer; }
.ss-external-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}
.ss-external-item span { font-size: 10px; color: var(--text-2); font-weight: 600; }

/* Barre de sélection / envoi */
.ss-selectbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-dark); border-top: 1px solid var(--border);
  flex-shrink: 0; font-size: 13px; color: var(--text-2); font-weight: 600;
}
.ss-send-btn {
  padding: 9px 22px; border-radius: 999px; border: none;
  background: var(--grad-brand); color: white; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-blue);
}
.ss-send-btn:disabled { opacity: .5; box-shadow: none; }