/* OTSI site chat widget — uses the real OTSI palette (navy #09141F / gold #D4A843). */
#pma-site-chat-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
}

#pma-site-chat-root .pma-chat-toggle {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #09141F;
	color: #D4A843;
	border: 2px solid #D4A843;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(9, 20, 31, 0.35);
	transition: transform 0.15s ease;
}
#pma-site-chat-root .pma-chat-toggle:hover {
	transform: scale(1.05);
}
#pma-site-chat-root .pma-chat-toggle-icon svg {
	width: 26px;
	height: 26px;
}
#pma-site-chat-root .pma-chat-toggle.is-open {
	background: #D4A843;
	color: #09141F;
	border-color: #09141F;
}

#pma-site-chat-root .pma-chat-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: min(360px, calc(100vw - 40px));
	height: min(520px, calc(100vh - 140px));
	background: #ffffff;
	border-radius: 14px;
	box-shadow: 0 16px 48px rgba(9, 20, 31, 0.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(9, 20, 31, 0.08);
}
/* Visibility is controlled ONLY via this class, never the `hidden` attribute —
   a class-based display:flex here would silently defeat `[hidden]` (same bug
   class already documented elsewhere in this codebase), which is exactly what
   caused the panel to be stuck permanently open with a non-functional close
   button. */
#pma-site-chat-root .pma-chat-panel.is-open {
	display: flex;
}

#pma-site-chat-root .pma-chat-header {
	background: #09141F;
	color: #ffffff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
}
#pma-site-chat-root .pma-chat-header-title {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.01em;
}
#pma-site-chat-root .pma-chat-close {
	background: none;
	border: none;
	color: #D4A843;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

#pma-site-chat-root .pma-chat-human-link {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	background: #eafaf0;
	color: #128c3f;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid rgba(9, 20, 31, 0.06);
}
#pma-site-chat-root .pma-chat-human-link:hover {
	background: #dcf6e6;
}
#pma-site-chat-root .pma-chat-human-link-icon svg {
	width: 16px;
	height: 16px;
}

#pma-site-chat-root .pma-chat-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f7f8;
}

#pma-site-chat-root .pma-chat-msg {
	display: flex;
	flex-direction: column;
	max-width: 86%;
}
#pma-site-chat-root .pma-chat-msg--user {
	align-self: flex-end;
	align-items: flex-end;
}
#pma-site-chat-root .pma-chat-msg--bot {
	align-self: flex-start;
	align-items: flex-start;
}

#pma-site-chat-root .pma-chat-bubble {
	padding: 9px 13px;
	border-radius: 12px;
	font-size: 13.5px;
	line-height: 1.5;
	word-break: break-word;
	white-space: normal;
}
#pma-site-chat-root .pma-chat-msg--user .pma-chat-bubble {
	background: #09141F;
	color: #ffffff;
	border-bottom-right-radius: 3px;
}
#pma-site-chat-root .pma-chat-msg--bot .pma-chat-bubble {
	background: #ffffff;
	color: #1c1c1e;
	border: 1px solid rgba(9, 20, 31, 0.1);
	border-bottom-left-radius: 3px;
}
#pma-site-chat-root .pma-chat-bubble--typing {
	color: rgba(28, 28, 30, 0.45);
	font-style: italic;
}

#pma-site-chat-root .pma-chat-sources {
	margin-top: 4px;
	font-size: 11px;
	color: rgba(28, 28, 30, 0.55);
	max-width: 100%;
}
#pma-site-chat-root .pma-chat-sources a {
	color: #8a6a1f;
	text-decoration: underline;
}

#pma-site-chat-root .pma-chat-form {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid rgba(9, 20, 31, 0.08);
	background: #ffffff;
}
#pma-site-chat-root .pma-chat-form input[type="text"] {
	flex: 1 1 auto;
	border: 1px solid rgba(9, 20, 31, 0.18);
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 13.5px;
	outline: none;
}
#pma-site-chat-root .pma-chat-form input[type="text"]:focus {
	border-color: #D4A843;
}
#pma-site-chat-root .pma-chat-send {
	background: #D4A843;
	color: #09141F;
	border: none;
	border-radius: 8px;
	padding: 0 16px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
}
#pma-site-chat-root .pma-chat-send:hover {
	filter: brightness(0.95);
}

@media (max-width: 480px) {
	#pma-site-chat-root {
		right: 12px;
		bottom: 12px;
	}
	#pma-site-chat-root .pma-chat-panel {
		width: calc(100vw - 24px);
		right: -8px;
	}
}
