/* Chat Website (11 Nov 2026): tombol bulat di pojok kanan bawah + kotak chat */
.chf{position:fixed;right:24px;bottom:96px;width:56px;height:56px;border-radius:50%;border:0;cursor:pointer;background:var(--g);color:#fff;
  display:grid;place-items:center;box-shadow:0 10px 24px -8px rgba(15,63,42,.6);z-index:21;font:inherit}
.chf .i .ic{width:26px;height:26px}
.chf .t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.chf em{position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:#D93B2B;color:#fff;
  font-style:normal;font-size:12px;font-weight:700;line-height:22px;text-align:center;border:2px solid #fff}
.chf[aria-expanded="true"]{display:none}

.chat{position:fixed;right:24px;bottom:24px;width:372px;height:min(600px,calc(100vh - 48px));background:#fff;border:1px solid var(--line);
  border-radius:18px;box-shadow:0 24px 60px -20px rgba(11,47,32,.45);z-index:60;display:flex;flex-direction:column;overflow:hidden}
.chat[hidden]{display:none}
.ch-h{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px;background:var(--g);color:#fff;flex:none}
.ch-h .av{width:38px;height:38px;border-radius:50%;background:#fff;display:grid;place-items:center;flex:none;overflow:hidden}
.ch-h .av img{width:32px;height:32px}
.ch-h div{flex:1;min-width:0;line-height:1.3}
.ch-h b{display:block;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-h small{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.9}
.ch-h small:before{content:"";width:8px;height:8px;border-radius:50%;background:#B9C7BF;flex:none}
.ch-h small.on:before{background:#5BE38E}
.ch-x{width:36px;height:36px;border-radius:50%;border:0;background:rgba(255,255,255,.14);color:#fff;cursor:pointer;display:grid;place-items:center}
.ch-x .ic{width:18px;height:18px}

.ch-b{flex:1;overflow-y:auto;padding:14px 12px;display:flex;flex-direction:column;gap:6px;background:var(--bg);overscroll-behavior:contain}
.ch-tgl{align-self:center;font-size:11.5px;color:var(--muted);background:rgba(0,0,0,.05);border-radius:999px;padding:2px 10px;margin:6px 0}
.ch-m{max-width:84%;padding:8px 11px 5px;border-radius:14px;font-size:14px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;position:relative}
.ch-m small{display:block;text-align:right;font-size:10.5px;opacity:.65;margin-top:2px}
.ch-m.saya{align-self:flex-end;background:var(--g);color:#fff;border-bottom-right-radius:4px}
.ch-m.admin{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.ch-m.sistem{align-self:center;max-width:94%;background:var(--goldl);border:1px solid #EBD9A6;color:#4A3A08;font-size:13px;border-radius:12px}
.ch-m.sapa{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.ch-m.kirim{opacity:.6}
.ch-fotos{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:4px;margin:2px 0 4px}
.ch-fotos a{display:block;border-radius:8px;overflow:hidden;background:rgba(0,0,0,.06)}
.ch-fotos img{display:block;width:100%;height:110px;object-fit:cover}
.ch-pilih{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.ch-pilih button{flex:1;min-width:120px;height:38px;border-radius:999px;border:1.5px solid var(--g);background:#fff;color:var(--g);font:inherit;font-weight:600;font-size:13px;cursor:pointer}
.ch-pilih button.ya{background:var(--g);color:#fff}

.ch-galat{flex:none;margin:0;padding:8px 14px;background:#FCE9E6;color:#A12A1C;font-size:13px;border-top:1px solid #F3C9C4}
.ch-galat[hidden]{display:none}

.ch-tamu{flex:none;padding:12px 14px 14px;border-top:1px solid var(--line);background:#fff;display:flex;flex-direction:column;gap:8px;max-height:72%;overflow-y:auto}
.ch-tamu[hidden],.ch-k[hidden]{display:none}
.ch-tamu label{display:flex;flex-direction:column;gap:3px;font-size:12.5px;font-weight:600;color:var(--ink)}
.ch-tamu input,.ch-tamu textarea{font:inherit;font-size:14px;font-weight:400;border:1.5px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff;color:var(--ink);resize:vertical}
.ch-tamu input:focus,.ch-tamu textarea:focus,.ch-k textarea:focus{outline:2px solid var(--g);outline-offset:-1px;border-color:transparent}
.ch-tamu .salah input,.ch-tamu .salah textarea{border-color:#D93B2B}
.ch-tamu .salah em{font-style:normal;font-weight:400;color:#A12A1C;font-size:12px}
.ch-tamu .btn{height:42px;width:100%}
.ch-tamu .btn .ic{width:17px;height:17px}
.ch-cat{font-size:12px;color:var(--muted);line-height:1.45}
.ch-cat a{color:var(--g);font-weight:600;text-decoration:underline}

.ch-k{flex:none;border-top:1px solid var(--line);background:#fff;padding:8px 10px}
.ch-baris{display:flex;align-items:flex-end;gap:6px}
.ch-k textarea{flex:1;min-width:0;font:inherit;font-size:14px;border:1.5px solid var(--line);border-radius:20px;padding:9px 14px;resize:none;max-height:120px;background:var(--bg);color:var(--ink);line-height:1.4}
.ch-foto,.ch-send{width:40px;height:40px;border-radius:50%;flex:none;display:grid;place-items:center;cursor:pointer;border:0}
.ch-foto{color:var(--g);background:var(--gl)}
.ch-send{background:var(--g);color:#fff}
.ch-send:disabled{opacity:.5;cursor:wait}
.ch-foto .ic,.ch-send .ic{width:19px;height:19px}
.ch-pra{display:flex;gap:6px;margin-bottom:6px;align-items:center;flex-wrap:wrap}
.ch-pra[hidden]{display:none}
.ch-pra span{position:relative;width:54px;height:54px;border-radius:8px;overflow:hidden;background:var(--bg)}
.ch-pra img{width:100%;height:100%;object-fit:cover}
.ch-pra button{font:inherit;font-size:12px;border:0;background:none;color:#A12A1C;text-decoration:underline;cursor:pointer}

@media (max-width:760px){
  .chf{right:14px;bottom:80px;width:52px;height:52px;transition:bottom .35s}
  /* Pita "kirim daftar belanja" sedang tampil di atas menu bawah: tombol chat naik supaya tidak tertutup */
  body:has(.dlv.on) .chf{bottom:150px}
  .chat{left:0;right:0;top:0;bottom:0;width:auto;height:auto;border-radius:0;border:0}
  .ch-m{max-width:88%}
  body.chat-buka{overflow:hidden}
}

[data-theme="dark"] .chat,[data-theme="dark"] .ch-tamu,[data-theme="dark"] .ch-k,[data-theme="dark"] .ch-m.admin,[data-theme="dark"] .ch-m.sapa,
[data-theme="dark"] .ch-tamu input,[data-theme="dark"] .ch-tamu textarea,[data-theme="dark"] .ch-pilih button{background:var(--card)}
[data-theme="dark"] .ch-pilih button.ya{background:var(--g)}
[data-theme="dark"] .ch-m.sistem{background:#2A2317;border-color:#4A3D1C;color:#EBD9A6}
[data-theme="dark"] .ch-tgl{background:rgba(255,255,255,.07)}
[data-theme="dark"] .ch-galat{background:#3A1A16;color:#F3B5AC;border-color:#5A2A24}
[data-theme="dark"] .chf em{border-color:var(--bg)}
