/* ---------- website live chat widget ---------- */
.chw{position:fixed;right:20px;bottom:20px;z-index:85;font-family:var(--font)}
.chw-launch{position:relative;width:60px;height:60px;border-radius:50%;border:0;background:var(--grad);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 14px 30px -10px rgba(10,102,255,.75);transition:transform .2s,box-shadow .2s}
.chw-launch:hover{transform:scale(1.06)}
.chw-launch:focus-visible{outline:3px solid #9cc4ff;outline-offset:3px}
.chw-launch .chw-ico-close{display:none}
.chw.is-open .chw-launch .chw-ico-open{display:none}
.chw.is-open .chw-launch .chw-ico-close{display:grid}
.chw-launch>span{display:grid;place-items:center}
.chw-badge{position:absolute;top:-2px;right:-2px;min-width:22px;height:22px;padding:0 6px;border-radius:99px;background:var(--red);color:#fff;font-size:.74rem;font-weight:800;border:2px solid #fff}
.chw-teaser{position:absolute;right:0;bottom:74px;width:260px;background:#fff;border:1px solid var(--line);border-radius:16px 16px 4px 16px;box-shadow:var(--shadow);padding:14px 30px 14px 16px;cursor:pointer;animation:chw-in .25s ease-out}
.chw-teaser p{margin:0;font-size:.9rem;color:var(--ink);line-height:1.45}
.chw-teaser-x{position:absolute;top:4px;right:6px;border:0;background:none;font-size:1.2rem;line-height:1;color:var(--muted);cursor:pointer;padding:4px}
.chw-panel{position:absolute;right:0;bottom:76px;width:min(380px,calc(100vw - 32px));height:min(600px,calc(100vh - 120px));background:#fff;border-radius:20px;box-shadow:0 30px 70px -20px rgba(7,17,31,.45),0 0 0 1px rgba(7,17,31,.06);display:flex;flex-direction:column;overflow:hidden;animation:chw-in .22s ease-out}
.chw-panel[hidden]{display:none}
@keyframes chw-in{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.chw-head{display:flex;align-items:center;gap:12px;padding:14px 14px 14px 16px;background:var(--grad-dark);color:#fff}
.chw-av{width:38px;height:38px;border-radius:12px;background:var(--grad);display:grid;place-items:center;flex-shrink:0}
.chw-head-main{flex:1;min-width:0}
.chw-head-main b{display:block;font:700 1rem var(--font-display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chw-head-main small{display:block;font-size:.76rem;color:#a9bdd6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chw-head-act{display:flex;gap:2px}
.chw-head-act a,.chw-head-act button{width:34px;height:34px;border-radius:10px;border:0;background:none;color:#dbe8f7;display:grid;place-items:center;cursor:pointer}
.chw-head-act a:hover,.chw-head-act button:hover{background:rgba(255,255,255,.12);color:#fff}
.chw-head-act [hidden]{display:none}
.chw-msgs{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;background:#f6f9fd;overscroll-behavior:contain}
.chw-msg{max-width:86%;padding:10px 13px;border-radius:16px;font-size:.92rem;line-height:1.5;word-wrap:break-word;position:relative}
.chw-msg .chw-body a{color:inherit;text-decoration:underline;word-break:break-all}
.chw-who{display:block;font-size:.7rem;font-weight:700;letter-spacing:.02em;opacity:.7;margin-bottom:2px}
.chw-at{display:block;font-size:.66rem;opacity:.55;margin-top:3px;text-align:right}
.chw-bot,.chw-staff{align-self:flex-start;background:#fff;color:var(--ink);border:1px solid var(--line);border-bottom-left-radius:4px}
.chw-staff{border-color:#c9dcff;background:#eef5ff}
.chw-visitor{align-self:flex-end;background:var(--brand);color:#fff;border-bottom-right-radius:4px}
.chw-system{align-self:center;max-width:94%;background:#fff8e6;color:#6e4b00;border:1px solid #f3dca2;font-size:.84rem;text-align:center}
.chw-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.chw-acts a,.chw-acts button{font:600 .8rem var(--font);padding:6px 11px;border-radius:99px;border:1.5px solid var(--brand);background:#fff;color:var(--brand-ink);cursor:pointer;text-decoration:none}
.chw-acts a:hover,.chw-acts button:hover{background:var(--brand);color:#fff}
.chw-typing{display:flex;gap:4px;padding:13px 14px}
.chw-typing i{width:7px;height:7px;border-radius:50%;background:#9db0c8;animation:chw-dot 1.2s infinite}
.chw-typing i:nth-child(2){animation-delay:.15s}.chw-typing i:nth-child(3){animation-delay:.3s}
@keyframes chw-dot{0%,60%,100%{transform:none;opacity:.5}30%{transform:translateY(-4px);opacity:1}}
.chw-quick{display:flex;flex-wrap:wrap;gap:6px;padding:8px 14px 0;background:#f6f9fd}
.chw-quick[hidden]{display:none}
.chw-quick button{font:600 .8rem var(--font);padding:7px 12px;border-radius:99px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer}
.chw-quick button:hover{border-color:var(--brand);color:var(--brand-ink)}
.chw-details{padding:12px 14px;border-top:1px solid var(--line);display:grid;gap:8px;background:#fff}
.chw-details[hidden]{display:none}
.chw-details p{margin:0;font-size:.84rem;color:var(--muted)}
.chw-details .input{padding:9px 12px;font-size:.9rem}
.chw-row{display:flex;gap:8px}
.chw-err{color:var(--red);font-size:.8rem}
.chw-err[hidden]{display:none}
.chw-rate{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-top:1px solid var(--line);font-size:.86rem;color:var(--ink)}
.chw-rate[hidden]{display:none}
.chw-rate button{border:0;background:none;font-size:1.3rem;color:#c7d2e0;cursor:pointer;padding:0 2px}
.chw-rate button:hover,.chw-rate button:hover~button{color:#f5b301}
.chw-rate div{display:flex;flex-direction:row-reverse}
.chw-compose{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--line);background:#fff}
.chw-compose[hidden]{display:none}
.chw-compose textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:14px;padding:10px 12px;font:inherit;font-size:.92rem;max-height:110px;outline:0;color:var(--ink)}
.chw-compose textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(10,102,255,.15)}
.chw-compose button{width:42px;height:42px;border-radius:12px;border:0;background:var(--brand);color:#fff;display:grid;place-items:center;cursor:pointer;flex-shrink:0}
.chw-compose button:hover{background:var(--brand-ink)}
.chw-foot{padding:6px 12px 9px;font-size:.7rem;color:var(--muted);text-align:center;background:#fff}
.chw-foot a{color:var(--muted);text-decoration:underline}
@media (max-width:520px){
  .chw{right:14px;bottom:14px}
  .chw.is-open{left:0;right:0;top:0;bottom:0}
  .chw.is-open .chw-launch{display:none}
  .chw-panel{position:fixed;inset:0;width:100%;height:100%;border-radius:0}
  .chw-teaser{width:calc(100vw - 100px)}
}
@media print{.chw{display:none}}
@media (prefers-reduced-motion:reduce){.chw-panel,.chw-teaser{animation:none}.chw-typing i{animation:none}}

/* ---------- admin: live chat & visitors ---------- */
.lc-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:18px;align-items:start}
.lc-panel{padding:0;overflow:hidden}
.lc-panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 16px;border-bottom:1px solid var(--line)}
.lc-panel-head h3{margin:0;font-size:1rem}
.lc-filters{display:flex;flex-wrap:wrap;gap:6px}
.lc-filters .op-chip{text-decoration:none}
.lc-filters .op-chip.is-active{background:var(--brand);color:#fff;border-color:var(--brand)}
.lc-list,.lc-visitors{max-height:640px;overflow-y:auto}
.lc-item{border-bottom:1px solid var(--line-2)}
.lc-item.st-waiting{background:#fff6f6}
.lc-item .wa-av{position:relative}
.lc-dot{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;background:var(--green);border:2px solid #fff}
.lc-tags{display:flex;gap:8px;align-items:center;margin-top:4px}
.lc-st-bot{background:#ece7ff;color:var(--violet)}
.lc-st-waiting{background:#ffe1e7;color:#b42318}
.lc-st-open{background:#e2f8ee;color:var(--green-ink)}
.lc-st-closed{background:#eef2f7;color:var(--muted)}
.lc-visitor{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line-2)}
.lc-v-main{min-width:0;flex:1}
.lc-v-main b{margin-right:6px}
.lc-page{margin-top:3px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lc-hello{display:flex;gap:6px;flex-shrink:0}
.lc-hello .input{width:150px;padding:6px 10px;font-size:.85rem}
.lc-chat{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start}
.lc-chat .wa-msgs{min-height:380px;max-height:560px}
.lc-chat .wa-msg.lc-bot{background:#f3efff;border-color:#ddd3ff}
.lc-chat .wa-msg.lc-system{align-self:center;background:#fff8e6;color:#6e4b00;max-width:90%;text-align:center;font-size:.85rem}
.lc-side h3{font-size:1rem;margin:0 0 10px}
.lc-dl{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px 10px;margin:0 0 14px;font-size:.88rem}
.lc-dl dt{color:var(--muted)}
.lc-dl dd{margin:0;color:var(--ink);min-width:0}
.lc-wrap{word-break:break-all}
.lc-hist{display:block;font-size:.86rem;padding:6px 0;border-bottom:1px dashed var(--line)}
@media (max-width:1080px){.lc-grid,.lc-chat{grid-template-columns:minmax(0,1fr)}}
@media (max-width:680px){.lc-visitor{flex-direction:column;align-items:stretch}.lc-hello .input{flex:1;width:auto}}
.lc-side{padding:18px}
.lc-settings{padding:14px 18px}
.lc-settings summary{cursor:pointer}
.lc-rating{font-style:normal}
.lc-canned{margin-bottom:6px;max-width:100%}
.lc-h3{font-size:.85rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:16px 0 6px}
.lc-journey{margin:0;padding-left:18px;display:grid;gap:5px;font-size:.84rem;max-height:260px;overflow:auto}
