/* Self-contained palette: the plugin must never depend on the active theme's variables. */
.chat-fab, .chat-panel, .chat-teaser{
  --cream:#FFFBF3; --cream2:#FFF6E8; --ink:#22303C; --ink-soft:#5B6B78;
  /* Site palette (v1.1.3): navy + yellow, matching itlikelife.com.
     Variable names kept so every teal/orange use follows automatically. */
  --teal:#151D2E; --teal-dark:#0B1120; --teal-soft:#FFF7D6;
  --orange:#FACC15; --orange-dark:#0B1120;
  --card:#FFFFFF; --line:#EBE2D2; --radius:22px;
  --shadow:0 18px 45px -18px rgba(34,48,60,.18);
}
/* ---------- CHATBOT ---------- */
.chat-fab{position:fixed; right:20px; bottom:20px; z-index:2147483647; width:56px; height:56px; border-radius:50%; border:2px solid var(--orange); cursor:pointer; background:linear-gradient(135deg,var(--teal),var(--teal-dark)); color:#fff; display:grid; place-items:center; box-shadow:0 12px 28px -8px rgba(11,17,32,.55), 0 0 0 3px rgba(255,255,255,.9); transition:transform .18s ease, box-shadow .18s ease; font-family:inherit}
.chat-fab:hover{transform:translateY(-2px) scale(1.06); box-shadow:0 18px 34px -8px rgba(11,17,32,.6), 0 0 0 3px rgba(255,255,255,.9)}
.chat-fab .fab-avatar{font-family:'Fraunces',serif; font-weight:700; font-size:26px; line-height:1}
.chat-fab .fab-dot{position:absolute; right:1px; bottom:3px; width:13px; height:13px; border-radius:50%; background:#4ADE80; border:2.5px solid #fff}
.chat-fab .pulse{position:absolute; inset:-4px; border-radius:50%; border:2.5px solid var(--teal); opacity:0; animation:pulse 2.2s ease-out 3 forwards}
@keyframes pulse{0%{transform:scale(.96); opacity:.55}70%{transform:scale(1.18); opacity:0}100%{opacity:0}}
.chat-fab .sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
/* Greeting teaser: shows once per session, a few seconds after load */
.chat-teaser{position:fixed; right:26px; bottom:172px; z-index:2147483647; width:264px; max-width:calc(100vw - 28px); background:#fff; border:1px solid var(--line, #EBE2D2); border-radius:16px; box-shadow:0 16px 40px -12px rgba(34,48,60,.28); padding:12px 14px; display:none; align-items:flex-start; gap:10px; cursor:pointer; animation:teaserIn .35s cubic-bezier(.2,.9,.3,1.1)}
.chat-teaser.show{display:flex}
@keyframes teaserIn{from{opacity:0; transform:translateY(10px) scale(.97)}}
.chat-teaser .teaser-avatar{width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--teal, #151D2E),var(--teal-dark, #0B1120)); color:#fff; display:grid; place-items:center; font-family:'Fraunces',serif; font-weight:700; font-size:17px; flex:none}
.chat-teaser .teaser-text{font-size:14px; line-height:1.45; color:var(--ink, #22303C)}
.chat-teaser .teaser-text b{display:block; font-size:14.5px}
.chat-teaser .teaser-close{margin-left:auto; background:none; border:0; color:var(--ink-soft, #5B6B78); font-size:13px; cursor:pointer; padding:2px 4px; flex:none}
.chat-panel{position:fixed; right:26px; bottom:104px; z-index:2147483647; width:380px; max-width:calc(100vw - 32px); height:600px; max-height:calc(100vh - 140px); background:#fff; color:var(--ink); border-radius:24px; box-shadow:0 24px 60px -12px rgba(34,48,60,.28), 0 0 0 1px rgba(34,48,60,.04); display:none; flex-direction:column; overflow:hidden; border:1px solid var(--line)}
.chat-panel.open{display:flex; animation:panelIn .28s cubic-bezier(.2,.9,.3,1.05)}
@keyframes panelIn{from{opacity:0; transform:translateY(16px) scale(.98)}}
.chat-head{background:linear-gradient(135deg,var(--teal),var(--teal-dark)); color:#fff; padding:16px 18px}
.chat-head .row{display:flex; align-items:center; gap:12px}
.chat-head .avatar{position:relative; width:44px; height:44px; border-radius:50%; background:#fff; color:var(--teal-dark); display:grid; place-items:center; font-family:'Fraunces',serif; font-weight:700; font-size:21px; flex:none; box-shadow:0 0 0 2px rgba(255,255,255,.35)}
.chat-head .avatar::after{content:''; position:absolute; right:0; bottom:1px; width:11px; height:11px; border-radius:50%; background:#4ADE80; border:2px solid var(--teal-dark)}
.chat-head b{font-size:17px; display:block; letter-spacing:.1px}
.chat-head .status{font-size:13px; opacity:.88; display:flex; align-items:center; gap:6px}
.chat-head .status i{width:8px; height:8px; border-radius:50%; background:#4ADE80; display:inline-block}
.chat-close{margin-left:auto; background:rgba(255,255,255,.16); border:0; color:#fff; width:34px; height:34px; border-radius:50%; cursor:pointer; font-size:16px; transition:background .15s}
.chat-close:hover{background:rgba(255,255,255,.3)}
.chat-clear{margin-left:auto; background:rgba(255,255,255,.16); border:0; color:#fff; height:34px; border-radius:999px; cursor:pointer; font-size:13px; font-weight:700; padding:0 12px; font-family:inherit; transition:background .15s; white-space:nowrap}
.chat-clear:hover{background:rgba(255,255,255,.3)}
.chat-close{margin-left:8px}
.chat-tools{display:flex; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); background:var(--cream); align-items:center; flex-wrap:wrap}
.chat-tools .clangs{display:flex; gap:5px}
.chat-tools .clangs button{border:1.5px solid var(--line); background:#fff; border-radius:999px; padding:5px 11px; font-size:13px; font-weight:700; cursor:pointer; font-family:inherit; transition:background .15s, color .15s}
.chat-tools .clangs button.active{background:var(--ink); color:#fff; border-color:var(--ink)}
.senior-toggle{display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--ink-soft); cursor:pointer; user-select:none}
.senior-toggle .switch{width:40px; height:22px; border-radius:999px; background:#D8CFBB; position:relative; transition:background .2s}
.senior-toggle .switch::after{content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:#fff; transition:left .2s; box-shadow:0 2px 5px rgba(0,0,0,.25)}
.senior-toggle.on .switch{background:var(--teal)}
.senior-toggle.on .switch::after{left:21px}
.human-btn{margin-left:auto; background:var(--orange); border:1.5px solid var(--orange); color:var(--orange-dark); font-weight:800; border-radius:999px; padding:7px 13px; font-size:13.5px; cursor:pointer; font-family:inherit; display:inline-flex; align-items:center; gap:6px; transition:background .15s}
.human-btn:hover{background:#E5B90F}
.human-btn svg{width:16px; height:16px}
.chat-body{flex:1; overflow-y:auto; padding:16px 14px; display:flex; flex-direction:column; gap:10px; background:#FCFAF5}
.chat-panel .msg{max-width:78%; padding:11px 15px; border-radius:20px; font-size:15.5px; line-height:1.5; animation:pop .25s ease}
@keyframes pop{from{opacity:0; transform:translateY(8px)}}
.chat-panel .msg.bot{background:#fff; border:1px solid var(--line); border-bottom-left-radius:6px; align-self:flex-start; box-shadow:0 2px 8px -2px rgba(34,48,60,.08)}
.chat-panel .msg.user{background:linear-gradient(135deg,var(--teal),var(--teal-dark)); color:#fff; border-bottom-right-radius:6px; align-self:flex-end}
.chat-panel .msg .speak{margin-top:8px; display:none; align-items:center; gap:7px; background:#fff; border:1.5px solid var(--line); border-radius:999px; padding:6px 14px; font-size:14px; font-weight:700; cursor:pointer; color:var(--teal-dark); font-family:inherit}
.chat-panel .msg .speak svg{width:16px; height:16px}
.chat-panel.senior .msg{font-size:20.5px}
.chat-panel.senior .msg .speak{display:inline-flex}
.chat-panel .msg.bot .call-link{display:inline-block; margin-top:10px; background:var(--orange); color:var(--orange-dark); font-weight:800; padding:10px 20px; border-radius:999px; text-decoration:none}
.chat-panel .quick{display:flex; gap:7px; flex-wrap:wrap; margin-top:2px}
.chat-panel .quick button{background:#fff; border:1.5px solid var(--teal); color:var(--teal-dark); border-radius:999px; padding:7px 14px; font-weight:700; font-size:14px; cursor:pointer; font-family:inherit; transition:background .15s}
.chat-panel .quick button:hover{background:var(--teal-soft)}
.chat-panel.senior .quick button{font-size:17.5px; padding:12px 20px}
.chat-panel .typing{align-self:flex-start; background:#fff; border:1px solid var(--line); border-radius:18px; padding:12px 16px; display:flex; gap:5px}
.chat-panel .typing i{width:9px; height:9px; border-radius:50%; background:#9AA5AF; animation:tp 1s infinite}
.chat-panel .typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes tp{0%,100%{opacity:.3}50%{opacity:1}}
.chat-input{display:flex; gap:8px; padding:12px; border-top:1px solid var(--line); background:#fff; align-items:center}
.chat-input input{flex:1; min-width:0; border:1.5px solid var(--line); background:#FBF8F1; border-radius:999px; padding:12px 18px; font-size:15.5px; font-family:inherit; outline:none; transition:border-color .15s, box-shadow .15s}
.chat-input input:focus{border-color:var(--teal); background:#fff; box-shadow:0 0 0 3px rgba(11,17,32,.12)}
.chat-panel .icon-btn{width:46px; height:46px; border-radius:50%; border:0; cursor:pointer; display:grid; place-items:center; flex:none; transition:transform .15s ease}
.chat-panel .icon-btn:hover{transform:scale(1.06)}
.chat-panel .icon-btn svg{width:21px; height:21px}
.chat-panel .mic-btn{background:#F1EFE7; color:var(--ink)}
.chat-panel .mic-btn.listening{background:#FEE2E2; color:#DC2626; animation:pulse 1.4s infinite}
.chat-panel .send-btn{background:linear-gradient(135deg,var(--teal),var(--teal-dark)); color:#fff; box-shadow:0 6px 14px -4px rgba(11,17,32,.5)}
.chat-panel .attach-btn{background:#F1EFE7; color:var(--ink)}
.chat-panel .msg.photo{padding:4px; background:none; border:0; box-shadow:none}
.chat-panel .msg.photo img{width:200px; max-width:100%; border-radius:14px; display:block}
.chat-panel .quick button.selected{background:var(--teal); color:#fff; border-color:var(--teal)}
.chat-panel[dir="rtl"] .msg.bot{align-self:flex-end; border-bottom-left-radius:18px; border-bottom-right-radius:6px}
.chat-panel[dir="rtl"] .msg.user{align-self:flex-start; border-bottom-right-radius:18px; border-bottom-left-radius:6px}
.chat-panel[dir="rtl"]{font-family:'Vazirmatn','Plus Jakarta Sans',sans-serif}

@media(min-width:961px){
  .chat-fab{bottom:100px}
  .chat-panel{bottom:184px; max-height:calc(100vh - 220px)}
}
@media(max-width:960px){
  .chat-panel{left:12px; right:12px; width:auto; bottom:172px; max-height:calc(100vh - 250px); max-height:calc(100dvh - 250px)}
  .chat-fab{right:14px; bottom:96px; width:56px; height:56px}
  .chat-fab .fab-avatar{font-size:24px}
  .chat-teaser{right:14px; bottom:164px; width:250px}
}
@media(max-width:600px){
  .quick button{padding:12px 18px}
  .chat-input{padding:12px; gap:8px}
  .chat-input input{padding:12px 16px; font-size:16px}
  .chat-panel .icon-btn{width:44px; height:44px}
}
