/* Prime Chat — visitor widget. Scoped under .pc; tokens follow the site (dark, mint accent, asymmetric corners). */
.pc {
	--pc-bg: #111312;
	--pc-surface: #181B19;
	--pc-surface-2: #1F2321;
	--pc-line: rgba(255, 255, 255, .08);
	--pc-text: #FFFFFF;
	--pc-muted: #9AA3A0;
	--pc-accent: var(--pk-accent, #0EFDC2);
	--pc-ink: #0B0B0B;
	--pc-tint: rgba(14, 253, 194, .12);
	--pc-danger: #FF8A8A;
	--pc-r: 18px 6px 18px 18px;
	--pc-r-sm: 14px 5px 14px 14px;
	--pc-ease: cubic-bezier(.32, .72, 0, 1);
	--pc-gap: 20px;
	--pc-vvh: 100vh;
	position: fixed;
	bottom: calc(var(--pc-gap) + env(safe-area-inset-bottom, 0px));
	z-index: 2147482000;
	direction: rtl;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.8;
	color: var(--pc-text);
	-webkit-tap-highlight-color: transparent;
	-webkit-font-smoothing: antialiased;
}

.pc--left { left: var(--pc-gap); }
.pc--right { right: var(--pc-gap); }

.pc *,
.pc *::before,
.pc *::after { box-sizing: border-box; }

.pc button,
.pc input,
.pc textarea { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }

.pc svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.pc [hidden] { display: none !important; }

/* Launcher */
.pc .pc-launcher {
	position: relative;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 22px 8px 22px 22px;
	background: var(--pc-accent);
	color: var(--pc-ink);
	box-shadow: 0 12px 32px rgba(14, 253, 194, .28), 0 4px 12px rgba(0, 0, 0, .35);
	cursor: pointer;
	transition: transform .25s var(--pc-ease), box-shadow .25s;
}

.pc--right .pc-launcher { border-radius: 8px 22px 22px 22px; }
.pc .pc-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(14, 253, 194, .34), 0 6px 14px rgba(0, 0, 0, .4); }
.pc .pc-launcher:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 3px; }
.pc .pc-launcher svg { width: 28px; height: 28px; stroke-width: 2; }

.pc-launcher__i { position: absolute; display: grid; place-items: center; transition: transform .3s var(--pc-ease), opacity .2s; }
.pc-launcher__i--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.pc.is-open .pc-launcher__i--chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.pc.is-open .pc-launcher__i--close { opacity: 1; transform: none; }

.pc .pc-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border: 2px solid #0F0F0F;
	border-radius: 11px;
	background: #FF5D5D;
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 800;
	line-height: 18px;
	text-align: center;
}

/* Teaser */
.pc .pc-teaser {
	position: absolute;
	bottom: 72px;
	display: flex;
	align-items: center;
	gap: 4px;
	max-width: min(260px, calc(100vw - 40px));
	padding: 6px 6px 6px 8px;
	border: 1px solid var(--pc-line);
	border-radius: var(--pc-r-sm);
	background: var(--pc-surface);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s, transform .3s var(--pc-ease);
}

.pc--left .pc-teaser { left: 0; }
.pc--right .pc-teaser { right: 0; }
.pc .pc-teaser.is-on { opacity: 1; transform: none; }

.pc .pc-teaser__text {
	padding: 6px 8px;
	border: 0;
	background: none;
	color: var(--pc-text);
	font-size: 13.5px;
	font-weight: 600;
	text-align: right;
	cursor: pointer;
}

.pc .pc-teaser__close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--pc-muted); cursor: pointer; }
.pc .pc-teaser__close svg { width: 16px; height: 16px; }

/* Panel */
.pc .pc-panel {
	position: absolute;
	bottom: 76px;
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(620px, calc(var(--pc-vvh) - 120px));
	overflow: hidden;
	border: 1px solid var(--pc-line);
	border-radius: 22px 8px 22px 22px;
	background: var(--pc-bg);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(14, 253, 194, .04);
	animation: pc-in .32s var(--pc-ease);
}

