.wa-widget {
  position: fixed;
  bottom: calc(var(--wa-y, 24px) + env(safe-area-inset-bottom, 0px));
  z-index: var(--wa-z, 9999);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: #1b2b27
}

.wa-widget.wa-system-font {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif
}

.wa-widget * {
  box-sizing: border-box
}

.wa-right {
  right: var(--wa-x, 24px);
  align-items: flex-end
}

.wa-left {
  left: var(--wa-x, 24px);
  align-items: flex-start
}

.wa-widget :focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px
}

.wa-panel:focus {
  outline: none
}

.wa-launcher {
  position: relative;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wa-accent);
  color: var(--wa-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  transition: transform .2s
}

.wa-launcher:hover {
  transform: scale(1.06)
}

.wa-launcher svg {
  width: 30px;
  height: 30px
}

.wa-ico {
  display: flex
}

.wa-ico-x {
  display: none
}

.is-open .wa-ico-wa {
  display: none
}

.is-open .wa-ico-x {
  display: flex
}

.wa-launcher[aria-expanded=false] {
  animation: wa-ring 2.8s ease-out 1.5s 3
}

@keyframes wa-ring {
  0% {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 0 0 0 0 color-mix(in srgb, var(--wa-accent) 55%, transparent)
  }

  70%,
  100% {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 0 0 0 16px transparent
  }
}

.wa-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #d92d20;
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center
}

.wa-panel {
  width: 360px;
  max-width: calc(100vw - (2 * var(--wa-x, 24px)));
  max-height: min(620px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s, transform .2s
}

.wa-left .wa-panel {
  transform-origin: bottom left
}

.is-open .wa-panel {
  opacity: 1;
  transform: none
}

.wa-panel[hidden] {
  display: none
}

.wa-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--wa-header);
  color: var(--wa-header-text)
}

.wa-head-text {
  flex: 1;
  min-width: 0
}

.wa-title {
  font-weight: 600;
  font-size: 16px
}

.wa-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px
}

.wa-iconbtn {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center
}

.wa-iconbtn:hover {
  background: rgba(255, 255, 255, .18)
}

.wa-iconbtn svg {
  width: 22px;
  height: 22px
}

.wa-av {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wa-accent);
  color: var(--wa-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  overflow: hidden
}

.wa-av img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.wa-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9aa5a1
}

.wa-dot.is-on {
  background: var(--wa-accent);
  animation: wa-pulse 2s infinite
}

@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--wa-accent) 60%, transparent)
  }

  70% {
    box-shadow: 0 0 0 7px transparent
  }

  100% {
    box-shadow: 0 0 0 0 transparent
  }
}

.wa-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--wa-bg)
}

.wa-chat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 90px
}

.wa-bubble {
  display: inline-block;
  max-width: 88%;
  margin: 0 0 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 4px 14px 14px 14px;
  white-space: pre-line
}

.wa-typing {
  display: flex;
  gap: 4px;
  padding: 13px 14px
}

.wa-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7d8d88;
  animation: wa-blink 1.2s infinite
}

.wa-typing i:nth-child(2) {
  animation-delay: .2s
}

.wa-typing i:nth-child(3) {
  animation-delay: .4s
}

@keyframes wa-blink {

  0%,
  80%,
  100% {
    opacity: .3
  }

  40% {
    opacity: 1
  }
}

.wa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px
}

.wa-chip {
  padding: 7px 13px;
  border: 1px solid var(--wa-header);
  border-radius: 999px;
  background: #fff;
  color: color-mix(in srgb, var(--wa-header) 80%, #000);
  font: inherit;
  font-size: 13px;
  cursor: pointer
}

.wa-chip:hover {
  background: var(--wa-header);
  color: var(--wa-header-text)
}

.wa-agent {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer
}

.wa-agent:hover {
  border-color: var(--wa-header)
}

.wa-agent-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0
}

.wa-agent-text small {
  color: #4d5f59
}

.wa-foot {
  padding: 12px 16px 4px;
  background: #f4f8f6;
  border-top: 1px solid rgba(0, 0, 0, .08)
}

.wa-form {
  display: flex;
  gap: 8px
}

.wa-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #c7d4cf;
  border-radius: 21px;
  background: #fff;
  color: inherit;
  font: inherit
}

.wa-send {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 21px;
  background: var(--wa-accent);
  color: var(--wa-accent-text);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer
}

.wa-send svg {
  width: 20px;
  height: 20px
}

.wa-send-ico {
  display: flex
}

.wa-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #4d5f59
}

.wa-credit {
  padding: 8px 16px 10px;
  background: #f4f8f6;
  text-align: center;
  font-size: 12px;
  color: #4d5f59
}

.wa-credit a {
  color: color-mix(in srgb, var(--wa-header) 75%, #000);
  text-decoration: underline
}

.wa-invite {
  position: relative;
  max-width: 230px;
  background: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  animation: wa-in .3s
}

.wa-invite-text {
  display: block;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer
}

.wa-invite-x {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #33403c;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center
}

.wa-invite-x svg {
  width: 12px;
  height: 12px
}

.wa-left .wa-invite-x {
  left: auto;
  right: -8px
}

@keyframes wa-in {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@media (max-width:480px) {
  .wa-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform-origin: bottom center
  }

  .is-open .wa-launcher {
    display: none
  }
}

@media (prefers-reduced-motion:reduce) {
  .wa-widget * {
    animation: none !important;
    transition: none !important
  }
}
