#social-launcher {
  position: fixed;
  z-index: 30;
  right: max(12px, calc(var(--gutter) * .45));
  bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
}

.social-links {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px);
  transition: width .28s cubic-bezier(.22,.68,0,1), opacity .18s ease, transform .28s cubic-bezier(.22,.68,0,1), visibility 0s linear .28s;
}

.social-launcher.is-open .social-links {
  width: 224px;
  max-width: calc(100vw - 112px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0s;
}

.social-link,
.social-toggle,
.social-whatsapp {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 7px 24px rgba(0, 0, 0, .24);
}

.social-link {
  color: var(--fg);
  background: var(--panel);
  transition: color .16s ease, transform .16s ease, border-color .16s ease;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.social-link:nth-child(1) { color: #25d366; }
.social-link:nth-child(2) { color: #e1306c; }
.social-link:nth-child(3) { color: #1877f2; }
.social-link:nth-child(4) { color: #ff3030; }
.social-link:nth-child(5) { color: #1d9bf0; }
.social-link svg { width: 18px; height: 18px; fill: currentColor; }

.social-toggle {
  color: var(--fg);
  background: var(--panel);
  font-size: 22px;
  transition: color .16s ease, border-color .16s ease, transform .24s ease;
}

.social-toggle:hover,
.social-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.social-toggle span {
  display: block;
  line-height: 1;
  transition: transform .24s ease;
}

.social-toggle[aria-expanded="true"] span { transform: rotate(45deg); }

.social-whatsapp {
  width: 46px;
  height: 46px;
  border: 0;
  color: #fff;
  background: #20bf5a;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .32);
  transition: transform .16s ease, filter .16s ease;
}

.social-whatsapp:hover { transform: translateY(-2px); filter: brightness(1.08); }
.social-whatsapp svg { width: 23px; height: 23px; fill: currentColor; }

@media (max-width: 520px) {
  #social-launcher { right: 12px; bottom: calc(49px + env(safe-area-inset-bottom, 0px)); gap: 5px; }
  .social-links { gap: 5px; }
  .social-launcher.is-open .social-links { width: 190px; max-width: calc(100vw - 108px); }
  .social-link, .social-toggle { width: 34px; height: 34px; }
  .social-link svg { width: 16px; height: 16px; }
  .social-toggle { font-size: 19px; }
  .social-whatsapp { width: 44px; height: 44px; }
  .social-whatsapp svg { width: 21px; height: 21px; }
}

@media (max-width: 340px) {
  #social-launcher { right: 12px; gap: 4px; }
  .social-links { gap: 4px; }
  .social-launcher.is-open .social-links { width: 161px; max-width: calc(100vw - 95px); }
  .social-link { width: 29px; height: 29px; }
  .social-link svg { width: 15px; height: 15px; }
  .social-toggle { width: 32px; height: 32px; }
  .social-whatsapp { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .social-links, .social-link, .social-toggle span, .social-whatsapp { transition: none; }
}
