/* Refuge Hospice — chat assistant */
.rh-launch{position:fixed;right:1.3rem;bottom:4.8rem;z-index:90;display:flex;align-items:center;gap:.7rem;background:var(--brand);color:#fff;border:0;border-radius:999px;padding:.7rem 1.2rem .7rem .8rem;font:600 .92rem var(--font-body);cursor:pointer;box-shadow:0 12px 30px rgba(74,59,115,.38);transition:transform .2s,box-shadow .2s}
.rh-launch:hover{transform:translateY(-2px);box-shadow:0 16px 36px rgba(74,59,115,.45)}
.rh-launch .ic{width:38px;height:38px;border-radius:50%;background:#25D366;display:grid;place-items:center;flex:none;position:relative}
.rh-launch .ic svg{width:20px;height:20px}
.rh-launch .ic::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid rgba(37,211,102,.55);animation:rhp 2.2s infinite}
@keyframes rhp{0%{transform:scale(.9);opacity:1}100%{transform:scale(1.5);opacity:0}}
.rh-launch small{display:block;font-weight:500;opacity:.8;font-size:.72rem}
.rh-launch.open{display:none}
.rh-nudge{position:fixed;right:1.3rem;bottom:8.9rem;z-index:89;background:#fff;color:var(--ink);border-radius:14px 14px 4px 14px;padding:.75rem 1rem;max-width:260px;font-size:.88rem;box-shadow:var(--shadow-md);opacity:0;transform:translateY(8px);transition:.3s;pointer-events:none}
.rh-nudge.show{opacity:1;transform:none;pointer-events:auto}
.rh-nudge button{position:absolute;top:-8px;left:-8px;width:22px;height:22px;border-radius:50%;border:0;background:var(--ink);color:#fff;font-size:12px;cursor:pointer}

.rh-panel{position:fixed;right:1.3rem;bottom:4.8rem;z-index:95;width:min(400px,calc(100vw - 2rem));height:min(620px,calc(100vh - 6.2rem));background:#fff;border-radius:22px;box-shadow:0 30px 80px rgba(30,27,46,.35);display:flex;flex-direction:column;overflow:hidden;transform:translateY(16px) scale(.98);opacity:0;pointer-events:none;transition:.22s ease}
.rh-panel.open{transform:none;opacity:1;pointer-events:auto}
.rh-head{background:var(--brand);color:#fff;padding:1rem 1.1rem;display:flex;align-items:center;gap:.8rem}
.rh-head .av{width:42px;height:42px;border-radius:50%;background:#FBF7F0;display:grid;place-items:center;flex:none}
.rh-head .av svg{width:26px;height:26px}
.rh-head strong{display:block;font-size:.98rem}
.rh-head span{font-size:.76rem;opacity:.8;display:flex;align-items:center;gap:.35rem}
.rh-head span i{width:7px;height:7px;border-radius:50%;background:#3DBE7A;display:inline-block}
.rh-head .x{margin-left:auto;background:rgba(255,255,255,.12);border:0;color:#fff;width:34px;height:34px;border-radius:50%;cursor:pointer;display:grid;place-items:center}
.rh-head .x:hover{background:rgba(255,255,255,.22)}

.rh-actions{display:grid;grid-template-columns:2fr 1fr 1fr;gap:.45rem;padding:.7rem .8rem;background:#FBF7F0;border-bottom:1px solid var(--line)}
.rh-actions a{display:flex;align-items:center;justify-content:center;gap:.4rem;padding:.6rem .5rem;border-radius:999px;font-size:.8rem;font-weight:700;text-decoration:none;border:1.5px solid var(--line);background:#fff;color:var(--ink)}
.rh-actions a svg{width:16px;height:16px;flex:none}
.rh-actions a.wa{background:#25D366;border-color:#25D366;color:#fff;box-shadow:0 6px 16px rgba(37,211,102,.35)}
.rh-actions a:hover{filter:brightness(.97)}

.rh-body{flex:1;overflow-y:auto;padding:1rem .9rem;display:flex;flex-direction:column;gap:.6rem;background:#FAF8FC;scroll-behavior:smooth}
.rh-msg{max-width:86%;padding:.7rem .9rem;border-radius:16px;font-size:.9rem;line-height:1.5;white-space:pre-wrap;animation:rhin .2s ease}
@keyframes rhin{from{opacity:0;transform:translateY(6px)}}
.rh-msg.bot{background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px;align-self:flex-start;color:var(--ink)}
.rh-msg.user{background:var(--brand);color:#fff;border-bottom-right-radius:4px;align-self:flex-end}
.rh-msg a{color:var(--brand);font-weight:600;text-decoration:underline}
.rh-msg.user a{color:#fff}
.rh-msg.typing{display:flex;gap:4px;padding:.8rem 1rem}
.rh-msg.typing i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:rhb 1s infinite}
.rh-msg.typing i:nth-child(2){animation-delay:.15s}.rh-msg.typing i:nth-child(3){animation-delay:.3s}
@keyframes rhb{0%,80%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-5px);opacity:1}}
.rh-chips{display:flex;flex-wrap:wrap;gap:.4rem;align-self:flex-start;max-width:95%}
.rh-chips button{border:1.5px solid var(--brand);background:#fff;color:var(--brand);border-radius:999px;padding:.4rem .8rem;font:600 .8rem var(--font-body);cursor:pointer}
.rh-chips button:hover{background:var(--brand-soft)}
.rh-chips button.wa{border-color:#25D366;color:#128C7E}
.rh-handoff{align-self:flex-start;max-width:86%;background:#E8F8EE;border:1px solid #B9EBCB;border-radius:16px;padding:.8rem .9rem;font-size:.86rem}
.rh-handoff strong{display:block;margin-bottom:.4rem}
.rh-handoff a{display:inline-flex;align-items:center;gap:.4rem;background:#25D366;color:#fff;font-weight:700;padding:.5rem .9rem;border-radius:999px;text-decoration:none;font-size:.82rem;margin-top:.3rem}
.rh-handoff a svg{width:16px;height:16px}

.rh-foot{display:flex;gap:.5rem;padding:.7rem .8rem;border-top:1px solid var(--line);background:#fff}
.rh-foot input{flex:1;font:inherit;font-size:.92rem;padding:.7rem .9rem;border:1.5px solid var(--line);border-radius:999px;outline:0}
.rh-foot input:focus{border-color:var(--brand-2);box-shadow:0 0 0 3px rgba(43,106,97,.15)}
.rh-foot button{width:44px;height:44px;border-radius:50%;border:0;background:var(--brand);color:#fff;cursor:pointer;display:grid;place-items:center;flex:none}
.rh-foot button svg{width:18px;height:18px}
.rh-note{font-size:.68rem;color:var(--muted);text-align:center;padding:0 .8rem .5rem;background:#fff}
@media (max-width:560px){.rh-panel{right:.5rem;bottom:.5rem;width:calc(100vw - 1rem);height:calc(100vh - 1rem);border-radius:18px}.rh-launch{right:.9rem;bottom:4.4rem}.rh-launch span{display:none}.rh-launch{padding:.5rem}.rh-nudge{right:.9rem;bottom:8.2rem}}