/* Khung chat Sách Nhà Đậu. Mọi class có tiền tố nd-chat- nên không ảnh hưởng CSS khác. */
#nd-chat { --c: var(--bean, #2f7d4f); --c-deep: var(--bean-deep, #1f5a38); --c-pale: var(--bean-pale, #e6f2ea); font-family: inherit; }
.nd-chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 1040; display: inline-flex; align-items: center; gap: .5rem;
  background: var(--c); color: #fff; border: 0; border-radius: 999px; padding: .7rem 1.05rem; font-weight: 600; font-size: .95rem;
  box-shadow: 0 6px 20px rgba(31,90,56,.35); cursor: pointer; }
.nd-chat-fab:hover { background: var(--c-deep); }
.nd-chat-fab svg { flex: none; }
.nd-chat-panel { position: fixed; right: 18px; bottom: 18px; z-index: 1041; width: 370px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 36px); background: #fff; border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.22); overflow: hidden; }
.nd-chat-panel[hidden] { display: none; }
.nd-chat-head { background: var(--c); color: #fff; padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.nd-chat-head strong { display: block; font-size: 1rem; }
.nd-chat-head small { opacity: .9; font-size: .78rem; }
.nd-chat-head button { background: transparent; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.nd-chat-body { flex: 1; overflow-y: auto; padding: .9rem; background: #f6f8f6; display: flex; flex-direction: column; gap: .55rem; }
.nd-msg { max-width: 86%; padding: .55rem .8rem; border-radius: 14px; font-size: .93rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.nd-msg.bot { background: #fff; color: #1e2b3a; border: 1px solid #e3e8e4; border-bottom-left-radius: 4px; align-self: flex-start; }
.nd-msg.me { background: var(--c); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.nd-typing { display: inline-flex; gap: 4px; align-items: center; padding: .7rem .8rem; }
.nd-typing span { width: 7px; height: 7px; background: #9aa8a0; border-radius: 50%; animation: nd-bounce 1s infinite ease-in-out; }
.nd-typing span:nth-child(2) { animation-delay: .15s; } .nd-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes nd-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
.nd-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-self: flex-start; }
.nd-chips button { background: #fff; color: var(--c-deep); border: 1.5px solid var(--c); border-radius: 999px; padding: .3rem .75rem; font-size: .84rem; cursor: pointer; }
.nd-chips button:hover { background: var(--c-pale); }
.nd-cards { display: flex; flex-direction: column; gap: .45rem; align-self: flex-start; width: 90%; }
.nd-card { display: flex; gap: .6rem; background: #fff; border: 1px solid #e3e8e4; border-radius: 12px; padding: .5rem; text-decoration: none; color: inherit; }
.nd-card:hover { border-color: var(--c); color: inherit; }
.nd-card img, .nd-card .nd-noimg { width: 52px; height: 68px; object-fit: cover; border-radius: 6px; background: var(--c-pale); flex: none; }
.nd-card b { display: block; font-size: .88rem; line-height: 1.25; color: #1e2b3a; }
.nd-card .nd-price { color: var(--c-deep); font-weight: 700; font-size: .9rem; }
.nd-card .nd-st { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; margin-left: .3rem; background: var(--c-pale); color: var(--c-deep); }
.nd-card .nd-st.held, .nd-card .nd-st.deposited { background: #fff3d6; color: #8a5a00; }
.nd-card .nd-st.sold { background: #eee; color: #666; }
.nd-chat-form { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid #e3e8e4; background: #fff; }
.nd-chat-form input { flex: 1; border: 1.5px solid #d6ddd8; border-radius: 999px; padding: .5rem .9rem; font-size: .93rem; outline: none; }
.nd-chat-form input:focus { border-color: var(--c); }
.nd-chat-form button { background: var(--c); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nd-chat-form button:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
  .nd-chat-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .nd-chat-fab span { display: none; }
}
