/* Widget chatbot de navigation — réutilise les tokens du design system
   (--color-accent, --color-surface, --radius, --shadow…) pour suivre le thème. */

.tcb-bubble {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent, #2980b9);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: transform 0.15s ease, background-color 0.2s;
}
.tcb-bubble:hover { transform: scale(1.06); background: var(--color-accent-light, #3498db); }
.tcb-bubble svg { width: 26px; height: 26px; }

.tcb-panel {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--color-surface, #fff);
    color: var(--color-text, #2c3e50);
    border: 1px solid var(--color-border, #e0e4e8);
    border-radius: var(--radius, 8px);
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.2));
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}
.tcb-panel.tcb-open { display: flex; }

.tcb-header {
    background: var(--color-accent, #2980b9);
    color: #fff;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tcb-header .tcb-close {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 1.3rem; line-height: 1; padding: 0 4px;
}

.tcb-log {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.9rem;
    line-height: 1.45;
}
.tcb-msg { max-width: 90%; padding: 9px 12px; border-radius: var(--radius, 8px); white-space: pre-wrap; word-wrap: break-word; }
.tcb-msg-user { align-self: flex-end; background: var(--color-accent, #2980b9); color: #fff; }
.tcb-msg-bot  { align-self: flex-start; background: var(--color-bg, #f4f7f9); border: 1px solid var(--color-border, #e0e4e8); }
.tcb-msg-bot.tcb-error { color: #c0392b; }

.tcb-sources { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-border, #e0e4e8); font-size: 0.78rem; }
.tcb-sources strong { display: block; margin-bottom: 4px; color: var(--color-text-light, #5a6a7a); font-weight: 600; }
.tcb-sources a { display: block; color: var(--color-accent, #2980b9); text-decoration: none; margin: 2px 0; }
.tcb-sources a:hover { text-decoration: underline; }
.tcb-sources .tcb-tag { font-size: 0.7rem; opacity: 0.7; }

.tcb-typing { align-self: flex-start; color: var(--color-text-light, #5a6a7a); font-style: italic; font-size: 0.85rem; }

.tcb-form {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid var(--color-border, #e0e4e8);
    background: var(--color-surface, #fff);
}
.tcb-form input {
    flex: 1;
    padding: 9px 11px;
    border: 1px solid var(--color-border, #e0e4e8);
    border-radius: var(--radius, 8px);
    background: var(--color-bg, #fff);
    color: var(--color-text, #2c3e50);
    font-size: 0.9rem;
}
.tcb-form input:focus { outline: none; border-color: var(--color-accent, #2980b9); }
.tcb-form button {
    padding: 0 14px;
    border: none;
    border-radius: var(--radius, 8px);
    background: var(--color-accent, #2980b9);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.tcb-form button:disabled { opacity: 0.5; cursor: default; }

.tcb-disclaimer { padding: 0 14px 10px; font-size: 0.7rem; color: var(--color-text-light, #5a6a7a); }

@media (max-width: 480px) {
    .tcb-panel { right: 10px; left: 10px; width: auto; bottom: 80px; }
    .tcb-bubble { right: 14px; bottom: 14px; }
}
