#ktlc-root{font-family:Arial,Helvetica,sans-serif}.ktlc-button{position:fixed;right:22px;bottom:22px;z-index:99999;border:0;border-radius:999px;color:#fff;padding:14px 18px;box-shadow:0 8px 24px rgba(0,0,0,.22);cursor:pointer;font-weight:700;font-size:15px}.ktlc-window{position:fixed;right:22px;bottom:82px;width:350px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 110px);background:#fff;border-radius:16px;box-shadow:0 18px 48px rgba(0,0,0,.24);z-index:99999;display:none;overflow:hidden;border:1px solid #e6e8ec}.ktlc-header{color:#fff;padding:16px 18px;font-weight:700;display:flex;justify-content:space-between;align-items:center}.ktlc-close{background:transparent;border:0;color:#fff;font-size:24px;cursor:pointer}.ktlc-body{height:336px;overflow:auto;padding:14px;background:#f6f8fb}.ktlc-hours{font-size:12px;color:#5d6778;background:#fff;border:1px solid #edf0f5;border-radius:10px;padding:8px 10px;margin-bottom:10px}.ktlc-msg{margin:8px 0;display:flex}.ktlc-msg span{padding:10px 12px;border-radius:14px;max-width:85%;white-space:pre-wrap;line-height:1.35;font-size:14px}.ktlc-msg.customer{justify-content:flex-end}.ktlc-msg.customer span{background:#2872fa;color:#fff;border-bottom-right-radius:4px}.ktlc-msg.agent span,.ktlc-msg.system span{background:#fff;color:#1d2733;border:1px solid #e8ecf2;border-bottom-left-radius:4px}.ktlc-attachment img{display:block;margin-top:8px;max-width:180px;max-height:180px;border-radius:10px}.ktlc-form{padding:12px;background:#fff;border-top:1px solid #edf0f5}.ktlc-guest-fields{display:flex;gap:8px;margin-bottom:8px}.ktlc-guest-fields input{width:50%;padding:9px;border:1px solid #d8dee8;border-radius:8px}.ktlc-actions{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:12px}.ktlc-actions button,.ktlc-file-btn{border:1px solid #d8dee8;background:#fff;color:#1d2733;border-radius:8px;padding:7px 9px;cursor:pointer;font-size:12px}.ktlc-file-btn input{display:none}#ktlc-file-name{color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.ktlc-input-row{display:flex;gap:8px}.ktlc-input-row textarea{flex:1;resize:none;height:48px;border:1px solid #d8dee8;border-radius:10px;padding:9px}.ktlc-input-row button{border:0;color:#fff;border-radius:10px;padding:0 16px;font-weight:700;cursor:pointer}.ktlc-note{font-size:11px;color:#6b7280;margin-top:6px}.ktlc-hidden{display:none!important}@media(max-width:480px){.ktlc-window{right:10px;left:10px;width:auto;bottom:74px}.ktlc-button{right:16px;bottom:16px}}
.ktlc-youtube{margin-top:8px;position:relative;width:220px;max-width:100%;aspect-ratio:16/9;border-radius:10px;overflow:hidden;background:#000}.ktlc-youtube iframe{width:100%;height:100%;display:block}.ktlc-msg.customer .ktlc-youtube{background:#000}.ktlc-msg.customer .ktlc-attachment img{border:1px solid rgba(255,255,255,.45)}
.ktlc-youtube iframe{border:0;pointer-events:auto;position:absolute;inset:0}

/* v1.4: make embedded videos easier to watch and fullscreen */
.ktlc-window{width:390px;height:600px;max-height:calc(100vh - 100px)}
.ktlc-body{height:374px}
.ktlc-msg span{max-width:96%;display:block;box-sizing:border-box}
.ktlc-youtube{width:320px;max-width:100%;aspect-ratio:16/9;border-radius:12px}
.ktlc-youtube iframe{width:100%;height:100%;position:absolute;inset:0;border:0}
@media(max-width:480px){.ktlc-window{width:auto;height:calc(100vh - 92px);max-height:calc(100vh - 92px)}.ktlc-body{height:calc(100vh - 280px)}.ktlc-youtube{width:100%}}
.ktlc-error{font-size:12px;color:#b42318;margin-top:6px}.ktlc-ended{font-size:12px;color:#5d6778;background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:7px 8px;margin-top:6px}.ktlc-ended button{border:1px solid #d8dee8;background:#fff;border-radius:6px;padding:3px 7px;margin-left:6px;cursor:pointer}
.ktlc-agent-name{font-weight:700;color:#475569;font-size:12px}

/* v2.9 mobile layout fix: keep message input visible on small screens */
.ktlc-window.ktlc-open{display:flex!important;flex-direction:column}
.ktlc-window.ktlc-open .ktlc-body{flex:1 1 auto;min-height:0}
.ktlc-window.ktlc-open .ktlc-form{flex:0 0 auto}
@media(max-width:480px){
  .ktlc-window{left:10px;right:10px;top:calc(env(safe-area-inset-top,0px) + 10px);bottom:calc(env(safe-area-inset-bottom,0px) + 10px);width:auto;height:auto!important;max-height:none!important;border-radius:16px}
  .ktlc-header{padding:14px 16px}
  .ktlc-body{height:auto!important;min-height:0;padding:12px}
  .ktlc-form{padding:10px 12px 12px}
  .ktlc-guest-fields{gap:8px}
  .ktlc-guest-fields input{font-size:16px;padding:10px 12px;min-width:0}
  .ktlc-actions{flex-wrap:wrap;gap:8px}
  .ktlc-actions button,.ktlc-file-btn{font-size:14px;padding:8px 10px}
  .ktlc-input-row textarea{font-size:16px;height:46px;min-height:46px}
  .ktlc-input-row button{font-size:16px;min-width:76px;padding:0 14px}
  #ktlc-file-name{max-width:100%}
}

.ktlc-file-link{display:inline-block;margin-top:8px;color:#2872fa;text-decoration:underline;font-size:13px}
/* v3.2.5 on-site notification badge */
.ktlc-button{position:fixed}
.ktlc-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:6px;border-radius:999px;background:#ef4444;color:#fff;font-size:12px;line-height:18px;font-weight:700;vertical-align:middle}

/* v3.2.6 product cards */
.ktlc-product-card{display:grid;grid-template-columns:82px 1fr;gap:10px;min-width:240px;max-width:100%;background:#fff;border:1px solid #d8e0ea;border-radius:12px;padding:10px;box-sizing:border-box}.ktlc-product-card img{width:82px;height:82px;object-fit:cover;border-radius:9px;border:1px solid #e2e8f0;background:#fff}.ktlc-product-card-body strong{display:block;color:#1e293b;margin-bottom:4px;line-height:1.25}.ktlc-product-card-body small{display:block;color:#64748b;margin:2px 0}.ktlc-product-card-btn{display:inline-block;margin-top:7px;background:#2872fa;color:#fff!important;text-decoration:none;border-radius:8px;padding:7px 10px;font-weight:700;font-size:13px}.ktlc-msg.agent .ktlc-product-card{border-bottom-left-radius:4px}.ktlc-msg.customer .ktlc-product-card{border-color:rgba(255,255,255,.45)}@media(max-width:480px){.ktlc-product-card{grid-template-columns:70px 1fr;min-width:0}.ktlc-product-card img{width:70px;height:70px}}

/* v3.2.8 optimistic send */
.ktlc-pending-msg{opacity:.78}.ktlc-send-failed{opacity:1}.ktlc-send-failed span{border:1px solid #d63638!important;background:#fff5f5!important}.ktlc-retry-send{margin-top:6px;border:1px solid #d63638;background:#fff;color:#d63638;border-radius:6px;padding:4px 8px}.ktlc-send-state{display:block;margin-top:4px;font-size:11px;color:#666}.ktlc-category-card .ktlc-product-card-btn{background:#2872fa}

/* v3.2.10: nicer product/category cards without image */
.ktlc-product-card.ktlc-no-image{display:block;min-width:0;max-width:100%;width:100%;padding:12px 14px;box-sizing:border-box;}
.ktlc-product-card.ktlc-no-image .ktlc-product-card-body{display:block;}
.ktlc-product-card.ktlc-no-image .ktlc-product-card-body strong{font-size:15px;line-height:1.3;margin-bottom:6px;}
.ktlc-product-card.ktlc-no-image .ktlc-product-card-body small{line-height:1.45;}
.ktlc-product-card-desc{display:-webkit-box!important;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;}
.ktlc-product-card.ktlc-no-image .ktlc-product-card-btn{margin-top:10px;}
.ktlc-category-card.ktlc-no-image{max-width:100%;}

/* v3.2.11: customer product search panel */
.ktlc-customer-product-panel{display:block;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:10px;margin:0 0 8px 0;max-height:240px;overflow:auto}
.ktlc-customer-product-label{font-size:12px;font-weight:700;color:#475569;margin:2px 0 6px}
.ktlc-customer-product-current{border-bottom:1px solid #e2e8f0;margin-bottom:10px;padding-bottom:10px}
.ktlc-customer-send-current,.ktlc-customer-product-result>button{border:0;background:#2872fa;color:#fff;border-radius:8px;padding:8px 10px;font-size:13px;font-weight:700;cursor:pointer;margin-top:8px}
.ktlc-customer-product-search{display:flex;gap:8px;margin-bottom:8px}
.ktlc-customer-product-search input{flex:1;min-width:0;border:1px solid #d8dee8;border-radius:8px;padding:8px 10px;font-size:14px}
.ktlc-customer-product-search button{border:1px solid #2872fa;background:#2872fa;color:#fff;border-radius:8px;padding:8px 10px;font-size:13px;font-weight:700;cursor:pointer}
.ktlc-customer-product-results{display:flex;flex-direction:column;gap:8px}
.ktlc-customer-product-result{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:8px}
.ktlc-customer-product-result .ktlc-product-card,.ktlc-customer-product-current .ktlc-product-card{box-shadow:none;margin:0}
.ktlc-product-empty{font-size:12px;color:#64748b;padding:8px;background:#fff;border:1px dashed #cbd5e1;border-radius:8px}
@media(max-width:480px){
  .ktlc-customer-product-panel{max-height:32vh;padding:9px;margin-bottom:8px}
  .ktlc-customer-product-search{gap:6px}
  .ktlc-customer-product-search input{font-size:16px;padding:9px 10px}
  .ktlc-customer-product-search button{font-size:14px;padding:9px 10px;white-space:nowrap}
  .ktlc-customer-send-current,.ktlc-customer-product-result>button{width:100%;font-size:14px;padding:9px 10px}
}

/* v3.3.5 customer-pasted product links */
.ktlc-product-link-card{color:inherit!important;text-decoration:none!important;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.ktlc-product-link-card:hover,.ktlc-product-link-card:focus{border-color:#2872fa!important;box-shadow:0 3px 12px rgba(40,114,250,.16);transform:translateY(-1px);outline:none}
.ktlc-product-link-card .ktlc-product-card-body{align-self:center;min-width:0}
.ktlc-product-link-card .ktlc-product-card-body strong{color:#1e293b}

/* AI Live processing uses the existing business-hours note. */
.ktlc-note.ktlc-ai-processing{color:#1760a4;font-weight:600;}
.ktlc-note.ktlc-ai-processing:before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:#2872fa;margin-right:7px;animation:ktlc-processing-pulse 1.1s ease-in-out infinite alternate;}
@keyframes ktlc-processing-pulse{from{opacity:.25}to{opacity:1}}