.pc--left .pc-panel { left: 0; }
.pc--right .pc-panel { right: 0; border-radius: 8px 22px 22px 22px; }

@keyframes pc-in {
	from { opacity: 0; transform: translateY(14px) scale(.98); }
	to { opacity: 1; transform: none; }
}

.pc .pc-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px 12px;
	border-bottom: 1px solid var(--pc-line);
	background: linear-gradient(180deg, rgba(14, 253, 194, .07), transparent);
}

.pc .pc-avatar {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 14px 5px 14px 14px;
	background: var(--pc-tint);
	color: var(--pc-accent);
	font-weight: 800;
	flex: none;
}

.pc .pc-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pc .pc-head__txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.pc .pc-head__txt strong { font-size: 15px; font-weight: 800; line-height: 1.5; }
.pc .pc-status { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--pc-muted); font-size: 12px; line-height: 1.6; white-space: nowrap; text-overflow: ellipsis; }
.pc .pc-dot { width: 8px; height: 8px; border-radius: 50%; background: #6B7471; flex: none; }
.pc .pc-dot.is-on { background: var(--pc-accent); box-shadow: 0 0 0 3px rgba(14, 253, 194, .18); }

.pc .pc-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 38px;
	height: 38px;
	padding: 0 8px;
	border: 1px solid var(--pc-line);
	border-radius: 12px;
	background: var(--pc-surface);
	color: var(--pc-text);
	cursor: pointer;
	flex: none;
	transition: background .2s, border-color .2s;
}

.pc .pc-icon:hover { border-color: rgba(14, 253, 194, .35); background: var(--pc-surface-2); }
.pc .pc-icon:focus-visible,
.pc .pc-btn:focus-visible,
.pc .pc-chip:focus-visible,
.pc .pc-send:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.pc .pc-icon svg { width: 19px; height: 19px; }
.pc .pc-human span { font-size: 12.5px; font-weight: 700; }

/* Messages */
.pc .pc-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
	min-height: 0;
	padding: 16px 14px 10px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.pc .pc-msg { display: flex; flex-direction: column; max-width: 86%; animation: pc-msg .28s var(--pc-ease); }
.pc .pc-msg--them { align-self: flex-start; align-items: flex-start; }
.pc .pc-msg--me { align-self: flex-end; align-items: flex-end; }

