/* Briqo — assistant LearnBriq. Accent modifiable via --cb-accent. */
:root { --cb-accent: #4f46e5; }

.cb-launcher {
  position: fixed; right: 20px; bottom: 20px;
  width: 56px; height: 56px; border: none; border-radius: 50%;
  background: var(--cb-accent); color: #fff; font-size: 24px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.cb-launcher:hover { transform: scale(1.06); }

.cb-panel {
  position: fixed; right: 20px; bottom: 88px;
  width: 360px; max-width: calc(100vw - 40px);
  height: 520px; max-height: calc(100vh - 120px);
  background: #fff; color: #1f2937; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  display: none; flex-direction: column; overflow: hidden; z-index: 9999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cb-panel.cb-open { display: flex; }

.cb-header {
  background: var(--cb-accent); color: #fff; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.cb-title { font-weight: 600; font-size: 14px; }
.cb-close { background: none; border: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

.cb-messages {
  flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc;
  display: flex; flex-direction: column; gap: 8px;
}
.cb-msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 14px;
  line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.cb-bot { align-self: flex-start; background: #eef2ff; color: #1f2937; border-bottom-left-radius: 4px; }
.cb-user { align-self: flex-end; background: var(--cb-accent); color: #fff; border-bottom-right-radius: 4px; }
.cb-typing { opacity: .6; font-style: italic; }

.cb-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; background: #fff; }
.cb-input { flex: 1; border: 1px solid #d1d5db; border-radius: 20px; padding: 9px 14px; font-size: 14px; outline: none; }
.cb-input:focus { border-color: var(--cb-accent); }
.cb-send {
  border: none; background: var(--cb-accent); color: #fff; width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 15px; flex: none;
}
.cb-notice { font-size: 11px; color: #6b7280; text-align: center; padding: 4px 10px 10px; background: #fff; }

.cb-teaser {
  position: fixed; right: 20px; bottom: 86px; max-width: 260px;
  background: #fff; color: #1f2937; padding: 12px 30px 12px 14px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: 13px; line-height: 1.4; z-index: 9997;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.cb-teaser.cb-teaser-show { opacity: 1; transform: translateY(0); pointer-events: auto; cursor: pointer; }
.cb-teaser-close {
  position: absolute; top: 4px; right: 8px; background: none; border: none;
  font-size: 18px; color: #9ca3af; line-height: 1; cursor: pointer;
}

/* Au-dessus de la bottom-nav mobile de learnbriq (valeurs d'origine récupérées) */
@media (max-width: 900px) {
  .cb-launcher { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .cb-panel {
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - 190px);
  }
  .cb-teaser { bottom: calc(138px + env(safe-area-inset-bottom, 0px)); }
}
