:root { --radius: 7px; }
.wa-chat {
  position: fixed;
  z-index: 990;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--pm-consent-lift, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  overflow: visible;
  font-family: Manrope, system-ui, sans-serif;
  color: #050505;
}

body:has(#mago-invoke) .wa-chat {
  right: max(clamp(16px, 2.5vw, 34px), env(safe-area-inset-right));
  bottom: calc(clamp(16px, 2.5vw, 30px) + 76px + var(--pm-consent-lift, 0px));
}

.wa-launcher {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 1px solid rgba(5, 5, 5, 0.14);
  border-radius: var(--radius);
  background: #fff;
  color: #4900e8;
  box-shadow: 0 16px 40px rgba(5, 5, 5, 0.16);
  cursor: pointer;
}

.wa-launcher:hover {
  color: #050505;
}

.wa-launcher:focus-visible,
.wa-close:focus-visible,
.wa-send:focus-visible {
  outline: 2px solid #4900e8;
  outline-offset: 3px;
}

.wa-launcher svg {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: block;
  overflow: visible;
  border-radius: 0;
  clip-path: none;
}

.wa-panel {
  position: relative;
  width: min(320px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: min(420px, calc(100svh - 120px - var(--pm-consent-lift, 0px)));
  overflow: auto;
  padding: 18px 18px 16px;
  border: 1px solid rgba(5, 5, 5, 0.1);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(5, 5, 5, 0.16);
}

.wa-panel[hidden] {
  display: none;
}

.wa-panel-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 36px;
}

.wa-panel-top img {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius:  50%;
  object-fit: cover;
  object-position: center 18%;
  background: #050505;
}

.wa-panel-top p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.wa-greeting {
  margin: 16px 0 0;
  color: rgba(5, 5, 5, 0.78);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.wa-send {
  min-height: 48px;
  margin-top: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  background: #050505;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wa-send svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  overflow: visible;
  border-radius: 0;
  clip-path: none;
}

.wa-send:hover {
  background: #4900e8;
}

.wa-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #050505;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 680px) {
  .wa-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--pm-consent-lift, 0px));
  }

  body:has(#mago-invoke) .wa-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 74px + var(--pm-consent-lift, 0px));
  }
}

@media (max-width: 759px) {
  body:has(#mago-invoke) .wa-chat {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 74px + var(--pm-consent-lift, 0px));
  }

  body:has(#mago-invoke) .site-footer {
    padding-bottom: calc(168px + env(safe-area-inset-bottom));
  }
}

body:not(:has(#mago-invoke)) main {
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
}
