:root{
    --rh-ai-primary:#783293;
    --rh-ai-primary-dark:#5d2571;
    --rh-ai-primary-light:#a855f7;
    --rh-ai-bg:#ffffff;
    --rh-ai-text:#1f2937;
    --rh-ai-muted:#6b7280;
    --rh-ai-border:#e5e7eb;
    --rh-ai-shadow:0 20px 50px rgba(17,24,39,.18);
  }

  #rh-ai-widget-root *{
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
  }

  #rh-ai-fab{
    position:fixed;
    right:22px;
    bottom:22px;
    width:70px;
    height:70px;
    border:none;
    border-radius:50%;
    background:linear-gradient(135deg,var(--rh-ai-primary),var(--rh-ai-primary-light));
    box-shadow:0 14px 34px rgba(120,50,147,.38);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    z-index:9999999;
    transition:transform .2s ease, box-shadow .2s ease;
  }
  #rh-ai-fab:hover{
    transform:translateY(-3px) scale(1.03);
    box-shadow:0 18px 40px rgba(120,50,147,.48);
  }
  #rh-ai-fab svg{
    width:30px;
    height:30px;
    fill:#fff;
    position:relative;
    z-index:2;
  }
  #rh-ai-fab .pulse-ring{
    position:absolute;
    inset:0;
    border-radius:50%;
    border:2px solid rgba(168,85,247,.45);
    animation:rhAiPulse 2s infinite;
  }
  #rh-ai-fab .pulse-ring:nth-child(2){
    animation-delay:.6s;
  }
  @keyframes rhAiPulse{
    0%{transform:scale(1);opacity:.8;}
    100%{transform:scale(1.6);opacity:0;}
  }

  #rh-ai-fab-label{
    position:fixed;
    right:102px;
    bottom:31px;
    background:#fff;
    color:var(--rh-ai-primary);
    border:1px solid rgba(120,50,147,.16);
    box-shadow:0 10px 24px rgba(17,24,39,.10);
    border-radius:999px;
    padding:10px 14px;
    font-weight:800;
    font-size:13px;
    z-index:9999998;
    white-space:nowrap;
  }

  #rh-ai-panel{
    position:fixed;
    right:22px;
    bottom:104px;
    width:390px;
    max-width:calc(100vw - 24px);
    height:640px;
    max-height:calc(100vh - 140px);
    background:#fff;
    border:1px solid rgba(120,50,147,.14);
    border-radius:28px;
    box-shadow:var(--rh-ai-shadow);
    overflow:hidden;
    z-index:9999999;
    display:none;
    flex-direction:column;
  }
  #rh-ai-panel.rh-open{
    display:flex;
    animation:rhAiUp .22s ease;
  }
  @keyframes rhAiUp{
    from{opacity:0; transform:translateY(12px) scale(.98);}
    to{opacity:1; transform:translateY(0) scale(1);}
  }

  .rh-ai-header{
    background:linear-gradient(135deg,var(--rh-ai-primary),var(--rh-ai-primary-light));
    color:#fff;
    padding:18px 18px 14px;
    position:relative;
  }
  .rh-ai-header-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }
  .rh-ai-brand{
    display:flex;
    align-items:center;
    gap:12px;
  }
  .rh-ai-brand-icon{
    width:46px;
    height:46px;
    border-radius:14px;
    background:rgba(255,255,255,.18);
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 46px;
  }
  .rh-ai-brand-icon svg{
    width:24px;
    height:24px;
    fill:#fff;
  }
  .rh-ai-brand h3{
    margin:0;
    font-size:18px;
    line-height:1.2;
    font-weight:700;
    color:#fff;
  }
  .rh-ai-brand p{
    margin:4px 0 0;
    font-size:12px;
    opacity:.92;
  }
  .rh-ai-close{
    border:none;
    background:rgba(255,255,255,.16);
    color:#fff;
    width:36px;
    height:36px;
    border-radius:12px;
    cursor:pointer;
    font-size:20px;
    line-height:1;
  }
  .rh-ai-sub{
    margin-top:14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    font-size:12px;
  }
  .rh-ai-status{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:rgba(255,255,255,.14);
    padding:8px 12px;
    border-radius:999px;
  }
  .rh-ai-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:#a7f3d0;
    box-shadow:0 0 0 0 rgba(167,243,208,.8);
    animation:rhAiDotPulse 1.8s infinite;
  }
  @keyframes rhAiDotPulse{
    0%{box-shadow:0 0 0 0 rgba(167,243,208,.65);}
    70%{box-shadow:0 0 0 10px rgba(167,243,208,0);}
    100%{box-shadow:0 0 0 0 rgba(167,243,208,0);}
  }

  .rh-ai-body{
    flex:1;
    background:linear-gradient(180deg,#faf7fd 0%,#ffffff 28%);
    padding:14px;
    overflow:auto;
  }
  .rh-ai-msg{
    display:flex;
    margin-bottom:12px;
  }
  .rh-ai-msg.user{
    justify-content:flex-end;
  }
  .rh-ai-bubble{
    max-width:85%;
    padding:12px 14px;
    border-radius:18px;
    font-size:14px;
    line-height:1.45;
    box-shadow:0 8px 18px rgba(17,24,39,.05);
    white-space:pre-wrap;
    word-wrap:break-word;
  }
  .rh-ai-msg.bot .rh-ai-bubble{
    background:#fff;
    border:1px solid #eee7f5;
    color:var(--rh-ai-text);
    border-bottom-left-radius:8px;
  }
  .rh-ai-msg.user .rh-ai-bubble{
    background:linear-gradient(135deg,var(--rh-ai-primary),var(--rh-ai-primary-light));
    color:#fff;
    border-bottom-right-radius:8px;
  }

  .rh-ai-quick{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:6px 0 14px;
  }
  .rh-ai-chip{
    border:1px solid rgba(120,50,147,.16);
    background:#fff;
    color:var(--rh-ai-primary);
    border-radius:999px;
    padding:9px 12px;
    font-size:12px;
    cursor:pointer;
    transition:.2s ease;
    font-weight:700;
  }
  .rh-ai-chip:hover{
    background:#f7effd;
  }

  .rh-ai-transcript{
    background:#faf5ff;
    border:1px dashed rgba(120,50,147,.28);
    border-radius:16px;
    padding:10px 12px;
    margin:0 0 12px;
    font-size:13px;
    color:var(--rh-ai-primary-dark);
    min-height:44px;
  }

  .rh-ai-wave{
    display:none;
    align-items:center;
    gap:4px;
    height:28px;
    margin-bottom:12px;
  }
  .rh-ai-wave span{
    width:4px;
    height:10px;
    border-radius:10px;
    background:var(--rh-ai-primary);
    animation:rhAiWave 1s infinite ease-in-out;
  }
  .rh-ai-wave span:nth-child(2){animation-delay:.1s;}
  .rh-ai-wave span:nth-child(3){animation-delay:.2s;}
  .rh-ai-wave span:nth-child(4){animation-delay:.3s;}
  .rh-ai-wave span:nth-child(5){animation-delay:.4s;}
  @keyframes rhAiWave{
    0%,100%{height:8px;opacity:.5;}
    50%{height:24px;opacity:1;}
  }

  .rh-ai-footer{
    padding:12px;
    border-top:1px solid var(--rh-ai-border);
    background:#fff;
  }
  .rh-ai-controls{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:10px;
  }
  .rh-ai-mic-btn{
    width:52px;
    height:52px;
    border:none;
    border-radius:16px;
    background:linear-gradient(135deg,var(--rh-ai-primary),var(--rh-ai-primary-light));
    color:#fff;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 52px;
    box-shadow:0 10px 22px rgba(120,50,147,.22);
  }
  
  @keyframes rhAiMicGlow {
  0% { box-shadow: 0 0 0 0 rgba(120,50,147,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(120,50,147,0); }
  100% { box-shadow: 0 0 0 0 rgba(120,50,147,0); }
}

#rh-ai-mic-btn.listening,
#rh-ai-mic-btn.speaking {
  animation: rhAiMicGlow 1.2s infinite;
}
  

  .rh-ai-input-wrap{
    flex:1;
    display:flex;
    gap:8px;
  }
  .rh-ai-input{
    flex:1;
    height:52px;
    border:1px solid var(--rh-ai-border);
    border-radius:16px;
    padding:0 14px;
    outline:none;
    font-size:14px;
  }
  .rh-ai-input:focus{
    border-color:rgba(120,50,147,.45);
    box-shadow:0 0 0 3px rgba(120,50,147,.08);
  }
  .rh-ai-send{
    min-width:52px;
    height:52px;
    border:none;
    border-radius:16px;
    background:#f3e8ff;
    color:var(--rh-ai-primary);
    cursor:pointer;
    font-size:18px;
    font-weight:700;
  }
  .rh-ai-note{
    font-size:11px;
    color:var(--rh-ai-muted);
    line-height:1.4;
    text-align:center;
  }

  @media (max-width: 767px){
    #rh-ai-panel{
      right:10px;
      left:10px;
      bottom:86px;
      width:auto;
      height:72vh;
      max-height:72vh;
      border-radius:24px;
    }
    #rh-ai-fab{
      right:14px;
      bottom:14px;
      width:64px;
      height:64px;
    }
    #rh-ai-fab-label{
      display:none;
    }
  }
  
 