/* ===============================
   SHARE MODAL — CENTER POPUP EDITION
   Root wrapper: <div id="shareModalRoot">
   Body lock class: body.shm-modal-open
   =============================== */

#shareModalRoot {
  --shm-bg: #f4f5f8;
  --shm-panel: rgba(255, 255, 255, 0.96);
  --shm-panel-2: rgba(248, 249, 251, 0.92);
  --shm-text: #111827;
  --shm-muted: #6b7280;
  --shm-line: rgba(17, 24, 39, 0.08);
  --shm-shadow: 0 28px 90px rgba(17, 24, 39, 0.22);
  --shm-shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.08);
  --shm-accent: #6d5efc;
  --shm-accent-2: #ff6b9a;
  --shm-accent-3: #18c29c;
  --shm-radius-xl: 32px;
  --shm-radius-lg: 24px;
  --shm-radius-md: 18px;
  --shm-radius-sm: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.shm-modal-open {
  overflow: hidden;
}

/* Overlay */
#shareModalRoot .shm-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.2), transparent 32%),
    rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
  z-index: 1000;
}

#shareModalRoot .shm-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Main centered popup */
#shareModalRoot .shm-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

#shareModalRoot .shm-modal.is-active {
  opacity: 1;
  visibility: visible;
}

#shareModalRoot .shm-card {
  pointer-events: auto;
  position: relative;
  width: min(560px, calc(100vw - 28px));
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 252, 0.96));
  box-shadow: var(--shm-shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
  transform: translateY(18px) scale(0.94);
  opacity: 0;
  transition:
    transform 0.34s cubic-bezier(0.2, 0.92, 0.2, 1),
    opacity 0.34s ease;
  overflow: hidden;
}

#shareModalRoot .shm-modal.is-active .shm-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#shareModalRoot .shm-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 252, 0.96));
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
}

#shareModalRoot .shm-card-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#shareModalRoot .shm-top {
  padding: 16px 16px 12px;
  position: relative;
  flex: none;
}

#shareModalRoot .shm-grabber {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.10);
  margin: 0 auto 14px;
}

#shareModalRoot .shm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 24, 39, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #111827;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#shareModalRoot .shm-close:hover {
  transform: scale(1.04);
  box-shadow: 0 14px 26px rgba(17, 24, 39, 0.10);
}

#shareModalRoot .shm-close svg {
  width: 18px;
  height: 18px;
}

#shareModalRoot .shm-header {
  padding: 4px 8px 0;
}

#shareModalRoot .shm-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--shm-text);
}

#shareModalRoot .shm-subtitle {
  display: none;
}

/* Body */
#shareModalRoot .shm-body {
  padding: 0 16px 12px;
  min-height: 0;
}

#shareModalRoot .shm-section {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 249, 0.96));
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: var(--shm-shadow-soft);
  padding: 14px;
  margin-bottom: 12px;
}

#shareModalRoot .shm-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#shareModalRoot .shm-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--shm-text);
}

#shareModalRoot .shm-section-head span {
  font-size: 12px;
  color: var(--shm-muted);
  white-space: nowrap;
}

/* Share rows */
#shareModalRoot .shm-share-list {
  display: grid;
  gap: 10px;
}

#shareModalRoot .shm-share-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.04);
}

#shareModalRoot .shm-share-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

#shareModalRoot .shm-share-row.is-active {
  background: rgba(244, 246, 248, 0.96);
}

#shareModalRoot .shm-share-left {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}

#shareModalRoot .shm-share-name {
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #111827;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareModalRoot .shm-share-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

#shareModalRoot .shm-mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#shareModalRoot .shm-mini-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.10);
}

#shareModalRoot .shm-mini-btn svg {
  width: 15px;
  height: 15px;
}

#shareModalRoot .shm-share-row.is-highlight {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 247, 0.96));
}

#shareModalRoot .shm-ic {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  border-radius: 50%;
  font-size: 14px;
}

/* App colors */
#shareModalRoot .shm-li {
  background: #0a66c2;
}

#shareModalRoot .shm-gm {
  background: linear-gradient(135deg, #ea4335 0%, #fbbc05 35%, #34a853 70%, #4285f4 100%);
}

#shareModalRoot .shm-wa {
  background: #25d366;
}

#shareModalRoot .shm-fb {
  background: #1877f2;
}

#shareModalRoot .shm-tg {
  background: #229ed9;
}

/* Bottom line */
#shareModalRoot .shm-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

#shareModalRoot .shm-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--shm-muted);
  font-weight: 500;
  padding-left: 4px;
  min-width: 0;
}

#shareModalRoot .shm-privacy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareModalRoot .shm-copy-link {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#shareModalRoot .shm-copy-link:hover {
  transform: translateY(-1px);
  background: rgba(17, 24, 39, 0.08);
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.08);
}

/* Bottom dock */
#shareModalRoot .shm-dock {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px) scale(0.96);
  width: min(560px, calc(100vw - 28px));
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.92, 0.2, 1);
}

#shareModalRoot .shm-dock.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

#shareModalRoot .shm-dock-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;

    padding:10px;

    border-radius:999px;

    background:rgba(255,255,255,.94);
    backdrop-filter:blur(18px);

    border:1px solid rgba(255,255,255,.9);

    box-shadow:
    0 18px 45px rgba(0,0,0,.12);
}

#shareModalRoot .shm-dock-btn{

    flex:1;

    height:52px;

    border:0;

    background:transparent;

    border-radius:999px;

    display:flex;

    align-items:center;

    justify-content:center;

    gap:10px;

    color:#344054;

    font-size:14px;

    font-weight:700;

    cursor:pointer;

    transition:.22s;
}

