/* Trợ lý Market Hub (assets/assistant.js) — khung tối, điểm nhấn vàng, giống nhau ở chế độ sáng/tối của site. */
#mha-root { --mha-bg: #0c0c11; --mha-card: #17171f; --mha-line: #ffffff17; --mha-text: #f3f1ec; --mha-muted: #a3a3b2; --mha-gold: #eaa944;
  --mha-gold-grad: linear-gradient(135deg, #fbe3b1, #f2c26c 45%, #d99a2b); position: fixed; right: 16px; bottom: 16px; z-index: 9990;
  font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--mha-text); }
#mha-root * { box-sizing: border-box; }
.mha-fab { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 13px 20px; border: 0; border-radius: 999px; background: var(--mha-gold-grad);
  color: #1a1206; font: 800 15px/1 inherit; cursor: pointer; box-shadow: 0 12px 30px -10px #d99a2bcc, inset 0 1px #ffffff80; }
.mha-fab:hover { filter: brightness(1.05); }
/* Nút Zalo nổi (24/11/2026): tròn xanh ngay trên nút trợ lý, ẩn khi khung chat mở. */
.mha-zfab { position: relative; display: grid; place-items: center; width: 54px; height: 54px; margin: 0 0 12px auto; border-radius: 50%; background: #0068ff;
  color: #fff; font: 800 13px/1 inherit; text-decoration: none; box-shadow: 0 10px 24px -8px #0068ffcc; }
.mha-zfab:hover { filter: brightness(1.08); }
.mha-zfab::before { content: ""; position: absolute; inset: -6px; border: 2px solid #0068ff66; border-radius: 50%; animation: mha-ring 2.2s ease-out infinite; pointer-events: none; }
@keyframes mha-ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
#mha-root.is-open .mha-zfab { display: none; }
/* Nút Facebook (02/12/2026): tròn xanh Facebook ngay trên nút Zalo. */
.mha-fbfab { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 0 12px auto; border-radius: 50%; background: #1877f2; color: #fff; text-decoration: none; box-shadow: 0 10px 24px -8px #1877f2cc; }
.mha-fbfab:hover { filter: brightness(1.08); color: #fff; }
#mha-root.is-open .mha-fbfab { display: none; }
@media (prefers-reduced-motion: reduce) { .mha-zfab::before { animation: none; } }
.mha-fab:focus-visible, #mha-root button:focus-visible, #mha-root a:focus-visible { outline: 2px solid #fbe3b1; outline-offset: 2px; }
.mha-panel { position: absolute; right: 0; bottom: 64px; display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 100px));
  overflow: hidden; border: 1px solid var(--mha-line); border-radius: 22px; background: var(--mha-bg); box-shadow: 0 30px 70px -20px #000000d9; }
.mha-panel[hidden] { display: none; }
.mha-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--mha-line); background: #121218; }
.mha-head > div { flex: 1; min-width: 0; }
.mha-head b { display: block; font-size: 15px; font-weight: 800; }
.mha-head small { display: block; margin-top: 2px; color: var(--mha-muted); font-size: 12px; }
.mha-avatar { position: relative; display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--mha-gold-grad); color: #1a1206; }
.mha-avatar i { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2px solid #121218; border-radius: 50%; background: #22c55e; }
.mha-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--mha-muted); cursor: pointer; }
.mha-x:hover { background: #ffffff10; color: var(--mha-text); }
.mha-body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.mha-row { display: flex; gap: 8px; margin-bottom: 12px; }
.mha-user { justify-content: flex-end; }
.mha-mini { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: #ffffff0d; color: var(--mha-gold); }
.mha-mini svg { width: 16px; height: 16px; }
.mha-msg { max-width: 85%; padding: 11px 14px; border-radius: 16px; background: var(--mha-card); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.mha-assistant .mha-msg { border-top-left-radius: 6px; }
.mha-user .mha-msg { border-top-right-radius: 6px; background: #3a2c12; color: #fdecc8; }
.mha-msg a { color: #f5c26b; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mha-msg b { color: #fff; }
.mha-li { display: block; position: relative; padding-left: 14px; }
.mha-li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--mha-gold); }
.mha-typing .mha-msg { color: var(--mha-muted); animation: mha-pulse 1s infinite alternate; }
@keyframes mha-pulse { to { opacity: .4; } }
.mha-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 4px 0 12px 36px; }
.mha-chip { padding: 8px 13px; border: 1px solid #eaa94466; border-radius: 999px; background: #eaa9440d; color: var(--mha-text); font: 600 13px/1.35 inherit; text-align: left; cursor: pointer; }
.mha-chip:hover { border-color: var(--mha-gold); background: #eaa9441f; }
.mha-form { display: flex; gap: 8px; padding: 12px 14px 10px; border-top: 1px solid var(--mha-line); }
.mha-form textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 12px 14px; border: 1px solid var(--mha-line); border-radius: 14px; background: #ffffff08;
  color: var(--mha-text); font: 14px/1.45 inherit; resize: none; }
.mha-form textarea::placeholder { color: var(--mha-muted); }
.mha-form textarea:focus { outline: none; border-color: #eaa94499; }
.mha-form button { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 0; border-radius: 14px; background: var(--mha-gold-grad); color: #1a1206; cursor: pointer; }
.mha-human { display: flex; gap: 8px; padding: 0 14px 8px; }
.mha-zalo { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid #0068ff55; border-radius: 12px; background: #0068ff14; color: var(--mha-text); text-decoration: none; }
.mha-zalo:hover { background: #0068ff26; }
.mha-zalo > span { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: #0068ff; color: #fff; font-size: 10px; font-weight: 800; }
.mha-zalo b { display: block; color: #7fb2ff; font-size: 13px; }
.mha-zalo small { display: block; color: var(--mha-muted); font-size: 11.5px; }
.mha-callback { flex: none; padding: 0 12px; border: 1px solid var(--mha-line); border-radius: 12px; background: #ffffff08; color: var(--mha-text); font: 700 12.5px/1.2 inherit; cursor: pointer; }
.mha-callback:hover { border-color: #eaa94499; }
.mha-lead { display: grid; gap: 8px; margin: 0 14px 8px; padding: 12px; border: 1px solid var(--mha-line); border-radius: 14px; background: var(--mha-card); }
.mha-lead[hidden] { display: none; }
.mha-lead > b { font-size: 13px; }
.mha-lead input { padding: 10px 12px; border: 1px solid var(--mha-line); border-radius: 10px; background: #ffffff08; color: var(--mha-text); font: 14px inherit; }
.mha-lead input:focus { outline: none; border-color: #eaa94499; }
.mha-lead div { display: flex; gap: 8px; }
.mha-lead div button { padding: 9px 14px; border: 0; border-radius: 10px; background: var(--mha-gold-grad); color: #1a1206; font: 800 13px inherit; cursor: pointer; }
.mha-lead div .mha-lead-cancel { background: transparent; color: var(--mha-muted); }
.mha-lead button:disabled { opacity: .6; }
.mha-lead-msg { margin: 0; color: var(--mha-muted); font-size: 12.5px; }
.mha-foot { margin: 0; padding: 0 16px 12px; color: var(--mha-muted); font-size: 11px; line-height: 1.5; text-align: center; }
@media (max-width: 480px) {
  #mha-root { right: 12px; bottom: 12px; }
  .mha-fab span { display: none; }
  .mha-fab { padding: 14px; }
  .mha-zfab { width: 48px; height: 48px; margin-bottom: 10px; font-size: 12px; }
  .mha-fbfab { width: 48px; height: 48px; margin-bottom: 10px; }
  #mha-root.is-open .mha-panel { position: fixed; inset: 8px 8px 76px; width: auto; height: auto; }
}
@media print { #mha-root { display: none; } }
