.ai-coach-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	font-family: var(--fuse-font-primary, sans-serif);
}

/* Toggle Button */
.ai-coach-toggle {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--fuse-mode-btn-primary-bg, var(--fuse-btn-primary-bg));
	color: var(--fuse-mode-btn-primary-color, var(--fuse-btn-primary-color));
	border: none;
	box-shadow: var(--fuse-shadow-soft, 0 8px 20px rgba(0, 0, 0, 0.2));
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-coach-icon {
	font-size: 28px;
	line-height: 1;
}

/* Chat Panel */
.ai-coach-panel {
	position: absolute;
	right: 0;
	bottom: 68px;
	width: 320px;
	max-height: 80vh;
	background: var(--fuse-mode-header-bg, var(--fuse-header-bg));
	border: 1px solid var(--fuse-mode-border, var(--fuse-border));
	border-radius: var(--fuse-radius-lg, 16px);
	box-shadow: var(--fuse-shadow-soft, 0 8px 20px rgba(0, 0, 0, 0.12));
	display: none;
	overflow: hidden;
}

.ai-coach-panel.open {
	display: block;
}

/* Header */
.ai-coach-header {
	padding: 12px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--fuse-mode-bg-secondary, var(--fuse-grey-50));
	border-bottom: 1px solid var(--fuse-mode-border, var(--fuse-border));
}

/* Messages */
.ai-coach-messages {
	padding: 12px 16px;
	max-height: 320px;
	overflow-y: auto;
	font-size: 14px;
	color: var(--fuse-mode-text, var(--fuse-tertiary));
}

.ai-coach-message {
	margin-bottom: 10px;
	padding: 10px 12px;
	border-radius: var(--fuse-radius-md, 10px);
	background: var(--fuse-mode-muted, var(--fuse-grey-50));
}

.ai-coach-message ul {
	margin: 8px 0 0 18px;
}

.ai-coach-message a {
	color: var(--fuse-mode-link, var(--fuse-primary));
}

.ai-coach-message.user {
	background: var(--fuse-mode-btn-primary-bg, var(--fuse-btn-primary-bg));
	color: var(--fuse-mode-btn-primary-color, var(--fuse-btn-primary-color));
}

/* FORM - STACKED ALWAYS */
.ai-coach-form {
	display: flex;
	flex-direction: column; /* Always stacked */
	gap: 8px;
	padding: 12px 16px 16px;
}

/* Input */
.ai-coach-input {
	width: 100%;
	border-radius: var(--fuse-radius-md, 10px);
	border: 1px solid var(--fuse-mode-border, var(--fuse-border));
	padding: 10px 12px;
	background: var(--fuse-mode-field-bg, var(--fuse-white));
	color: var(--fuse-mode-text, var(--fuse-tertiary));
	font-size: 16px; /* Prevents iPhone zoom */
}

/* Send Button */
.ai-coach-form button {
	width: 100%;
	border-radius: var(--fuse-radius-md, 10px);
	padding: 10px 12px;
	border: none;
	cursor: pointer;
	background: var(--fuse-mode-btn-primary-bg, var(--fuse-btn-primary-bg));
	color: var(--fuse-mode-btn-primary-color, var(--fuse-btn-primary-color));
}

/* Resource Area */
.ai-coach-resource {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 6px 16px 12px;
}

/* Close Button */
.ai-coach-close {
	background: transparent;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: var(--fuse-mode-text, var(--fuse-tertiary));
}

/* Mobile Panel Width Adjustment */
@media (max-width: 768px) {
	.ai-coach-panel {
		width: 92vw;
		right: 4vw; /* Center better instead of -10px */
	}
}

/* iOS Stability Fix */
html {
	-webkit-text-size-adjust: 100%;
}