/* YK 9 - AI thật + nguồn web + Markdown đẹp */
.web-chip { border-color: #a7d8d3; color: var(--primary-dark); background: #ecfdf5; font-weight: 750; }
.web-chip:hover { border-color: var(--primary); background: #dcfce7; }
.ai-status.ai-offline { color: #b45309 !important; }
.ai-status.ai-offline .status-dot { background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.send-btn:disabled, .compose-row textarea:disabled { opacity: .55; cursor: wait; }
.ai-thinking { display: flex; align-items: center; gap: 5px; min-height: 48px; }
.thinking-dot { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: ykThinking 1s infinite ease-in-out; }
.thinking-dot:nth-child(2) { animation-delay: .15s; }
.thinking-dot:nth-child(3) { animation-delay: .3s; }
@keyframes ykThinking { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
.msg-sources { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e7eef0; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-sources strong { width: 100%; color: #64748b; font-size: 10px; }
.msg-sources a { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 8px; border-radius: 999px; background: #f0fdfa; color: var(--primary-dark); font-size: 10px; text-decoration: none; }
.msg-sources a:hover { text-decoration: underline; }

.msg-content { line-height: 1.62; overflow-wrap: anywhere; }
.markdown-body p { margin: 0 0 9px; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5 {
  margin: 16px 0 7px;
  line-height: 1.35;
  color: #183b3b;
  font-weight: 800;
}
.markdown-body h2:first-child, .markdown-body h3:first-child, .markdown-body h4:first-child, .markdown-body h5:first-child { margin-top: 0; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body h4, .markdown-body h5 { font-size: 14px; }
.markdown-body strong { font-weight: 800; color: #163434; }
.markdown-body em { font-style: italic; }
.markdown-body ul, .markdown-body ol { margin: 7px 0 11px 20px; padding: 0; }
.markdown-body li { margin: 4px 0; padding-left: 2px; }
.markdown-body hr { border: 0; border-top: 1px solid #dbe8e8; margin: 14px 0; }
.markdown-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; padding: 1px 5px; border-radius: 5px; background: #f1f5f9; }
