/* ===== Floating WhatsApp chat (prefix ww-) ===== */
.ww { --green:#25d366; --green-d:#1ebe5a; --ink:#0f172a; --mut:#94a3b8; --line:#e5e7eb;
  position:fixed; right:20px; bottom:20px; z-index:9990; display:flex; flex-direction:column; align-items:flex-end; gap:12px;
  font-family:"Inter",sans-serif; color:var(--ink); }
.ww *, .ww *::before, .ww *::after { box-sizing:border-box; }

/* ── Launcher pill ── */
.ww-launcher { display:flex; align-items:center; gap:.75rem; padding:.45rem .5rem .45rem .45rem; border:0; border-radius:999px; background:#fff; cursor:pointer;
  box-shadow:0 10px 30px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.08); transition:transform .2s, box-shadow .2s; font:inherit; }
.ww-launcher:hover { transform:translateY(-2px); box-shadow:0 14px 34px rgba(15,23,42,.22); }
.ww-launcher:focus-visible, .ww-close:focus-visible, .ww-chip:focus-visible, .ww-send:focus-visible, .ww-go:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.ww-launcher__icon, .ww-launcher__go { display:grid; place-items:center; flex:none; width:44px; height:44px; border-radius:50%; background:var(--green); color:#fff; }
.ww-launcher__icon { font-size:1.45rem; }
.ww-launcher__go { width:38px; height:38px; font-size:.8rem; }
.ww-launcher__text { display:flex; flex-direction:column; text-align:left; line-height:1.15; }
.ww-launcher__text small { font-size:.66rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--mut); }
.ww-launcher__text b { font-size:1rem; font-weight:700; color:var(--ink); }

/* ── Panel ── */
.ww-panel { display:flex; flex-direction:column; width:350px; max-width:calc(100vw - 32px); max-height:min(560px, calc(100vh - 120px));
  overflow:hidden; border-radius:22px; background:#fff; box-shadow:0 24px 60px rgba(15,23,42,.28); outline:0;
  opacity:0; visibility:hidden; transform:translateY(12px) scale(.98); transform-origin:bottom right;
  transition:opacity .22s ease, transform .22s ease, visibility .22s; }
.ww.is-open .ww-panel { opacity:1; visibility:visible; transform:none; }

.ww-head { display:flex; align-items:center; justify-content:space-between; padding:.95rem 1.1rem; background:var(--green); color:#fff; }
.ww-head__title { display:inline-flex; align-items:center; gap:.5rem; font-weight:700; font-size:1.02rem; }
.ww-close { display:grid; place-items:center; width:30px; height:30px; border:0; border-radius:50%; background:transparent; color:#fff; font-size:1rem; cursor:pointer; }
.ww-close:hover { background:rgba(255,255,255,.2); }

/* thread */
.ww-body { flex:1; min-height:120px; overflow-y:auto; padding:1.1rem 1.1rem .6rem; display:flex; flex-direction:column; gap:.6rem; scroll-behavior:smooth; overscroll-behavior:contain; }
.ww-msg { max-width:88%; padding:.65rem .9rem; border-radius:16px; font-size:.9rem; line-height:1.5; animation:wwIn .25s ease both; white-space:pre-wrap; word-wrap:break-word; }
.ww-msg--bot { align-self:flex-start; background:#f1f5f9; color:#334155; border-bottom-left-radius:5px; }
.ww-msg--me  { align-self:flex-end; background:var(--green); color:#fff; border-bottom-right-radius:5px; }
.ww-msg--sum { align-self:stretch; max-width:100%; background:#f0fdf4; border:1px solid #bbf7d0; color:#14532d; font-size:.84rem; }
@keyframes wwIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.ww-typing { align-self:flex-start; display:flex; gap:4px; padding:.8rem .9rem; border-radius:16px; background:#f1f5f9; }
.ww-typing i { width:6px; height:6px; border-radius:50%; background:#94a3b8; animation:wwDot 1s infinite ease-in-out; }
.ww-typing i:nth-child(2) { animation-delay:.15s; } .ww-typing i:nth-child(3) { animation-delay:.3s; }
@keyframes wwDot { 0%,60%,100% { transform:translateY(0); opacity:.5; } 30% { transform:translateY(-4px); opacity:1; } }

.ww-chips { display:flex; flex-wrap:wrap; gap:.45rem; align-self:flex-start; animation:wwIn .25s ease both; }
.ww-chip { padding:.5rem .85rem; border:1.5px solid var(--green); border-radius:999px; background:#fff; color:#128c4a; font:600 .82rem "Inter",sans-serif; cursor:pointer;
  transition:background .15s, color .15s; }
.ww-chip:hover { background:var(--green); color:#fff; }
.ww-chip--ghost { border-color:var(--line); color:#64748b; }
.ww-chip--ghost:hover { background:#f1f5f9; color:var(--ink); }

/* footer area */
.ww-foot { padding:.4rem 1.1rem 1.1rem; }
.ww-foot:empty { display:none; }
.ww-hint { margin:0 0 .6rem; font-size:.84rem; color:#64748b; }
.ww-text { display:block; width:100%; min-height:96px; padding:.75rem .85rem; border:1.5px solid var(--green); border-radius:12px; outline:0; resize:vertical;
  font:.9rem/1.5 "Inter",sans-serif; color:var(--ink); }
.ww-text::placeholder { color:#94a3b8; }
.ww-text:focus { box-shadow:0 0 0 4px rgba(37,211,102,.18); }
.ww-row { display:flex; gap:.5rem; }
.ww-input { flex:1; min-width:0; height:46px; padding:0 .9rem; border:1.5px solid var(--green); border-radius:999px; outline:0; font:.9rem "Inter",sans-serif; color:var(--ink); }
.ww-input:focus { box-shadow:0 0 0 4px rgba(37,211,102,.18); }
.ww-go { display:grid; place-items:center; flex:none; width:46px; height:46px; border:0; border-radius:50%; background:var(--green); color:#fff; font-size:.85rem; cursor:pointer; }
.ww-go:hover { background:var(--green-d); }
.ww-skip { display:block; margin:.55rem auto 0; padding:.2rem .5rem; border:0; background:none; color:#64748b; font:.8rem "Inter",sans-serif; text-decoration:underline; cursor:pointer; }

.ww-send { display:flex; align-items:center; justify-content:center; gap:.55rem; width:100%; margin-top:.75rem; padding:.9rem 1rem; border-radius:12px;
  background:var(--green); color:#fff; font:700 .92rem "Inter",sans-serif; text-decoration:none; transition:background .15s; }
.ww-send:hover { background:var(--green-d); }
.ww-send i { font-size:1.05rem; }
.ww-restart { display:block; margin:.6rem auto 0; padding:.2rem .5rem; border:0; background:none; color:#64748b; font:.8rem "Inter",sans-serif; text-decoration:underline; cursor:pointer; }

/* ── Mobile: icon-only launcher, wider panel ── */
@media (max-width:480px) {
  .ww { right:14px; bottom:14px; left:14px; align-items:flex-end; }
  .ww-panel { width:100%; max-width:none; max-height:calc(100vh - 100px); max-height:calc(100dvh - 100px); }
  .ww-launcher { padding:.4rem; }
  .ww-launcher__text, .ww-launcher__go { display:none; }
  .ww-launcher__icon { width:54px; height:54px; font-size:1.7rem; }
}
@media (prefers-reduced-motion:reduce) {
  .ww-panel, .ww-launcher, .ww-msg, .ww-chips { transition:none; animation:none; }
  .ww-typing i { animation:none; }
  .ww-body { scroll-behavior:auto; }
}