#wpca-chat-button{
  position:fixed; bottom:24px; right:24px; background:url("../img/avatar.png") center/cover no-repeat transparent;
  color:#fff; border:none; width:115px; height:115px; font-size:32px; cursor:pointer; z-index:10000;
  transition:box-shadow .2s;
}

#wpca-chat-box{
  position:fixed; bottom:100px; right:24px; width:560px; min-height:140px; max-width:90%; background:#f9f9fb; border:none; border-radius:18px; padding:8px 0 0 0; display:none; z-index:9999; box-shadow:0 8px 32px rgba(0,0,0,.18);
  font-family:'Segoe UI','Roboto',Arial,sans-serif; transition:min-height .2s;
}
#wpca-chat-minimize{
  position:absolute; top:10px; right:10px; background:none; border:none; font-size:28px; line-height:1;
  color:#0073aa; cursor:pointer; z-index:10001;
}

.wpca-screen{ padding:24px 20px 20px 20px }
#wpca-login-screen{ display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:100px }
#wpca-chat-screen{ display:none }

.wpca-screen > .elementor-button-link{
  background-color: #b87de0; padding: 10px 48px; color: #fff; border-radius: 5px;
}

#wpca-chat-box input, #wpca-chat-box textarea{
  width:100%; margin-bottom:12px; border-radius:8px; border:1px solid #e0e0e0; padding:8px; font-size:15px;
}
#wpca-user-msg{ resize:none; width:100%; box-sizing:border-box }

.chat-messages{
  height:320px; width:100%; overflow-y:auto; border:none; background:#fff; padding:10px; margin-bottom:12px; font-size:15px;
  border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,.04);
}

.wpca-msg-row{ display:flex; align-items:flex-start; margin:10px 0 }
.wpca-msg-user{ flex-direction:row-reverse }
.wpca-msg-bot{ flex-direction:row }

.wpca-msg-icon{
  width:32px; height:32px; border-radius:50%; background:#e3eafc; display:flex; align-items:center; justify-content:center;
  font-size:20px; margin:0 8px;
}
.wpca-msg-bubble{
  max-width:82%; padding:10px 16px; border-radius:16px; background:#e3eafc; color:#222; font-size:12px;
  box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.wpca-msg-user .wpca-msg-bubble{ background:#0073aa; color:#fff }

.wpca-loader{ display:flex; align-items:center; justify-content:flex-start; margin-bottom:10px }
.wpca-loader[hidden]{ display:none }
.wpca-loader-dot{
  width:8px; height:8px; background:#00c6fb; border-radius:50%; margin-right:4px; animation:wpca-bounce 1s infinite alternate;
}
.wpca-loader-dot:nth-child(2){ animation-delay:.2s }
.wpca-loader-dot:nth-child(3){ animation-delay:.4s }
.wpca-loader-text{ margin-left:8px; color:#0073aa; font-size:14px }

@keyframes wpca-bounce { to { transform: translateY(-6px) } }

.wpca-actions{ display:flex; gap:8px; align-items:center }
.wpca-actions #wpca-msg-send{
    flex: 1 1 0;
    background: #00c6fb;
    color: #fff;
    border: none;
    border-radius: 8px;
    height: 44px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
.wpca-actions #wpca-end-chat{
  background:#e74c3c; color:#fff; border:none; border-radius:8px; height:44px; width:44px; display:flex; align-items:center; justify-content:center; font-size:22px; cursor:pointer;
}

/* Utility */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Selezione argomento */
.wpca-topic-title{
  margin: 0 0 12px 0; font-size:16px; color:#222; font-weight:600;
}
.wpca-topic-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  max-height: 400px;
}
.wpca-topic-btn{
  background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:10px 12px; cursor:pointer;
  box-shadow:0 1px 3px rgba(0,0,0,.05); text-align:center; font-size:14px;
}
.wpca-topic-btn:hover{ border-color:#0073aa }

@media (max-width: 640px){
  #wpca-chat-box{
    right: 12px; left: 12px; width: auto;
    bottom: 90px;
    max-height: 80vh;
  }
  .chat-messages{ height: 45vh; }
}
