/* Assistant Shalom — styles du site initial, couleurs et polices adaptées à la charte v2 */
#rivers-chat-root{
  --purple:var(--navy-700); --purple-deep:var(--navy-900); --purple-soft:var(--blue-400);
  --gold:var(--gold-500); --gold-light:var(--gold-300);
  --ink:#0b1d47; --ink-soft:#4a5778; --mist:#eef2fa;
  font-family:var(--f-ui);
}
#rivers-chat-root button.launcher{padding:0;cursor:pointer;font:inherit}

/* Styles assistant Shalom (chat widget) */
  #rivers-chat-root{
    --panel-w: 408px;
    --panel-h: 686px;
  }
  #rivers-chat-root *{box-sizing:border-box;}

  /* ---------- Launcher (état réduit) ---------- */
  #rivers-chat-root .launcher{
    position:fixed;
    right:34px;
    bottom:34px;
    width:84px;
    height:84px;
    border-radius:50%;
    background:linear-gradient(150deg, var(--purple) 0%, var(--purple-deep) 100%);
    border:2.5px solid var(--gold);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 18px 40px -14px rgba(6,18,48,0.65);
    transition:transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
    z-index:2000;
  }
  #rivers-chat-root .launcher img{
    width:100%; height:100%; object-fit:cover; border-radius:50%;
    position:relative; z-index:1;
  }
  #rivers-chat-root .launcher-label{
    position:fixed;
    right:34px;
    bottom:122px;
    background:#fff;
    color:var(--purple-deep);
    font-family:var(--f-display);
    font-weight:600;
    font-size:13px;
    padding:7px 14px;
    border-radius:20px;
    box-shadow:0 12px 26px -10px rgba(6,18,48,0.45);
    border:1px solid rgba(232,184,74,0.5);
    z-index:2000;
    white-space:nowrap;
    animation:rivers-rise .5s .3s cubic-bezier(.2,.8,.2,1) both;
    pointer-events:none;
  }
  #rivers-chat-root .launcher-label.is-hidden{display:none;}
  #rivers-chat-root .launcher:hover{transform:translateY(-4px) scale(1.03); box-shadow:0 24px 48px -14px rgba(6,18,48,0.75);}
  #rivers-chat-root .launcher::before{
    content:'';
    position:absolute;
    inset:-8px;
    border-radius:50%;
    border:1px solid rgba(232,184,74,0.35);
    animation:rivers-pulse-ring 2.6s ease-out infinite;
  }
  @keyframes rivers-pulse-ring{
    0%{transform:scale(.86); opacity:.9;}
    80%{transform:scale(1.25); opacity:0;}
    100%{opacity:0;}
  }
  #rivers-chat-root .launcher .dot{
    position:absolute; top:4px; right:4px;
    width:15px; height:15px; border-radius:50%;
    background:#7CE0A0;
    border:2.5px solid var(--purple-deep);
    z-index:2;
    box-shadow:0 0 0 3px rgba(124,224,160,0.25);
  }
  #rivers-chat-root .launcher.is-hidden{opacity:0; pointer-events:none; transform:scale(.7);}

  /* ---------- Panneau ---------- */
  #rivers-chat-root .panel{
    position:fixed;
    right:34px;
    bottom:34px;
    width:var(--panel-w);
    height:var(--panel-h);
    max-height:calc(100vh - 68px);
    background:var(--cream);
    border-radius:22px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    box-shadow:0 40px 90px -24px rgba(3,10,28,0.55), 0 4px 14px rgba(3,10,28,0.18);
    transform:translateY(24px) scale(.97);
    opacity:0;
    pointer-events:none;
    transition:transform .4s cubic-bezier(.2,.9,.25,1), opacity .32s ease;
    z-index:2001;
  }
  #rivers-chat-root .panel.is-open{
    transform:translateY(0) scale(1);
    opacity:1;
    pointer-events:auto;
  }

  /* ---- Header ---- */
  #rivers-chat-root .panel-header{
    position:relative;
    padding:22px 22px 20px;
    background:linear-gradient(150deg, var(--purple-deep) 0%, var(--navy-800) 60%, var(--purple) 130%);
    color:#fff;
    flex-shrink:0;
    overflow:hidden;
  }
  #rivers-chat-root .panel-header::after{
    content:'';
    position:absolute; inset:0;
    background:radial-gradient(circle at 85% -10%, rgba(232,184,74,0.35), transparent 55%);
    pointer-events:none;
  }
  #rivers-chat-root .header-top{display:flex; align-items:flex-start; justify-content:space-between; position:relative; z-index:1;}
  #rivers-chat-root .header-id{display:flex; align-items:center; gap:12px;}

  #rivers-chat-root .river-avatar{
    width:52px; height:52px;
    border-radius:50%;
    position:relative;
    flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background:radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 55%, var(--gold-700) 100%);
    box-shadow:0 0 0 2px rgba(255,255,255,0.25), 0 8px 18px -6px rgba(0,0,0,0.5);
  }
  #rivers-chat-root .river-avatar img{
    width:100%; height:100%; object-fit:cover; border-radius:50%;
    position:relative; z-index:1;
  }
  #rivers-chat-root .river-avatar .ring{
    position:absolute;
    border-radius:50%;
    border:1.3px solid rgba(255,255,255,0.55);
    animation:rivers-ripple 2.8s ease-out infinite;
  }
  #rivers-chat-root .river-avatar .ring:nth-child(2){animation-delay:.9s;}
  #rivers-chat-root .river-avatar .ring:nth-child(3){animation-delay:1.8s;}
  @keyframes rivers-ripple{
    0%{inset:14px; opacity:.9;}
    100%{inset:-9px; opacity:0;}
  }
  #rivers-chat-root .river-avatar svg{width:18px; height:18px; position:relative; z-index:1; color:var(--purple-deep);}

  #rivers-chat-root .header-name{font-family:var(--f-display); font-weight:500; font-size:16.5px; line-height:1.25;}
  #rivers-chat-root .header-status{display:flex; align-items:center; gap:6px; margin-top:3px; font-size:12px; color:rgba(255,255,255,0.68);}
  #rivers-chat-root .header-status .pip{width:6px; height:6px; border-radius:50%; background:#7CE0A0; box-shadow:0 0 0 3px rgba(124,224,160,0.22);}

  #rivers-chat-root .header-actions{display:flex; gap:6px;}
  #rivers-chat-root .header-actions button{
    width:30px; height:30px;
    border-radius:9px;
    border:none;
    background:rgba(255,255,255,0.08);
    color:rgba(255,255,255,0.75);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
    transition:background .2s ease, color .2s ease;
  }
  #rivers-chat-root .header-actions button:hover{background:rgba(255,255,255,0.16); color:#fff;}
  #rivers-chat-root .header-actions svg{width:15px; height:15px;}

  #rivers-chat-root .header-tagline{
    position:relative; z-index:1;
    margin:16px 0 0;
    font-family:var(--f-display);
    font-style:italic;
    font-weight:400;
    font-size:14.5px;
    line-height:1.5;
    color:var(--gold-light);
    max-width:88%;
  }

  /* ---- Corps / messages ---- */
  #rivers-chat-root .panel-body{
    flex:1;
    overflow-y:auto;
    padding:20px 18px 10px;
    display:flex;
    flex-direction:column;
    gap:16px;
    scroll-behavior:smooth;
  }
  #rivers-chat-root .panel-body::-webkit-scrollbar{width:7px;}
  #rivers-chat-root .panel-body::-webkit-scrollbar-track{background:transparent;}
  #rivers-chat-root .panel-body::-webkit-scrollbar-thumb{background:rgba(47,107,255,0.28); border-radius:10px;}

  #rivers-chat-root .welcome-card{
    background:#fff;
    border-radius:16px;
    padding:20px 20px 18px;
    border:1px solid rgba(6,18,48,0.07);
    box-shadow:0 14px 30px -20px rgba(6,18,48,0.35);
    animation:rivers-rise .5s cubic-bezier(.2,.8,.2,1) both;
  }
  #rivers-chat-root .welcome-card .eyebrow{
    display:flex; align-items:center; gap:8px;
    font-size:11px; letter-spacing:2px; text-transform:uppercase;
    color:var(--gold); font-weight:700; margin-bottom:10px;
  }
  #rivers-chat-root .welcome-card .eyebrow::before{
    content:''; width:16px; height:1.5px; background:var(--gold);
  }
  #rivers-chat-root .welcome-card h2{
    font-family:var(--f-display); font-weight:500; font-size:18.5px;
    margin:0 0 8px; color:var(--purple-deep); line-height:1.3;
  }
  #rivers-chat-root .welcome-card p{
    margin:0 0 10px; font-size:13.6px; line-height:1.62; color:var(--ink-soft);
  }
  #rivers-chat-root .welcome-card p:last-of-type{margin-bottom:0;}

  #rivers-chat-root .qa-label{
    font-size:11px; letter-spacing:2px; text-transform:uppercase;
    color:var(--purple-soft); font-weight:700;
    margin:4px 2px 2px;
    animation:rivers-rise .5s .05s cubic-bezier(.2,.8,.2,1) both;
  }

  #rivers-chat-root .qa-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
  }
  #rivers-chat-root .qa-card{
    display:flex; flex-direction:column; gap:9px;
    background:#fff;
    border:1px solid rgba(6,18,48,0.08);
    border-radius:13px;
    padding:12px 12px 11px;
    text-align:left;
    cursor:pointer;
    font-family:inherit;
    color:var(--ink);
    transition:transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s ease, box-shadow .22s ease, background .22s ease;
    animation:rivers-rise .5s cubic-bezier(.2,.8,.2,1) both;
  }
  #rivers-chat-root .qa-card:nth-child(1){animation-delay:.08s;}
  #rivers-chat-root .qa-card:nth-child(2){animation-delay:.13s;}
  #rivers-chat-root .qa-card:nth-child(3){animation-delay:.18s;}
  #rivers-chat-root .qa-card:nth-child(4){animation-delay:.23s;}
  #rivers-chat-root .qa-card:nth-child(5){animation-delay:.28s;}
  #rivers-chat-root .qa-card:nth-child(6){animation-delay:.33s;}
  #rivers-chat-root .qa-card:nth-child(7){animation-delay:.38s;}
  #rivers-chat-root .qa-card:nth-child(8){animation-delay:.43s;}
  #rivers-chat-root .qa-card:hover{
    transform:translateY(-3px);
    border-color:rgba(232,184,74,0.55);
    box-shadow:0 16px 28px -18px rgba(17,42,98,0.45);
    background:linear-gradient(180deg, #fff, #fdfbf6);
  }
  #rivers-chat-root .qa-card:active{transform:translateY(-1px);}
  #rivers-chat-root .qa-icon{
    width:32px; height:32px;
    border-radius:9px;
    background:linear-gradient(150deg, rgba(47,107,255,0.14), rgba(232,184,74,0.16));
    display:flex; align-items:center; justify-content:center;
    color:var(--purple);
  }
  #rivers-chat-root .qa-icon svg{width:16px; height:16px;}
  #rivers-chat-root .qa-card span{font-size:12.3px; font-weight:500; line-height:1.35; color:var(--ink);}

  @keyframes rivers-rise{
    from{opacity:0; transform:translateY(10px);}
    to{opacity:1; transform:translateY(0);}
  }

  /* ---- Bulles de discussion ---- */
  #rivers-chat-root .msg-row{display:flex; gap:9px; max-width:92%; animation:rivers-rise .38s cubic-bezier(.2,.8,.2,1) both;}
  #rivers-chat-root .msg-row.user{align-self:flex-end; flex-direction:row-reverse;}
  #rivers-chat-root .msg-avatar{
    width:26px; height:26px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(150deg, var(--gold-light), var(--gold));
    display:flex; align-items:center; justify-content:center;
    margin-top:2px;
    overflow:hidden;
  }
  #rivers-chat-root .msg-avatar img{width:100%; height:100%; object-fit:cover; border-radius:50%;}
  #rivers-chat-root .bubble{
    padding:11px 14px;
    border-radius:15px;
    font-size:13.6px;
    line-height:1.55;
  }
  #rivers-chat-root .msg-row.bot .bubble{
    background:#fff;
    color:var(--ink);
    border:1px solid rgba(6,18,48,0.07);
    border-top-left-radius:5px;
  }
  #rivers-chat-root .msg-row.user .bubble{
    background:linear-gradient(150deg, var(--purple), var(--purple-deep));
    color:#fff;
    border-top-right-radius:5px;
  }

  #rivers-chat-root .typing-row{display:flex; gap:9px; align-items:center; animation:rivers-rise .3s ease both;}
  #rivers-chat-root .typing-dots{
    background:#fff;
    border:1px solid rgba(6,18,48,0.07);
    border-radius:15px; border-top-left-radius:5px;
    padding:12px 15px;
    display:flex; gap:4px;
  }
  #rivers-chat-root .typing-dots span{
    width:6px; height:6px; border-radius:50%;
    background:var(--purple-soft);
    opacity:.4;
    animation:rivers-bounce 1.2s infinite ease-in-out;
  }
  #rivers-chat-root .typing-dots span:nth-child(2){animation-delay:.15s;}
  #rivers-chat-root .typing-dots span:nth-child(3){animation-delay:.3s;}
  @keyframes rivers-bounce{
    0%,60%,100%{transform:translateY(0); opacity:.4;}
    30%{transform:translateY(-4px); opacity:1;}
  }

  /* ---- Zone de saisie ---- */
  #rivers-chat-root .panel-input{
    flex-shrink:0;
    padding:12px 14px 14px;
    background:var(--cream);
    border-top:1px solid rgba(6,18,48,0.06);
  }
  #rivers-chat-root .input-row{
    display:flex; align-items:center; gap:8px;
    background:#fff;
    border:1px solid rgba(6,18,48,0.1);
    border-radius:26px;
    padding:6px 6px 6px 16px;
    transition:border-color .2s ease, box-shadow .2s ease;
  }
  #rivers-chat-root .input-row:focus-within{
    border-color:var(--purple-soft);
    box-shadow:0 0 0 3px rgba(47,107,255,0.14);
  }
  #rivers-chat-root .input-row input{
    flex:1; border:none; outline:none; font-family:inherit;
    font-size:13.6px; color:var(--ink); background:transparent;
  }
  #rivers-chat-root .input-row input::placeholder{color:var(--mist);}
  #rivers-chat-root .send-btn{
    width:36px; height:36px; border-radius:50%; border:none;
    background:linear-gradient(150deg, var(--gold-light), var(--gold));
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; flex-shrink:0;
    transition:transform .2s cubic-bezier(.3,.8,.3,1), box-shadow .2s ease;
    box-shadow:0 6px 14px -6px rgba(232,184,74,0.7);
  }
  #rivers-chat-root .send-btn:hover{transform:scale(1.06);}
  #rivers-chat-root .send-btn:active{transform:scale(.94);}
  #rivers-chat-root .send-btn svg{width:15px; height:15px; color:var(--purple-deep);}
  #rivers-chat-root .input-foot{
    text-align:center; font-size:10.3px; color:var(--mist);
    margin-top:9px; letter-spacing:.2px;
  }

  /* ---------- Mobile ---------- */
  @media (max-width:520px){
    #rivers-chat-root .panel{
      right:0; bottom:0; left:0; top:0;
      width:100%; height:100%; max-height:none;
      border-radius:0;
    }
    #rivers-chat-root .launcher{right:20px; bottom:20px;}
    #rivers-chat-root .launcher-label{right:20px; bottom:106px; font-size:12px;}
  }

  @media (prefers-reduced-motion: reduce){
    #rivers-chat-root *{animation-duration:.001s !important; animation-iteration-count:1 !important; transition-duration:.001s !important;}
  }

