/* HTL FAQ chat widget — drop-in styles. Scoped via #htl-chat- prefix. */
#htl-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1f3a93;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
}
#htl-chat-launcher:hover { background: #2746b8; }

#htl-chat-window {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #222;
}
#htl-chat-window.open { display: flex; }

#htl-chat-header {
  background: #1f3a93;
  color: #fff;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#htl-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

#htl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fb;
}
.htl-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.htl-msg.user {
  align-self: flex-end;
  background: #1f3a93;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.htl-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e3e5ec;
  border-bottom-left-radius: 4px;
}
.htl-msg.bot p { margin: 0 0 8px 0; }
.htl-msg.bot p:last-child { margin-bottom: 0; }
.htl-msg.bot ul, .htl-msg.bot ol { margin: 4px 0 8px 0; padding-left: 22px; }
.htl-msg.bot li { margin: 2px 0; }
.htl-msg.bot code { background: #f1f1f6; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.htl-msg.bot a { color: #1f3a93; text-decoration: underline; }
.htl-msg.bot strong { font-weight: 600; }
.htl-msg.bot.loading::after {
  content: "...";
  display: inline-block;
  animation: htl-dots 1.4s infinite;
}
@keyframes htl-dots {
  0%, 20%   { content: "."; }
  40%       { content: ".."; }
  60%, 100% { content: "..."; }
}

#htl-chat-input-row {
  border-top: 1px solid #e3e5ec;
  padding: 10px;
  display: flex;
  gap: 8px;
  background: #fff;
}
#htl-chat-input {
  flex: 1;
  border: 1px solid #d0d3dc;
  border-radius: 20px;
  padding: 8px 14px;
  font: inherit;
  outline: none;
}
#htl-chat-input:focus { border-color: #1f3a93; }
#htl-chat-send {
  background: #1f3a93;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
#htl-chat-send:disabled { background: #aab; cursor: not-allowed; }

#htl-chat-footer {
  font-size: 11px;
  color: #888;
  text-align: center;
  padding: 6px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}
