@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

  :root {
    /* ---- Couleurs : reprises de la charte Orée Numérique (navy + or) ---- */
    --oree-primary: #1e4e8c;       /* moss — bleu de marque */
    --oree-primary-dark: #163a68;
    --oree-accent: #cf9021;        /* brass — or, accent secondaire */
    --oree-bg: #f8f7f3;            /* paper — fond ivoire chaud */
    --oree-bot-bubble: #efece3;    /* paper-2 */
    --oree-user-bubble: #1e4e8c;
    --oree-text: #0e1a30;          /* ink — bleu marine */
    --oree-text-light: #4b5773;    /* ink-soft */
    --oree-border: #ddd8ca;        /* hairline */
    --oree-radius: 16px;
    --oree-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }

  #oree-chatbot-root, #oree-chatbot-root * {
    box-sizing: border-box;
    font-family: var(--oree-font);
  }

  /* ---------- Bulle flottante ---------- */
  .oree-cb-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--oree-primary);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999998;
    transition: transform 0.15s ease;
    isolation: isolate;
  }
  .oree-cb-launcher:hover { transform: scale(1.06); }
  .oree-cb-launcher svg { width: 30px; height: 30px; }

  /* Halo pulsant continu pour attirer l'œil sur la bulle */
  .oree-cb-launcher::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid var(--oree-accent);
    opacity: 0;
    animation: oreeCbLauncherPulse 2.6s ease-out infinite;
    pointer-events: none;
    z-index: -1;
  }
  @keyframes oreeCbLauncherPulse {
    0% { transform: scale(0.92); opacity: 0.9; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .oree-cb-launcher::before { animation: none; opacity: 0; }
  }
  .oree-cb-launcher .oree-cb-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--oree-accent);
    border: 2px solid #fff;
    display: none;
  }
  .oree-cb-launcher.oree-cb-has-badge .oree-cb-dot { display: block; }

  /* ---------- Bulle-teaser (message spontané) ---------- */
  .oree-cb-teaser {
    position: fixed;
    right: 90px;
    bottom: 30px;
    max-width: 230px;
    background: #fff;
    color: var(--oree-text);
    border: 1px solid var(--oree-border);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 999997;
    display: none;
    cursor: pointer;
  }
  .oree-cb-teaser.oree-cb-show { display: block; animation: oreeCbFadeUp 0.25s ease; }
  .oree-cb-teaser button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--oree-border);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    color: var(--oree-text-light);
  }

  /* ---------- Fenêtre de chat ---------- */
  .oree-cb-window {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: var(--oree-bg);
    border-radius: var(--oree-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
  }
  .oree-cb-window.oree-cb-open { display: flex; animation: oreeCbFadeUp 0.2s ease; }

  .oree-cb-header {
    background: var(--oree-primary);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .oree-cb-header .oree-cb-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .oree-cb-header .oree-cb-avatar svg { width: 18px; height: 18px; }
  .oree-cb-header-text { flex: 1; min-width: 0; }
  .oree-cb-header-text strong { display: block; font-size: 14.5px; }
  .oree-cb-header-text span { display: block; font-size: 12px; opacity: 0.85; }
  .oree-cb-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    opacity: 0.85;
  }
  .oree-cb-close:hover { opacity: 1; }

  .oree-cb-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafbfa;
  }

  .oree-cb-msg { display: flex; }
  .oree-cb-msg.oree-cb-bot { justify-content: flex-start; }
  .oree-cb-msg.oree-cb-user { justify-content: flex-end; }
  .oree-cb-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
  }
  .oree-cb-bot .oree-cb-bubble {
    background: var(--oree-bot-bubble);
    color: var(--oree-text);
    border-bottom-left-radius: 4px;
  }
  .oree-cb-user .oree-cb-bubble {
    background: var(--oree-user-bubble);
    color: #fff;
    border-bottom-right-radius: 4px;
  }

  .oree-cb-typing .oree-cb-bubble { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
  .oree-cb-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--oree-text-light);
    animation: oreeCbBlink 1.2s infinite ease-in-out;
  }
  .oree-cb-typing span:nth-child(2) { animation-delay: 0.2s; }
  .oree-cb-typing span:nth-child(3) { animation-delay: 0.4s; }

  .oree-cb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0 4px;
  }
  .oree-cb-option-btn {
    background: #fff;
    border: 1.5px solid var(--oree-primary);
    color: var(--oree-primary);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .oree-cb-option-btn:hover { background: var(--oree-primary); color: #fff; }
  .oree-cb-option-btn:disabled { opacity: 0.5; cursor: default; }

  .oree-cb-footer {
    border-top: 1px solid var(--oree-border);
    padding: 10px 12px;
    flex-shrink: 0;
    background: #fff;
  }
  .oree-cb-textrow { display: flex; gap: 8px; }
  .oree-cb-textrow input, .oree-cb-textrow textarea {
    flex: 1;
    border: 1px solid var(--oree-border);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13.5px;
    resize: none;
    font-family: var(--oree-font);
  }
  .oree-cb-textrow input:focus, .oree-cb-textrow textarea:focus { outline: 2px solid var(--oree-primary); outline-offset: 1px; }
  .oree-cb-send {
    background: var(--oree-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 13.5px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .oree-cb-send:hover { background: var(--oree-primary-dark); }
  .oree-cb-send:disabled { opacity: 0.5; cursor: default; }

  .oree-cb-skip {
    background: none;
    border: none;
    color: var(--oree-text-light);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 2px 0;
  }
  .oree-cb-skip:hover { color: var(--oree-text); }

  .oree-cb-form { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
  .oree-cb-form label { font-size: 12px; color: var(--oree-text-light); }
  .oree-cb-form input, .oree-cb-form textarea, .oree-cb-form select {
    border: 1px solid var(--oree-border);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13.5px;
    font-family: var(--oree-font);
    width: 100%;
    background: #fff;
    color: var(--oree-text);
  }
  .oree-cb-form textarea { min-height: 60px; resize: vertical; }
  .oree-cb-form-submit {
    background: var(--oree-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 13.5px;
    cursor: pointer;
    margin-top: 4px;
  }
  .oree-cb-form-submit:hover { background: var(--oree-primary-dark); }
  .oree-cb-form-submit:disabled { opacity: 0.6; cursor: default; }
  .oree-cb-form-error { color: #b3261e; font-size: 12px; display: none; }

  /* Honeypot toujours caché */
  .oree-cb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

  @keyframes oreeCbFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes oreeCbBlink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
  }

  @media (max-width: 420px) {
    .oree-cb-window { right: 8px; left: 8px; width: auto; bottom: 84px; }
    .oree-cb-launcher { right: 14px; bottom: 14px; }
    .oree-cb-teaser { right: 14px; bottom: 84px; max-width: 200px; }
  }
