/* PHWO Chat — user side. Teal #0D5C63 / gold #E8A33D. Mobile-first. */
.pc-app { --pc-p: #0D5C63; --pc-p2: #0a4a50; --pc-g: #E8A33D; --pc-ink: #14262B; --pc-mute: #5f6f74; --pc-line: #e1e9ea; --pc-bg: #f4f8f8; --pc-me: #0D5C63; --pc-them: #fff;
	font-family: var(--phwo-font, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif); color: var(--pc-ink); background: #fff; display: flex; overflow: hidden; box-sizing: border-box; font-size: 15px; line-height: 1.45; }
.pc-app *, .pc-app *::before, .pc-app *::after { box-sizing: border-box; }
.pc-app[lang="ur"], .pc-app [lang="ur"] { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", var(--phwo-font, system-ui), sans-serif; }
.pc-app button { font: inherit; cursor: pointer; }
.pc-app [hidden] { display: none !important; }
.pc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* page mode: two panes */
.pc-app.is-page { border: 1px solid var(--pc-line); border-radius: 18px; height: min(76vh, 720px); min-height: 480px; box-shadow: 0 10px 40px rgba(13, 92, 99, .08); }
.pc-list { width: 320px; flex: 0 0 320px; border-inline-end: 1px solid var(--pc-line); display: flex; flex-direction: column; background: #fbfdfd; min-height: 0; }
.pc-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--pc-bg); position: relative; }
.pc-app.is-page:not(.is-thread) .pc-thread { visibility: visible; }

.pc-lhead, .pc-thead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--pc-line); background: #fff; min-height: 62px; }
.pc-lhead > div { flex: 1; min-width: 0; }
.pc-lhead strong { font-size: 17px; display: block; }
.pc-lhead small, .pc-ttl small { color: var(--pc-mute); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8c4c6; display: inline-block; }
.pc-dot.is-on { background: #22b07d; box-shadow: 0 0 0 3px rgba(34, 176, 125, .18); }
.pc-btn { border: 1px solid var(--pc-line); background: #fff; color: var(--pc-p); border-radius: 999px; padding: 7px 13px; font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s; }
.pc-btn:hover { background: #eef6f6; border-color: #cfe1e2; }
.pc-btn.is-solid { background: var(--pc-p); color: #fff; border-color: var(--pc-p); }
.pc-icon { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--pc-mute); flex: 0 0 auto; text-decoration: none; font-size: 17px; }
.pc-icon:hover { background: #eef4f4; color: var(--pc-p); }
.pc-wa { color: #1fa855; }
.pc-app :focus-visible { outline: 3px solid var(--pc-g); outline-offset: 2px; }

.pc-convs { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.pc-convs li[data-id] { display: flex; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; align-items: center; transition: background .12s; }
.pc-convs li[data-id]:hover { background: #eef5f5; }
.pc-convs li.is-cur { background: #e3f0f0; }
.pc-convs li.is-closed { opacity: .72; }
.pc-avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: linear-gradient(135deg, var(--pc-p), #138089); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.pc-cmain { flex: 1; min-width: 0; }
.pc-crow { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pc-crow strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-crow time { color: var(--pc-mute); font-size: 12px; flex: 0 0 auto; }
.pc-prev { color: var(--pc-mute); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
li.is-unread .pc-prev { color: var(--pc-ink); font-weight: 600; }
li.is-unread .pc-crow time { color: var(--pc-p); font-weight: 700; }
.pc-count { font-style: normal; background: var(--pc-g); color: #14262B; font-weight: 800; font-size: 11.5px; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }
.pc-tag { font-size: 11px; color: var(--pc-mute); border: 1px solid var(--pc-line); border-radius: 6px; padding: 1px 6px; }
.pc-empty { text-align: center; padding: 34px 18px; color: var(--pc-mute); list-style: none; }
.pc-empty strong { color: var(--pc-ink); display: block; margin: 6px 0; }
.pc-empty-ico { font-size: 34px; }
.pc-picker { padding: 10px; border-bottom: 1px solid var(--pc-line); background: #fff; max-height: 50%; overflow-y: auto; }
.pc-pick-h { margin: 2px 4px 8px; font-weight: 700; font-size: 13.5px; }
.pc-pick { display: flex; gap: 10px; width: 100%; text-align: start; align-items: center; border: 1px solid var(--pc-line); background: #fff; border-radius: 12px; padding: 9px 11px; margin-bottom: 6px; }
.pc-pick:hover { border-color: var(--pc-p); }
.pc-pick > span:first-child { font-size: 20px; }
.pc-pick strong { display: block; font-size: 13.5px; }
.pc-pick small { color: var(--pc-mute); }
.pc-muted { color: var(--pc-mute); font-size: 13px; }

.pc-ttl { flex: 1; min-width: 0; }
.pc-ttl strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-back { display: none; }
.pc-thead .pc-avatar { width: 36px; height: 36px; flex-basis: 36px; }

.pc-log { flex: 1; overflow-y: auto; padding: 14px 16px 8px; scroll-behavior: auto; overscroll-behavior: contain; background: radial-gradient(circle at 20% 0, rgba(13, 92, 99, .05), transparent 50%), var(--pc-bg); }
.pc-day { text-align: center; margin: 14px 0 10px; }
.pc-day span { background: #fff; border: 1px solid var(--pc-line); color: var(--pc-mute); font-size: 12px; padding: 3px 12px; border-radius: 999px; }
.pc-msg { display: flex; flex-direction: column; margin: 3px 0; max-width: 78%; animation: pcIn .18s ease-out; }
.pc-msg.is-me { margin-inline-start: auto; align-items: flex-end; }
.pc-msg.is-them { margin-inline-end: auto; align-items: flex-start; }
.pc-who { font-size: 11.5px; color: var(--pc-p); font-weight: 700; margin: 6px 6px 2px; }
.pc-bub { padding: 8px 11px 6px; border-radius: 16px; position: relative; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 1.5px rgba(20, 38, 43, .08); }
.is-me .pc-bub { background: var(--pc-me); color: #fff; border-end-end-radius: 5px; }
.is-them .pc-bub { background: var(--pc-them); border-end-start-radius: 5px; border: 1px solid #e6eeee; }
.is-pending .pc-bub { opacity: .75; }
.pc-text { white-space: normal; }
.pc-text[dir="rtl"], .pc-text:dir(rtl) { font-size: 1.08em; line-height: 1.9; }
.is-me .pc-text a { color: #ffe2ad; }
.pc-meta { display: flex; gap: 5px; justify-content: flex-end; align-items: center; font-size: 11px; margin-top: 2px; opacity: .78; }
.pc-tick { letter-spacing: -3px; padding-inline-end: 3px; }
.pc-tick.is-read { color: #8fe3ff; opacity: 1; font-weight: 700; }
.is-them .pc-meta { color: var(--pc-mute); }
.pc-retry { border: 0; background: #fff3f3; color: #b42318; border-radius: 6px; font-size: 11px; padding: 1px 6px; }
.pc-removed { opacity: .75; font-size: 13px; }
.pc-img { display: block; max-width: 260px; border-radius: 12px; overflow: hidden; background: #dfe9ea; margin: -3px -6px 4px; }
.pc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-msg.is-media .pc-bub { padding: 4px; }
.pc-msg.is-media .pc-img { margin: 0; }
.pc-msg.is-media .pc-meta { position: absolute; bottom: 8px; inset-inline-end: 10px; background: rgba(0, 0, 0, .45); color: #fff; padding: 1px 6px; border-radius: 8px; opacity: 1; }
.pc-doc { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .14); text-decoration: none; color: inherit; min-width: 200px; margin-bottom: 4px; }
.is-them .pc-doc { background: #f1f6f6; }
.pc-doc-ico { width: 38px; height: 44px; border-radius: 6px; background: #d64545; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.pc-doc strong { display: block; font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-doc small { opacity: .8; font-size: 11.5px; }
.pc-sys { margin: 10px auto; max-width: 88%; text-align: center; background: #fff8ea; border: 1px solid #f3dcae; color: #6b4a10; border-radius: 12px; padding: 8px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.pc-sys time { font-size: 11px; opacity: .7; }
.pc-csat { margin: 12px auto; max-width: 92%; text-align: center; background: #fff; border: 1px solid var(--pc-line); border-radius: 14px; padding: 12px; }
.pc-csat p { margin: 0 0 8px; }
.pc-csat div { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.pc-hello { text-align: center; color: var(--pc-mute); padding: 30px 12px; }
.pc-hello strong { color: var(--pc-ink); display: block; font-size: 17px; margin: 6px 0; }
.pc-more { display: block; margin: 0 auto 10px; border: 1px solid var(--pc-line); background: #fff; color: var(--pc-p); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; }
.pc-loading, .pc-typing { display: flex; gap: 4px; align-items: center; }
.pc-loading { justify-content: center; padding: 40px; }
.pc-loading span, .pc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9db4b6; animation: pcDot 1.2s infinite ease-in-out; }
.pc-loading span:nth-child(2), .pc-typing span:nth-child(2) { animation-delay: .15s; }
.pc-loading span:nth-child(3), .pc-typing span:nth-child(3) { animation-delay: .3s; }
.pc-typing { padding: 4px 18px 6px; font-size: 12px; color: var(--pc-mute); }
.pc-typing em { font-style: normal; margin-inline-start: 6px; }
.pc-quick { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 6px; scrollbar-width: none; }
.pc-quick:empty { display: none; }
.pc-quick button { flex: 0 0 auto; border: 1px solid #cfe1e2; background: #fff; color: var(--pc-p); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; white-space: nowrap; }
.pc-quick button:hover { background: #e9f3f3; }
.pc-up { padding: 4px 14px; font-size: 12px; color: var(--pc-mute); }
.pc-up-bar { height: 4px; border-radius: 4px; background: #dbe7e8; overflow: hidden; margin-bottom: 3px; }
.pc-up-bar i { display: block; height: 100%; width: 0; background: var(--pc-g); transition: width .2s; }
.pc-compose { display: flex; align-items: flex-end; gap: 4px; padding: 8px 10px; background: #fff; border-top: 1px solid var(--pc-line); }
.pc-compose textarea { flex: 1; resize: none; border: 1px solid #d5e2e3; border-radius: 20px; padding: 9px 14px; font: inherit; max-height: 140px; min-height: 40px; outline: none; background: #f8fbfb; line-height: 1.4; }
.pc-compose textarea:focus { border-color: var(--pc-p); background: #fff; box-shadow: 0 0 0 3px rgba(13, 92, 99, .12); }
.pc-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--pc-p); color: #fff; display: grid; place-items: center; flex: 0 0 auto; transition: transform .1s, background .15s; }
.pc-send:hover { background: var(--pc-p2); }
.pc-send:active { transform: scale(.94); }
[dir="rtl"] .pc-send svg { transform: scaleX(-1); }
.pc-emoji { position: absolute; bottom: 92px; inset-inline-start: 10px; background: #fff; border: 1px solid var(--pc-line); border-radius: 14px; box-shadow: 0 12px 34px rgba(20, 38, 43, .16); padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; z-index: 3; }
.pc-emoji button { border: 0; background: none; font-size: 21px; width: 36px; height: 36px; border-radius: 8px; }
.pc-emoji button:hover { background: #eef4f4; }
.pc-privacy { margin: 0; padding: 4px 12px 8px; font-size: 11.5px; color: var(--pc-mute); background: #fff; text-align: center; }
.pc-app.is-drop .pc-thread::after { content: "⇪"; position: absolute; inset: 8px; border: 3px dashed var(--pc-g); border-radius: 16px; background: rgba(255, 248, 234, .85); display: grid; place-items: center; font-size: 40px; color: var(--pc-g); }
.pc-skel { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid #e1e9ea; border-radius: 18px; }
.pc-skel span { height: 56px; border-radius: 12px; background: linear-gradient(90deg, #eef3f3, #f7fafa, #eef3f3); background-size: 200% 100%; animation: pcSk 1.2s infinite; }

/* page mode: no thread chosen yet */
.pc-app.is-page:not(.is-thread) .pc-thread > *:not(.pc-log) { display: none; }
.pc-app.is-page:not(.is-thread) .pc-log::before { content: "💬"; display: grid; place-items: center; height: 100%; font-size: 52px; opacity: .25; }

/* floating launcher (stacked above the AI assistant) */
.pc-widget { position: fixed; right: 22px; bottom: 96px; z-index: 9991; }
.pc-launch { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--phwo-color-accent, #E8A33D); color: #14262B; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(232, 163, 61, .45); position: relative; cursor: pointer; transition: transform .15s; }
.pc-launch:hover { transform: translateY(-2px); }
.pc-launch.is-open { background: #0D5C63; color: #fff; }
.pc-badge { position: absolute; top: -3px; right: -3px; background: #d92d20; color: #fff; font-size: 11.5px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; font-style: normal; }
.pc-app.is-widget { position: absolute; bottom: 70px; right: 0; width: 380px; height: min(620px, calc(100vh - 190px)); border-radius: 20px; box-shadow: 0 24px 64px rgba(20, 38, 43, .28); border: 1px solid var(--pc-line); animation: pcPop .2s ease-out; }
.pc-app.is-widget .pc-list { width: 100%; flex-basis: 100%; border: 0; }
.pc-app.is-widget .pc-thread { display: none; }
.pc-app.is-widget.is-thread .pc-list { display: none; }
.pc-app.is-widget.is-thread .pc-thread { display: flex; }
.pc-app.is-widget .pc-back { display: inline-grid; }
.pc-app.is-widget .pc-msg { max-width: 84%; }
.pc-handoff { border: 1px solid rgba(13, 92, 99, .25); background: #fff8ea; color: #0D5C63; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; margin-inline-end: 6px; }

/* toasts */
.pc-toasts { position: fixed; z-index: 99999; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.pc-toast { pointer-events: auto; background: #fff; border-inline-start: 4px solid var(--phwo-color-accent, #E8A33D); border-radius: 12px; box-shadow: 0 14px 40px rgba(20, 38, 43, .22); padding: 11px 36px 11px 14px; font: 14px/1.4 var(--phwo-font, system-ui, sans-serif); color: #14262B; position: relative; transform: translateY(-12px); opacity: 0; transition: transform .25s, opacity .25s; cursor: pointer; }
.pc-toast.is-in { transform: none; opacity: 1; }
.pc-toast strong { display: block; color: #0D5C63; margin-bottom: 2px; }
.pc-toast span { display: block; color: #3c4d51; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-toast.is-err { border-color: #d92d20; cursor: default; }
.pc-toast-x { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: #7a8a8e; cursor: pointer; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; }

@keyframes pcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pcPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pcDot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes pcSk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pc-app *, .pc-toast, .pc-launch { animation: none !important; transition: none !important; } }

/* phones: full-screen chat */
@media (max-width: 760px) {
	.pc-app.is-page { height: calc(100vh - 140px); min-height: 420px; border-radius: 14px; }
	.pc-app.is-page .pc-list { width: 100%; flex-basis: 100%; border: 0; }
	.pc-app.is-page .pc-thread { display: none; }
	.pc-app.is-page.is-thread .pc-list { display: none; }
	.pc-app.is-page.is-thread .pc-thread { display: flex; }
	.pc-app.is-page .pc-back { display: inline-grid; }
	.pc-msg { max-width: 86%; }
}
@media (max-width: 640px) {
	.pc-widget { right: 14px; bottom: 150px; }
	body:not(.has-stickybar) .pc-widget { bottom: 142px; }
	.pc-app.is-widget { position: fixed; inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; border: 0; z-index: 99998; }
	html.pc-lock, html.pc-lock body { overflow: hidden; }
	.pc-toasts { top: 10px; right: 10px; left: 10px; max-width: none; }
	.pc-emoji { grid-template-columns: repeat(7, 1fr); }
}

/* Message PHWO: topics + first-message form + restriction notice (5 Oct 2026) */
.pc-picker { max-height: 70%; overflow: auto; }
.pc-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pc-topics .pc-pick { margin: 0; }
.pc-newform { display: grid; gap: 8px; padding: 4px 2px; }
.pc-newform label { display: grid; gap: 4px; font-weight: 600; font-size: 13.5px; }
.pc-newform input, .pc-newform textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--pc-line); border-radius: 10px; padding: 9px 11px; font: inherit; background: #fff; }
.pc-newform textarea { resize: vertical; min-height: 96px; }
.pc-newrow { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pc-restrict { margin: 8px 12px; padding: 10px 12px; border-radius: 10px; background: #fff6e6; border: 1px solid #f0d49a; color: #6b4a00; font-size: 14px; }
@media (max-width: 420px) { .pc-topics { grid-template-columns: 1fr; } }

/* [phwo_message_us] — cache-safe: the guest block shows unless chat.js marks the page signed in. */
.phwo-msg-us { border: 1px solid #d7e6e7; border-radius: 14px; padding: 16px 18px; background: #f4f8f8; margin: 0 0 22px; }
.phwo-msg-us h2, .phwo-msg-us h3 { margin: 0 0 6px; font-size: 1.15em; }
.phwo-msg-us p { margin: 0 0 10px; }
.phwo-msg-us .phwo-msg-in { display: none; }
html.pc-signed .phwo-msg-us .phwo-msg-in { display: block; }
html.pc-signed .phwo-msg-us .phwo-msg-out { display: none; }
.phwo-msg-us a.phwo-msg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: #0D5C63; color: #fff !important; font-weight: 700; text-decoration: none !important; }
.phwo-msg-us a.phwo-msg-btn.is-ghost { background: #fff; color: #0D5C63 !important; border: 1px solid #0D5C63; }

/* [chatfix 14 Oct 2026] The panel and badge themselves honour [hidden] (".pc-app { display:flex }" used to beat it,
   so the widget sat open on every page and X did nothing). Launchers stack above the AI assistant (chat.js place()). */
.pc-app[hidden], .pc-badge[hidden], .pc-widget [hidden] { display: none !important; }
.pc-widget.is-open { z-index: 100000; }
.pc-widget.is-left .pc-app.is-widget { right: auto; left: 0; }
.pc-widget.is-left .pc-badge { right: auto; left: -3px; }
.pc-app.is-widget { max-height: calc(100vh - 120px); }
body:has(.phwo-assist.is-open) .pc-widget:not(.is-open) { display: none; }
@media (max-width: 640px) {
	.pc-app.is-widget { max-height: none; overscroll-behavior: contain; }
	.pc-widget.is-open .pc-launch { visibility: hidden; }
	html.pc-lock, html.pc-lock body { overflow: hidden !important; overscroll-behavior: none; }
}

/* dash-final (6 Oct 2026): WCAG AA text contrast - muted text, message times, system-note times. */
.pc-app { --pc-mute: #52636a; }
.pc-meta { opacity: 1; }
.pc-sys time { opacity: 1; color: #6b5626; }
