/* Workspace support chat widget (Phase 1) */
.ws-support-fab {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 1200;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ws-support-fab:hover {
	transform: scale(1.04);
	box-shadow: 0 10px 28px rgba(37, 99, 235, 0.5);
}

.ws-support-fab svg {
	width: 26px;
	height: 26px;
}

.ws-support-panel {
	position: fixed;
	right: 20px;
	bottom: 88px;
	z-index: 1200;
	width: min(380px, calc(100vw - 32px));
	height: min(520px, calc(100vh - 120px));
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #e5e7eb;
}

.ws-support-panel.hidden {
	display: none;
}

.ws-support-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: #111827;
	color: #f9fafb;
	flex-shrink: 0;
}

.ws-support-head-title {
	font-weight: 600;
	font-size: 15px;
}

.ws-support-head-sub {
	font-size: 11px;
	color: #9ca3af;
	margin-top: 2px;
}

.ws-support-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 2px 8px;
	border-radius: 999px;
	background: #2563eb;
	color: #fff;
	margin-left: 8px;
	vertical-align: middle;
}

.ws-support-badge.human {
	background: #059669;
}

.ws-support-close {
	background: transparent;
	border: none;
	color: #9ca3af;
	cursor: pointer;
	padding: 4px;
	line-height: 0;
}

.ws-support-close:hover {
	color: #fff;
}

.ws-support-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px 12px;
	background: #f9fafb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ws-support-msg {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

.ws-support-msg.user {
	align-self: flex-end;
	background: #2563eb;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.ws-support-msg.assistant {
	align-self: flex-start;
	background: #fff;
	color: #111827;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}

.ws-support-msg.agent {
	align-self: flex-start;
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #86efac;
	border-bottom-left-radius: 4px;
}

.ws-support-msg-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.75;
	margin-bottom: 4px;
}

.ws-support-foot {
	padding: 10px 12px 12px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
	flex-shrink: 0;
}

.ws-support-human-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
	font-size: 11px;
	color: #6b7280;
}

.ws-support-mode-btns {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex-shrink: 0;
}

.ws-support-ai-btn {
	background: none;
	border: none;
	color: #059669;
	font-weight: 600;
	font-size: 12px;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.ws-support-ai-btn:disabled {
	color: #9ca3af;
	cursor: default;
	text-decoration: none;
}

.ws-support-human-btn {
	background: none;
	border: none;
	color: #2563eb;
	font-weight: 600;
	font-size: 12px;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.ws-support-human-btn:disabled {
	color: #9ca3af;
	cursor: not-allowed;
	text-decoration: none;
}

.ws-support-human-btn--pulse {
	animation: ws-support-pulse 1.2s ease-in-out infinite;
}

@keyframes ws-support-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
	50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}

.ws-support-input-row {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.ws-support-input-row textarea {
	flex: 1;
	min-height: 40px;
	max-height: 100px;
	resize: none;
	padding: 10px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	font-family: inherit;
	font-size: 13px;
	box-sizing: border-box;
}

.ws-support-input-row textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ws-support-send {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 10px;
	background: #2563eb;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ws-support-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ws-support-typing,
.ws-support-other-typing {
	font-size: 12px;
	color: #6b7280;
	padding: 4px 2px;
	align-self: flex-start;
	font-style: italic;
}

.ws-support-other-typing::after {
	content: '';
	animation: ws-support-dots 1.2s steps(3, end) infinite;
}

@keyframes ws-support-dots {
	0% { content: ''; }
	33% { content: '.'; }
	66% { content: '..'; }
	100% { content: '...'; }
}

@media (max-width: 480px) {
	.ws-support-panel {
		right: 12px;
		bottom: 80px;
		width: calc(100vw - 24px);
		height: min(70vh, 520px);
	}
	.ws-support-fab {
		right: 16px;
		bottom: 16px;
	}
}
