/* ApSeed Support Chatbot styles */
.apseed-chat { max-width: 760px; margin: 0 auto; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.06); display:flex; flex-direction:column; height: 520px; max-height: 80vh; background:#fff; }
.apseed-chat__header { padding: 14px 16px; background:#fafafa; border-bottom:1px solid #eee; display:flex; gap:8px; align-items:center; }
.apseed-chat__title { font-weight:600; font-size:16px; margin:0; }
.apseed-chat__body { padding: 16px; flex:1 1 auto; min-height: 280px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.apseed-chat__bubble { max-width: 90%; padding: 12px 14px; border-radius: 14px; line-height:1.35; opacity:0; }
.apseed-chat__bubble--bot { align-self:flex-start; background:#f3f4f6; animation: apseedChatInLeft .26s ease-out forwards; transform-origin: bottom left; }
.apseed-chat__bubble--user { align-self:flex-end; background:#edf2ff; animation: apseedChatInRight .26s ease-out forwards; transform-origin: bottom right; }
.apseed-chat__choices { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; opacity:0; animation: apseedChoiceIn .2s ease-out .08s forwards; }
.apseed-chat__btn { appearance:none; border:1px solid #e5e7eb; background:#fff; border-radius:12px; padding:9px 12px; cursor:pointer; font-size:14px; }
.apseed-chat__btn:hover { background:#f8fafc; }
.apseed-chat__footer { display:flex; justify-content:space-between; padding:12px 16px; background:#fafafa; border-top:1px solid #eee; gap:8px; align-items:center; }
.apseed-chat__linkbtn { border:none; background:transparent; color:#334155; cursor:pointer; font-size:13px; text-decoration:underline; }
.apseed-chat__form { display:grid; gap:10px; margin-top:6px; }
.apseed-chat__input, .apseed-chat__textarea { width:100%; border:1px solid #e5e7eb; border-radius:10px; padding:10px 12px; font-size:14px; }
.apseed-chat__submit { border:none; border-radius:12px; padding:10px 14px; cursor:pointer; font-weight:600; background:#851515; color:#fff; }
.apseed-chat__note { font-size:12px; color:#64748b; margin-top:4px; }
.apseed-chat__small { font-size:12px; color:#64748b; }
.apseed-chat__kbd { font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; background:#f1f5f9; border:1px solid #e2e8f0; padding:1px 6px; border-radius:6px; }

/* Toast for new messages when scrolled up */
.apseed-chat__toast { position: sticky; bottom: 8px; align-self: center; background:#111827; color:#fff; padding:6px 10px; border-radius:999px; font-size:12px; box-shadow:0 8px 18px rgba(0,0,0,.18); cursor:pointer; opacity:0; transform: translateY(8px); transition: all .18s ease; z-index: 2; }
.apseed-chat__toast--show { opacity:1; transform: none; }

/* Typing indicator */
.apseed-chat__typing { align-self:flex-start; display:inline-flex; align-items:center; gap:8px; background:#f3f4f6; border-radius:14px; padding:10px 12px; }
.apseed-chat__dots { display:inline-flex; gap:4px; }
.apseed-chat__dot { width:6px; height:6px; background:#9ca3af; border-radius:50%; animation: apseedTyping 1.2s infinite ease-in-out; }
.apseed-chat__dot:nth-child(2){ animation-delay: .15s; }
.apseed-chat__dot:nth-child(3){ animation-delay: .3s; }
@keyframes apseedTyping { 0%, 80%, 100% { opacity:.3; transform: translateY(0);} 40% { opacity:1; transform: translateY(-2px);} }

@keyframes apseedChatInLeft { from { opacity:0; transform: translateY(8px) translateX(-8px) scale(.98); } to { opacity:1; transform: none; } }
@keyframes apseedChatInRight{ from { opacity:0; transform: translateY(8px) translateX(8px) scale(.98); } to { opacity:1; transform: none; } }
@keyframes apseedChoiceIn { from { opacity:0; transform: translateY(6px);} to { opacity:1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .apseed-chat__body { scroll-behavior: auto; }
  .apseed-chat__bubble { opacity: 1 !important; animation: none !important; }
  .apseed-chat__choices { opacity: 1 !important; animation: none !important; }
}
