/* Une conversation lisible ; les choix de contexte restent dans le menu +. */
.chatbot-drawer { width: 440px; height: 650px; max-height: calc(100dvh - 40px); isolation: isolate; }
.chatbot-drawer [hidden] { display: none !important; }
.chatbot-header { flex-shrink: 0; }
.chatbot-avatar { display: none; }
.chatbot-subtitle { font-size: 12px; }
.chatbot-title { font-size: 17px; }
.chat-context { display: flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 12px; color: #aaa; border-bottom: 1px solid #292929; flex-shrink: 0; }
.chat-context > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-context button, .chat-picker-heading button { background: none; border: 0; color: #bbb; cursor: pointer; padding: 4px; }
.chatbot-messages { min-height: 0; flex: 1; overflow: auto; }
.chatbot-suggestions { display: none !important; }
.chatbot-bubble { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.chatbot-msg-user .chat-user-text { white-space: pre-wrap; }
.chatbot-bubble h1, .chatbot-bubble h2, .chatbot-bubble h3, .chatbot-bubble h4 { font-size: 16px; line-height: 1.4; margin: 14px 0 8px; padding: 0; border: 0; background: none; }
.chatbot-bubble h1::after, .chatbot-bubble h2::after, .chatbot-bubble h3::after { display: none; }
.chatbot-bubble p, .chatbot-bubble li { font-size: 14px; line-height: 1.65; }
.chatbot-bubble ul, .chatbot-bubble ol { margin: 8px 0; padding-left: 22px; }
.chatbot-empty-state { padding: 36px 12px; }
.chatbot-empty-title { font-size: 20px; }
.chatbot-empty-sub { max-width: 290px; font-size: 13px; line-height: 1.7; }
.chatbot-input-bar { flex-shrink: 0; padding: 12px 14px 6px; }
.chatbot-input-container { align-items: flex-end; gap: 8px; padding: 8px; }
.chatbot-textarea { font-size: 14px; padding: 8px 0; min-height: 36px; }
.chat-add { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border: 0; border-radius: 50%; background: none; color: #bbb; font-size: 25px; cursor: pointer; }
.chat-add:hover, .chat-add[aria-expanded=true] { color: #fff; background: #333; }
.chatbot-footer-caption { font-size: 10px; padding: 4px 10px 10px; flex-shrink: 0; }
.chat-picker { position: absolute; inset: 105px 10px 88px; padding: 14px; background: #202020; border: 1px solid #404040; border-radius: 12px; z-index: 3; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 32px #0008; animation: chat-picker-in .15s ease-out; }
.chat-picker-heading { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.chat-picker-heading button { font-size: 22px; }
.chat-all { text-align: left; padding: 10px; background: #292929; border: 1px solid #444; border-radius: 8px; color: #ddd; font-size: 13px; cursor: pointer; }
.chat-all[aria-pressed=true] { border-color: #aaa; }
.chat-picker input[type=search] { width: 100%; background: #171717; color: #ddd; border: 1px solid #444; padding: 10px; border-radius: 8px; font-size: 13px; }
.chat-course-list { flex: 1; min-height: 0; overflow-y: auto; }
.chat-course { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 8px; background: transparent; border: 0; border-bottom: 1px solid #333; text-align: left; color: #ddd; font-size: 13px; cursor: pointer; }
.chat-course > span:first-child { flex: 1; }
.chat-course small { display: block; color: #999; font-size: 11px; margin-bottom: 3px; }
.chat-course-plus { font-size: 20px; width: 26px; height: 26px; text-align: center; color: #bbb; }
.chat-course:hover, .chat-course[aria-pressed=true] { background: #303030; border-radius: 6px; }
.chat-search-option { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #bbb; }
.chat-picker > small { color: #888; font-size: 11px; }
#chatbot-picker-status:empty { display: none; }
#chatbot-picker-status, .chat-no-result, .chat-error { font-size: 12px; color: #d9a99d; padding: 8px; }
.chat-sources { font-size: 11px; color: #999; margin-top: 12px; }
.chat-sources summary { cursor: pointer; }
.chat-sources a { display: block; color: #bbb; margin: 6px 0; font-size: 11px; }
.chatbot-drawer button:focus-visible, .chatbot-drawer input:focus-visible, .chatbot-drawer textarea:focus-visible { outline: 2px solid #aaa; outline-offset: 2px; }
@keyframes chat-picker-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) { .chatbot-drawer { inset: auto 8px 8px; width: calc(100vw - 16px); height: min(650px, calc(100dvh - 16px)); max-height: calc(100dvh - 16px); } }
@media (prefers-reduced-motion: reduce) { .chat-picker { animation: none; } }

.chatbot-working { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.chatbot-working strong { display: block; font-size: 13px; font-weight: 500; color: #ddd; }
.chatbot-working small { display: block; font-size: 11px; line-height: 1.5; color: #999; margin-top: 3px; }
.chat-working-spinner { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid #444; border-top-color: #ccc; border-radius: 50%; animation: chat-working-spin .8s linear infinite; }
#chatbot-working-time { margin-left: auto; white-space: nowrap; color: #888; font-size: 11px; }
.chatbot-input-bar.is-generating .chatbot-send-btn { opacity: .35; cursor: wait; }
@keyframes chat-working-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chat-working-spinner { animation: none; border-top-color: #ccc; } }
