/* ProxyPerk Chat — widget + operator dashboard styles.
   No preprocessor, no external fonts. Brand color comes from --pp-chat-brand. */

/* ==========================================================================
   1. Visitor widget
   ========================================================================== */

.pp-chat {
	--pp-chat-brand: #357073;
	--pp-chat-ink: #101828;
	--pp-chat-muted: #667085;
	--pp-chat-line: #e4e7ec;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--pp-chat-ink);
	-webkit-font-smoothing: antialiased;
}

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

.pp-chat__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.pp-chat__launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pp-chat-brand);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(16, 24, 40, 0.22);
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.pp-chat__launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(16, 24, 40, 0.26);
}

.pp-chat__launcher:focus-visible,
.pp-chat__icon-btn:focus-visible,
.pp-chat__send:focus-visible,
.pp-chat-inline:focus-visible {
	outline: 2px solid #101828;
	outline-offset: 2px;
}

.pp-chat__ico-close {
	display: none;
}

.pp-chat[data-open="1"] .pp-chat__ico-open {
	display: none;
}

.pp-chat[data-open="1"] .pp-chat__ico-close {
	display: block;
}

.pp-chat__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #d92d20;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.pp-chat__panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 110px);
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--pp-chat-line);
	border-radius: 16px;
	box-shadow: 0 24px 56px rgba(16, 24, 40, 0.24);
}

.pp-chat__panel[hidden] {
	display: none;
}

.pp-chat__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--pp-chat-brand) 0%, #244f52 100%);
	color: #fff;
}

.pp-chat__ava {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
}

.pp-chat__id {
	flex: 1;
	min-width: 0;
}

.pp-chat__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

.pp-chat__state {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0 0;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.82);
}

.pp-chat__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #75e0a7;
	box-shadow: 0 0 0 2px rgba(117, 224, 167, 0.28);
}

.pp-chat[data-online="0"] .pp-chat__dot {
	background: #fdb022;
	box-shadow: 0 0 0 2px rgba(253, 176, 34, 0.25);
}

.pp-chat__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.pp-chat__head .pp-chat__icon-btn:hover {
	background: rgba(255, 255, 255, 0.16);
}

.pp-chat__log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
	overflow-y: auto;
	background: #f8fafc;
	overscroll-behavior: contain;
}

.pp-chat__intro {
	margin: 0 0 2px;
	padding: 10px 12px;
	border: 1px dashed var(--pp-chat-line);
	border-radius: 12px;
	background: #fff;
	color: var(--pp-chat-muted);
	font-size: 13px;
}

.pp-chat__msg {
	display: flex;
	flex-direction: column;
	max-width: 84%;
	gap: 3px;
}

.pp-chat__msg--operator {
	align-self: flex-start;
}

.pp-chat__msg--visitor {
	align-self: flex-end;
	align-items: flex-end;
}

.pp-chat__bubble {
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.pp-chat__msg--operator .pp-chat__bubble {
	background: #fff;
	border: 1px solid var(--pp-chat-line);
	border-bottom-left-radius: 4px;
	color: var(--pp-chat-ink);
}

.pp-chat__msg--visitor .pp-chat__bubble {
	background: var(--pp-chat-brand);
	border-bottom-right-radius: 4px;
	color: #fff;
}

.pp-chat__bubble img {
	display: block;
	max-width: 220px;
	max-height: 220px;
	border-radius: 8px;
	height: auto;
}

.pp-chat__time {
	font-size: 11px;
	color: #98a2b3;
}

.pp-chat__pending {
	opacity: 0.65;
}

.pp-chat__system {
	align-self: center;
	padding: 4px 10px;
	border-radius: 999px;
	background: #eef2f6;
	color: var(--pp-chat-muted);
	font-size: 11.5px;
	text-align: center;
}

.pp-chat__status {
	padding: 8px 14px;
	border-top: 1px solid var(--pp-chat-line);
	background: #fffbf0;
	color: #7a5a10;
	font-size: 12.5px;
}

.pp-chat__status a {
	color: inherit;
	font-weight: 600;
}

.pp-chat__form {
	padding: 10px 12px 12px;
	border-top: 1px solid var(--pp-chat-line);
	background: #fff;
}

.pp-chat__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 8px;
}

