/* AF SEO Agent -- public chatbot widget. Scoped under #af-chatbot-root so it never leaks into or is affected by the site's theme styles. */
#af-chatbot-root { position: fixed; z-index: 999999; bottom: 20px; right: 20px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#af-chatbot-root * { box-sizing: border-box; }

#af-chat-launcher { width: 58px; height: 58px; border-radius: 50%; background: #2c5f2d; color: #fff; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: 26px; display: flex; align-items: center; justify-content: center; }
#af-chat-launcher:hover { background: #244f25; }

#af-chat-panel { display: none; flex-direction: column; width: 340px; max-width: calc(100vw - 40px); height: 460px; max-height: calc(100vh - 100px); position: absolute; bottom: 72px; right: 0; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.25); overflow: hidden; }
#af-chat-panel.af-chat-open { display: flex; }

#af-chat-header { background: #2c5f2d; color: #fff; padding: 12px 14px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
#af-chat-header small { display: block; font-size: 11px; font-weight: 400; opacity: .8; margin-top: 1px; }
#af-chat-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; line-height: 1; opacity: .85; }
#af-chat-close:hover { opacity: 1; }

#af-chat-log { flex: 1; overflow-y: auto; padding: 12px; font-size: 13.5px; line-height: 1.5; background: #f7f7f5; }
.af-chat-msg { margin-bottom: 10px; max-width: 88%; padding: 8px 11px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; }
.af-chat-msg-user { margin-left: auto; background: #2c5f2d; color: #fff; border-bottom-right-radius: 2px; }
.af-chat-msg-bot { margin-right: auto; background: #fff; color: #222; border: 1px solid #e2e2e0; border-bottom-left-radius: 2px; }
.af-chat-msg-bot a { color: #2c5f2d; text-decoration: underline; }
.af-chat-msg-bot strong { font-weight: 700; }
.af-chat-msg-bot hr { border: none; border-top: 1px solid #e5e5e3; margin: 8px 0; }
.af-chat-msg-system { text-align: center; color: #888; font-size: 12px; margin: 6px 0; }

#af-chat-newsletter-row { display: none; align-items: center; gap: 7px; padding: 7px 12px; font-size: 12px; color: #444; background: #f0f4ef; border-top: 1px solid #e5e5e3; cursor: pointer; }
#af-chat-newsletter-row.af-chat-newsletter-visible { display: flex; }
#af-chat-newsletter-row input { margin: 0; }

.af-chat-typing { display: inline-flex; gap: 4px; align-items: center; padding: 11px 13px; }
.af-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9a9a95; display: inline-block; animation: af-chat-bounce 1.2s infinite ease-in-out; }
.af-chat-typing span:nth-child(2) { animation-delay: .15s; }
.af-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes af-chat-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

#af-chat-inputbar { display: flex; border-top: 1px solid #e5e5e3; padding: 8px; gap: 6px; }
#af-chat-input { flex: 1; resize: none; border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; font-family: inherit; height: 38px; }
#af-chat-send { background: #2c5f2d; color: #fff; border: none; border-radius: 8px; padding: 0 14px; cursor: pointer; font-size: 13px; }
#af-chat-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
	#af-chat-panel { width: calc(100vw - 24px); right: -8px; }
}
