/* Live chat widget — TikTok Shop professional landing */
#lc-root {
  --lc-primary: #3BB5D4;
  --lc-accent: #F0357A;
  --lc-header-bg: #3BB5D4;
  --lc-header-text: #FFFFFF;
  --lc-header-subtext: #FFF8FA;
  --lc-agent-bg: #FFFFFF;
  --lc-agent-text: #151515;
  --lc-visitor-bg: #F0357A;
  --lc-visitor-text: #FFFFFF;
  --lc-launcher-bg: #F0357A;
  --lc-launcher-text: #FFFFFF;
  --lc-text: #151515;
  --lc-muted: #64748b;
  --lc-bg: #fff;
  --lc-online: #22c55e;
  --lc-shadow: 0 22px 60px rgba(28, 45, 72, 0.22);
  position: fixed;
  left: 12px;
  right: auto;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 9998;
  font-family: Sarabun, 'Noto Sans Thai', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

#lc-launcher {
  width: auto;
  max-width: min(340px, calc(100vw - 24px));
  height: auto;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  color: #111827;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  text-align: left;
}
#lc-launcher:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16); }
#lc-launcher:active { transform: translateY(0); }
#lc-root.lc-open #lc-launcher { display: none; }

.lc-launcher-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.lc-launcher-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lc-launcher-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding-right: 4px;
}
.lc-launcher-copy b {
  font-size: 13.5px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.lc-launcher-copy small {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
  white-space: nowrap;
}

#lc-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

#lc-panel {
  display: none;
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  width: min(378px, calc(100vw - 20px));
  height: min(640px, calc(100vh - 118px));
  background: var(--lc-bg);
  border-radius: 28px;
  box-shadow: var(--lc-shadow);
  overflow: hidden;
  flex-direction: column;
}

#lc-root.lc-open #lc-panel { display: flex; }

.lc-head {
  padding: 16px 16px 18px;
  color: var(--lc-header-text);
  background: linear-gradient(115deg, var(--lc-header-bg) 0%, #7C6CFF 52%, var(--lc-accent) 100%);
  flex-shrink: 0;
}
.lc-head p { color: var(--lc-header-subtext); }
.lc-head.is-night {
  background: linear-gradient(115deg, #0F2744 0%, #1E3A5F 55%, #312E81 100%);
}

.lc-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1.5px solid rgba(255,255,255,.55);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.lc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lc-head-copy { min-width: 0; flex: 1; }
.lc-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.lc-head p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: .95;
}
.lc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lc-online);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
  flex-shrink: 0;
}
.lc-dot.is-off {
  background: #cbd5e1;
  box-shadow: none;
}

.lc-icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--lc-header-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lc-offline {
  display: none;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.45;
  background: #fff7ed;
  color: #9a3412;
  border-bottom: 1px solid #fed7aa;
}
.lc-offline.is-on { display: block; }

.lc-scroll {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 42%);
}

.lc-home {
  padding: 8px 14px 6px;
}

.lc-hero {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 6px;
  align-items: center;
  padding: 6px 4px 10px;
}
.lc-bot {
  width: 108px;
  height: 128px;
  object-fit: cover;
  object-position: center 8%;
  border-radius: 22px;
  background: #eef6ff;
  box-shadow: 0 10px 22px rgba(59, 181, 212, .22);
}
.lc-hello {
  display: inline-block;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 12px 12px 12px 4px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
  margin-bottom: 8px;
}
.lc-hero h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #0f172a;
  line-height: 1.2;
}
.lc-hero .lc-lead {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  font-weight: 500;
}

