/* Assistente de agendamento · Dr. Rafael Cruz (TopTags) */
.cb-root{position:fixed; right:22px; bottom:22px; z-index:260; font-family:'Manrope',system-ui,sans-serif; font-size:15px; line-height:1.5; --cb-wa:#25D366;}
:where(.cb-root) *{box-sizing:border-box;}
:where(.cb-root) button{font:inherit; cursor:pointer; border:0; background:none; padding:0; color:inherit;}

/* botão: pílula dourada com a foto do Dr. Rafael */
.cb-launch{
  position:relative; margin-left:auto;
  display:flex; align-items:center; gap:12px;
  height:66px; padding:6px 24px 6px 6px; border-radius:999px;
  color:#1A1613; text-align:left;
  background:linear-gradient(135deg,#F1DDAE 0%,var(--gold-light,#E3C994) 30%,var(--gold,#AE8A55) 100%);
  box-shadow:0 20px 44px -14px rgba(138,106,62,.75), 0 0 0 1px rgba(255,255,255,.35) inset, 0 1px 0 rgba(255,255,255,.6) inset;
  transform:translateY(130%) scale(.9); opacity:0;
  transition:transform .7s cubic-bezier(.16,1,.3,1), opacity .5s, width .5s cubic-bezier(.16,1,.3,1), padding .5s, background .4s, box-shadow .4s;
  animation:cbNudge 9s ease 5s infinite;
}
.cb-root.is-ready .cb-launch{transform:none; opacity:1;}
.cb-launch:hover{box-shadow:0 26px 54px -14px rgba(138,106,62,.9), 0 0 0 1px rgba(255,255,255,.4) inset;}
.cb-launch:hover .cb-launch-face img{transform:scale(1.06);}
.cb-launch::before{content:''; position:absolute; inset:0; border-radius:inherit; background:linear-gradient(105deg,transparent 30%,rgba(255,255,255,.6) 45%,transparent 60%); background-size:250% 100%; background-position:120% 0; animation:cbShine 5s ease-in-out 2s infinite; pointer-events:none;}
.cb-launch-face{position:relative; width:54px; height:54px; flex:none;}
.cb-launch-face img{width:100%; height:100%; border-radius:50%; object-fit:cover; border:2.5px solid #1A1613; background:#1A1613; transition:transform .5s cubic-bezier(.16,1,.3,1);}
.cb-launch-badge{position:absolute; right:-4px; bottom:-3px; width:25px; height:25px; border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--cb-wa); border:2.5px solid #F1DDAE; box-shadow:0 4px 10px rgba(0,0,0,.2);}
.cb-launch-badge svg{width:13px; height:13px;}
.cb-launch-text{position:relative; display:grid; line-height:1.15; white-space:nowrap;}
.cb-launch-text small{display:inline-flex; align-items:center; gap:6px; font-size:.7rem; font-weight:700; letter-spacing:.02em; opacity:.8;}
.cb-launch-text b{font-size:1.04rem; font-weight:800; letter-spacing:-.01em;}
.cb-launch-dot{width:7px; height:7px; border-radius:50%; background:#1f9d55; box-shadow:0 0 0 0 rgba(31,157,85,.7); animation:cbLive 1.8s infinite;}
.cb-launch-x{position:absolute; inset:0; display:grid; place-items:center; opacity:0; transform:rotate(-90deg); transition:opacity .3s, transform .5s cubic-bezier(.16,1,.3,1); color:var(--gold-light,#E3C994);}
.cb-launch-x svg{width:24px; height:24px;}
.cb-launch-ring{position:absolute; inset:0; border-radius:999px; border:2px solid var(--gold-light,#E3C994); animation:cbRing 2.8s ease infinite; pointer-events:none;}
.cb-launch-ring--2{animation-delay:1.4s;}
.cb-launch.is-open{width:66px; padding:0; gap:0; background:linear-gradient(140deg,#2B241D,#1A1613); box-shadow:0 18px 40px -14px rgba(0,0,0,.6), 0 0 0 1px rgba(174,138,85,.4) inset; animation:none;}
.cb-launch.is-open .cb-launch-face,.cb-launch.is-open .cb-launch-text,.cb-launch.is-open .cb-launch-ring,.cb-launch.is-open::before{display:none;}
.cb-launch.is-open .cb-launch-x{opacity:1; transform:none;}
@keyframes cbRing{0%{transform:scale(1); opacity:.65;}100%{transform:scale(1.22,1.6); opacity:0;}}
@keyframes cbShine{0%,70%{background-position:120% 0;}100%{background-position:-40% 0;}}
@keyframes cbLive{0%{box-shadow:0 0 0 0 rgba(31,157,85,.7);}100%{box-shadow:0 0 0 7px rgba(31,157,85,0);}}
@keyframes cbNudge{0%,88%,100%{transform:none;}90%{transform:translateY(-6px) rotate(-2deg);}92%{transform:translateY(0) rotate(2deg);}94%{transform:translateY(-3px) rotate(-1deg);}96%{transform:none;}}

/* aviso flutuante */
.cb-teaser{
  position:absolute; right:calc(100% + 14px); bottom:2px; width:300px;
  display:flex; gap:12px; align-items:flex-start;
  padding:16px 18px 16px 14px; border-radius:20px 20px 6px 20px;
  background:#FBF8F1; color:#544B3E; box-shadow:0 30px 60px -24px rgba(26,22,19,.55); border:1px solid rgba(174,138,85,.3);
  cursor:pointer; opacity:0; visibility:hidden; transform:translateY(10px) scale(.96); transform-origin:bottom right;
  transition:opacity .5s, transform .5s cubic-bezier(.16,1,.3,1), visibility .5s;
}
.cb-teaser.is-on{opacity:1; visibility:visible; transform:none;}
.cb-teaser p{margin:0; font-size:.87rem; line-height:1.45;}
.cb-teaser b{display:block; color:#241F19; font-family:'Fraunces',serif; font-weight:500; font-size:1.02rem; margin-bottom:3px;}
.cb-teaser-avatar{width:44px; height:44px; border-radius:50%; overflow:hidden; flex:none; border:1.5px solid var(--gold,#AE8A55);}
.cb-teaser-avatar img{width:100%; height:100%; object-fit:cover;}
.cb-teaser-close{position:absolute; right:8px; top:6px; width:26px; height:26px; border-radius:50%; color:#8a7f6c; font-size:1.2rem; line-height:1;}
.cb-teaser-close:hover{background:#EFE7D6;}

/* janela */
.cb{
  position:absolute; right:0; bottom:80px;
  width:400px; height:min(660px, calc(100svh - 120px));
  display:flex; flex-direction:column; border-radius:26px; overflow:hidden;
  background:#F6F1E6;
  box-shadow:0 40px 100px -30px rgba(26,22,19,.7), 0 0 0 1px rgba(174,138,85,.28);
  opacity:0; visibility:hidden; transform:translateY(16px) scale(.97); transform-origin:bottom right;
  transition:opacity .45s cubic-bezier(.16,1,.3,1), transform .55s cubic-bezier(.16,1,.3,1), visibility .45s;
}
.cb.is-open{opacity:1; visibility:visible; transform:none;}
.cb-head{display:flex; align-items:center; gap:12px; padding:16px 12px 16px 18px; color:#EFE7D6;
  background:radial-gradient(120% 140% at 100% 0%, rgba(174,138,85,.38), transparent 60%), linear-gradient(135deg,#2B241D,#1A1613 60%);
  border-bottom:1px solid rgba(174,138,85,.35);}
.cb-avatar{position:relative; width:46px; height:46px; flex:none;}
.cb-avatar img{width:100%; height:100%; border-radius:50%; object-fit:cover; border:1.5px solid var(--gold-light,#E3C994);}
.cb-online{position:absolute; right:0; bottom:1px; width:12px; height:12px; border-radius:50%; background:#2bd56f; border:2px solid #1A1613;}
.cb-title{flex:1; min-width:0; line-height:1.3;}
.cb-title b{display:block; font-family:'Fraunces',serif; font-weight:500; font-size:1.06rem; letter-spacing:.01em;}
.cb-title small{font-size:.76rem; color:#C9BCA0;}
.cb-icon-btn{width:38px; height:38px; border-radius:50%; display:grid; place-items:center; color:#E3C994; transition:background-color .3s;}
.cb-icon-btn:hover{background:rgba(227,201,148,.12);}
.cb-icon-btn svg{width:19px; height:19px;}
.cb-progress{height:3px; background:rgba(174,138,85,.15);}
.cb-progress b{display:block; height:100%; background:linear-gradient(90deg,#8A6A3E,#E3C994); transform:scaleX(0); transform-origin:left; transition:transform .6s cubic-bezier(.16,1,.3,1);}

.cb-body{flex:1; overflow-y:auto; overscroll-behavior:contain; padding:20px 16px 10px; display:flex; flex-direction:column; gap:8px;
  background-image:radial-gradient(rgba(138,106,62,.09) 1px, transparent 1px); background-size:18px 18px; scrollbar-width:thin;}
.cb-msg{max-width:86%; padding:11px 15px; border-radius:18px; font-size:.93rem; line-height:1.5; animation:cbIn .45s cubic-bezier(.16,1,.3,1) both; overflow-wrap:break-word;}
.cb-msg--bot{align-self:flex-start; background:#fff; color:#241F19; border-bottom-left-radius:6px; box-shadow:0 2px 8px rgba(36,31,25,.06);}
.cb-msg--bot b{color:#1A1613;}
.cb-msg--user{align-self:flex-end; color:#1A1613; font-weight:600; background:linear-gradient(135deg,#EBD5A3,#C9A46A); border-bottom-right-radius:6px; box-shadow:0 8px 18px -10px rgba(138,106,62,.7); white-space:pre-wrap;}
.cb-muted{color:#8a7f6c; font-size:.86em;}
.cb-privacy{display:block; margin-top:8px; padding-top:8px; border-top:1px solid rgba(174,138,85,.2); font-size:.74em; line-height:1.45; color:#8a7f6c;}
.cb-privacy a,.cb-lgpd a,.cb-legal a{color:#8A6A3E; font-weight:700; text-decoration:underline; text-underline-offset:2px;}
@keyframes cbIn{from{opacity:0; transform:translateY(8px) scale(.98);}to{opacity:1; transform:none;}}
.cb-typing{display:inline-flex; gap:4px; padding:14px 16px;}
.cb-typing span{width:7px; height:7px; border-radius:50%; background:#C9BCA0; animation:cbDot 1.1s infinite;}
.cb-typing span:nth-child(2){animation-delay:.15s;}
.cb-typing span:nth-child(3){animation-delay:.3s;}
@keyframes cbDot{0%,60%,100%{transform:translateY(0); opacity:.5;}30%{transform:translateY(-4px); opacity:1;}}
.cb-msg.cb-alert{color:#7A1E17; background:#FDECEA; border:1px solid #F5C2BD;}
.cb-msg.cb-alert b{color:#B3261E;}

.cb-summary{max-width:94%; padding:0; overflow:hidden;}
.cb-summary-head{display:flex; align-items:center; gap:8px; padding:12px 16px; font-size:.74rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:#8A6A3E; background:rgba(227,201,148,.22); border-bottom:1px solid rgba(174,138,85,.2);}
.cb-summary-head svg{width:16px; height:16px; color:#1f9d55;}
.cb-summary dl{margin:0; padding:6px 16px 12px;}
.cb-summary dl div{display:grid; grid-template-columns:112px 1fr; gap:10px; padding:7px 0; border-bottom:1px dashed rgba(174,138,85,.25); font-size:.86rem;}
.cb-summary dl div:last-child{border-bottom:0;}
.cb-summary dt{color:#8a7f6c; font-weight:600;}
.cb-summary dd{margin:0; color:#241F19; font-weight:700;}

.cb-foot{padding:12px 14px 8px; background:#FFFDF8; border-top:1px solid rgba(174,138,85,.22); display:flex; flex-direction:column; gap:8px;}
.cb-foot:empty{padding:0; border-top:0;}
.cb-foot--chips{flex-direction:row; flex-wrap:wrap; gap:7px; max-height:48%; overflow-y:auto;}
.cb-chip{padding:9px 14px; border-radius:999px; font-size:.86rem; font-weight:700; color:#544B3E; background:#F2ECDE; border:1px solid rgba(174,138,85,.3);
  transition:background-color .25s, color .25s, border-color .25s, transform .3s cubic-bezier(.16,1,.3,1); animation:cbIn .4s cubic-bezier(.16,1,.3,1) both; text-align:left;}
.cb-chip:hover{background:#fff; border-color:#AE8A55; color:#1A1613; transform:translateY(-1px);}
.cb-chip--alarm{border-color:#F0C3BE; background:#FDF1EF; color:#8E2B22;}
.cb-chip--alarm:hover{border-color:#D8433B; color:#B3261E;}
.cb-chip--check{padding-left:34px; position:relative;}
.cb-chip--check::before{content:''; position:absolute; left:12px; top:50%; width:15px; height:15px; margin-top:-7.5px; border-radius:5px; border:1.5px solid rgba(174,138,85,.6); background:#fff; transition:background-color .2s, border-color .2s;}
.cb-chip--check.is-on{background:#1A1613; color:#E3C994; border-color:#1A1613;}
.cb-chip--check.is-on::before{border-color:#E3C994; background:#E3C994 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1613' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/11px no-repeat;}
.cb-go{width:100%; margin-top:4px; min-height:46px; border-radius:14px; display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:800; color:#E3C994; background:#1A1613; transition:opacity .3s;}
.cb-go svg{width:18px; height:18px;}
.cb-go:disabled{opacity:.35; cursor:not-allowed;}
.cb-form{display:flex; align-items:flex-end; gap:8px;}
.cb-form.is-shake{animation:cbShake .4s;}
@keyframes cbShake{20%,60%{transform:translateX(-5px);}40%,80%{transform:translateX(5px);}}
.cb-input{flex:1; min-width:0; resize:none; font:inherit; font-size:16px; color:#241F19; padding:12px 16px; border-radius:16px; background:#F6F1E6; border:1.5px solid rgba(174,138,85,.3); outline:none; transition:border-color .25s, background-color .25s;}
.cb-input:focus{border-color:#AE8A55; background:#fff;}
.cb-send{width:48px; height:48px; flex:none; border-radius:14px; display:grid; place-items:center; color:#E3C994; background:#1A1613;}
.cb-send svg{width:20px; height:20px;}
.cb-skip{align-self:center; padding:6px 10px; font-size:.84rem; font-weight:700; color:#8a7f6c; border-radius:10px;}
.cb-skip:hover{color:#1A1613; background:#F2ECDE;}
.cb-err{margin:0; font-size:.8rem; color:#B23B22;}
.cb-err:empty{display:none;}
.cb-wa{display:flex; align-items:center; justify-content:center; gap:10px; min-height:54px; border-radius:16px; font-weight:800; font-size:1rem; color:#fff; text-decoration:none; background:linear-gradient(140deg,#2bd56f,#12a650); box-shadow:0 14px 30px -14px rgba(18,166,80,.8); transition:transform .3s cubic-bezier(.16,1,.3,1);}
.cb-wa:hover{transform:translateY(-2px);}
.cb-wa svg{width:22px; height:22px;}
.cb-wa--alert{background:linear-gradient(140deg,#E0544B,#B3261E); box-shadow:0 10px 24px -10px rgba(216,67,59,.7);}
.cb-wa--call{background:#1A1613; color:#E3C994; box-shadow:0 10px 24px -10px rgba(26,22,19,.6);}
.cb-wa--call svg{width:18px; height:18px;}
.cb-callback{min-height:46px; border-radius:14px; font-weight:800; font-size:.92rem; color:#544B3E; background:#F2ECDE; border:1px solid rgba(174,138,85,.3); transition:background-color .3s;}
.cb-callback:hover{background:#EBE1CC;}
.cb-lgpd{margin:0; font-size:.7rem; line-height:1.4; color:#8a7f6c; text-align:center;}
.cb-legal{margin:0; padding:4px 16px 12px; background:#FFFDF8; font-size:.7rem; color:#8a7f6c; text-align:center; line-height:1.4;}

/* não disputa espaço com o "voltar ao topo" */
.cb-open #backtotop{opacity:0 !important; pointer-events:none;}
.menu-open .cb-root{opacity:0; visibility:hidden; pointer-events:none;}

@media (max-width:640px){
  .cb-root{right:14px; bottom:14px;}
  .cb-launch{height:58px; padding:5px 18px 5px 5px; gap:10px;}
  .cb-launch.is-open{width:58px;}
  .cb-launch-face{width:48px; height:48px;}
  .cb-launch-badge{width:21px; height:21px;}
  .cb-launch-badge svg{width:11px; height:11px;}
  .cb-launch-text small{font-size:.64rem;}
  .cb-launch-text b{font-size:.96rem;}
  .cb-teaser{right:0; bottom:70px; width:calc(100vw - 28px);}
  .cb{position:fixed; left:0; right:0; bottom:0; width:100%; height:92svh; border-radius:24px 24px 0 0; transform:translateY(100%);}
  .cb.is-open{transform:none;}
  .cb-open .cb-launch{opacity:0; pointer-events:none;}
}
@media (prefers-reduced-motion:reduce){
  .cb-launch,.cb-launch::before,.cb-launch-ring,.cb-launch-dot{animation:none !important;}
}
