
/* Auto insert is mobile-first */
@media (min-width: 783px){
  #an-mobile-chat-search.anmcs-auto{ display:none; }
}
@media (max-width: 782px){
  #an-mobile-chat-search.anmcs-auto{ display:block; }
}

/* Sticky opener bar */
.anmcs-sticky{
  position: sticky;
  top: 0;
  z-index: 9997;
  background:#f7fbf8;
  border-bottom:1px solid #e9e9e9;
  padding:8px 10px;
}
.anmcs-open{
  width:100%;
  height:48px;
  border-radius:9999px;
  border:1px solid #cfd8d3;
  background:#fff;
  display:flex; align-items:center; gap:8px; justify-content:center;
  font-size:16px;
}

/* Fullscreen panel */
.anmcs-panel{
  position: fixed;
  inset:0;
  background: rgba(10, 61, 36, 0.04);
  display:none;
  z-index: 9998;
}
.anmcs-panel.active{ display:block; }
.anmcs-chat{
  position:absolute; left:0; right:0; bottom:0; top:12%;
  background:#fff;
  border-top-left-radius:16px; border-top-right-radius:16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,.15);
  display:flex; flex-direction:column;
}
.anmcs-header{ display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid #eee; }
.anmcs-title{ font-weight:600; }
.anmcs-close{ background:none; border:0; font-size:24px; line-height:1; }

.anmcs-thread{ padding:14px; overflow:auto; flex:1 1 auto; }
.anmcs-bubble{ display:flex; gap:10px; margin-bottom:12px; }
.anmcs-bubble.user{ justify-content:flex-end; }
.anmcs-bubble.bot{ justify-content:flex-start; }
.anmcs-bubble .avatar{ width:28px; height:28px; border-radius:8px; background:#eef3f0; display:flex; align-items:center; justify-content:center; font-weight:600; }
.anmcs-msg{ max-width:86%; padding:10px 12px; border-radius:14px; line-height:1.5; font-size:15px; }
.user .anmcs-msg{ background:#e7f5ee; border:1px solid #cfe9dd; }
.bot .anmcs-msg{ background:#f7fbf8; border:1px solid #e6efe9; }

.anmcs-item{ margin-top:8px; padding:8px 10px; border-radius:12px; border:1px solid #eef0ef; background:#fff; }
.anmcs-item a{ text-decoration:none; color:#0a3d24; font-weight:600; display:block; margin-bottom:2px; }
.anmcs-item .excerpt{ font-size:13px; opacity:.85; }

.anmcs-typing{ display:inline-block; width:28px; }
.anmcs-typing span{ display:inline-block; width:5px; height:5px; border-radius:50%; background:#9bb7aa; margin-right:3px; animation: anmcs-bounce 1.2s infinite ease-in-out; }
.anmcs-typing span:nth-child(2){ animation-delay: .15s; }
.anmcs-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes anmcs-bounce{ 0%,80%,100%{transform:scale(0);opacity:.5;} 40%{transform:scale(1);opacity:1;} }

.anmcs-inputbar{ border-top:1px solid #e6e6e6; display:flex; gap:8px; padding:10px; }
.anmcs-input{ flex:1 1 auto; height:48px; border-radius:9999px; border:1px solid #cfd8d3; padding:0 14px; font-size:15px; outline:none; }
.anmcs-send{ height:48px; padding:0 16px; border-radius:9999px; border:0; background:#009345; color:#fff; }

/* Quick prompt chips */
.anmcs-suggest{ display:flex; gap:8px; padding:0 10px 6px; flex-wrap:wrap; }
.anmcs-chip{ background:#f0f6f3; border:1px solid #d7e6de; border-radius:9999px; padding:6px 10px; font-size:13px; }

/* Placement helper for auto mode */
#an-mobile-chat-search.anmcs-auto{ }
