.chatbot-launcher {
  position: fixed;
  right: 22px;
  bottom: 112px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: .48rem;
  min-height: 54px;
  padding: .42rem 1rem .42rem .38rem;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  background: linear-gradient(135deg,#006f68,#168ec2);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0,83,79,.3);
  font: 700 .86rem/1.2 "IBM Plex Sans Thai",sans-serif;
  cursor: pointer;
  transition: transform .2s ease,box-shadow .2s ease;
}
.chatbot-launcher img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,.96);
}
.chatbot-launcher:hover,.chatbot-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(0,83,79,.36);
}
.chatbot-panel {
  position: fixed;
  right: 22px;
  bottom: 178px;
  z-index: 1250;
  width: min(420px,calc(100vw - 28px));
  max-height: min(690px,calc(100vh - 194px));
  overflow: hidden;
  border: 1px solid #cfe4df;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,43,55,.26);
  grid-template-rows: auto minmax(210px,1fr) auto auto auto;
}
.chatbot-panel:not([hidden]) { display: grid; }
.chatbot-header {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) 76px 26px;
  align-items: center;
  gap: .62rem;
  min-height: 76px;
  padding: 10px 12px;
  background: linear-gradient(135deg,#004f61,#087f94 66%,#15aaa1);
  color: #fff;
}
.chatbot-avatar {
  width: 52px;
  height: 52px;
  padding: 2px;
  object-fit: contain;
  border: 2px solid rgba(255,255,255,.84);
  border-radius: 50%;
  background: #fff;
}
.chatbot-header > span { display:grid; gap:.1rem; min-width:0; }
.chatbot-header strong { font-size:1.05rem; }
.chatbot-header small { color:#d8f7f1; font-size:.72rem; }
.chatbot-brand-logo {
  width: 76px;
  height: 40px;
  padding: 3px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
}
.chatbot-header button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.chatbot-messages {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-height: 210px;
  padding: 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg,#f6faf9,#eef7f6);
}
.chatbot-message {
  max-width: 90%;
  padding: .72rem .82rem;
  border-radius: 14px;
  font-size: .83rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chatbot-message.bot {
  align-self: flex-start;
  border: 1px solid #d6e9e4;
  border-top-left-radius: 4px;
  background: #fff;
  color: #244b4b;
}
.chatbot-message.user {
  align-self: flex-end;
  border-top-right-radius: 4px;
  background: #087c70;
  color: #fff;
}
.chatbot-message a { color:#006e66; font-weight:800; }
.chatbot-message-copy { min-width:0; }
.chatbot-answer { display:grid; gap:.68rem; }
.chatbot-answer-group {
  display:grid;
  gap:.34rem;
  min-width:0;
}
.chatbot-answer-group + .chatbot-answer-group {
  padding-top:.62rem;
  border-top:1px solid #e3efec;
}
.chatbot-answer-heading {
  display:block;
  color:#073d49;
  font-size:.82rem;
  font-weight:900;
  line-height:1.4;
}
.chatbot-answer p { margin:0; }
.chatbot-answer-list {
  display:grid;
  gap:.38rem;
  margin:.06rem 0 0;
  padding:0;
  list-style:none;
}
.chatbot-answer-list li {
  position:relative;
  min-width:0;
  padding-left:1.15rem;
}
.chatbot-answer-list-detail {
  display:block;
  margin-top:.16rem;
  color:#5f7773;
  font-size:.78rem;
  line-height:1.45;
}
.chatbot-answer-list li::before {
  content:"•";
  position:absolute;
  left:.16rem;
  top:0;
  color:#00988e;
  font-weight:900;
}
.chatbot-answer-list li[data-number]::before {
  content:attr(data-number) ".";
  left:0;
  color:#087c70;
}
.chatbot-product-cards { display:grid; gap:.55rem; }
.chatbot-product-card {
  display: grid;
  gap: .28rem;
  padding: .72rem .78rem;
  border: 1px solid #cce3dd;
  border-left: 4px solid #10a69b;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(0,86,79,.07);
}
.chatbot-product-card strong { color:#063d4c; font-size:.82rem; }
.chatbot-product-card small { color:#00786d; font-weight:700; }
.chatbot-product-card p { margin:0; color:#55716d; font-size:.74rem; line-height:1.45; }
.chatbot-product-card a { color:#006f68; font-size:.76rem; font-weight:800; }
.chatbot-lead-confirmation {
  align-self: stretch;
  padding: .5rem .65rem;
  border-radius: 10px;
  background: #e9f8f4;
  color: #247067;
  font-size: .68rem;
  line-height: 1.45;
}
.chatbot-contact-card {
  display: grid;
  gap: .45rem;
  padding: .75rem;
  border: 1px solid #b9ddd4;
  border-radius: 14px;
  background: #fff;
  color: #244b4b;
}
.chatbot-contact-card > strong { color:#063d4c; font-size:.86rem; }
.chatbot-contact-card > p { margin:0; color:#5d7772; font-size:.72rem; line-height:1.45; }
.chatbot-contact-card > button,
.chatbot-contact-form > button {
  border: 0;
  border-radius: 10px;
  background: #007d72;
  color: #fff;
  padding: .62rem .72rem;
  font: 800 .74rem/1.2 inherit;
  cursor: pointer;
}
.chatbot-contact-form { display:grid; gap:.48rem; }
.chatbot-contact-form[hidden] { display:none; }
.chatbot-contact-form label { display:grid; gap:.22rem; color:#345d58; font-size:.7rem; font-weight:700; }
.chatbot-contact-form input,
.chatbot-contact-form select {
  width:100%;
  min-width:0;
  border:1px solid #bdd8d2;
  border-radius:9px;
  background:#fff;
  padding:.55rem .62rem;
  font:inherit;
}
.chatbot-contact-form .chatbot-contact-consent {
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:start;
  gap:.42rem;
  font-weight:500;
  line-height:1.45;
}
.chatbot-contact-consent input { width:auto; margin-top:.15rem; }
.chatbot-contact-form small { color:#bd2f4f; font-size:.68rem; }
.chatbot-contact-success { margin:0; color:#00766d; font-size:.75rem; font-weight:700; }
.chatbot-line-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: .65rem;
  align-items: center;
  margin-top: .65rem;
  padding: .55rem;
  border-radius: 12px;
  background: #effaf4;
}
.chatbot-line-card img { width:78px; height:78px; }
.chatbot-line-card a { margin:0; }
.chatbot-quick-actions {
  display: flex;
  gap: .4rem;
  padding: 10px 12px;
  overflow-x: auto;
  border-top: 1px solid #e2ece9;
  background: #fff;
}
.chatbot-quick-actions button {
  flex: 0 0 auto;
  border: 1px solid #aad2c8;
  border-radius: 999px;
  background: #fff;
  color: #006d63;
  padding: .43rem .65rem;
  font: 700 .72rem/1.2 inherit;
  cursor: pointer;
}
.chatbot-quick-actions button:hover { background:#eaf7f3; }
.chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .45rem;
  padding: 10px 12px;
  border-top: 1px solid #e2ece9;
  background: #fff;
}
.chatbot-form label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.chatbot-form input { min-width:0; border:1px solid #bdd8d2; border-radius:12px; padding:.68rem .75rem; font:inherit; }
.chatbot-form button { border:0; border-radius:11px; background:#007d72; color:#fff; padding:.65rem .85rem; font:800 .78rem/1 inherit; cursor:pointer; }
.chatbot-form button:disabled,.chatbot-form input:disabled { opacity:.62; cursor:wait; }
.chatbot-disclaimer { margin:0; padding:0 12px 10px; color:#6b807c; background:#fff; font-size:.65rem; line-height:1.4; }
.chatbot-typing { display:flex; gap:4px; align-items:center; min-width:52px; }
.chatbot-typing i { width:7px; height:7px; border-radius:50%; background:#16a69c; animation:nong-noodee-typing 1s infinite ease-in-out; }
.chatbot-typing i:nth-child(2) { animation-delay:.15s; }
.chatbot-typing i:nth-child(3) { animation-delay:.3s; }
@keyframes nong-noodee-typing { 0%,60%,100%{transform:translateY(0);opacity:.45} 30%{transform:translateY(-4px);opacity:1} }
.cart-drawer.open ~ .chatbot-launcher,.cart-drawer.open ~ .chatbot-panel { display:none!important; }
@media(max-width:720px) {
  .line-friend-section { padding:48px 0; }
  .line-friend-layout { grid-template-columns:1fr; gap:25px; }
  .line-friend-card { width:min(320px,100%); justify-self:center; }
  .chatbot-launcher { right:14px; bottom:76px; width:54px; min-height:54px; height:54px; padding:4px; justify-content:center; }
  .chatbot-launcher img { width:44px; height:44px; }
  .chatbot-launcher > strong { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .chatbot-panel { right:14px; bottom:158px; max-height:calc(100vh - 174px); }
  .chatbot-header { grid-template-columns:48px minmax(0,1fr) 62px 24px; }
  .chatbot-avatar { width:48px; height:48px; }
  .chatbot-brand-logo { width:62px; height:36px; }
}
@media(max-height:680px) {
  .chatbot-panel { bottom:88px; max-height:calc(100vh - 102px); }
  .chatbot-launcher { bottom:28px; }
}
