.ppc-chat,
.ppc-chat * { box-sizing: border-box; }

.ppc-chat {
	--ppc-ink: #152331;
	--ppc-navy: #0c1a25;
	--ppc-surface: #f7f5ef;
	--ppc-line: rgba(21, 35, 49, .16);
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--ppc-ink);
}

.ppc-chat button,
.ppc-chat input,
.ppc-chat textarea { font: inherit; }

.ppc-chat-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 20px;
	border: 1px solid rgba(255,255,255,.22);
	border-radius: 28px;
	background: var(--ppc-navy);
	color: #fff;
	box-shadow: 0 14px 36px rgba(4, 13, 20, .25);
	cursor: pointer;
}

.ppc-chat-toggle svg { width: 22px; height: 22px; color: var(--ppc-accent); }
.ppc-chat-toggle:hover { transform: translateY(-1px); }
.ppc-chat-toggle:focus-visible,
.ppc-chat button:focus-visible,
.ppc-chat input:focus-visible,
.ppc-chat textarea:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }
@supports (color: color-mix(in srgb, black, white)) {
	.ppc-chat-toggle:focus-visible,
	.ppc-chat button:focus-visible,
	.ppc-chat input:focus-visible,
	.ppc-chat textarea:focus-visible { outline-color: color-mix(in srgb, var(--ppc-accent), white 25%); }
}

.ppc-chat-panel {
	position: absolute;
	right: 0;
	bottom: 66px;
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 32px));
	height: min(650px, calc(100vh - 120px));
	min-height: 470px;
	overflow: hidden;
	border: 1px solid rgba(255,255,255,.18);
	border-radius: 16px;
	background: var(--ppc-surface);
	box-shadow: 0 24px 70px rgba(4, 13, 20, .28);
}

.ppc-chat-panel[hidden],
.ppc-chat-prestart[hidden],
.ppc-chat-conversation[hidden],
.ppc-chat-error[hidden] { display: none !important; }

.ppc-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 76px;
	padding: 15px 18px;
	background: var(--ppc-navy);
	color: #fff;
}

.ppc-chat-header div { display: flex; flex-direction: column; gap: 2px; }
.ppc-chat-header strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; letter-spacing: .01em; }
.ppc-chat-header span { position: relative; padding-left: 13px; color: rgba(255,255,255,.68); font-size: 12px; }
.ppc-chat-header span::before { content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--ppc-accent); }
.ppc-chat-header button { width: 36px; height: 36px; border: 0; background: transparent; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

.ppc-chat-prestart { padding: 22px; overflow-y: auto; }
.ppc-chat-intro { margin: 0 0 18px; color: #41505d; }
.ppc-chat-prestart form { display: grid; gap: 15px; }
.ppc-chat-prestart label:not(.ppc-chat-consent):not(.ppc-chat-honeypot) { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.ppc-chat-prestart input[type="text"],
.ppc-chat-prestart input[type="email"] { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--ppc-line); border-radius: 6px; background: #fff; color: var(--ppc-ink); }
.ppc-chat-consent { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; color: #53616c; font-size: 11px; line-height: 1.55; }
.ppc-chat-consent input { margin-top: 3px; }
.ppc-chat-consent a { color: var(--ppc-ink); text-decoration: underline; }
.ppc-chat-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.ppc-chat-primary {
	min-height: 45px;
	border: 1px solid var(--ppc-accent);
	border-radius: 6px;
	background: var(--ppc-accent);
	color: #0c1a25;
	font-weight: 700;
	cursor: pointer;
}
.ppc-chat-primary:disabled { opacity: .65; cursor: wait; }

.ppc-chat-conversation { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.ppc-chat-messages { flex: 1; min-height: 0; padding: 18px; overflow-y: auto; background: #f2f0e9; }
.ppc-chat-message { display: grid; max-width: 84%; margin: 0 0 13px; }
.ppc-chat-message p { margin: 2px 0; padding: 10px 12px; border: 1px solid var(--ppc-line); border-radius: 5px 13px 13px 13px; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.ppc-chat-message-visitor { margin-left: auto; justify-items: end; }
.ppc-chat-message-visitor p { border-color: var(--ppc-navy); border-radius: 13px 5px 13px 13px; background: var(--ppc-navy); color: #fff; }
.ppc-chat-message-admin p { border-color: color-mix(in srgb, var(--ppc-accent), #8b761f 25%); box-shadow: inset 3px 0 0 var(--ppc-accent); }
.ppc-chat-message-system { max-width: 100%; justify-items: center; color: #69747e; font-size: 11px; text-align: center; }
.ppc-chat-message-system p { padding: 5px 8px; border: 0; background: transparent; }
.ppc-chat-message-meta { color: #67747e; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ppc-chat-message time { color: #7a858e; font-size: 9px; }
.ppc-chat-typing { margin: 6px 0 12px; color: #6d7780; font-size: 11px; font-style: italic; }

.ppc-chat-actions { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--ppc-line); background: #fff; }
.ppc-chat-actions button { padding: 4px; border: 0; background: transparent; color: #52606b; font-size: 11px; text-decoration: underline; cursor: pointer; }
.ppc-chat-actions button:disabled { opacity: .5; cursor: default; }

.ppc-chat-composer { display: grid; grid-template-columns: 1fr 46px; gap: 8px; padding: 10px 12px 12px; background: #fff; }
.ppc-chat-composer textarea { width: 100%; min-height: 48px; max-height: 110px; resize: vertical; padding: 10px; border: 1px solid var(--ppc-line); border-radius: 6px; color: var(--ppc-ink); }
.ppc-chat-composer button { display: grid; place-items: center; min-height: 46px; border: 1px solid var(--ppc-accent); border-radius: 6px; background: var(--ppc-accent); color: var(--ppc-navy); cursor: pointer; }
.ppc-chat-composer button:disabled { opacity: .55; }
.ppc-chat-composer svg { width: 22px; height: 22px; }
.ppc-chat-error { margin: 0; padding: 0 14px 10px; color: #a43e34; font-size: 12px; }
.ppc-chat .screen-reader-text { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 600px) {
	.ppc-chat { right: 12px; bottom: 12px; }
	.ppc-chat-panel { position: fixed; inset: 10px; width: auto; height: auto; min-height: 0; border-radius: 12px; }
	.ppc-chat-toggle span { display: none; }
	.ppc-chat-toggle { width: 54px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.ppc-chat-toggle { transition: none; }
}
