.rchat, .rchat * { box-sizing: border-box; }
.rchat { --rchat-green:#173f33; --rchat-deep:#0b3026; --rchat-gold:#d6aa2b; --rchat-cream:#fcfaf3; position:fixed; z-index:8000; right:20px; bottom:28px; font-family:Manrope,Arial,sans-serif; color:#20342a; }
.rchat-launch { position:relative; z-index:2; display:flex; align-items:center; justify-content:center; width:64px; height:64px; border:0; border-radius:50%; background:var(--rchat-gold); color:#fff; cursor:pointer; box-shadow:0 7px 20px rgba(113,81,9,.29); transition:transform .2s ease,box-shadow .2s ease; }
.rchat-launch::before { content:""; position:absolute; inset:-7px; border-radius:50%; background:rgba(214,170,43,.24); opacity:0; transform:scale(.75); transition:transform .25s ease,opacity .25s ease; z-index:-1; }
.rchat-launch:hover,.rchat-launch:focus-visible { transform:translateY(-3px); box-shadow:0 14px 30px rgba(113,81,9,.43); }
.rchat-launch:hover::before,.rchat-launch:focus-visible::before { opacity:1; transform:scale(1); }
.rchat-launch--pulse { animation:rchat-launch-pulse 5s ease-in-out both; }
.rchat-launch--pulse::before { animation:rchat-halo-pulse 5s ease-in-out both; }
.rchat-unread { position:absolute; z-index:3; right:0; bottom:78px; max-width:180px; padding:9px 12px; border-radius:13px; background:#fff; color:var(--rchat-deep); font-size:12px; font-weight:800; line-height:1.2; white-space:nowrap; box-shadow:0 8px 24px rgba(8,40,29,.22); }
.rchat-unread::after { content:""; position:absolute; right:22px; bottom:-7px; width:14px; height:14px; transform:rotate(45deg); background:#fff; }
.rchat-unread[hidden] { display:none; }
.rchat-unread-number { color:#c62832; }
.rchat-launch svg { width:30px; height:30px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.rchat-launch:focus-visible,.rchat button:focus-visible,.rchat a:focus-visible,.rchat input:focus-visible,.rchat textarea:focus-visible { outline:3px solid var(--rchat-gold); outline-offset:2px; }
.rchat-panel { position:absolute; z-index:1; right:0; bottom:80px; display:flex; flex-direction:column; width:min(370px,calc(100vw - 32px)); height:min(710px,calc(100dvh - 112px)); background:#fff; border:1px solid #dedfd5; border-radius:13px; box-shadow:0 18px 50px rgba(8,40,29,.25); overflow:hidden; }
.rchat-panel[hidden] { display:none; }
.rchat-head { display:flex; align-items:center; gap:12px; min-height:75px; padding:12px 16px; background:linear-gradient(120deg,var(--rchat-deep),var(--rchat-green)); border-bottom:3px solid var(--rchat-gold); color:#fff; }
.rchat-avatar { width:45px; height:45px; flex:none; object-fit:cover; border-radius:50%; border:2px solid var(--rchat-gold); background:#ede8dc; }
.rchat-head-copy { min-width:0; flex:1; }
.rchat-head-title { display:block; font-size:16px; font-weight:800; line-height:1.2; }
.rchat-close { display:flex; align-items:center; justify-content:center; width:34px; height:34px; flex:none; padding:0; border:0; border-radius:50%; color:#fff; background:rgba(255,255,255,.13); cursor:pointer; }
.rchat-close svg { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.rchat-log { flex:1; min-height:0; overflow:auto; overflow-anchor:none; padding:14px 14px 10px; background:#fff; scroll-behavior:auto; overscroll-behavior:contain; }
.rchat-new { position:absolute; z-index:3; bottom:72px; left:50%; transform:translateX(-50%); white-space:nowrap; padding:7px 12px; border:1px solid #d6aa2b; border-radius:20px; background:#fff; color:#173f33; font-weight:800; font-size:12px; box-shadow:0 3px 12px #0002; cursor:pointer; }
.rchat-new[hidden] { display:none; }
.rchat-test-reset { align-self:center; margin:5px 0 0; padding:4px 8px; border:0; background:transparent; color:#617067; font:11px Manrope,Arial,sans-serif; text-decoration:underline; cursor:pointer; }
.rchat-test-reset[hidden] { display:none; }
.rchat-test-reset:hover { color:var(--rchat-deep); }
.rchat-row { display:flex; gap:8px; align-items:flex-start; margin-bottom:10px; animation:rchat-pop .27s cubic-bezier(.2,1.25,.35,1) both; }
.rchat-row--restored { animation:none; }
.rchat-row--user { justify-content:flex-end; }
.rchat-row--typing { align-items:center; }
.rchat-typing-dots { display:inline-flex; align-items:center; gap:5px; min-height:33px; padding:9px 12px; border-radius:14px 14px 14px 4px; background:#f3f4f1; }
.rchat-typing-dots i { width:6px; height:6px; border-radius:50%; background:#8b968d; animation:rchat-typing 1s ease-in-out infinite; }
.rchat-typing-dots i:nth-child(2) { animation-delay:.16s; }
.rchat-typing-dots i:nth-child(3) { animation-delay:.32s; }
.rchat-row img { width:30px; height:30px; flex:none; object-fit:cover; border-radius:50%; }
.rchat-content { display:flex; flex-direction:column; align-items:flex-start; max-width:83%; }
.rchat-row--user .rchat-content { align-items:flex-end; }
.rchat-bubble { padding:10px 12px; border-radius:15px 15px 15px 4px; background:#f3f4f1; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.rchat-row--user .rchat-bubble { border-radius:15px 15px 4px 15px; background:#f1db8b; color:var(--rchat-deep); }
.rchat-time { display:block; margin-top:6px; color:#718075; font-size:10px; line-height:1.3; text-align:right; white-space:nowrap; }
.rchat-row--user .rchat-time { color:#61552c; }
.rchat-read { display:block; margin:3px 3px 0 0; color:#718075; font-size:10px; line-height:1.3; text-align:right; }
.rchat-link { color:#88630b!important; text-decoration:underline; text-underline-offset:2px; font-weight:800; }
.rchat-link:hover { color:#5f4405!important; }
.rchat-compose { display:flex; gap:8px; align-items:flex-end; padding:12px 14px; border-top:1px solid #e2e8e2; background:#fff; }
.rchat-input { min-width:0; min-height:42px; flex:1; height:42px; max-height:142px; border:1px solid #d3c7a2; border-radius:10px; padding:10px 12px; resize:none; overflow-y:hidden; background:#fff; font:14px/20px Manrope,Arial,sans-serif; color:#20342a; }
.rchat-tool { display:flex; align-items:center; justify-content:center; width:30px; height:36px; flex:none; padding:0; border:0; border-radius:8px; background:transparent; color:#68777b; cursor:pointer; }
.rchat-tool[hidden] { display:none; }
.rchat-tool:hover,.rchat-mic--active { background:#f6edcf; color:var(--rchat-deep); }
.rchat-tool svg { display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.rchat-file-status { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 14px 8px; padding:5px 8px; border-radius:8px; background:#f8f2df; color:#283e30; font-size:11px; }
.rchat-file-status[hidden] { display:none; }
.rchat-file-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rchat-file-remove { flex:none; padding:0 4px; border:0; background:transparent; color:#59675b; font-size:18px; cursor:pointer; }
.rchat-send { width:42px; height:42px; flex:none; border:0; border-radius:50%; background:var(--rchat-gold); color:var(--rchat-deep); font-size:20px; cursor:pointer; }
.rchat-send:hover { background:#e1b94d; }
.rchat-send:disabled,.rchat-send:disabled:hover { background:#cbd0d5; color:#fff; box-shadow:none; cursor:default; }
@keyframes rchat-pop { from { opacity:0; transform:translateY(8px) scale(.94); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes rchat-launch-pulse { 0%,33.33%,66.67%,100% { transform:none; box-shadow:0 7px 20px rgba(113,81,9,.29); } 16.67%,50%,83.33% { transform:translateY(-3px); box-shadow:0 14px 30px rgba(113,81,9,.43); } }
@keyframes rchat-halo-pulse { 0%,33.33%,66.67%,100% { opacity:0; transform:scale(.75); } 16.67%,50%,83.33% { opacity:1; transform:scale(1); } }
@keyframes rchat-typing { 0%,60%,100% { transform:translateY(0); opacity:.55; } 30% { transform:translateY(-4px); opacity:1; } }
@media (max-width:600px) {
  .rchat { right:14px; bottom:max(22px,env(safe-area-inset-bottom)); }
  .rchat-panel { position:absolute; inset:0; width:100%; height:100%; border:0; border-radius:0; }
  .rchat-head { padding-top:max(12px,env(safe-area-inset-top)); }
  .rchat-compose { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion:reduce) { .rchat *, .rchat *::before { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

@media (max-width:600px) {
  html.rchat-mobile-open { height:100%; overflow:hidden; overscroll-behavior:none; scroll-behavior:auto; }
  html.rchat-mobile-open body { position:fixed; inset:0; width:100%; height:100%; overflow:hidden; overscroll-behavior:none; }
  .rchat--mobile-open { z-index:2147483000; top:var(--rchat-top,0px); left:0; right:auto; bottom:auto; width:var(--rchat-width,100%); touch-action:pan-y; }
  .rchat--mobile-open .rchat-launch,.rchat--mobile-open .rchat-unread { display:none!important; }
  .rchat-head,.rchat-compose,.rchat-file-status { flex-shrink:0; }
  .rchat-input { font-size:16px; line-height:20px; }
  .rchat-panel { max-width:100%; box-shadow:none; }
}

@media (max-width:980px) {
  body:has(.rchat) .mobile-scroll-top {
    right:30px;
    bottom:calc(max(22px,env(safe-area-inset-bottom)) + 64px + 70px + 18px);
  }
}
@media (max-width:600px) {
  html.rchat-mobile-open { background:#fff; }
  html.rchat-mobile-open body > :not(.rchat) { visibility:hidden!important; }
  .rchat--mobile-open { background:#fff; height:var(--rchat-height,100dvh); min-height:0; overflow:clip; isolation:isolate; }
  .rchat--mobile-open::before { content:""; position:fixed; z-index:-1; inset:-100lvh -100vw; background:#fff; pointer-events:none; }
  .rchat--mobile-open .rchat-panel { isolation:isolate; margin:0; max-height:none; overflow:clip; transition:none; }
  html.rchat-mobile-open .mobile-scroll-top { display:none!important; }
}
