/* HFV Trợ lý AI — widget chat */
#hfv-ai-nut {
  position: fixed; left: 18px; bottom: 18px; z-index: 99998;
  display: flex; align-items: center; gap: 8px;
  background: #172b4d; color: #fff; border: 0; border-radius: 24px;
  padding: 11px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .15s ease;
}
#hfv-ai-nut:hover { transform: translateY(-2px); background: #1f3a68; }
#hfv-ai-nut.hfv-ai-an { display: none; }

#hfv-ai-khung {
  position: fixed; left: 18px; bottom: 18px; z-index: 99999;
  width: 360px; max-width: calc(100vw - 36px);
  height: 480px; max-height: calc(100vh - 90px);
  display: none; flex-direction: column;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  font-size: 14.5px; line-height: 1.45;
}
#hfv-ai-khung.hfv-ai-mo { display: flex; }

#hfv-ai-dau {
  display: flex; align-items: flex-start; justify-content: space-between;
  background: #172b4d; color: #fff; padding: 12px 14px;
}
#hfv-ai-dau strong { font-size: 15.5px; }
#hfv-ai-phu { font-size: 11.5px; opacity: .8; margin-top: 2px; }
#hfv-ai-dong {
  background: none; border: 0; color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; padding: 0 4px; opacity: .85;
}
#hfv-ai-dong:hover { opacity: 1; }

#hfv-ai-vung { flex: 1; overflow-y: auto; padding: 12px; background: #f5f7fa; }

.hfv-ai-tin { display: flex; margin-bottom: 8px; }
.hfv-ai-tin-khach { justify-content: flex-end; }
.hfv-ai-bong {
  max-width: 85%; padding: 8px 12px; border-radius: 12px;
  white-space: pre-line; word-break: break-word;
}
.hfv-ai-tin-bot .hfv-ai-bong { background: #fff; border: 1px solid #e3e6ea; border-bottom-left-radius: 4px; color: #172b4d; }
.hfv-ai-tin-khach .hfv-ai-bong { background: #172b4d; color: #fff; border-bottom-right-radius: 4px; }
.hfv-ai-bong a { color: #0a66c2; text-decoration: underline; }
.hfv-ai-tin-khach .hfv-ai-bong a { color: #cfe3ff; }
.hfv-ai-cho .hfv-ai-bong { color: #7a869a; font-style: italic; }

#hfv-ai-goiy { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: #f5f7fa; }
#hfv-ai-goiy button {
  background: #fff; border: 1px solid #c6d0dd; color: #172b4d;
  border-radius: 14px; padding: 5px 11px; font-size: 12.5px; cursor: pointer;
}
#hfv-ai-goiy button:hover { border-color: #172b4d; }

#hfv-ai-chan { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e6ea; background: #fff; margin: 0; }
#hfv-ai-o {
  flex: 1; border: 1px solid #c6d0dd; border-radius: 8px; padding: 9px 11px;
  font-size: 14px; outline: none; min-width: 0;
}
#hfv-ai-o:focus { border-color: #172b4d; }
#hfv-ai-gui {
  background: #d32f2f; color: #fff; border: 0; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#hfv-ai-gui:hover { background: #b32424; }

@media (max-width: 480px) {
  /* Khung mở nổi trên cả bong bóng Zalo (Zalo dùng z-index rất lớn) */
  #hfv-ai-khung.hfv-ai-mo { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; height: 72vh; z-index: 2147483000; }
  #hfv-ai-nut { left: 12px; bottom: 12px; }
}
