.gh-whatsapp {
  --wa-inset: clamp(14px, 2.2vw, 28px);
  --wa-green: #136649;
  --wa-paper: #fff8ef;
  --wa-ink: #561724;
  --wa-visible-height: 100vh;
  --wa-visible-height: 100dvh;
  position: fixed;
  z-index: 10;
  right: max(var(--wa-inset), env(safe-area-inset-right));
  bottom: calc(max(var(--wa-inset), env(safe-area-inset-bottom)) + var(--wa-keyboard, 0px));
  color: var(--wa-ink);
  font: 400 1rem/1.4 var(--gh-sans, "Segoe UI", sans-serif);
  text-align: left;
}

.gh-whatsapp .gh-wa-toggle,
.gh-whatsapp .gh-wa-close {
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.gh-whatsapp .gh-wa-toggle {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 248, 239, .8);
  border-radius: 50%;
  background: var(--wa-green);
  color: white;
  box-shadow: 0 3px 14px #32141c42;
}

.gh-wa-toggle svg { width: 33px; height: 33px; }

.gh-whatsapp .gh-wa-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  box-sizing: border-box;
  width: min(21rem, calc(100vw - max(var(--wa-inset), env(safe-area-inset-right)) - max(var(--wa-inset), env(safe-area-inset-left))));
  max-height: calc(var(--wa-visible-height) - 64px - max(var(--wa-inset), env(safe-area-inset-top)) - max(var(--wa-inset), env(safe-area-inset-bottom)));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 17px 20px 20px;
  border: 1px solid #dbc3b9;
  border-radius: 14px;
  background: var(--wa-paper);
  box-shadow: 0 10px 42px #32141c35;
}

.gh-wa-panel[hidden] { display: none; }
.gh-wa-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.gh-wa-header h2 {
  margin: 0;
  font: 400 1.5rem/1.14 var(--gh-serif, Georgia, serif);
  letter-spacing: -.035em;
}

.gh-whatsapp .gh-wa-close {
  width: 44px;
  height: 44px;
  margin: -4px -7px 0 0;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--wa-ink);
}

.gh-wa-close svg { width: 18px; height: 18px; }
.gh-wa-panel label { display: block; margin: 15px 0 6px; font-size: .875rem; font-weight: 600; }

.gh-wa-panel textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 4rem;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #bba49e;
  border-radius: 6px;
  color: #361a20;
  background: white;
  font: inherit;
}

.gh-whatsapp .gh-wa-send {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--wa-green);
  color: white;
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 600;
}

.gh-whatsapp .gh-wa-send[aria-disabled=true] { color: #4e574f; background: #e0e6dd; }
.gh-whatsapp :is(button, a, textarea):focus-visible { outline: 2px solid #8c443c; outline-offset: 2px; }

@media (hover: hover) {
  .gh-whatsapp .gh-wa-toggle:hover,
  .gh-whatsapp .gh-wa-send[aria-disabled=false]:hover { background: #0a5138; }
  .gh-whatsapp .gh-wa-close:hover { background: #f2e2d9; }
}

@media (prefers-reduced-motion: no-preference) {
  .gh-wa-panel:not([hidden]) { animation: gh-wa-open .17s ease-out; }
  @keyframes gh-wa-open {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
  }
}