.lc-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 12px 12px 12px 10px;
  border-radius: 18px;
  background: linear-gradient(90deg, #eef6ff 0%, #f7fbff 55%, #ffffff 100%);
  box-shadow: 0 8px 20px rgba(80, 120, 180, .08);
  font: inherit;
  color: inherit;
}
.lc-card.is-cyan {
  background: linear-gradient(90deg, #e6fbff 0%, #f4feff 55%, #ffffff 100%);
}
.lc-card.is-cyan .lc-card-ico {
  background: linear-gradient(145deg, #5EEAD4, #14B8A6);
  box-shadow: 0 8px 16px rgba(20, 184, 166, .28);
}
.lc-rec-back {
  border: 0; background: transparent; color: #64748b; font: inherit;
  font-weight: 700; font-size: 13px; padding: 4px 0 8px; cursor: pointer;
}
.lc-rec-title { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: #0f172a; }
.lc-rec-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 14px; margin-bottom: 4px;
  background: #fff;
  border: 1px solid #e8eef5;
  color: #0f172a;
}
.lc-msg.agent .lc-rec-card,
.lc-msg.visitor .lc-rec-card {
  background: #fff; border: 1px solid #e8eef5; color: #0f172a;
}
.lc-rec-ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; font-size: 14px; flex-shrink: 0;
  background: linear-gradient(145deg, #4DA6FF, #2563EB);
}
.lc-rec-card.tone-cyan .lc-rec-ico { background: linear-gradient(145deg, #5EEAD4, #14B8A6); }
.lc-rec-card.tone-pink .lc-rec-ico { background: linear-gradient(145deg, #FF6B9A, #EE3B78); }
.lc-rec-copy { min-width: 0; flex: 1; }
.lc-rec-card b { display: block; font-size: 13px; font-weight: 800; color: #0f172a; }
.lc-rec-card span { display: block; font-size: 12px; line-height: 1.4; color: #475569; opacity: 1; margin-top: 3px; }
.lc-rec-card a { font-size: 12px; font-weight: 700; color: #1A93B0; }
.lc-pay {
  width: 246px; max-width: 100%;
  background: #fff; border-radius: 18px; overflow: hidden;
  border: 1px solid #e2e8f0; box-shadow: 0 10px 22px rgba(15,23,42,.1);
  text-align: left; color: #0f172a; margin: 0 0 6px;
}
.lc-pay-h {
  display: flex; align-items: center; gap: 8px;
  background: #0f172a; color: #fff; font-size: 12px; font-weight: 800; padding: 8px 12px;
}
.lc-pay-h i { color: #6ee7b7; }
.lc-pay-amt { font-size: 18px; font-weight: 800; letter-spacing: -.02em; padding: 12px 12px 2px; font-variant-numeric: tabular-nums; word-break: break-all; }
.lc-pay-title { font-size: 13px; font-weight: 700; padding: 0 12px 6px; color: #334155; }
.lc-pay-note { font-size: 12px; color: #64748b; padding: 0 12px 8px; }
.lc-pay-bank { padding: 8px 12px; border-top: 1px solid #f1f5f9; font-size: 12px; }
.lc-pay-row, .lc-pay-acc { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
.lc-pay-row em, .lc-pay-acc em { font-style: normal; color: #94a3b8; min-width: 62px; font-weight: 600; }
.lc-pay-row strong, .lc-pay-acc b { min-width: 0; font-weight: 700; word-break: break-all; }
.lc-pay-acc b { font-size: 15px; font-variant-numeric: tabular-nums; }
.lc-pay-copy {
  margin-left: auto; border: 0; background: #ecfdf5; color: #047857;
  border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.lc-pay-qrwrap { padding: 2px 12px 10px; text-align: center; }
.lc-pay-qr {
  width: 140px; height: 140px; object-fit: contain; margin: 0 auto;
  display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 6px;
}
.lc-pay-qrwrap small { display: block; margin-top: 6px; color: #64748b; font-size: 11px; font-weight: 600; }
.lc-pay-st { padding: 0 12px 10px; }
.lc-pay-st span {
  display: inline-flex; border-radius: 999px; padding: 3px 9px;
  font-size: 11px; font-weight: 800; background: #fffbeb; color: #b45309;
}
.lc-pay.st-paid .lc-pay-st span { background: #ecfdf5; color: #047857; }
.lc-pay.st-cancelled .lc-pay-st span { background: #fef2f2; color: #b91c1c; }
.lc-pay.st-slip_sent .lc-pay-st span { background: #eff6ff; color: #1d4ed8; }
.lc-pay-acts { display: flex; gap: 6px; padding: 0 10px 10px; }
.lc-pay-btn {
  flex: 1; border: 0; border-radius: 10px; padding: 8px 6px;
  background: #059669; color: #fff; font-size: 12px; font-weight: 800;
}
.lc-pay-btn.ghost { background: #f1f5f9; color: #0f172a; }
.lc-msg.agent .lc-pay, .lc-msg.visitor .lc-pay { background: #fff; color: #0f172a; }
.lc-card:disabled { opacity: .55; cursor: not-allowed; }
.lc-card-ico {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #4DA6FF, #2563EB);
  box-shadow: 0 8px 16px rgba(37, 99, 235, .28);
}
.lc-card.is-pink .lc-card-ico {
  background: linear-gradient(145deg, #FF6B9A, #EE3B78);
  box-shadow: 0 8px 16px rgba(238, 59, 120, .28);
}
.lc-card-copy { min-width: 0; flex: 1; }
.lc-card-copy b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.lc-card-copy span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
  white-space: pre-line;
}
.lc-card-go {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #94a3b8;
  background: #fff;
  flex-shrink: 0;
  font-size: 12px;
}

.lc-trust {
  text-align: center;
  padding: 4px 8px 8px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
}
.lc-trust b { color: #64748b; font-weight: 700; }
.lc-trust .lc-dot {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px 0 6px;
}

.lc-body {
  padding: 12px 12px 8px;
  display: none;
}
.lc-body.is-on { display: block; }

.lc-msg {
  max-width: 85%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}
.lc-msg.agent {
  background: var(--lc-agent-bg);
  color: var(--lc-agent-text);
  border: 1px solid #eef2f7;
  border-bottom-left-radius: 4px;
  margin-right: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.lc-msg.visitor {
  color: var(--lc-visitor-text);
  background: var(--lc-visitor-bg);
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.lc-del {
  position: absolute;
  left: -22px;
  top: 6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, .45);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}
.lc-msg.visitor:hover .lc-del,
.lc-msg.visitor:focus-within .lc-del,
.lc-del:focus {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 860px) {
  .lc-del { opacity: .7; pointer-events: auto; }
}
.lc-msg.is-ask {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .45);
}
.lc-confirm {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .45);
}
.lc-confirm[hidden] { display: none !important; }
.lc-confirm-card {
  width: 100%;
  max-width: 280px;
  background: #fff;
  border-radius: 18px;
  padding: 20px 18px 16px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}
.lc-confirm-ico {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #FEF2F2;
  color: #DC2626;
  font-size: 18px;
}
.lc-confirm-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
}
.lc-confirm-card p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}
.lc-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lc-confirm-actions button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#lc-confirm-no {
  background: #F1F5F9;
  color: #334155;
}
#lc-confirm-yes {
  background: #DC2626;
  color: #fff;
}
.lc-meta {
  font-size: 10px;
  color: var(--lc-muted);
  margin-top: 4px;
}
.lc-msg.visitor .lc-meta { color: rgba(255,255,255,.78); }
.lc-auto-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1A93B0;
  background: #E6F7FB;
  border-radius: 999px;
  padding: 1px 7px;
  margin-right: 6px;
  vertical-align: middle;
}

.lc-name-form {
  padding: 16px 16px 8px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.lc-name-form.is-on { display: flex; }
.lc-name-form label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}
.lc-name-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
}
.lc-name-form button {
  padding: 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lc-primary), var(--lc-accent));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.lc-foot {
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: center;
}
.lc-composer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1.5px solid #e8eef5;
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
}
.lc-foot textarea {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 88px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
.lc-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--lc-primary), #7C6CFF 46%, var(--lc-accent));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(124, 108, 255, .28);
}
.lc-send:disabled,
.lc-attach:disabled { opacity: 0.5; cursor: not-allowed; }

.lc-attach {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.lc-attach:hover { color: var(--lc-accent); }

.lc-msg img.lc-img {
  display: block;
  max-width: 220px;
  max-height: 180px;
  width: auto;
  border-radius: 10px;
  margin-bottom: 6px;
  object-fit: contain;
  background: #fff;
}
.lc-msg.visitor img.lc-img,
.lc-msg.agent img.lc-img { border: 1px solid #e8eef5; }
.lc-quote {
  font-size: 11px;
  opacity: .8;
  border-left: 2px solid currentColor;
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
}
.lc-file { display: inline-block; margin-bottom: 6px; font-size: 12px; }
.lc-audio { display: block; max-width: 220px; margin-bottom: 6px; }
.lc-msg a { color: inherit; text-decoration: underline; }
.lc-msg .lc-rec-card a { color: #1A93B0; text-decoration: none; }

@media (max-width: 480px) {
  #lc-root {
    left: 10px;
    right: auto;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
  #lc-panel {
    width: calc(100vw - 16px);
    height: min(78vh, 680px);
    border-radius: 24px;
  }
  .lc-hero { grid-template-columns: 88px 1fr; }
  .lc-bot { width: 88px; height: 108px; border-radius: 18px; }
}
