/* ============================================================
   ARENA PINTAR — Webchat (halaman /chat), tampilan ala WhatsApp
   ============================================================ */
#kc-webchat{--kcw-brand:#ea7a0c;--kcw-brand-dark:#1b1e26;--kcw-wa:#25D366;--kcw-wa-dark:#128c4a;--kcw-bg:#f3efe8;--kcw-me:#ffe8c7;--kcw-them:#ffffff;--kcw-ink:#111b21;--kcw-muted:#667781;font-family:'Poppins',system-ui,sans-serif;color:var(--kcw-ink)}
#kc-webchat *{box-sizing:border-box}
#kc-webchat [hidden]{display:none!important}
html.kcw-page,html.kcw-page body{margin:0;height:100%;overflow:hidden;background:#14161c radial-gradient(900px 500px at 15% 0%,#2a3040 0%,transparent 60%)}
.kcw-brand{position:fixed;left:28px;top:24px;display:flex;align-items:center;text-decoration:none}
.kcw-brand img{height:44px;width:auto}
@media (max-width:900px){.kcw-brand{display:none}}

.kcw-panel{position:fixed;top:0;bottom:0;left:50%;transform:translateX(-50%);width:min(560px,100%);height:100%;height:100dvh;display:flex;flex-direction:column;background:var(--kcw-bg);overflow:hidden;box-shadow:0 18px 50px rgba(0,0,0,.35)}
@media (max-width:640px){.kcw-panel{left:0;transform:none;width:100%}}

.kcw-head{display:flex;align-items:center;gap:10px;padding:10px 10px 10px 8px;background:var(--kcw-brand-dark);color:#fff;flex:none}
.kcw-avatar{width:40px;height:40px;border-radius:50%;background:#fff;color:#1b1e26;font-weight:800;font-size:15px;display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden}
.kcw-avatar img{width:30px;height:30px;object-fit:contain}
.kcw-who{display:flex;flex-direction:column;min-width:0;flex:1}
.kcw-name{font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kcw-sub{font-size:12px;opacity:.85}
.kcw-head button{border:0;background:transparent;color:#fff;cursor:pointer;width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:none}
.kcw-head button:hover{background:rgba(255,255,255,.12)}
.kcw-head svg{width:20px;height:20px}

.kcw-body{flex:1;overflow-y:auto;padding:12px 12px 6px;background-color:var(--kcw-bg);background-image:radial-gradient(rgba(17,27,33,.045) 1px,transparent 1px);background-size:18px 18px;overscroll-behavior:contain}
.kcw-privacy{margin:0 auto 12px;max-width:300px;text-align:center;font-size:11.5px;line-height:1.45;color:#54656f;background:#fff7d6;border-radius:8px;padding:7px 10px}
.kcw-list{display:flex;flex-direction:column;gap:4px}

.kcw-row{display:flex}
.kcw-me{justify-content:flex-end}
.kcw-bubble{position:relative;max-width:82%;padding:7px 9px 6px 10px;border-radius:10px;font-size:14.5px;line-height:1.42;box-shadow:0 1px .5px rgba(11,20,26,.13);display:flex;flex-direction:column}
.kcw-them .kcw-bubble{background:var(--kcw-them);border-top-left-radius:2px}
.kcw-me .kcw-bubble{background:var(--kcw-me);border-top-right-radius:2px}
.kcw-text{white-space:pre-wrap;overflow-wrap:anywhere}
.kcw-text a{color:#027eb5;text-decoration:underline}
.kcw-from{font-size:12.5px;font-weight:700;color:#c2610a;margin-bottom:1px}
.kcw-time{align-self:flex-end;font-size:11px;color:var(--kcw-muted);margin-top:2px;white-space:nowrap}
.kcw-me .kcw-time{color:#a16207}
.kcw-pending{opacity:.7}
.kcw-failed .kcw-bubble{background:#ffe1e1}
.kcw-failed .kcw-time{color:#b42318}
.kcw-sys{align-self:center;max-width:88%;margin:6px 0;padding:6px 10px;border-radius:8px;background:#e1f3fb;color:#30444f;font-size:12.5px;line-height:1.45;text-align:center;box-shadow:0 1px .5px rgba(11,20,26,.1)}
.kcw-err{background:#fde8e8;color:#8a1c1c}

.kcw-typing{display:inline-flex;gap:4px;background:#fff;border-radius:10px;border-top-left-radius:2px;padding:11px 12px;margin-top:4px;box-shadow:0 1px .5px rgba(11,20,26,.13)}
.kcw-typing span{width:7px;height:7px;border-radius:50%;background:#8696a0;animation:kcw-blink 1.2s infinite}
.kcw-typing span:nth-child(2){animation-delay:.2s}.kcw-typing span:nth-child(3){animation-delay:.4s}
@keyframes kcw-blink{0%,80%,100%{opacity:.3}40%{opacity:1}}
@media (prefers-reduced-motion:reduce){.kcw-typing span{animation:none}}

.kcw-quick{display:flex;flex-wrap:wrap;gap:6px;padding:6px 12px 8px;background:var(--kcw-bg);flex:none}
.kcw-chip{border:1px solid #c9d6f2;background:#fff;color:var(--kcw-brand-dark);font-family:inherit;font-weight:600;font-size:13px;line-height:1.2;padding:8px 12px;border-radius:999px;cursor:pointer}
.kcw-chip:hover{background:#eef3fc;border-color:var(--kcw-brand)}

.kcw-input{display:flex;align-items:flex-end;gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));background:#f0f2f5;flex:none}
.kcw-input textarea{flex:1;resize:none;border:0;border-radius:22px;padding:11px 15px;font-family:inherit;font-size:15px;line-height:1.35;background:#fff;color:var(--kcw-ink);max-height:120px;outline:none}
.kcw-input textarea:focus{box-shadow:0 0 0 2px #c9d6f2}
.kcw-send{width:44px;height:44px;flex:none;border:0;border-radius:50%;background:var(--kcw-brand);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.kcw-send:hover{background:var(--kcw-brand-dark)}
.kcw-send svg{width:20px;height:20px;margin-left:2px}

/* Jalur WhatsApp untuk lead serius: tombol hijau penuh tepat di atas kolom ketik */
.kcw-wa{flex:none;background:#fff;border-top:1px solid #e3e7ea;padding:8px 12px 9px;text-align:center}
.kcw-wa-note{margin:0 0 7px;font-size:12.5px;line-height:1.4;color:#3b4a54}
.kcw-wa-btn{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 14px;border-radius:999px;border:0;color:#fff;font-weight:800;font-size:15px;letter-spacing:.01em;text-decoration:none;background:linear-gradient(180deg,#1FB457,#179C4A);box-shadow:0 6px 18px rgba(23,156,74,.38);transition:transform .15s,box-shadow .15s}
.kcw-wa-btn:hover{background:linear-gradient(180deg,#19A14D,#128C4A);transform:translateY(-1px);box-shadow:0 8px 22px rgba(23,156,74,.45)}
.kcw-wa-btn svg{width:21px;height:21px;flex:none}
.kcw-wa-btn::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 rgba(31,180,87,.55);animation:kcw-pulse 2.6s ease-out infinite}
@keyframes kcw-pulse{0%{box-shadow:0 0 0 0 rgba(31,180,87,.55)}70%{box-shadow:0 0 0 12px rgba(31,180,87,0)}100%{box-shadow:0 0 0 0 rgba(31,180,87,0)}}
.kcw-diskon .kcw-wa{background:#fdf2f8;border-top-color:#fbcfe8}
.kcw-diskon .kcw-wa-note{color:#831843;font-weight:700}
/* Tombol WhatsApp di header, selalu terlihat */
.kcw-head-wa{display:inline-flex;align-items:center;gap:6px;flex:none;padding:7px 12px 7px 10px;border-radius:999px;background:#1FB457;color:#fff;font-weight:800;font-size:13px;text-decoration:none;box-shadow:0 2px 8px rgba(0,0,0,.25)}
.kcw-head-wa:hover{background:#179C4A}
.kcw-head-wa svg{width:18px;height:18px}
@media (max-width:380px){.kcw-head-wa span{display:none}.kcw-head-wa{padding:8px}}
@media (prefers-reduced-motion:reduce){.kcw-wa-btn::after{animation:none}.kcw-wa-btn{transition:none}}
/* Tombol isi profil */
.kcw-chip-main{background:var(--kcw-brand);border-color:var(--kcw-brand);color:#fff}
.kcw-chip-main:hover{background:var(--kcw-brand-dark);border-color:var(--kcw-brand-dark);color:#fff}

/* Lampiran */
.kcw-clip{width:44px;height:44px;flex:none;display:flex;align-items:center;justify-content:center;border-radius:50%;color:#54656f;cursor:pointer}
.kcw-clip:hover{background:#e3e7ea}
.kcw-clip svg{width:22px;height:22px}
.kcw-img{display:block;max-width:100%;width:240px;max-height:320px;object-fit:cover;border-radius:8px;margin-bottom:4px}
.kcw-file{display:block;padding:8px 10px;margin-bottom:4px;background:rgba(0,0,0,.05);border-radius:8px;color:#0b5394;text-decoration:none;font-size:13.5px;overflow-wrap:anywhere}

/* ---------- Balas (kutip) & edit pesan ---------- */
.kcw-row{position:relative}
.kcw-row:not(.kcw-pending) .kcw-bubble{cursor:pointer}
.kcw-quote{display:flex;flex-direction:column;gap:1px;width:100%;min-width:160px;margin:0 0 5px;padding:5px 8px;border:0;border-left:3px solid var(--kcw-brand);border-radius:6px;background:rgba(11,20,26,.06);text-align:left;font:inherit;cursor:pointer;color:inherit}
.kcw-me .kcw-quote{background:rgba(11,20,26,.07);border-left-color:#16a34a}
.kcw-quote b{font-size:12px;color:var(--kcw-brand)}
.kcw-me .kcw-quote b{color:#15803d}
.kcw-quote span{font-size:12.5px;line-height:1.35;color:#3b4a54;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.kcw-rbtn{position:absolute;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:50%;border:0;background:#fff;color:#54656f;font-size:15px;line-height:1;box-shadow:0 1px 3px rgba(0,0,0,.18);cursor:pointer;opacity:0;transition:opacity .15s}
.kcw-them .kcw-rbtn{right:-36px}
.kcw-me .kcw-rbtn{left:-36px}
@media (hover:hover){.kcw-row:hover .kcw-rbtn,.kcw-rbtn:focus-visible{opacity:1}}
.kcw-act{display:flex;gap:6px;margin:2px 0 6px}
.kcw-act[data-for]{justify-content:flex-start}
.kcw-me + .kcw-act{justify-content:flex-end}
.kcw-act button{border:1px solid #c7d4f5;background:#fff;color:var(--kcw-brand-dark);border-radius:999px;padding:6px 12px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.kcw-act button:hover{border-color:var(--kcw-brand);color:var(--kcw-brand)}
.kcw-ctx{display:flex;align-items:center;gap:10px;flex:none;padding:7px 12px;background:#f0f2f5;border-top:1px solid #e3e7ea}
.kcw-ctx[hidden]{display:none}
.kcw-ctx-ic{flex:none;font-size:16px;color:var(--kcw-brand)}
.kcw-ctx-tx{flex:1;min-width:0;border-left:3px solid var(--kcw-brand);padding:2px 8px;background:#fff;border-radius:6px}
.kcw-ctx-tx b{display:block;font-size:12px;color:var(--kcw-brand)}
.kcw-ctx-tx span{display:block;font-size:12.5px;color:#3b4a54;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kcw-ctx-x{flex:none;width:30px;height:30px;border:0;border-radius:50%;background:#e2e8f0;color:#334155;font-size:18px;line-height:1;cursor:pointer}
.kcw-editing .kcw-input textarea{box-shadow:0 0 0 2px var(--kcw-brand) inset}
.kcw-flash .kcw-bubble{animation:kcw-flash 1.4s ease-out}
@keyframes kcw-flash{0%,40%{box-shadow:0 0 0 3px rgba(21,66,196,.45)}100%{box-shadow:0 1px .5px rgba(11,20,26,.13)}}
@media (prefers-reduced-motion:reduce){.kcw-flash .kcw-bubble{animation:none}.kcw-rbtn{transition:none}}
@media (hover:none){.kcw-rbtn{display:none}}
