/* เฮียเลี้ยง — ปุ่มแชทลอย โทนส้มคูโบต้า (เวอร์ชันเดียวกับที่เทสผ่าน — บนเว็บ V23 ต้นฉบับ) */
.kbc-wrap, .kbc-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.kbc-wrap {
  position: fixed; right: 16px; bottom: 16px; z-index: 99990;
  font-family: 'Noto Sans Thai', 'Sukhumvit Set', 'Leelawadee UI', system-ui, sans-serif;
  color: #241a12;
}

/* ---------- ปุ่มลอย ---------- */
.kbc-fab {
  position: relative; display: flex; align-items: center; gap: 10px;
  border: none; cursor: pointer; background: none; padding: 0;
  transition: transform .15s ease;
}
.kbc-fab:active { transform: scale(.95); }
.kbc-fab-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6a00, #ff8c1a);
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(230, 88, 0, .45);
  border: 2.5px solid #fff;
}
.kbc-fab-tag {
  background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 800; color: #ff6a00;
  box-shadow: 0 3px 10px rgba(60, 40, 20, .22);
  white-space: nowrap;
}
.kbc-fab.kbc-hide { display: none; }
.kbc-fab-avatar::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #3ddc6f; border: 2.5px solid #fff;
}

/* ---------- แผงแชท ---------- */
.kbc-panel[hidden] { display: none !important; }
.kbc-panel {
  position: fixed; right: 16px; bottom: 16px;
  width: 340px; max-width: calc(100vw - 24px);
  height: 480px; max-height: calc(100dvh - 32px);
  background: #f2eade; border-radius: 18px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(40, 25, 10, .35);
  display: flex; flex-direction: column;
}

.kbc-head {
  background: linear-gradient(135deg, #ff6a00, #ff8c1a);
  color: #fff; padding: 11px 13px;
  display: flex; align-items: center; gap: 11px; flex: none;
}
.kbc-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #fff; color: #ff6a00; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.kbc-hcopy { flex: 1; min-width: 0; }
.kbc-title { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.kbc-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #3ddc6f;
  border: 1.5px solid #fff; display: inline-block; flex: none;
}
.kbc-sub { font-size: 10.5px; opacity: .92; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbc-close {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1;
}
.kbc-close:active { background: rgba(255, 255, 255, .35); }

/* ---------- ข้อความ ---------- */
.kbc-msgs { flex: 1; overflow-y: auto; padding: 12px 11px 6px; display: flex; flex-direction: column; gap: 9px; }
.kbc-msg {
  max-width: 82%; padding: 8px 12px; line-height: 1.55; font-size: 13.8px;
  white-space: pre-wrap; word-break: break-word; animation: kbc-pop .18s ease;
}
@keyframes kbc-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kbc-bot {
  align-self: flex-start; background: #fff;
  border-radius: 13px 13px 13px 4px; box-shadow: 0 1px 3px rgba(60, 40, 20, .1);
}
.kbc-user {
  align-self: flex-end; color: #fff;
  background: linear-gradient(135deg, #ff6a00, #ff8c1a);
  border-radius: 13px 13px 4px 13px; box-shadow: 0 1px 3px rgba(200, 80, 0, .25);
}
.kbc-note {
  align-self: center; font-size: 10.8px; color: #8a7a68;
  background: rgba(255, 255, 255, .65); padding: 4px 11px; border-radius: 999px;
}
.kbc-typing { display: flex; gap: 4px; padding: 11px 13px; }
.kbc-typing i { width: 6px; height: 6px; border-radius: 50%; background: #c9b8a0; animation: kbc-blink 1s infinite; }
.kbc-typing i:nth-child(2) { animation-delay: .2s; }
.kbc-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes kbc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- การ์ดรถ ---------- */
/* flex: none ห้ามขาด — เดิมแถวการ์ดโดน flex-shrink ของคอลัมน์แชทบีบยุบ 222px→8px จนมองเป็นว่าไม่มีรถ */
.kbc-cards { flex: none; align-self: stretch; display: flex; gap: 9px; overflow-x: auto; padding: 3px 2px 5px; scrollbar-width: none; }
.kbc-cards::-webkit-scrollbar { display: none; }
.kbc-card {
  flex: none; width: 158px; background: #fff; border-radius: 13px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(60, 40, 20, .14);
}
.kbc-ph { width: 100%; height: 88px; background: #efe3d2; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.kbc-ph img { width: 100%; height: 88px; object-fit: cover; display: block; }
.kbc-cp { padding: 8px 9px 9px; }
.kbc-nm { font-weight: 800; font-size: 12.8px; }
.kbc-mt { font-size: 10.5px; color: #8a7a68; margin-top: 2px; }
.kbc-down {
  display: inline-block; margin-top: 6px; background: #ff6a00; color: #fff;
  font-size: 11px; font-weight: 700; padding: 3.5px 8px; border-radius: 999px;
}
.kbc-go {
  display: block; margin-top: 7px; text-align: center; font-size: 11.6px; font-weight: 800;
  color: #ff6a00; text-decoration: none; border-top: 1px dashed #e8dcc8; padding-top: 6px;
}
.kbc-go:active { color: #ff8c1a; }

/* ---------- ชิป + แถบพิมพ์ ---------- */
.kbc-chips { flex: none; display: flex; gap: 7px; overflow-x: auto; padding: 7px 11px 3px; scrollbar-width: none; }
.kbc-chips::-webkit-scrollbar { display: none; }
.kbc-chip {
  flex: none; background: #fff; border: 1.5px solid #ff6a00; color: #ff6a00;
  font-size: 11.8px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  cursor: pointer; font-family: inherit;
}
.kbc-chip:active { background: #ff6a00; color: #fff; }

.kbc-inputrow {
  flex: none; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid #e8dcc8; display: flex; gap: 8px;
}
.kbc-in {
  flex: 1; min-width: 0; border: 1.5px solid #e8dcc8; border-radius: 999px;
  padding: 9px 14px; font-size: 13.8px; font-family: inherit; outline: none;
  background: #f7f1e7; color: #241a12;
}
.kbc-in:focus { border-color: #ff6a00; }
.kbc-send {
  flex: none; width: 40px; height: 40px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, #ff6a00, #ff8c1a); color: #fff;
  font-size: 16px; cursor: pointer; box-shadow: 0 2px 6px rgba(200, 80, 0, .3);
}
.kbc-send:disabled { opacity: .5; }

@media (max-width: 420px) {
  .kbc-panel { width: calc(100vw - 20px); right: 10px; bottom: 10px; }
}

/* ประทับเวอร์ชัน (v3 · สมอง 27) — โชว์ในหัวแผงแชท ข้างปุ่มย่อ */
.kbc-ver {
  font-size: 10px; line-height: 1; white-space: nowrap; align-self: center;
  color: rgba(255, 255, 255, .78); font-weight: 600;
  margin-left: auto; padding: 3px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}
.kbc-close { margin-left: 0; }
