/* Live chat widget - uses the variables from assets/site.css */
.lcw{position:fixed;right:20px;bottom:20px;z-index:1000;font-family:var(--font);font-size:15px;line-height:1.5;color:var(--text)}
.lcw[hidden]{display:none}
.lcw-launch{position:relative;display:flex;align-items:center;justify-content:center;width:60px;height:60px;border:0;border-radius:50%;background:var(--blue);color:#fff;cursor:pointer;box-shadow:var(--shadow-md);transition:background .2s,transform .2s}
.lcw-launch:hover{background:var(--blue-600);transform:translateY(-2px)}
.lcw-launch .icon{width:28px;height:28px}
.lcw-badge{position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--amber);color:var(--navy);font-size:12px;font-weight:800;line-height:22px;text-align:center}
.lcw-panel{position:absolute;right:0;bottom:76px;width:370px;max-width:calc(100vw - 24px);height:540px;max-height:calc(100vh - 110px);display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-md);overflow:hidden}
.lcw-panel[hidden]{display:none}
.lcw-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;background:linear-gradient(135deg,var(--navy),var(--navy-2));color:#fff}
.lcw-head strong{display:block;font-size:16px}
.lcw-sub{display:block;font-size:13px;opacity:.8}
.lcw-close{border:0;background:rgba(255,255,255,.14);color:#fff;width:34px;height:34px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer}
.lcw-close:hover{background:rgba(255,255,255,.26)}
.lcw [hidden]{display:none!important}

.lcw-start{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px}
.lcw-start p{margin:0;color:var(--text)}
.lcw-start label{display:block;font-weight:600;font-size:14px;color:var(--ink)}
.lcw input[type=text],.lcw input[type=email],.lcw textarea{width:100%;margin-top:4px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit;color:var(--ink)}
.lcw input:focus,.lcw textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(21,101,216,.15)}
.lcw-start textarea{resize:vertical;min-height:80px}
.lcw-hp{position:absolute!important;left:-9999px;width:1px;height:1px;opacity:0}

.lcw-chat{flex:1;display:flex;flex-direction:column;min-height:0}
.lcw-msgs{flex:1;overflow-y:auto;padding:14px;background:var(--soft);display:flex;flex-direction:column;gap:8px}
.lcw-msg{display:flex}
.lcw-msg.me{justify-content:flex-end}
.lcw-bubble{max-width:82%;padding:9px 13px;border-radius:14px;background:#fff;border:1px solid var(--line);overflow-wrap:anywhere}
.lcw-msg.me .lcw-bubble{background:var(--blue);border-color:var(--blue);color:#fff}
.lcw-body{white-space:pre-wrap}
.lcw-bubble time{display:block;font-size:11px;opacity:.7;margin-top:3px}
.lcw-bubble img{display:block;max-width:100%;max-height:200px;border-radius:8px;margin-top:6px}
.lcw-doc{display:inline-block;margin-top:6px;font-weight:700;text-decoration:underline;color:inherit}
.lcw-msg.me .lcw-doc{color:#fff}
.lcw-closed{padding:14px;text-align:center;background:#fff;border-top:1px solid var(--line)}
.lcw-closed p{margin:0 0 10px;color:var(--muted)}
.lcw-compose{padding:10px 12px;background:#fff;border-top:1px solid var(--line)}
.lcw-row{display:flex;gap:8px;align-items:flex-end}
.lcw-row textarea{margin:0;resize:none;max-height:100px;min-height:42px}
.lcw-attach,.lcw-send{flex:0 0 auto;width:42px;height:42px;border:0;border-radius:10px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.lcw-attach{background:var(--soft);color:var(--navy)}
.lcw-attach:hover{background:var(--line)}
.lcw-send{background:var(--amber);color:var(--navy)}
.lcw-send:hover{background:var(--amber-600)}
.lcw-send:disabled{opacity:.6;cursor:default}
.lcw .icon{width:20px;height:20px}
.lcw-chip{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--soft);border-radius:20px;padding:4px 12px;font-size:13px;margin-bottom:8px}
.lcw-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lcw-chip button{border:0;background:none;color:var(--red);font-weight:700;cursor:pointer;font-size:16px}
.lcw-error{padding:8px 14px;background:#fdecea;color:#b3261e;font-size:13px;font-weight:600}

@media (max-width:540px){
  .lcw{right:14px;bottom:14px}
  .lcw-panel{position:fixed;inset:0;width:100%;max-width:none;height:100%;max-height:none;border-radius:0;border:0}
  .lcw.is-open .lcw-launch{display:none}
  .lcw-start input,.lcw-start textarea,.lcw-row textarea{font-size:16px}
}