.pp-chat__fields[hidden] {
	display: none;
}

.pp-chat__fields input,
.pp-chat__composer textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--pp-chat-line);
	border-radius: 9px;
	background: #fff;
	font: inherit;
	font-size: 13px;
	color: var(--pp-chat-ink);
}

.pp-chat__composer textarea {
	min-height: 40px;
	max-height: 96px;
	resize: none;
	padding-right: 10px;
}

.pp-chat__fields input:focus,
.pp-chat__composer textarea:focus {
	outline: none;
	border-color: var(--pp-chat-brand);
	box-shadow: 0 0 0 3px rgba(53, 112, 115, 0.16);
}

.pp-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 6px;
}

.pp-chat__composer textarea {
	flex: 1;
}

.pp-chat__composer .pp-chat__icon-btn {
	color: var(--pp-chat-muted);
}

.pp-chat__composer .pp-chat__icon-btn:hover {
	background: #f2f4f7;
	color: var(--pp-chat-brand);
}

.pp-chat__send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--pp-chat-brand);
	color: #fff;
	cursor: pointer;
}

.pp-chat__send[disabled] {
	opacity: 0.55;
	cursor: progress;
}

.pp-chat__note {
	margin: 8px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: #98a2b3;
}

.pp-chat-inline {
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	background: #357073;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

@media (max-width: 480px) {
	.pp-chat {
		right: 12px;
		bottom: 12px;
	}

	.pp-chat__launcher {
		width: 52px;
		height: 52px;
	}

	.pp-chat__panel {
		position: fixed;
		right: 8px;
		left: 8px;
		bottom: 76px;
		width: auto;
		max-width: none;
		height: min(72vh, 560px);
		max-height: calc(100vh - 96px);
	}

	.pp-chat__fields {
		grid-template-columns: 1fr;
	}

	.pp-chat__bubble img {
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pp-chat__launcher {
		transition: none;
	}
}

/* ==========================================================================
   2. Operator dashboard (wp-admin)
   ========================================================================== */

.pp-admin__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.pp-admin__pill {
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

.pp-admin__pill.is-on {
	background: #e7f6ec;
	color: #0d7a3e;
}

.pp-admin__pill.is-off {
	background: #fdf0e6;
	color: #a13c00;
}

.pp-admin__link {
	margin-left: auto;
	font-size: 13px;
}

.pp-admin__grid {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	height: calc(100vh - 210px);
	min-height: 460px;
	margin-top: 14px;
	overflow: hidden;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
}

.pp-admin__list {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 1px solid #dcdcde;
	background: #f9fafb;
}

.pp-admin__filters {
	display: flex;
	gap: 4px;
	padding: 10px;
	border-bottom: 1px solid #dcdcde;
}

.pp-admin__filter {
	flex: 1;
	padding: 4px 8px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fff;
	font-size: 12px;
	cursor: pointer;
}

.pp-admin__filter.is-active {
	border-color: #357073;
	background: #357073;
	color: #fff;
}

.pp-admin__items {
	flex: 1;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.pp-admin__items li {
	margin: 0;
}

.pp-admin__item {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-bottom: 1px solid #eef0f2;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.pp-admin__item:hover {
	background: #eef4f4;
}

.pp-admin__item.is-active {
	background: #e3eeee;
	box-shadow: inset 3px 0 0 #357073;
}

.pp-admin__item-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.pp-admin__item-name {
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

.pp-admin__item-time {
	font-size: 11px;
	color: #8c8f94;
	white-space: nowrap;
}

.pp-admin__item-preview {
	margin: 2px 0 0;
	font-size: 12px;
	color: #646970;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pp-admin__unread {
	display: inline-block;
	min-width: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #d92d20;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.pp-admin__empty {
	padding: 16px;
	color: #8c8f94;
	font-size: 13px;
}

.pp-admin__thread {
	display: flex;
	flex-direction: column;
	min-height: 0;
	min-width: 0;
}

.pp-admin__thread-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid #dcdcde;
	background: #fff;
}

.pp-admin__thread-head[hidden] {
	display: none;
}

.pp-admin__meta {
	display: block;
	font-size: 12px;
	color: #646970;
}

.pp-admin__thread-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pp-admin__tag {
	padding: 2px 8px;
	border-radius: 999px;
	background: #e7f6ec;
	color: #0d7a3e;
	font-size: 11px;
	font-weight: 600;
}

.pp-admin__tag.is-closed {
	background: #f0f0f1;
	color: #50575e;
}

.pp-admin__log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	overflow-y: auto;
	background: #f6f7f7;
}

.pp-admin__hint {
	margin: auto;
	color: #8c8f94;
	font-size: 13px;
}

.pp-admin__msg {
	max-width: 68%;
	padding: 8px 12px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.pp-admin__msg--visitor {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #dcdcde;
}

.pp-admin__msg--operator {
	align-self: flex-end;
	background: #357073;
	color: #fff;
}

.pp-admin__msg img {
	display: block;
	max-width: 260px;
	max-height: 260px;
	margin-top: 4px;
	border-radius: 8px;
	height: auto;
}

.pp-admin__msg-time {
	margin-top: 3px;
	font-size: 10.5px;
	opacity: 0.7;
}

.pp-admin__compose {
	padding: 10px 14px 12px;
	border-top: 1px solid #dcdcde;
	background: #fff;
}

.pp-admin__compose[hidden] {
	display: none;
}

.pp-admin__compose textarea {
	width: 100%;
	resize: vertical;
}

.pp-admin__compose-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.pp-admin__compose-row select {
	flex: 1;
	max-width: 320px;
}

.pp-admin__compose-row .button-primary {
	margin-left: auto;
}

.pp-chat-count {
	display: inline-block;
	min-width: 18px;
	margin-left: 4px;
	padding: 0 5px;
	border-radius: 9px;
	background: #d92d20;
	color: #fff;
	font-size: 11px;
	line-height: 18px;
	text-align: center;
}

@media (max-width: 960px) {
	.pp-admin__grid {
		grid-template-columns: 1fr;
		grid-template-rows: 220px minmax(0, 1fr);
		height: auto;
	}

	.pp-admin__list {
		border-right: 0;
		border-bottom: 1px solid #dcdcde;
	}

	.pp-admin__thread {
		min-height: 420px;
	}

	.pp-admin__msg {
		max-width: 85%;
	}
}

/* ==========================================================================
   3. Standalone operator app (PWA, outside wp-admin)
   ========================================================================== */

.pp-app {
	--pp-app-bg: #f6f7f7;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	background: var(--pp-app-bg);
	color: #1d2327;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	-webkit-text-size-adjust: 100%;
}

.pp-app * {
	box-sizing: border-box;
}

.pp-app__bar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	padding-top: calc(10px + env(safe-area-inset-top));
	background: #fff;
	border-bottom: 1px solid #e4e7ec;
}

.pp-app__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 14px;
	min-width: 0;
}

.pp-app__brand img {
	border-radius: 8px;
	flex: 0 0 auto;
}

.pp-app__brand span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pp-app__bar-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.pp-app__btn {
	padding: 7px 11px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	color: #1d2327;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
}

.pp-app__btn:hover {
	border-color: var(--pp-chat-brand);
	color: var(--pp-chat-brand);
}

.pp-app__btn--primary {
	border: 0;
	background: var(--pp-chat-brand);
	color: #fff;
}

.pp-app__btn--primary:hover {
	color: #fff;
	opacity: 0.92;
}

.pp-app__menu {
	position: relative;
}

.pp-app__menu > summary {
	list-style: none;
}

.pp-app__menu > summary::-webkit-details-marker {
	display: none;
}

.pp-app__menu-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	min-width: 210px;
	padding: 6px;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
}

.pp-app__menu-item {
	display: block;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 7px;
	background: none;
	color: #1d2327;
	font: inherit;
	font-size: 13px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.pp-app__menu-item:hover {
	background: #f2f4f7;
}

.pp-app__main {
	padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
}

.pp-app .pp-admin__grid {
	height: calc(100dvh - 96px - env(safe-area-inset-top));
	min-height: 520px;
	margin-top: 0;
	border-radius: 10px;
}

/* Login screen */

.pp-app--login {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.pp-app__login {
	width: 100%;
	max-width: 380px;
	padding: 26px 22px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(16, 24, 40, 0.12);
	text-align: center;
}

.pp-app__logo {
	border-radius: 14px;
}

.pp-app__login-title {
	margin: 10px 0 2px;
	font-size: 19px;
	line-height: 1.3;
}

.pp-app__login-sub {
	margin: 0 0 18px;
	color: #667085;
	font-size: 13px;
}

.pp-app__alert {
	margin: 0 0 14px;
	padding: 9px 12px;
	border-radius: 9px;
	background: #fef3f2;
	color: #b42318;
	font-size: 13px;
	text-align: left;
}

.pp-app__form {
	text-align: left;
}

.pp-app__form label {
	display: block;
	margin: 0 0 5px;
	font-size: 12.5px;
	font-weight: 600;
	color: #344054;
}

.pp-app__form input {
	width: 100%;
	margin-bottom: 14px;
	padding: 11px 12px;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	font-size: 15px; /* 16px avoids iOS zoom on focus */
	color: #1d2327;
}

.pp-app__form input:focus {
	outline: none;
	border-color: var(--pp-chat-brand);
	box-shadow: 0 0 0 3px rgba(53, 112, 115, 0.16);
}

.pp-app__form .pp-app__btn--primary {
	width: 100%;
	padding: 12px;
	font-size: 15px;
}

.pp-app__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.pp-app__hint {
	margin: 16px 0 0;
	color: #98a2b3;
	font-size: 11.5px;
	line-height: 1.5;
}

/* Phone layout: keep list + thread on one screen, no page scroll */

@media (max-width: 960px) {
	.pp-app .pp-admin__grid {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(110px, 32dvh) minmax(0, 1fr);
		height: calc(100dvh - 96px - env(safe-area-inset-top));
		min-height: 0;
	}

	.pp-app .pp-admin__thread {
		min-height: 0;
	}

	.pp-app .pp-admin__compose textarea {
		font-size: 16px;
	}

	.pp-app .pp-admin__compose-row select {
		max-width: 45%;
	}
}

@media (max-width: 420px) {
	.pp-app__bar {
		gap: 6px;
	}

	.pp-app__brand span {
		display: none;
	}

	.pp-app__bar-actions .pp-app__btn {
		padding: 6px 9px;
		font-size: 12px;
	}
}

/* App polish: never let the phone layout clip a control */

.pp-app .pp-admin__filters {
	flex-wrap: wrap;
}

.pp-app .pp-admin__filter {
	min-width: 0;
	flex: 1 1 72px;
}

.pp-app .pp-admin__thread-head {
	flex-wrap: wrap;
}

.pp-app .pp-admin__thread-head > div:first-child {
	min-width: 0;
	flex: 1 1 140px;
}

.pp-app .pp-admin__meta {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pp-app .pp-admin__compose-row {
	flex-wrap: wrap;
}

.pp-app .pp-admin__compose-row select {
	flex: 1 1 130px;
}

@media (max-width: 430px) {
	.pp-app .pp-admin__compose-row select {
		flex: 1 1 100%;
		max-width: none;
	}

	.pp-app .pp-admin__compose-row .button-primary {
		flex: 1 1 100%;
		margin-left: 0;
	}

	.pp-app .pp-admin__compose-row .button {
		flex: 1 1 auto;
	}
}

/* Grid items must be allowed to shrink, otherwise long previews widen the column. */

.pp-app .pp-admin__grid {
	grid-template-columns: minmax(0, 1fr);
}

.pp-app .pp-admin__list,
.pp-app .pp-admin__thread,
.pp-app .pp-admin__items,
.pp-app .pp-admin__item,
.pp-app .pp-admin__filters {
	min-width: 0;
}

.pp-app .pp-admin__item-preview {
	min-width: 0;
}

@media (min-width: 961px) {
	.pp-app .pp-admin__grid {
		grid-template-columns: 300px minmax(0, 1fr);
	}
}

.pp-app__ver {
	margin: 6px 10px 4px;
	color: #98a2b3;
	font-size: 11px;
	letter-spacing: 0.02em;
}

.pp-app__ver--login {
	margin: 18px 0 0;
}

/* Phone: one pane at a time — list OR the open conversation */

.pp-app__back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-right: 2px;
}

.pp-app__back[hidden] {
	display: none;
}

@media (min-width: 961px) {
	.pp-app__back {
		display: none !important;
	}
}

@media (max-width: 960px) {
	.pp-app .pp-admin__grid {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr);
	}

	.pp-app .pp-admin__grid[data-view="list"] .pp-admin__thread {
		display: none;
	}

	.pp-app .pp-admin__grid[data-view="thread"] .pp-admin__list {
		display: none;
	}

	.pp-app .pp-admin__list {
		border-right: 0;
		border-bottom: 0;
	}

	.pp-app .pp-admin__thread {
		height: 100%;
		min-height: 0;
	}

	.pp-app .pp-admin__compose {
		padding-bottom: calc(10px + env(safe-area-inset-bottom));
	}
}

/* Bookmark (star) a conversation */

.pp-admin__star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
	color: #98a2b3;
	cursor: pointer;
	transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.pp-admin__star:hover {
	color: #b54708;
	border-color: #f0b429;
	background: #fffaeb;
}

.pp-admin__star.is-on {
	color: #b54708;
	border-color: #f0b429;
	background: #fffaeb;
}

.pp-admin__star.is-on .pp-star-path {
	fill: currentColor;
}

.pp-admin__star:disabled {
	opacity: 0.6;
	cursor: progress;
}

.pp-admin__item-star {
	margin-left: 4px;
	color: #b54708;
	font-size: 12px;
	line-height: 1;
	flex: 0 0 auto;
}

/* Visitor identity bar + history pagination */

.pp-chat__who {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-bottom: 1px solid var(--pp-chat-line);
	background: #fff;
	color: var(--pp-chat-muted);
	font-size: 12px;
}

.pp-chat__who[hidden] {
	display: none;
}

.pp-chat__who span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pp-chat__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--pp-chat-brand);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.pp-chat__more {
	align-self: center;
	margin: 0 auto 6px;
	padding: 6px 12px;
	border: 1px solid var(--pp-chat-line);
	border-radius: 999px;
	background: #fff;
	color: var(--pp-chat-muted);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

.pp-chat__more:hover {
	color: var(--pp-chat-brand);
	border-color: var(--pp-chat-brand);
}

.pp-chat__more[hidden] {
	display: none;
}

.pp-chat__save {
	grid-column: 1 / -1;
	justify-self: end;
	padding: 5px 12px;
	border: 1px solid var(--pp-chat-brand);
	border-radius: 999px;
	background: transparent;
	color: var(--pp-chat-brand);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.pp-chat__save:hover {
	background: var(--pp-chat-brand);
	color: #fff;
}

.pp-chat__save[hidden] {
	display: none;
}

/* Visitor e-mail verification (unlock past chats) */

.pp-chat__verify {
	padding: 10px 14px;
	border-bottom: 1px solid var(--pp-chat-line);
	background: #f4f8f8;
}

.pp-chat__verify[hidden] {
	display: none;
}

.pp-chat__verify-text {
	margin: 0 0 8px;
	color: var(--pp-chat-muted);
	font-size: 12.5px;
	line-height: 1.45;
}

.pp-chat__verify-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pp-chat__verify-row[hidden] {
	display: none;
}

.pp-chat__verify-row input {
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid var(--pp-chat-line);
	border-radius: 9px;
	font: inherit;
	font-size: 15px;
	letter-spacing: 0.18em;
	text-align: center;
}

.pp-chat__verify-row input:focus {
	outline: none;
	border-color: var(--pp-chat-brand);
	box-shadow: 0 0 0 3px rgba(53, 112, 115, 0.16);
}

.pp-chat__save--solid {
	border: 0;
	background: var(--pp-chat-brand);
	color: #fff;
}

.pp-chat__save--solid:hover {
	background: #244f52;
	color: #fff;
}

.pp-chat__verify-msg {
	min-height: 16px;
	margin: 6px 0 0;
	font-size: 12px;
	color: #0d7a3e;
}

.pp-chat__verify-msg.is-error {
	color: #b42318;
}

/* ==========================================================================
   4. Operator app — tabs and live visitors
   ========================================================================== */

.pp-app__tabs {
	display: flex;
	gap: 6px;
	padding: 8px 12px 0;
}

.pp-app__tab {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid #d0d5dd;
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
	background: #eef1f4;
	color: #475467;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.pp-app__tab.is-active {
	background: #fff;
	color: var(--pp-chat-brand);
	box-shadow: 0 -1px 0 #d0d5dd inset;
}

.pp-app__tab-count {
	display: inline-block;
	min-width: 18px;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 9px;
	background: #12b76a;
	color: #fff;
	font-size: 11px;
	line-height: 18px;
	text-align: center;
}

.pp-app__vhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 2px;
}

.pp-app__vsummary {
	color: #475467;
	font-size: 12.5px;
	font-weight: 600;
}

.pp-app__vlist {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.pp-app__vitem {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid #f2f4f7;
}

.pp-app__vitem:last-child {
	border-bottom: 0;
}

.pp-app__vdot {
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #d0d5dd;
}

.pp-app__vitem.is-online .pp-app__vdot {
	background: #12b76a;
	box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.18);
}

.pp-app__vmain {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.pp-app__vmain strong {
	font-size: 13.5px;
	color: #101828;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pp-app__vmeta,
.pp-app__vmail {
	color: #667085;
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pp-app__vmail {
	color: #98a2b3;
	font-size: 11.5px;
}

.pp-app__vmsg {
	flex: 0 0 auto;
}

.pp-app__vempty {
	padding: 16px;
	color: #98a2b3;
	font-size: 13px;
	text-align: center;
}

.pp-app__nudge {
	margin-top: 12px;
	padding: 12px;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	background: #fff;
}

.pp-app__nudge[hidden] {
	display: none;
}

.pp-app__nudge-to {
	margin: 0 0 8px;
	color: #475467;
	font-size: 12.5px;
	font-weight: 600;
}

.pp-app__nudge textarea {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #d0d5dd;
	border-radius: 9px;
	font: inherit;
	font-size: 14px;
	resize: vertical;
}

.pp-app__nudge-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 8px;
}

@media (max-width: 960px) {
	.pp-app__visitors {
		padding-bottom: calc(12px + env(safe-area-inset-bottom));
	}
}

/* Automatic (assistant) messages */

.pp-chat__msg--auto {
	align-self: flex-start;
}

.pp-chat__msg--auto .pp-chat__bubble {
	background: #eef6f6;
	border: 1px solid #cfe3e3;
	border-bottom-left-radius: 4px;
	color: #1d2327;
}

.pp-admin__msg--auto {
	align-self: flex-start;
	background: #eef6f6;
	border: 1px solid #cfe3e3;
	color: #1d2327;
}

.pp-admin__msg--auto .pp-admin__msg-time {
	color: #667085;
	opacity: 1;
}

/* App shell: the composer must always sit at the bottom of the screen.
   The app is a fixed-height flex column; only the message log scrolls. */

body.pp-app:not(.pp-app--login) {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	min-height: 100dvh;
	overflow: hidden;
}

.pp-app:not(.pp-app--login) .pp-app__bar,
.pp-app:not(.pp-app--login) .pp-app__tabs {
	flex: 0 0 auto;
}

.pp-app:not(.pp-app--login) .pp-app__main {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
	overflow: hidden;
}

.pp-app:not(.pp-app--login) [data-pp-pane] {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}

.pp-app:not(.pp-app--login) [data-pp-pane][hidden] {
	display: none;
}

.pp-app .pp-admin__grid {
	height: 100%;
	min-height: 0;
	flex: 1 1 auto;
}

.pp-app .pp-admin__list,
.pp-app .pp-admin__thread {
	min-height: 0;
}

.pp-app .pp-admin__thread {
	display: flex;
	flex-direction: column;
}

.pp-app .pp-admin__log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.pp-app .pp-admin__compose {
	flex: 0 0 auto;
	position: sticky;
	bottom: 0;
	z-index: 2;
	background: #fff;
	padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.pp-app #pp-pane-visitors {
	overflow: hidden;
}

.pp-app .pp-app__vhead {
	flex: 0 0 auto;
}

.pp-app .pp-app__vlist {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}

.pp-app .pp-app__nudge {
	flex: 0 0 auto;
}

@media (max-width: 960px) {
	.pp-app .pp-admin__grid {
		height: 100%;
		min-height: 0;
	}
}

/* Chat ownership (one operator per conversation) */

.pp-admin__owner {
	padding: 2px 8px;
	border-radius: 999px;
	background: #e3eeee;
	color: #244f52;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pp-admin__owner.is-free {
	background: #f2f4f7;
	color: #667085;
}

.pp-admin__owner.is-mine {
	background: #e7f6ec;
	color: #0d7a3e;
}

.pp-admin__thread-actions select[data-pp-admin="transferTo"] {
	max-width: 150px;
}

.pp-admin__lock {
	margin: 0;
	padding: 9px 14px;
	border-top: 1px solid #fdf0d5;
	background: #fffbf0;
	color: #7a5a10;
	font-size: 12.5px;
	font-weight: 600;
}

.pp-admin__lock[hidden] {
	display: none;
}

.pp-admin__compose textarea:disabled,
.pp-admin__compose button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Team page (administrators only) */

.pp-team__table {
	margin-top: 8px;
	max-width: 900px;
}

.pp-team__pill {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 600;
}

.pp-team__pill.is-on {
	background: #e7f6ec;
	color: #0d7a3e;
}

.pp-team__pill.is-off {
	background: #f2f4f7;
	color: #667085;
}

.pp-team__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 10px 0 14px;
}

.pp-team__periods .button.is-active {
	border-color: #357073;
	background: #357073;
	color: #fff;
}

.pp-team__chart {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	max-width: 900px;
	height: 220px;
	padding: 12px;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
	overflow-x: auto;
}

.pp-team__bar {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	min-width: 26px;
	height: 100%;
}

.pp-team__bar-fill {
	position: relative;
	width: 100%;
	max-width: 46px;
	min-height: 2px;
	border-radius: 4px 4px 0 0;
	background: linear-gradient(180deg, #4a9093, #357073);
}

.pp-team__bar-fill[data-value]::after {
	content: attr(data-value);
	position: absolute;
	top: -18px;
	left: 0;
	right: 0;
	text-align: center;
	color: #475467;
	font-size: 11px;
	font-weight: 600;
}

.pp-team__bar-label {
	margin-top: 6px;
	color: #98a2b3;
	font-size: 10.5px;
	white-space: nowrap;
}
