/* Khung "Tư vấn viên AI". Đặt bên trái để không che khung nhắn tin sẵn có ở bên phải. */
.ai-fab { position: fixed; left: 20px; bottom: 100px; z-index: 1500; display: flex; align-items: center; gap: .5rem;
    border: 0; border-radius: 999px; padding: .8rem 1.2rem; background: var(--accent-color); color: #fff;
    font-weight: 700; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.ai-panel { position: fixed; left: 20px; bottom: 100px; z-index: 1600; width: min(420px, calc(100vw - 24px));
    height: min(620px, calc(100dvh - 115px)); display: flex; flex-direction: column; background: #fff;
    border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); font-size: .9rem; }
.ai-panel[hidden], .ai-fab[hidden], .ai-view[hidden] { display: none !important; }
.ai-head { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; background: var(--primary-color); color: #fff; }
.ai-head div { flex: 1; }
.ai-head small { display: block; font-size: .72rem; opacity: .7; }
.ai-icon { background: none; border: 0; color: #fff; padding: .25rem .4rem; }
.ai-tabs { display: flex; border-bottom: 1px solid #e5e7eb; }
.ai-tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: .55rem; font-weight: 600; color: #6b7280; }
.ai-tabs button[aria-selected="true"] { color: var(--accent-color); border-bottom-color: var(--accent-color); }
.ai-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-scroll { overflow-y: auto; padding: .9rem; gap: .6rem; }
.ai-scroll > * { flex-shrink: 0; }
.ai-log { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; background: var(--bg-warm); }
.ai-log > * { flex-shrink: 0; }
.ai-msg { max-width: 90%; padding: .55rem .8rem; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-bot { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; }
.ai-user { align-self: flex-end; background: var(--primary-color); color: #fff; }
.ai-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ai-chips button { background: #fff; border: 1px solid #d1d5db; border-radius: 999px; padding: .35rem .75rem; font-size: .8rem; }
.ai-chips button:hover { border-color: var(--accent-color); color: var(--accent-color); }
.ai-car { display: flex; justify-content: space-between; gap: .5rem; background: #fff; border: 1px solid #e5e7eb;
    border-left: 4px solid var(--accent-color); border-radius: 8px; padding: .5rem .75rem; color: inherit; text-decoration: none; }
.ai-car strong { white-space: nowrap; color: var(--accent-color); }
.ai-sources { font-size: .75rem; }
.ai-sources a { display: block; }
.ai-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid #e5e7eb; }
.ai-form input { flex: 1; min-width: 0; border: 1px solid #d1d5db; border-radius: 999px; padding: .5rem .9rem; }
.ai-form button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--accent-color); color: #fff; }
.ai-form button:disabled, .ai-primary:disabled { opacity: .5; }
.ai-primary { border: 0; border-radius: 999px; padding: .6rem 1rem; background: var(--accent-color); color: #fff; font-weight: 700; }
.ai-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .8rem; }
.ai-table th, .ai-table td { border: 1px solid #e5e7eb; padding: .4rem; vertical-align: top; overflow-wrap: anywhere; }
.ai-table th:first-child { width: 22%; color: #6b7280; }
.ai-view label { display: block; font-weight: 600; }
.ai-hint { color: #6b7280; font-size: .78rem; margin: 0; }
.ai-result { background: var(--bg-warm); border-radius: 10px; padding: .75rem; white-space: pre-line; }
.ai-result b { display: block; font-size: 1.5rem; color: var(--accent-color); }
/* Chừa chỗ cho dải quảng cáo ở đáy trang của Somee (gói miễn phí). */
#user-chat-widget { bottom: 100px !important; }
#user-chat-panel { max-height: calc(100dvh - 180px); }
