/* =============================================================
   Live Chat CS Virtual — tombol mengambang + panel percakapan.
   Palet mengikuti tema situs (teal/hijau + aksen gold).
   ============================================================= */

.lc-float {
  position: fixed; bottom: 20px; right: 20px; z-index: 99990;
  width: 58px; height: 58px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-deep));
  color: #fff; font-size: 26px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(7, 63, 61, .38);
  transition: transform .2s ease, box-shadow .2s ease;
}
/* Ikon upload: tampil penuh tanpa latar hijau */
.lc-float.lc-has-img { background: transparent; box-shadow: none; border-radius: 0; padding: 0; }
.lc-float.lc-has-img:hover { box-shadow: none; }
.lc-float.lc-has-img .lc-float-icon img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 0;
  filter: drop-shadow(0 4px 10px rgba(7, 63, 61, .30));
}
.lc-float:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 32px rgba(7, 63, 61, .45); }
.lc-float.lc-has-img:hover { transform: translateY(-3px) scale(1.04); box-shadow: none; }
.lc-float .lc-float-icon { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.lc-float .lc-float-icon img { width: 34px; height: 34px; object-fit: contain; border-radius: 50%; }
.lc-float-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--c-gold); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.lc-float-tip {
  position: absolute; right: 70px; top: 50%; transform: translateY(-50%) translateX(6px);
  background: var(--c-deep); color: #fff; font-size: 12.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.lc-float:hover .lc-float-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* Panel chat */
.lc-panel {
  position: fixed; bottom: 92px; right: 20px; z-index: 99991;
  width: min(378px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--c-surface); border-radius: 18px;
  border: 1px solid var(--c-line);
  box-shadow: 0 24px 64px rgba(7, 63, 61, .35);
  animation: lc-in .22s ease;
}
@keyframes lc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.lc-head {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  background: linear-gradient(120deg, var(--c-deep), var(--c-primary));
  color: #fff; flex: 0 0 auto;
}
.lc-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px;
  background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .55);
  display: inline-flex; align-items: center; justify-content: center; font-size: 21px; overflow: hidden;
}
.lc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lc-head-txt { flex: 1; min-width: 0; }
.lc-name { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.25; }
.lc-status { margin: 1px 0 0; font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.lc-dot { width: 8px; height: 8px; border-radius: 50%; background: #6BE2A8; box-shadow: 0 0 0 3px rgba(107, 226, 168, .25); flex: 0 0 8px; }
.lc-close { background: rgba(255, 255, 255, .14); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; transition: background .2s ease; }
.lc-close:hover { background: rgba(255, 255, 255, .28); }

/* Area pesan */
.lc-msgs { flex: 1; overflow-y: auto; padding: 14px 13px 8px; background: #F4F9F7; display: flex; flex-direction: column; gap: 9px; scroll-behavior: smooth; }
.lc-row { display: flex; }
.lc-row-bot { justify-content: flex-start; }
.lc-row-user { justify-content: flex-end; }
.lc-bubble { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.lc-bubble-bot { background: #fff; color: var(--c-text); border: 1px solid var(--c-line); border-top-left-radius: 4px; box-shadow: 0 2px 6px rgba(7, 63, 61, .06); }
.lc-bubble-user { background: var(--c-primary); color: #fff; border-top-right-radius: 4px; box-shadow: 0 3px 10px rgba(8, 122, 80, .25); }
.lc-bubble p { margin: 0 0 6px; }
.lc-bubble p:last-child { margin-bottom: 0; }
.lc-link { display: inline-flex; align-items: center; gap: 5px; color: var(--c-primary); font-weight: 600; text-decoration: none; border-bottom: 1px dashed currentColor; }
.lc-link:hover { color: var(--c-deep); }

/* Chip topik */
.lc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 13px 6px; background: #F4F9F7; flex: 0 0 auto; }
.lc-chips-wrap { display: flex; flex-direction: column; gap: 4px; padding: 0 13px 6px; background: #F4F9F7; flex: 0 0 auto; }
.lc-chips-label { font-size: 11.5px; color: var(--c-text-soft); }
.lc-chip {
  border: 1.5px solid var(--c-primary); color: var(--c-primary); background: #fff;
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; transition: all .18s ease; text-align: left;
}
.lc-chip:hover { background: var(--c-primary); color: #fff; }

/* Indikator mengetik */
.lc-typing { display: inline-flex; gap: 5px; align-items: center; padding: 4px 2px; }
.lc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary); opacity: .45; animation: lc-b 1.1s infinite; }
.lc-typing i:nth-child(2) { animation-delay: .18s; }
.lc-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes lc-b { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Blok "bicara dengan admin" + tombol WhatsApp */
.lc-human { flex: 0 0 auto; border-top: 1px solid var(--c-line); background: #fff; padding: 10px 13px 11px; }
.lc-human-sub { margin: 0 0 8px; font-size: 11.5px; color: var(--c-text-soft); display: flex; align-items: center; gap: 6px; }
.lc-wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: #1FAD52; color: #fff; font-weight: 700; font-size: 13.5px;
  text-decoration: none; transition: filter .2s ease, transform .2s ease;
}
.lc-wa-btn:hover { filter: brightness(1.07); transform: translateY(-1px); color: #fff; }

/* Input */
.lc-input { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid var(--c-line); }
.lc-input input {
  flex: 1; min-width: 0; border: 1.5px solid var(--c-line); border-radius: 12px;
  padding: 10px 14px; font-size: 13.5px; background: #F7FBF9; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.lc-input input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(8, 122, 80, .12); }
.lc-input button {
  flex: 0 0 44px; width: 44px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--c-primary), var(--c-deep)); color: #fff; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: filter .2s ease;
}
.lc-input button:hover { filter: brightness(1.08); }

/* Mobile */
@media (max-width: 640px) {
  .lc-float { bottom: 16px; right: 16px; width: 54px; height: 54px; }
  .lc-panel { right: 12px; left: 12px; width: auto; bottom: 84px; height: min(560px, calc(100dvh - 110px)); }
  .lc-float-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-panel { animation: none; }
  .lc-typing i { animation: none; opacity: .7; }
}