#shareModalRoot .shm-dock-btn svg{

    width:20px;

    height:20px;

    stroke-width:2;
}

#shareModalRoot .shm-dock-btn:hover{

    background:rgba(0,0,0,.04);
}

#shareModalRoot .shm-dock-btn.is-active{

    flex:1.45;

    background:#111827;

    color:#fff;

    box-shadow:
    0 10px 24px rgba(17,24,39,.22);
}

#shareModalRoot .shm-dock-btn.is-active svg{

    stroke:#fff;
}

#shareModalRoot .shm-dock-btn span{

    white-space:nowrap;

    font-weight:700;

    letter-spacing:-.02em;
}



#shareModalRoot .shm-dock-share {
  min-width: 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  padding: 0 18px;
}

#shareModalRoot .shm-dock-share .shm-share-dot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.06);
}

/* People page */
#shareModalRoot .shm-people-page {
  position: fixed;
  inset: 0;
  z-index: 1003;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.985);
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease,
    transform 0.28s cubic-bezier(0.2, 0.92, 0.2, 1);
  background:
    radial-gradient(circle at top, rgba(109, 94, 252, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(242, 245, 250, 0.98));
  display: flex;
  flex-direction: column;
}

#shareModalRoot .shm-people-page.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#shareModalRoot .shm-people-head {
  flex: none;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
}

#shareModalRoot .shm-people-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#shareModalRoot .shm-back {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(17, 24, 39, 0.06);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #111827;
  transition: transform 0.18s ease, background 0.18s ease;
}

#shareModalRoot .shm-back:hover {
  transform: scale(1.04);
  background: rgba(17, 24, 39, 0.08);
}

#shareModalRoot .shm-back svg {
  width: 18px;
  height: 18px;
}

#shareModalRoot .shm-people-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--shm-text);
  text-align: center;
  flex: 1;
}

#shareModalRoot .shm-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.06);
}

#shareModalRoot .shm-search svg {
  opacity: 0.55;
  flex: none;
}

#shareModalRoot .shm-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--shm-text);
}

#shareModalRoot .shm-people-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 22px;
}

#shareModalRoot .shm-people-body::-webkit-scrollbar {
  width: 10px;
}

#shareModalRoot .shm-people-body::-webkit-scrollbar-thumb {
  background: rgba(17, 24, 39, 0.12);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

#shareModalRoot .shm-suggest-wrap,
#shareModalRoot .shm-list-wrap {
  max-width: 760px;
  margin: 0 auto 16px;
}

#shareModalRoot .shm-suggest-head,
#shareModalRoot .shm-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

#shareModalRoot .shm-suggest-head h3,
#shareModalRoot .shm-list-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--shm-text);
}

#shareModalRoot .shm-suggest-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

#shareModalRoot .shm-suggest-row::-webkit-scrollbar {
  display: none;
}

#shareModalRoot .shm-suggest-card {
  flex: 0 0 auto;
  width: 76px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  scroll-snap-align: start;
  padding: 0;
  transition: transform 0.18s ease;
}

#shareModalRoot .shm-suggest-card:active {
  transform: scale(0.98);
}

#shareModalRoot .shm-suggest-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
  color: #475467;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow:
    0 8px 18px rgba(17, 24, 39, 0.10),
    inset 0 0 0 2px rgba(255, 255, 255, 0.92);
  flex: none;
}

#shareModalRoot .shm-suggest-avatar img,
#shareModalRoot .shm-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#shareModalRoot .shm-suggest-name {
  width: 100%;
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
  color: #344054;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareModalRoot .shm-list {
  display: grid;
  gap: 10px;
}

#shareModalRoot .shm-list-item {
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#shareModalRoot .shm-list-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

#shareModalRoot .shm-list-item.is-current {
  background: rgba(244, 246, 248, 0.96);
}

#shareModalRoot .shm-list-avatar {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
  color: #475467;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

#shareModalRoot .shm-list-name {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--shm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareModalRoot .shm-list-tail {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.05);
  color: rgba(17, 24, 39, 0.72);
}

/* Toast */
#shareModalRoot .shm-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.92);
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
  z-index: 1105;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#shareModalRoot .shm-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Empty */
#shareModalRoot .shm-empty {
  padding: 16px;
  text-align: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed rgba(17, 24, 39, 0.10);
  color: var(--shm-muted);
  font-size: 13px;
}

/* Mobile */
@media (max-width: 520px) {
  #shareModalRoot .shm-card {
    width: calc(100vw - 18px);
    border-radius: 26px;
  }

  #shareModalRoot .shm-title {
    font-size: 20px;
  }

  #shareModalRoot .shm-body,
  #shareModalRoot .shm-top {
    padding-left: 12px;
    padding-right: 12px;
  }

  #shareModalRoot .shm-section {
    padding: 12px;
    border-radius: 22px;
  }

  #shareModalRoot .shm-share-name {
    font-size: 16px;
  }

  #shareModalRoot .shm-dock {
    bottom: 16px;
    width: calc(100vw - 18px);
  }

  #shareModalRoot .shm-dock-bar {
    padding: 10px 10px;
    gap: 6px;
  }

  #shareModalRoot .shm-dock-share {
    min-width: 100px;
    font-size: 14px;
  }

  #shareModalRoot .shm-people-head {
    padding: 14px 14px 12px;
  }

  #shareModalRoot .shm-people-body {
    padding: 14px;
  }

  #shareModalRoot .shm-list-item {
    padding: 11px 12px;
  }

  #shareModalRoot .shm-list-name {
    font-size: 14px;
  }
}