@keyframes pc-msg {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.pc .pc-msg__who { margin: 0 4px 3px; color: var(--pc-muted); font-size: 11.5px; font-weight: 700; line-height: 1.4; }
.pc .pc-msg__time { margin: 3px 6px 0; color: rgba(154, 163, 160, .75); font-size: 11px; line-height: 1.3; }

.pc .pc-bubble {
	padding: 9px 13px;
	border-radius: var(--pc-r-sm);
	background: var(--pc-surface-2);
	overflow-wrap: anywhere;
}

.pc .pc-msg--them .pc-bubble { border: 1px solid var(--pc-line); border-top-right-radius: 5px; }
.pc .pc-msg--me .pc-bubble { background: var(--pc-accent); color: var(--pc-ink); border-radius: 14px 14px 5px 14px; font-weight: 500; }
.pc .pc-msg--me.is-pending .pc-bubble { opacity: .65; }
.pc .pc-msg--me.is-failed .pc-bubble { background: rgba(255, 138, 138, .2); color: var(--pc-text); border: 1px solid rgba(255, 138, 138, .5); }

.pc .pc-bubble p { margin: 0; white-space: pre-line; font-size: 14px; line-height: 1.85; }
.pc .pc-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pc .pc-msg--them .pc-bubble a { color: var(--pc-accent); }

.pc .pc-img { display: block; margin: -3px -7px 6px; overflow: hidden; border-radius: 10px; }
.pc .pc-img:last-child { margin-bottom: -3px; }
.pc .pc-img img { display: block; width: 100%; max-width: 240px; max-height: 260px; object-fit: cover; }

.pc .pc-sys { align-self: center; max-width: 92%; padding: 6px 12px; border: 1px dashed var(--pc-line); border-radius: 12px; color: var(--pc-muted); font-size: 12.5px; line-height: 1.8; text-align: center; }
.pc .pc-sys--err { border-color: rgba(255, 138, 138, .45); color: var(--pc-danger); }
.pc .pc-sys .pc-actions { justify-content: center; }

/* Cards, buttons, chips */
.pc .pc-cards { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 6px; }

.pc .pc-card {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 240px;
	padding: 8px;
	border: 1px solid var(--pc-line);
	border-radius: var(--pc-r-sm);
	background: var(--pc-surface);
	color: var(--pc-text);
	text-decoration: none;
	transition: border-color .2s, background .2s;
}

.pc .pc-card:hover { border-color: rgba(14, 253, 194, .4); background: var(--pc-surface-2); }
.pc .pc-card img,
.pc .pc-card__ph { width: 44px; height: 44px; border-radius: 12px 4px 12px 12px; object-fit: cover; flex: none; }
.pc .pc-card__ph { display: grid; place-items: center; background: var(--pc-tint); color: var(--pc-accent); font-weight: 800; }
.pc .pc-card__txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.pc .pc-card__txt strong { overflow: hidden; font-size: 13.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; text-overflow: ellipsis; }
.pc .pc-card__txt small { display: -webkit-box; overflow: hidden; color: var(--pc-muted); font-size: 12px; line-height: 1.7; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc .pc-card__go { display: grid; place-items: center; color: var(--pc-accent); }
.pc .pc-card__go svg { width: 18px; height: 18px; }

.pc .pc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

.pc .pc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid var(--pc-accent);
	border-radius: 12px 4px 12px 12px;
	background: var(--pc-accent);
	color: var(--pc-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.pc .pc-btn--ghost { border-color: rgba(14, 253, 194, .4); background: var(--pc-tint); color: var(--pc-accent); }
.pc .pc-btn:disabled { opacity: .55; cursor: default; }

.pc .pc-chips {
	display: flex;
	gap: 6px;
	padding: 0 14px 10px;
	overflow-x: auto;
	scrollbar-width: none;
	flex: none;
}

.pc .pc-chips::-webkit-scrollbar { display: none; }

.pc .pc-chip {
	padding: 7px 12px;
	border: 1px solid rgba(14, 253, 194, .3);
	border-radius: 12px 4px 12px 12px;
	background: var(--pc-tint);
	color: var(--pc-accent);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	cursor: pointer;
	flex: none;
}

.pc .pc-chip:hover { background: rgba(14, 253, 194, .2); }

/* Offline card */
.pc .pc-offline {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid rgba(14, 253, 194, .25);
	border-radius: var(--pc-r-sm);
	background: var(--pc-surface);
}

.pc .pc-offline strong { font-size: 13.5px; }
.pc .pc-offline p { margin: 0; color: var(--pc-muted); font-size: 12.5px; line-height: 1.8; }
.pc .pc-contact { display: flex; flex-direction: column; gap: 6px; }

.pc .pc-contact input {
	width: 100%;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--pc-line);
	border-radius: 11px;
	background: var(--pc-bg);
	font-size: 16px;
	outline: none;
}

.pc .pc-contact input:focus { border-color: rgba(14, 253, 194, .5); }
.pc .pc-link { color: var(--pc-accent); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }

/* Typing */
.pc .pc-typing { display: flex; align-self: flex-start; gap: 4px; padding: 12px 14px; border: 1px solid var(--pc-line); border-radius: var(--pc-r-sm); background: var(--pc-surface-2); }
.pc .pc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--pc-muted); animation: pc-dot 1s infinite ease-in-out; }
.pc .pc-typing i:nth-child(2) { animation-delay: .15s; }
.pc .pc-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes pc-dot {
	0%, 80%, 100% { opacity: .3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* Composer */
.pc .pc-foot {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px calc(12px + var(--pc-safe, 0px));
	border-top: 1px solid var(--pc-line);
	background: var(--pc-bg);
	flex: none;
}

.pc .pc-hp { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }

.pc .pc-input {
	flex: 1 1 auto;
	min-height: 42px;
	max-height: 120px;
	padding: 9px 12px;
	border: 1px solid var(--pc-line);
	border-radius: 14px 5px 14px 14px;
	background: var(--pc-surface);
	font-size: 16px; /* No zoom on iOS. */
	line-height: 1.6;
	resize: none;
	outline: none;
	transition: border-color .2s;
}

.pc .pc-input::placeholder { color: rgba(154, 163, 160, .8); }
.pc .pc-input:focus { border-color: rgba(14, 253, 194, .5); }

.pc .pc-send {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 14px 5px 14px 14px;
	background: var(--pc-accent);
	color: var(--pc-ink);
	cursor: pointer;
	flex: none;
}

.pc .pc-send svg { width: 20px; height: 20px; stroke-width: 2; transform: scaleX(-1); }
.pc .pc-send:disabled { opacity: .5; cursor: default; }
.pc .pc-attach { height: 42px; cursor: pointer; }
.pc .pc-attach.is-busy { opacity: .5; pointer-events: none; }

/* Mobile: full screen sheet that follows the on-screen keyboard. */
@media (max-width: 600px) {
	.pc { --pc-gap: 16px; }
	.pc .pc-launcher { width: 56px; height: 56px; }

	.pc.is-full { inset: 0; bottom: auto; left: 0; right: 0; z-index: 2147483600; }

	.pc.is-full .pc-panel {
		position: fixed;
		inset: 0 0 auto 0;
		bottom: auto;
		width: 100%;
		height: var(--pc-vvh);
		overscroll-behavior: none;
		border: 0;
		border-radius: 0;
		animation: pc-up .3s var(--pc-ease);
	}

	.pc.is-full .pc-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
	.pc.is-full .pc-foot { --pc-safe: env(safe-area-inset-bottom, 0px); }
	.pc.is-full .pc-launcher,
	.pc.is-full .pc-teaser { display: none; }
	.pc .pc-msg { max-width: 90%; }
}

@keyframes pc-up {
	from { opacity: 0; }
	to { opacity: 1; }
}

html.pc-lock { overflow: hidden !important; }
html.pc-lock body { position: fixed !important; right: 0; left: 0; width: 100%; overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
	.pc *,
	.pc .pc-panel { animation: none !important; transition: none !important; }
}

/* Themes often restyle every button on hover/focus; keep ours. */
.pc .pc-launcher:hover,
.pc .pc-launcher:focus,
.pc .pc-launcher:active { background: var(--pc-accent); color: var(--pc-ink); }
.pc .pc-send:hover,
.pc .pc-send:focus,
.pc .pc-send:active { background: var(--pc-accent); color: var(--pc-ink); }
.pc .pc-icon:focus,
.pc .pc-icon:active { background: var(--pc-surface-2); color: var(--pc-text); }
.pc .pc-chip:focus,
.pc .pc-chip:active { color: var(--pc-accent); }
.pc .pc-btn:hover,
.pc .pc-btn:focus { background: var(--pc-accent); color: var(--pc-ink); text-decoration: none; }
.pc .pc-btn--ghost:hover,
.pc .pc-btn--ghost:focus { background: rgba(14, 253, 194, .2); color: var(--pc-accent); }
.pc .pc-teaser__text:hover,
.pc .pc-teaser__text:focus,
.pc .pc-teaser__close:hover,
.pc .pc-teaser__close:focus { background: transparent; }
.pc .pc-head__txt strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pc button { box-shadow: none; text-shadow: none; }
.pc .pc-launcher { box-shadow: 0 12px 32px rgba(14, 253, 194, .28), 0 4px 12px rgba(0, 0, 0, .35); }
.pc.is-human .pc-btn--human { display: none; }
