/* ChatBot widget — usa as cores de marca do tema (com fallback). */
.cb-root {
  --cb-primary: var(--bs-primary, #2572FF);
  --cb-primary-dark: #003059;
  --cb-ink: #1E1E2C;
  --cb-muted: #6A7180;
  --cb-line: #E6EDF6;
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  font-family: 'Manrope', system-ui, sans-serif;
}
.cb-toggle {
  display: flex; align-items: center; gap: .5rem; cursor: pointer; border: 0;
  background: var(--cb-primary); color: #fff; font-weight: 700; font-size: 15px;
  padding: 14px 18px; border-radius: 999px; box-shadow: 0 12px 30px -8px rgba(0,48,89,.5);
  transition: transform .2s ease, background .2s ease;
}
.cb-toggle:hover { transform: translateY(-2px); background: var(--cb-primary-dark); }
.cb-toggle svg { width: 22px; height: 22px; }

.cb-panel {
  position: absolute; right: 0; bottom: 70px; width: 370px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 120px); background: #fff; border: 1px solid var(--cb-line);
  border-radius: 18px; box-shadow: 0 24px 60px -20px rgba(0,48,89,.45); display: none;
  flex-direction: column; overflow: hidden;
}
.cb-root.is-open .cb-panel { display: flex; }
.cb-header {
  background: linear-gradient(120deg, var(--cb-primary-dark), var(--cb-primary)); color: #fff;
  padding: 16px 18px; font-weight: 800; display: flex; align-items: center; justify-content: space-between;
}
.cb-header .cb-close { background: none; border: 0; color: #fff; cursor: pointer; font-size: 22px; line-height: 1; }
.cb-body { flex: 1; overflow-y: auto; padding: 16px; background: #F6F9FC; display: flex; flex-direction: column; gap: 10px; }
.cb-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.cb-msg.bot { background: #fff; border: 1px solid var(--cb-line); color: var(--cb-ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.cb-msg.user { background: var(--cb-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.cb-sources { font-size: 11px; color: var(--cb-muted); align-self: flex-start; margin-top: -4px; }
.cb-typing { font-size: 13px; color: var(--cb-muted); align-self: flex-start; font-style: italic; }
.cb-footer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--cb-line); background: #fff; }
.cb-input { flex: 1; resize: none; border: 1px solid var(--cb-line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; max-height: 90px; }
.cb-input:focus { outline: 2px solid color-mix(in srgb, var(--cb-primary) 35%, transparent); border-color: var(--cb-primary); }
.cb-send { border: 0; background: var(--cb-primary); color: #fff; border-radius: 12px; padding: 0 16px; cursor: pointer; font-weight: 700; }
.cb-send:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
  .cb-root { right: 14px; bottom: 14px; }
  .cb-panel { width: calc(100vw - 28px); height: calc(100vh - 100px); }
}
.cb-msg.bot a { color: var(--cb-primary); text-decoration: underline; word-break: break-word; }
.cb-msg.bot strong { font-weight: 700; }
.cb-msg.bot .cb-list { margin: 6px 0; padding-left: 20px; }
.cb-msg.bot .cb-list li {
  margin: 2px 0;
  list-style: disclosure-closed!important;
}
