.ws-whatsapp {
  position: fixed;
  z-index: 40;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  font: 400 1rem/1.4 Inter, system-ui, sans-serif;
  color: #fff;
}

.ws-whatsapp svg {
  display: block;
  width: 1.4em;
  height: 1.4em;
  flex: none;
}

.ws-whatsapp__launcher,
.ws-whatsapp__close {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.ws-whatsapp__launcher {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #e8c86a;
  color: #17130b;
  font: inherit;
  font-size: 1.25rem;
  box-shadow: 0 8px 26px rgb(0 0 0 / 40%);
}

.ws-whatsapp__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + .75rem);
  box-sizing: border-box;
  width: min(22rem, calc(100vw - max(1rem, env(safe-area-inset-right)) - max(1rem, env(safe-area-inset-left))));
  max-height: calc(100vh - 6.25rem - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 6.25rem - env(safe-area-inset-bottom));
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #2a2a2a;
  border-radius: 1.25rem;
  background: #111;
  box-shadow: 0 22px 60px rgb(0 0 0 / 45%);
  text-align: left;
}

.ws-whatsapp__panel[hidden] {
  display: none;
}

.ws-whatsapp__header {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.75rem;
  align-items: center;
  gap: .625rem;
  min-height: 4rem;
  padding: .5rem .625rem .5rem .875rem;
  border-bottom: 1px solid #2a2a2a;
}

.ws-whatsapp__avatar {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #2a2210;
  color: #e8c86a;
}

.ws-whatsapp__avatar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  width: .625rem;
  height: .625rem;
  border: 2px solid #111;
  border-radius: 50%;
  background: #e8c86a;
  content: "";
}

.ws-whatsapp__identity h2 {
  margin: 0;
  color: #fff;
  font: 700 .9375rem/1.25 Inter, system-ui, sans-serif;
}

.ws-whatsapp__identity p {
  margin: .1875rem 0 0;
  color: #a0a0a0;
  font: 400 .75rem/1.3 Inter, system-ui, sans-serif;
}

.ws-whatsapp__close {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: transparent;
  color: #c8c8c8;
  font: inherit;
  font-size: .875rem;
}

.ws-whatsapp__body {
  display: grid;
  gap: .75rem;
  padding: .875rem;
}

.ws-whatsapp__bubble,
.ws-whatsapp__message {
  box-sizing: border-box;
  margin: 0;
  padding: .625rem .75rem;
  border: 1px solid #353535;
  border-radius: .75rem;
  background: #1c1c1c;
  color: #fff;
}

.ws-whatsapp__bubble {
  justify-self: start;
  font: 400 .875rem/1.4 Inter, system-ui, sans-serif;
}

.ws-whatsapp__message {
  width: 100%;
  min-height: 4.875rem;
  max-height: 12rem;
  resize: vertical;
  font: 400 1rem/1.4 Inter, system-ui, sans-serif;
}

.ws-whatsapp__panel .ws-whatsapp__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #fde9a8, #e8b84b 58%, #d9a441);
  color: #000;
  font: 700 .875rem/1.3 Inter, system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
}

.ws-whatsapp__action svg {
  width: 1rem;
  height: 1rem;
}

.ws-whatsapp :is(button, a):hover {
  filter: brightness(1.12);
}

.ws-whatsapp :is(button, a, textarea):focus-visible {
  outline: 2px solid #fde9a8;
  outline-offset: 2px;
}

@media (max-width: 360px) {
  .ws-whatsapp__message {
    min-height: 5.625rem;
  }
}
