/* PHWO Assist — floating support chat */
.phwo-assist { --pa-primary: var(--phwo-color-primary, #0D5C63); --pa-accent: var(--phwo-color-accent, #E8A33D); --pa-ink: #14262B; position: fixed; bottom: 22px; right: 22px; z-index: 9990; font-family: var(--phwo-font, "Inter", system-ui, sans-serif); }
.phwo-assist.is-left { right: auto; left: 22px; }
.phwo-assist[hidden] { display: none; }

/* launcher */
.pa-launch { display: flex; align-items: center; gap: .6rem; padding: .6rem .6rem .6rem .7rem; border: 0; border-radius: 999px; background: var(--pa-primary); color: #fff; cursor: pointer; box-shadow: 0 10px 30px rgba(13, 92, 99, .35); transition: transform .15s, box-shadow .15s; font: inherit; }
.pa-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(13, 92, 99, .4); }
.pa-launch-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; position: relative; flex: none; }
.pa-launch-icon svg { width: 22px; height: 22px; }
.pa-launch-icon::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #2fbf8f; border: 2px solid var(--pa-primary); right: -1px; bottom: -1px; }
.pa-launch-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; padding-right: .5rem; }
.pa-launch-text strong { font-size: .92rem; }
.pa-launch-text small { font-size: .72rem; opacity: .85; }
.phwo-assist.is-open .pa-launch { display: none; }

/* panel */
.pa-panel { display: none; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 100px)); background: #fff; border-radius: 20px; box-shadow: 0 24px 70px rgba(13, 38, 43, .28); overflow: hidden; flex-direction: column; animation: pa-in .18s ease-out; }
.phwo-assist.is-open .pa-panel { display: flex; }
@keyframes pa-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.pa-head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: linear-gradient(135deg, var(--pa-primary), #14807f); color: #fff; }
.pa-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.pa-avatar img { width: 30px; height: 30px; object-fit: contain; }
.pa-avatar svg { width: 22px; height: 22px; color: var(--pa-primary); }
.pa-head-text { flex: 1; min-width: 0; line-height: 1.2; }
.pa-head-text strong { display: block; font-size: 1rem; }
.pa-head-text small { font-size: .75rem; opacity: .85; display: flex; align-items: center; gap: .35rem; }
.pa-head-text small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2fbf8f; }
.pa-head button { background: transparent; border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; opacity: .85; }
.pa-head button:hover { background: rgba(255,255,255,.15); opacity: 1; }
.pa-head button svg { width: 18px; height: 18px; }

.pa-log { flex: 1; overflow-y: auto; padding: 1rem; background: #f4f8f8; display: flex; flex-direction: column; gap: .45rem; scroll-behavior: smooth; }
.pa-msg { max-width: 86%; padding: .6rem .85rem; border-radius: 16px; font-size: .93rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.pa-msg.is-bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.06); color: var(--pa-ink); }
.pa-msg.is-user { align-self: flex-end; background: var(--pa-primary); color: #fff; border-bottom-right-radius: 5px; }
.pa-msg.is-rtl { direction: rtl; text-align: right; font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif; font-size: 1.02rem; line-height: 1.9; }
.pa-msg a { color: var(--pa-primary); text-decoration: underline; word-break: break-all; }
.pa-msg.is-user a { color: #fff; }
.pa-msg ul { margin: .3rem 0 .2rem 1.1rem; padding: 0; }
.pa-msg.is-rtl ul { margin: .3rem 1.1rem .2rem 0; }
.pa-msg li { margin: .12rem 0; }
.pa-msg strong { font-weight: 700; }
.pa-typing { align-self: flex-start; background: #fff; border-radius: 16px; padding: .6rem .9rem; display: flex; gap: 4px; }
.pa-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9db2b5; animation: pa-dot 1.2s infinite; }
.pa-typing span:nth-child(2) { animation-delay: .2s; } .pa-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes pa-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.pa-sys { align-self: center; font-size: .74rem; color: #2a7f5a; background: #dff3ea; padding: .25rem .7rem; border-radius: 999px; }
.pa-rate { align-self: flex-start; display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: #6b7a80; margin-top: -.1rem; }
.pa-rate button { border: 1px solid #d5e0e1; background: #fff; border-radius: 999px; padding: .15rem .55rem; cursor: pointer; font-size: .85rem; }
.pa-rate button:hover { border-color: var(--pa-primary); }

.pa-quick { display: flex; gap: .4rem; overflow-x: auto; padding: .55rem 1rem 0; background: #fff; scrollbar-width: none; }
.pa-quick::-webkit-scrollbar { display: none; }
.pa-quick button { flex: none; border: 1px solid #cfdcdd; background: #fff; color: var(--pa-primary); border-radius: 999px; padding: .38rem .8rem; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
.pa-quick button:hover { background: #e2f4f0; border-color: var(--pa-primary); }
.pa-quick[hidden] { display: none; }

.pa-compose { display: flex; align-items: flex-end; gap: .5rem; padding: .7rem 1rem .5rem; background: #fff; }
.pa-compose textarea { flex: 1; resize: none; border: 1.5px solid #cfdcdd; border-radius: 20px; padding: .6rem .95rem; font: inherit; font-size: .95rem; line-height: 1.4; max-height: 7rem; background: #f7f9f9; }
.pa-compose textarea:focus { outline: none; border-color: var(--pa-primary); background: #fff; box-shadow: 0 0 0 4px rgba(13,92,99,.12); }
.pa-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--pa-accent); color: var(--pa-ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .12s; }
.pa-send:hover { transform: scale(1.06); }
.pa-send:disabled { opacity: .45; transform: none; cursor: default; }
.pa-send svg { width: 20px; height: 20px; }
.pa-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: 0 1rem .6rem; font-size: .68rem; color: #7c8b90; background: #fff; }
.pa-foot button { background: none; border: 0; color: var(--pa-primary); cursor: pointer; font-size: .68rem; padding: 0; text-decoration: underline; font-family: inherit; }

@media (max-width: 640px) {
	.phwo-assist { bottom: 84px; right: 14px; }
	body:not(.has-stickybar) .phwo-assist { bottom: 76px; }
	.phwo-assist.is-left { left: 14px; }
	.pa-launch-text small { display: none; }
	.phwo-assist.is-open { inset: 0; bottom: 0; right: 0; }
	.pa-panel { width: 100vw; height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .pa-panel, .pa-typing span { animation: none; } }
