/* PlatformPoints chatbot v1.0.0 — self-contained so it works on any theme */
.ppc {
	--ppc-brand: var(--pps-chat-brand, #2457F5);
	--ppc-ink: #0B1530;
	--ppc-muted: #5D6785;
	--ppc-line: #E3E7F0;
	--ppc-tint: #F4F6FB;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gurmukhi", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
	font-size: 16px; line-height: 1.5; color: var(--ppc-ink);
}
.ppc *, .ppc *::before, .ppc *::after { box-sizing: border-box; }
.ppc svg { width: 24px; height: 24px; flex: none; }
.ppc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.ppc-locked, html.ppc-locked body { overflow: hidden; }

.ppc-launcher {
	position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 9998;
	width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--ppc-brand); color: #fff; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 10px 30px color-mix(in srgb, var(--ppc-brand) 45%, transparent); transition: transform .2s;
	-webkit-tap-highlight-color: transparent;
}
.ppc-launcher:hover { transform: scale(1.06); }
.ppc-launcher svg { width: 28px; height: 28px; }
.ppc-dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: #FF4D4F; border: 2px solid #fff; transform: scale(0); transition: transform .3s; }
.ppc.has-nudge .ppc-dot:not([hidden]) { transform: scale(1); }
.ppc.is-open .ppc-launcher { transform: scale(.9); }
/* On PlatformPoints pages phones use the bottom dock's Chat button instead of a floating bubble. */
@media (max-width: 1023px) { .ppc.ppc-has-dock .ppc-launcher { display: none; } }

.ppc-panel {
	position: fixed; z-index: 9999; display: flex; flex-direction: column; overflow: hidden; background: #fff;
	inset: 0; width: 100%; height: 100%;
	opacity: 0; transform: translateY(16px); transition: opacity .2s, transform .2s;
}
.ppc.is-open .ppc-panel { opacity: 1; transform: none; }
.ppc-panel[hidden] { display: none; }
@media (min-width: 640px) {
	.ppc-panel { inset: auto 20px 92px auto; width: 380px; height: min(620px, calc(100vh - 120px)); border-radius: 20px; box-shadow: 0 24px 60px rgba(11,21,48,.22); border: 1px solid var(--ppc-line); }
	.ppc.ppc-has-dock .ppc-panel { bottom: 92px; }
}

.ppc-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; padding-top: max(12px, env(safe-area-inset-top, 0px)); background: var(--ppc-ink); color: #fff; }
.ppc-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--ppc-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.ppc-who { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.ppc-who strong { font-size: 16px; }
.ppc-who span { font-size: 12.5px; opacity: .8; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppc-online { width: 8px; height: 8px; border-radius: 50%; background: #3DD68C; flex: none; box-shadow: 0 0 0 3px rgba(61,214,140,.25); }
.ppc-x { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ppc-x:hover { background: rgba(255,255,255,.1); }

.ppc-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--ppc-tint); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; }
.ppc-msg { display: flex; flex-direction: column; max-width: 88%; animation: ppc-in .25s ease; }
.ppc-msg.is-user { align-self: flex-end; align-items: flex-end; }
.ppc-bubble { padding: 10px 14px; border-radius: 18px; background: #fff; border: 1px solid var(--ppc-line); word-wrap: break-word; overflow-wrap: anywhere; font-size: 15.5px; }
.ppc-msg.is-assistant .ppc-bubble { border-bottom-left-radius: 6px; }
.ppc-msg.is-user .ppc-bubble { background: var(--ppc-brand); color: #fff; border-color: var(--ppc-brand); border-bottom-right-radius: 6px; }
.ppc-bubble a { color: var(--ppc-brand); font-weight: 600; }
.ppc-msg.is-user .ppc-bubble a { color: #fff; }
.ppc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ppc-action { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ppc-brand); background: #fff; color: var(--ppc-brand) !important; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none !important; }
.ppc-action:hover { background: color-mix(in srgb, var(--ppc-brand) 8%, #fff); }
.ppc-action.is-primary { background: var(--ppc-brand); color: #fff !important; width: 100%; justify-content: center; min-height: 46px; }
.ppc-action[disabled] { opacity: .6; }
.ppc-typing .ppc-bubble { display: inline-flex; gap: 4px; padding: 14px 16px; }
.ppc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ppc-muted); animation: ppc-dot 1.2s infinite; }
.ppc-typing i:nth-child(2) { animation-delay: .15s; } .ppc-typing i:nth-child(3) { animation-delay: .3s; }

.ppc-lead { display: grid; gap: 8px; width: 100%; min-width: 250px; }
.ppc-lead p { margin: 0 0 2px; }
.ppc-lead label { display: grid; gap: 3px; font-size: 13px; font-weight: 650; color: var(--ppc-muted); }
.ppc-lead input, .ppc-lead textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px; border: 1.5px solid var(--ppc-line); border-radius: 10px; color: var(--ppc-ink); background: #fff; }
.ppc-lead input:focus, .ppc-lead textarea:focus { outline: none; border-color: var(--ppc-brand); }
.ppc-err { color: #B42318; font-size: 13px; margin: 0; min-height: 0; }

.ppc-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; background: #fff; border-top: 1px solid var(--ppc-line); scrollbar-width: none; flex: none; }
.ppc-chips::-webkit-scrollbar { display: none; }
.ppc-chip { flex: none; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ppc-line); background: var(--ppc-tint); color: var(--ppc-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ppc-chip:hover { border-color: var(--ppc-brand); color: var(--ppc-brand); }

.ppc-input { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; flex: none; margin: 0; }
.ppc-input textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 12px 14px; border-radius: 22px; border: 1.5px solid var(--ppc-line); font: inherit; font-size: 16px; resize: none; color: var(--ppc-ink); background: var(--ppc-tint); line-height: 1.35; }
.ppc-input textarea:focus { outline: none; border-color: var(--ppc-brand); background: #fff; }
.ppc-send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ppc-brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ppc-send svg { width: 20px; height: 20px; }
.ppc-note { margin: 0; padding: 0 14px 8px; font-size: 11.5px; color: var(--ppc-muted); background: #fff; text-align: center; }
.ppc :focus-visible { outline: 3px solid color-mix(in srgb, var(--ppc-brand) 55%, #fff); outline-offset: 2px; }

@keyframes ppc-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes ppc-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ppc *, .ppc-panel { animation: none !important; transition: none !important; } }
@media print { .ppc { display: none !important; } }
