.mgf-wa {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  font-family: Manrope, system-ui, sans-serif;
}
.mgf-wa-fab {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #2f9d92;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(36, 122, 114, 0.38);
  display: grid;
  place-items: center;
  text-decoration: none;
}
.mgf-wa-fab:hover { filter: brightness(1.06); }
.mgf-wa-badge {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e23d3d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.mgf-wa-badge.is-on { display: block; }
.mgf-wa-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(360px, calc(100vw - 28px));
  background: #fff;
  color: #163532;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(16, 40, 36, 0.22);
}
.mgf-wa.is-open .mgf-wa-panel { display: flex; flex-direction: column; }
.mgf-wa-head {
  background: #247a72;
  color: #fff;
  padding: 14px 16px;
}
.mgf-wa-head strong { display: block; font-size: 1rem; }
.mgf-wa-head span { font-size: 0.82rem; opacity: 0.92; }
.mgf-wa-log {
  height: 250px;
  overflow-y: auto;
  padding: 12px;
  background: #f3faf9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mgf-wa-empty {
  margin: auto;
  text-align: center;
  color: #5d7572;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0 8px;
}
.mgf-wa-msg {
  max-width: 86%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.mgf-wa-msg img,
.mgf-wa-msg video {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 4px;
}
.mgf-wa-msg audio { width: 100%; }
.mgf-wa-msg a { color: inherit; font-weight: 700; }
.mgf-wa-msg.is-visitor {
  margin-left: auto;
  background: #2f9d92;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.mgf-wa-msg.is-staff {
  margin-right: auto;
  background: #fff;
  border: 1px solid rgba(47, 157, 146, 0.22);
  border-bottom-left-radius: 4px;
}
.mgf-wa-form {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid rgba(47, 157, 146, 0.18);
  background: #fff;
}
.mgf-wa-form input,
.mgf-wa-form textarea {
  width: 100%;
  border: 1px solid #c9e4df;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  box-sizing: border-box;
}
.mgf-wa-form textarea {
  min-height: 44px;
  max-height: 90px;
  resize: none;
}
.mgf-wa-row {
  display: flex;
  gap: 8px;
}
.mgf-wa-attach {
  flex: 0 0 auto;
  width: 42px;
  border: 1px solid #c9e4df;
  border-radius: 10px;
  background: #f4fffd;
  font-size: 1.15rem;
  cursor: pointer;
}
.mgf-wa-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: #2f9d92;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.mgf-wa-err {
  display: none;
  padding: 0 10px 8px;
  color: #b42318;
  font-size: 0.8rem;
}
@media (max-width: 760px) {
  .mgf-wa { right: 12px; bottom: 12px; }
}
