/* WTC-WIDGET-CSS  Telegram Live Chat widget (scoped under .tlc-) */
.tlc-launcher{position:fixed;right:22px;bottom:22px;z-index:2147483000;width:60px;height:60px;border-radius:50%;
  background:linear-gradient(135deg,#2563eb,#1e3a8a);color:#fff;border:none;padding:0;margin:0;cursor:pointer;box-sizing:border-box;
  box-shadow:0 10px 28px rgba(37,99,235,.42);display:block;
  transition:transform .18s cubic-bezier(.34,1.56,.64,1),box-shadow .18s}
.tlc-launcher:hover{transform:scale(1.07)}
.tlc-launcher:active{transform:scale(.96)}
/* Icon wrappers fill the circle and centre the SVG; the two icons overlay for the crossfade. */
.tlc-launcher .tlc-ico-chat,.tlc-launcher .tlc-ico-close{position:absolute;top:0;left:0;right:0;bottom:0;
  display:flex;align-items:center;justify-content:center;transition:transform .2s ease,opacity .2s ease}
.tlc-launcher svg{width:27px;height:27px;fill:#fff}
.tlc-launcher .tlc-ico-close{opacity:0;transform:rotate(-90deg) scale(.6)}
.tlc-launcher.is-open .tlc-ico-chat{opacity:0;transform:rotate(90deg) scale(.6)}
.tlc-launcher.is-open .tlc-ico-close{opacity:1;transform:none}
.tlc-badge{position:absolute;top:-3px;right:-3px;min-width:20px;height:20px;border-radius:10px;background:#ef4444;color:#fff;
  font:700 11px/20px system-ui,sans-serif;text-align:center;padding:0 5px;display:none;border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.2)}

.tlc-panel{position:fixed;right:22px;bottom:94px;z-index:2147483000;width:372px;max-width:calc(100vw - 32px);
  height:560px;max-height:calc(100vh - 130px);background:#fff;border-radius:18px;overflow:hidden;
  box-shadow:0 18px 60px rgba(15,23,42,.32);display:flex;flex-direction:column;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  opacity:0;visibility:hidden;transform:translateY(18px) scale(.97);pointer-events:none;
  transition:opacity .22s ease,transform .22s cubic-bezier(.34,1.4,.64,1),visibility .22s}
.tlc-panel.tlc-open{opacity:1;visibility:visible;transform:none;pointer-events:auto}

/* Left-side placement */
.tlc-launcher.tlc-left{right:auto;left:22px}
.tlc-launcher.tlc-left .tlc-badge{right:auto;left:-3px}
.tlc-panel.tlc-left{right:auto;left:22px}

/* ---- Header ---- */
.tlc-header{background:linear-gradient(135deg,#2563eb,#1e3a8a);color:#fff;padding:15px 16px;display:flex;align-items:center;gap:12px}
.tlc-hd-avatar{width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.tlc-hd-avatar svg{width:22px;height:22px;fill:#fff}
.tlc-hd-text{flex:1;min-width:0}
/* Force white — host themes often define a dark color on bare h4 which beats inherited white. */
.tlc-header .tlc-hd-text h4{margin:0;font-size:16px;font-weight:700;line-height:1.2;color:#fff !important;font-family:inherit}
.tlc-header .tlc-hd-sub{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.92;margin-top:2px;color:#fff !important}
.tlc-dot{width:8px;height:8px;border-radius:50%;background:#34d399;box-shadow:0 0 0 0 rgba(52,211,153,.7);animation:tlc-pulse 2s infinite}
@keyframes tlc-pulse{0%{box-shadow:0 0 0 0 rgba(52,211,153,.6)}70%{box-shadow:0 0 0 6px rgba(52,211,153,0)}100%{box-shadow:0 0 0 0 rgba(52,211,153,0)}}
.tlc-actions{display:flex;align-items:center;gap:6px;position:relative;z-index:1}
.tlc-end{background:rgba(255,255,255,.18);border:none;color:#fff;cursor:pointer;font:600 12px/1 system-ui,sans-serif;padding:6px 11px;border-radius:7px}
.tlc-end:hover{background:rgba(255,255,255,.3)}
.tlc-end:disabled{opacity:.55;cursor:default}
.tlc-close{background:rgba(255,255,255,.12);border:none;color:#fff;cursor:pointer;width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;opacity:.9}
.tlc-close:hover{opacity:1;background:rgba(255,255,255,.25)}
.tlc-close svg{width:16px;height:16px;fill:#fff}

/* ---- Body ---- */
.tlc-body{flex:1;overflow-y:auto;padding:16px 14px 8px;background:#f3f5f9;display:flex;flex-direction:column;gap:9px}
.tlc-body::-webkit-scrollbar{width:8px}
.tlc-body::-webkit-scrollbar-thumb{background:#cfd6e2;border-radius:8px}
.tlc-body::-webkit-scrollbar-thumb:hover{background:#b4bdcd}

/* ---- Prechat / welcome ---- */
.tlc-prechat{padding:22px 18px;display:flex;flex-direction:column}
.tlc-welcome{text-align:center;margin-bottom:18px}
.tlc-welcome-avatar{width:58px;height:58px;border-radius:50%;margin:0 auto 12px;background:linear-gradient(135deg,#2563eb,#1e3a8a);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 20px rgba(37,99,235,.3)}
.tlc-welcome-avatar svg{width:28px;height:28px;fill:#fff}
.tlc-welcome-title{margin:0 0 4px;font-size:18px;font-weight:700;color:#1f2937}
.tlc-welcome-sub{margin:0;color:#6b7280;font-size:13.5px;line-height:1.5}
.tlc-prechat input{width:100%;box-sizing:border-box;padding:11px 14px;margin-bottom:10px;border:1px solid #dde1e8;
  border-radius:10px;font-size:14px;transition:border-color .15s,box-shadow .15s}
.tlc-prechat input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.13)}
.tlc-btn{width:100%;padding:12px;background:linear-gradient(135deg,#2563eb,#1e3a8a);color:#fff;border:none;border-radius:10px;
  font-size:14px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:filter .15s,transform .1s;box-shadow:0 6px 16px rgba(37,99,235,.28)}
.tlc-btn:hover{filter:brightness(1.06)}
.tlc-btn:active{transform:translateY(1px)}
.tlc-btn:disabled{opacity:.6;cursor:default}
.tlc-btn svg{width:16px;height:16px;fill:#fff}

/* ---- Messages ---- */
.tlc-msg{max-width:82%;padding:9px 13px;border-radius:16px;font-size:13.5px;line-height:1.45;word-wrap:break-word;white-space:pre-wrap;
  animation:tlc-in .22s ease both;box-shadow:0 1px 2px rgba(15,23,42,.06)}
@keyframes tlc-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.tlc-msg.tlc-customer{align-self:flex-end;background:linear-gradient(135deg,#2563eb,#1e3a8a);color:#fff;border-bottom-right-radius:5px}
.tlc-msg.tlc-agent{align-self:flex-start;background:#fff;color:#1f2430;border:1px solid #e8ebf0;border-bottom-left-radius:5px}
.tlc-msg.tlc-system{align-self:center;background:#e7ecf3;color:#5b6675;font-size:12px;border-radius:10px;box-shadow:none;text-align:center;max-width:92%}
.tlc-msg .tlc-sender{display:block;font-size:11px;font-weight:700;color:#2563eb;margin-bottom:2px}
.tlc-msg a.tlc-file{color:inherit;text-decoration:underline}

/* ---- Quote & reply ---- */
.tlc-msg{position:relative}
.tlc-quote{display:block;border-left:3px solid rgba(37,99,235,.85);background:rgba(37,99,235,.08);border-radius:7px;
  padding:5px 9px;margin:0 0 6px;font-size:12px;line-height:1.35;cursor:pointer;white-space:normal;
  overflow:hidden;text-overflow:ellipsis;max-height:54px;color:#475569}
.tlc-msg.tlc-customer .tlc-quote{border-left-color:rgba(255,255,255,.85);background:rgba(255,255,255,.16);color:rgba(255,255,255,.92)}
.tlc-quote .tlc-quote-sender{display:block;font-weight:700;font-size:11px;color:#2563eb;margin-bottom:1px}
.tlc-msg.tlc-customer .tlc-quote .tlc-quote-sender{color:#fff}
.tlc-reply-btn{position:absolute;top:-9px;width:24px;height:24px;border-radius:50%;border:1px solid #dde1e8;background:#fff;
  color:#64748b;cursor:pointer;font:600 13px/1 system-ui,sans-serif;display:none;align-items:center;justify-content:center;
  padding:0;box-shadow:0 2px 6px rgba(15,23,42,.16);z-index:2}
.tlc-msg.tlc-agent .tlc-reply-btn{right:-9px}
.tlc-msg.tlc-customer .tlc-reply-btn{left:-9px}
.tlc-msg:hover .tlc-reply-btn{display:flex}
/* Touch devices have no hover — keep the reply button visible (subtle). */
@media (hover:none){.tlc-msg .tlc-reply-btn{display:flex;opacity:.7}}
.tlc-reply-btn:hover{color:#2563eb;border-color:#2563eb;background:#eef3ff}
.tlc-flash{outline:2px solid #2563eb;outline-offset:2px;transition:outline-color .3s}
.tlc-replybar{display:flex;align-items:center;gap:8px;background:#f3f6fd;border:1px solid #dbe4f5;border-left:3px solid #2563eb;
  border-radius:9px;padding:6px 9px;font-size:12px;color:#475569}
.tlc-replybar-info{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tlc-replybar-info .tlc-quote-sender{display:block;font-weight:700;font-size:11px;color:#2563eb}
.tlc-replybar-x{flex:0 0 auto;width:22px;height:22px;border-radius:50%;border:none;background:#e2e8f0;color:#475569;
  cursor:pointer;font:700 13px/1 system-ui,sans-serif;display:flex;align-items:center;justify-content:center;padding:0}
.tlc-replybar-x:hover{background:#cbd5e1}

/* "Start new chat" button shown after a chat ends */
.tlc-newchat{display:flex;justify-content:center;padding:12px 0 4px}
.tlc-newchat .tlc-btn{width:auto;padding:10px 22px}

/* ---- Footer ---- */
.tlc-footer{border-top:1px solid #e8ebf0;padding:10px 12px;display:flex;flex-direction:column;align-items:stretch;gap:8px;background:#fff;position:relative}
.tlc-controls{display:flex;align-items:flex-end;gap:6px}
.tlc-emoji-panel{position:absolute;bottom:56px;left:8px;right:8px;background:#fff;border:1px solid #e6e8ec;border-radius:12px;
  box-shadow:0 10px 30px rgba(15,23,42,.2);padding:8px;display:none;grid-template-columns:repeat(8,1fr);gap:2px;max-height:178px;overflow-y:auto;z-index:6}
.tlc-emoji-panel.tlc-show{display:grid}
.tlc-emoji-panel span{cursor:pointer;font-size:20px;text-align:center;padding:5px 0;border-radius:7px;line-height:1}
.tlc-emoji-panel span:hover{background:#eef3ff}
/* Auto-growing textarea — appearance reset + no scrollbar arrows. */
.tlc-footer textarea{flex:1 1 auto;min-width:0;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;
  border:1px solid #dde1e8;border-radius:21px;padding:11px 15px;font-size:13.5px;height:44px;min-height:44px;max-height:120px;overflow-y:hidden;
  font-family:inherit;line-height:1.4;transition:border-color .15s;background:#fff;color:#1f2430;box-sizing:border-box}
.tlc-footer textarea:focus{outline:none;border-color:#2563eb}
.tlc-footer textarea::-webkit-scrollbar{width:6px}
.tlc-footer textarea::-webkit-scrollbar-button{display:none;height:0;width:0}
.tlc-footer textarea::-webkit-scrollbar-thumb{background:#cfd6e2;border-radius:6px}
.tlc-icon-btn{background:none;border:none;cursor:pointer;color:#7b8595;display:flex;align-items:center;justify-content:center;padding:7px;border-radius:50%;transition:color .15s,background .15s;flex:0 0 auto}
.tlc-icon-btn:hover{color:#2563eb;background:#eef3ff}
.tlc-icon-btn svg{width:20px;height:20px;fill:currentColor}
.tlc-send-btn{width:40px;height:40px;background:linear-gradient(135deg,#2563eb,#1e3a8a);color:#fff;border:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;flex:0 0 auto;transition:filter .15s,transform .1s;box-shadow:0 4px 12px rgba(37,99,235,.3)}
.tlc-send-btn:hover{filter:brightness(1.07)}
.tlc-send-btn:active{transform:scale(.93)}
.tlc-send-btn svg{width:18px;height:18px;fill:#fff}
/* ---- Attachment previews (tawk-style thumbnails, multiple) ---- */
.tlc-previews{display:none;flex-wrap:wrap;gap:9px;padding:2px 2px 0}
.tlc-prev-item{position:relative;width:56px;height:56px;flex:0 0 auto}
.tlc-prev-thumb{width:100%;height:100%;border-radius:10px;border:1px solid #e0e5ee;overflow:hidden;background:#f3f5f9;display:flex;align-items:center;justify-content:center}
.tlc-prev-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.tlc-prev-doc{font-size:24px;line-height:1}
.tlc-prev-name{position:absolute;left:0;right:0;bottom:0;font-size:8px;line-height:1.3;background:rgba(15,23,42,.6);color:#fff;padding:1px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom-left-radius:10px;border-bottom-right-radius:10px}
.tlc-prev-x{position:absolute;top:-7px;right:-7px;width:19px;height:19px;border-radius:50%;background:#ef4444;color:#fff;border:2px solid #fff;cursor:pointer;font:700 12px/1 system-ui,sans-serif;display:flex;align-items:center;justify-content:center;padding:0;box-shadow:0 1px 4px rgba(0,0,0,.25)}
.tlc-prev-x:hover{background:#dc2626}
.tlc-prev-add{width:56px;height:56px;border-radius:10px;border:1.5px dashed #c3ccdb;background:#f8fafc;color:#94a3b8;font-size:26px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1;flex:0 0 auto;padding:0}
.tlc-prev-add:hover{border-color:#2563eb;color:#2563eb;background:#eef3ff}
.tlc-ended{padding:14px;text-align:center;color:#777;font-size:13px}

/* ---- Mobile: full screen ---- */
@media (max-width:480px){
  .tlc-panel{inset:0;width:100%;height:100%;max-width:100%;max-height:100%;border-radius:0;bottom:0;right:0}
  .tlc-panel.tlc-left{left:0}
  .tlc-launcher{right:16px;bottom:16px}
  .tlc-launcher.tlc-left{left:16px}
}
