/* OS Chatbot widget */

#oschat-root {
	--oschat-primary: #0e6ba8;
	--oschat-primary-dark: #0a5486;
	--oschat-bg: #ffffff;
	--oschat-visitor: #0e6ba8;
	--oschat-bot: #f0f2f5;
	--oschat-text: #1f2933;
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--oschat-text);
}

/* Bubble */
#oschat-bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border: none;
	border-radius: 50%;
	background: var(--oschat-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background 0.15s ease;
}

#oschat-bubble:hover {
	background: var(--oschat-primary-dark);
	transform: scale(1.06);
}

/* Panel */
#oschat-panel[hidden] {
	display: none;
}

#oschat-panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 480px;
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	background: var(--oschat-bg);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}

#oschat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--oschat-primary);
	color: #fff;
	font-weight: 600;
}

#oschat-close {
	border: none;
	background: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.85;
}

#oschat-close:hover {
	opacity: 1;
}

/* Messages */
#oschat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafbfc;
}

.oschat-msg {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 14px;
	white-space: normal;
	word-wrap: break-word;
}

.oschat-msg-user {
	align-self: flex-end;
	background: var(--oschat-visitor);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.oschat-msg-assistant {
	align-self: flex-start;
	background: var(--oschat-bot);
	color: var(--oschat-text);
	border-bottom-left-radius: 4px;
}

/* Typing indicator */
.oschat-typing {
	display: flex;
	gap: 4px;
	padding: 14px 16px;
}

.oschat-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa5b1;
	animation: oschat-blink 1.2s infinite both;
}

.oschat-typing span:nth-child(2) { animation-delay: 0.2s; }
.oschat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes oschat-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* Input */
#oschat-form {
	display: flex;
	border-top: 1px solid #e4e7eb;
	background: #fff;
}

#oschat-input {
	flex: 1;
	border: none;
	padding: 14px 16px;
	font: inherit;
	outline: none;
	background: transparent;
	color: var(--oschat-text);
}

#oschat-send {
	border: none;
	background: none;
	color: var(--oschat-primary);
	padding: 0 16px;
	cursor: pointer;
}

#oschat-send:disabled,
#oschat-input:disabled {
	opacity: 0.5;
	cursor: default;
}

/* Honeypot: visually gone, still in the DOM for bots */
#oschat-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Mobile */
@media (max-width: 480px) {
	#oschat-root {
		right: 12px;
		bottom: 12px;
	}

	#oschat-panel {
		width: calc(100vw - 24px);
		height: 70vh;
	}
}
