/*!
 * LiveChat Kit (pasangan livechat-kit.js)
 * Warna & posisi diatur lewat variabel di bawah. Di website lain cukup timpa variabelnya, mis.:
 *   .lck { --lck-accent: #e11d48; --lck-bottom: 20px; }
 * Bawaan: memakai variabel dashboard (--accent, --bg, dst.) kalau ada, kalau tidak pakai warna cadangan.
 */
.lck {
  --lck-accent: var(--accent, #7c3aed);
  --lck-on-accent: #fff;
  --lck-bg: var(--bg, #fff);
  --lck-surface: var(--surface, #f8fafc);
  --lck-surface-2: var(--surface-2, #f1f5f9);
  --lck-text: var(--text, #0f172a);
  --lck-soft: var(--text-soft, #475569);
  --lck-faint: var(--text-faint, #94a3b8);
  --lck-border: var(--border, #e2e8f0);
  --lck-ok: var(--ok, #16a34a);
  --lck-bad: var(--bad, #dc2626);
  --lck-shadow: 0 12px 24px rgba(15, 23, 42, .12), 0 4px 8px rgba(15, 23, 42, .08);
  --lck-right: 24px;         /* jarak tombol bulat dari kanan */
  --lck-bottom: 24px;        /* jarak tombol bulat dari bawah */
  --lck-right-mobile: 16px;
  --lck-bottom-mobile: 24px; /* naikkan kalau ada navigasi bawah, mis. calc(78px + env(safe-area-inset-bottom)) */
  --lck-z: 85;
  font-family: inherit;
}
.lck *, .lck *::before, .lck *::after { box-sizing: border-box; }
.lck-i { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- tombol bulat ---------- */
.lck-btn {
  position: fixed; right: var(--lck-right); bottom: var(--lck-bottom); z-index: var(--lck-z);
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--lck-accent); color: var(--lck-on-accent); box-shadow: var(--lck-shadow);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .2s ease;
}
.lck-btn:hover { transform: translateY(-2px); }
.lck-btn[hidden], .lck.is-open .lck-btn, .lck.teaser-on .lck-btn { display: none; }
.lck-btn > .lck-i { width: 24px; height: 24px; }
.lck-btn::after { /* titik status: hijau = admin online */
  content: ""; position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--lck-faint); border: 2px solid var(--lck-bg);
}
.lck-btn.is-online::after { background: var(--lck-ok); }
.lck-dot { /* jumlah balasan agen yang belum dibaca */
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--lck-bad); color: #fff; border: 2px solid var(--lck-bg);
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.lck-dot[hidden] { display: none; }

/* ---------- Beranda ---------- */
.lck-home {
  position: fixed; right: var(--lck-right); bottom: calc(var(--lck-bottom) + 64px); z-index: calc(var(--lck-z) + 1); width: 380px;
  height: min(620px, calc(100vh - var(--lck-bottom) - 96px)); display: flex; flex-direction: column;
  background: var(--lck-surface); border: 1px solid var(--lck-border); border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22), 0 6px 16px rgba(15, 23, 42, .1);
  animation: lckIn .18s ease-out;
}
.lck-home[hidden], .lck.is-open .lck-home { display: none; }
@keyframes lckIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lck-home-scroll { flex: 1; overflow: auto; }
.lck-home-head {
  position: relative; padding: 26px 24px 78px;
  background:
    linear-gradient(to bottom, transparent 45%, var(--lck-surface) 100%),
    radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, #38bdf8 22%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--lck-accent) 24%, var(--lck-surface)) 0%, var(--lck-surface) 100%);
}
.lck-home-min {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.lck-home-min span { width: 18px; height: 2.5px; border-radius: 2px; background: var(--lck-text); }
.lck-home-min:hover { background: color-mix(in srgb, var(--lck-text) 8%, transparent); }
.lck-home-head h2 { margin: 30px 0 0; font-size: 34px; font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; color: var(--lck-text); overflow-wrap: anywhere; }
.lck-card {
  position: relative; margin: -52px 14px 0; padding: 18px; border-radius: 20px;
  background: var(--lck-bg); border: 1px solid var(--lck-border); box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.lck-agent { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lck-avatar { position: relative; flex-shrink: 0; }
.lck-avatar-img {
  display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  background: #fff; border: 1px solid var(--lck-border); overflow: hidden; color: var(--lck-accent);
}
.lck-avatar-img img { width: 100%; height: 100%; padding: 4px; object-fit: contain; }
.lck-avatar-img .lck-i { width: 26px; height: 26px; }
.lck-led { position: absolute; left: 2px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--lck-faint); border: 2px solid var(--lck-bg); }
.lck-agent.is-online .lck-led { background: var(--lck-ok); }
.lck-agent-name { font-size: 13px; color: var(--lck-soft); margin-bottom: 3px; }
.lck-agent-msg { font-size: 14.5px; color: var(--lck-text); line-height: 1.4; }
.lck-cta {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; border-radius: 14px; padding: 15px; cursor: pointer; font: inherit; font-weight: 800; font-size: 16px;
  background: var(--lck-accent); color: var(--lck-on-accent); transition: filter .2s ease;
}
.lck-cta .lck-i { width: 20px; height: 20px; }
.lck-cta:hover { filter: brightness(1.08); }
.lck-links { display: grid; margin: 12px 14px 14px; background: var(--lck-bg); border: 1px solid var(--lck-border); border-radius: 16px; overflow: hidden; }
.lck-links[hidden] { display: none; }
.lck-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; color: var(--lck-text); text-decoration: none; font-size: 13.5px; border-top: 1px solid var(--lck-border); }
.lck-link:first-child { border-top: none; }
.lck-link:hover { background: var(--lck-surface-2); }
.lck-link > span { display: inline-flex; align-items: center; gap: 10px; }
.lck-link b { font-weight: 600; }
.lck-link > .lck-i { color: var(--lck-faint); }
.lck-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 14px 14px; padding: 8px;
  background: var(--lck-bg); border: 1px solid var(--lck-border); border-radius: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}
.lck-tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: none; border-radius: 12px;
  background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--lck-faint);
}
.lck-tab .lck-i { width: 24px; height: 24px; }
.lck-tab.active { color: var(--lck-text); }
.lck-tab.active .lck-i { fill: currentColor; }
.lck-tab:hover { background: var(--lck-surface-2); color: var(--lck-text); }

/* ---------- tombol kembali (ditempel di dalam jendela chat Text, kanan ikon "Perluas") ---------- */
.lck-back {
  position: fixed; z-index: 2147483647; width: 30px; height: 30px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: none; background: #e4e4e7; color: #18181b; /* mengikuti tombol header widget Text (tema terang) */
}
.lck-back[hidden] { display: none; }
.lck-back:hover { background: #d4d4d8; }
.lck-back .lck-i { width: 17px; height: 17px; stroke-width: 2.4; }

/* ---------- gambar promosi (transparan) di posisi tombol bulat ---------- */
.lck-teaser {
  position: fixed; right: calc(var(--lck-right) - 12px); bottom: calc(var(--lck-bottom) - 16px); z-index: var(--lck-z); width: 360px;
  animation: lckTeaserIn .35s ease-out;
}
.lck-teaser[hidden], .lck.is-open .lck-teaser { display: none; }
@keyframes lckTeaserIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.lck-teaser-img {
  display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .18)); transition: transform .2s ease;
}
.lck-teaser-img:hover { transform: translateY(-3px); }
.lck-teaser-img img { display: block; width: 100%; height: auto; }
.lck-teaser-x {
  position: absolute; top: 2px; right: 2px; width: 30px; height: 30px; border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--lck-bg); color: var(--lck-text); border: 1px solid var(--lck-border); box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
}
.lck-teaser-x:hover { background: var(--lck-surface-2); }
.lck-teaser-x .lck-i { width: 15px; height: 15px; stroke-width: 2.6; }

/* ---------- HP ---------- */
@media (max-width: 600px) {
  .lck-btn { right: var(--lck-right-mobile); bottom: var(--lck-bottom-mobile); width: 46px; height: 46px; }
  .lck-btn > .lck-i { width: 22px; height: 22px; }
  .lck-home { left: 12px; right: 12px; width: auto; bottom: calc(var(--lck-bottom-mobile) + 54px); height: min(560px, calc(100vh - var(--lck-bottom-mobile) - 120px)); }
  .lck-home-head h2 { font-size: 30px; }
  .lck-teaser { right: calc(var(--lck-right-mobile) - 10px); width: min(290px, 76vw); bottom: calc(var(--lck-bottom-mobile) - 12px); }
}
@media (prefers-reduced-motion: reduce) { .lck-home, .lck-teaser { animation: none; } }