/* Version de test : la barre d'aperçu occupe le bas de l'écran — le bouton remonte (sans effet en production) */
body.show-tbc #rivers-chat-root .launcher{bottom:96px}
body.show-tbc #rivers-chat-root .launcher-label{bottom:190px}
@media (max-width:520px){
  body.show-tbc #rivers-chat-root .launcher{bottom:92px}
  body.show-tbc #rivers-chat-root .launcher-label{bottom:178px}
}

/* ---------- Avatar Shalom en format portrait (rectangle vertical) — 12/10/2026 ---------- */
#rivers-chat-root .launcher{width:132px;height:176px;border-radius:14px;padding:0;overflow:visible;background:var(--navy-900)}
#rivers-chat-root .launcher img{border-radius:11px;object-fit:cover;object-position:50% 20%}
#rivers-chat-root .launcher::before{inset:-7px;border-radius:19px;animation-name:rivers-pulse-rect}
@keyframes rivers-pulse-rect{0%{transform:scale(.97);opacity:.9}80%{transform:scale(1.08);opacity:0}100%{opacity:0}}
#rivers-chat-root .launcher .dot{top:-6px;right:-6px;width:18px;height:18px}
#rivers-chat-root .launcher-label{bottom:222px;font-size:14px;padding:8px 16px}
#rivers-chat-root .river-avatar{width:46px;height:61px;border-radius:9px}
#rivers-chat-root .river-avatar img{border-radius:7px;object-position:50% 20%}
#rivers-chat-root .river-avatar .ring{border-radius:12px}
#rivers-chat-root .msg-avatar{border-radius:6px}
#rivers-chat-root .msg-avatar img{border-radius:6px;object-position:50% 18%}
@media (max-width:520px){
  #rivers-chat-root .launcher{width:96px;height:128px;right:16px;bottom:16px}
  #rivers-chat-root .launcher-label{right:16px;bottom:154px;font-size:12.5px}
}
body.show-tbc #rivers-chat-root .launcher{bottom:96px}
body.show-tbc #rivers-chat-root .launcher-label{bottom:284px}
@media (max-width:520px){
  body.show-tbc #rivers-chat-root .launcher{bottom:92px}
  body.show-tbc #rivers-chat-root .launcher-label{bottom:230px}
}

/* Liens de contact réels dans les réponses de Shalom */
#rivers-chat-root .bubble-links{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
#rivers-chat-root .bubble-links a{display:inline-block;padding:5px 11px;border-radius:999px;background:var(--navy-800);color:#fff;font-size:12px;font-weight:600;text-decoration:none}
#rivers-chat-root .bubble-links a:hover,#rivers-chat-root .bubble-links a:focus-visible{background:var(--gold-600);color:var(--navy-950)}

/* Assistant : paragraphes de réponse */
#rivers-chat-root .bubble-p{margin:0}
#rivers-chat-root .bubble-p+.bubble-p{margin-top:8px}
