:root {
  --wa-theme: #25d366;
  --wa-theme-dark: #1ebc58;
  --wa-surface: #ffffff;
  --wa-bg: #e5ddd5;
  --wa-text: #111827;
  --wa-muted: #6b7280;
  --wa-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  --wa-radius: 16px;
  --wa-z: 2147483000;
  --wa-btn-size: 60px;
  --wa-gap: 20px;
  --wa-width: min(92vw, 360px);
  --wa-height: min(70vh, 500px);
}

.wa-widget {
  position: fixed;
  right: var(--wa-gap);
  bottom: var(--wa-gap);
  z-index: var(--wa-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
}

.wa-widget.left {
  left: var(--wa-gap);
  right: auto;
  align-items: flex-start;
}

.wa-chatbox {
  width: var(--wa-width);
  height: var(--wa-height);
  background: var(--wa-surface);
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
  overflow: hidden;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
  display: grid;
  grid-template-rows: auto 1fr auto;
  pointer-events: auto;
}

.wa-chatbox.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.wa-header {
  background: var(--wa-theme);
  color: #fff;
  padding: 14px 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--wa-theme);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.wa-meta {
  min-width: 0;
}

.wa-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-status {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.95;
}

.wa-close {
  margin-left: auto;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.wa-body {
  background: var(--wa-bg);
  padding: 14px;
  overflow: auto;
}

.wa-bubble {
  max-width: 86%;
  background: #fff;
  color: #111827;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.wa-time {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--wa-muted);
}

.wa-footer {
  border-top: 1px solid #e5e7eb;
  background: #fff;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.wa-input {
  flex: 1;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #111827;
}

.wa-input:focus {
  border-color: var(--wa-theme);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.wa-send {
  border: 0;
  background: var(--wa-theme);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.wa-send:hover {
  background: var(--wa-theme-dark);
}

.wa-launcher-wrap {
  position: relative;
  pointer-events: auto;
}

.wa-launcher {
  width: var(--wa-btn-size);
  height: var(--wa-btn-size);
  border: 0;
  border-radius: 50%;
  background: var(--wa-theme);
  color: #fff;
  box-shadow: var(--wa-shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
  animation: waPulseIn 520ms ease both;
}

.wa-launcher:hover {
  background: var(--wa-theme-dark);
  transform: translateY(-1px);
}

.wa-launcher svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.wa-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
  display: none;
}

.wa-badge.show {
  display: block;
}

@media (max-width: 480px) {
  :root {
    --wa-gap: 14px;
    --wa-btn-size: 56px;
    --wa-width: calc(100vw - 22px);
    --wa-height: min(72vh, 470px);
  }
}

@keyframes waPulseIn {
  0% {
    transform: scale(0.84);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
