/**
 * Claude Chat Widget Styles
 *
 * @package ClaudeChat
 */

:root {
	--claude-chat-primary: #2563eb;
	--claude-chat-primary-hover: #1d4ed8;
	--claude-chat-primary-light: #dbeafe;
	--claude-chat-bg: #ffffff;
	--claude-chat-text: #1f2937;
	--claude-chat-text-light: #6b7280;
	--claude-chat-border: #e5e7eb;
	--claude-chat-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--claude-chat-radius: 12px;
	--claude-chat-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--claude-chat-z-index: 99999;
}

/* Reset */
#claude-chat-widget * {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

#claude-chat-widget {
	position: fixed;
	z-index: var(--claude-chat-z-index);
	font-family: var(--claude-chat-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--claude-chat-text);
	text-align: left;
}

/* Positions */
#claude-chat-widget.claude-chat-position-bottom-right {
	bottom: 20px;
	right: 20px;
}

#claude-chat-widget.claude-chat-position-bottom-left {
	bottom: 20px;
	left: 20px;
}

/* Toggle Button */
#claude-chat-widget .claude-chat-toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: var(--claude-chat-primary);
	color: white;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, background-color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	z-index: 2;
	padding: 0;
	margin: 0;
	background-image: none;
}

#claude-chat-widget .claude-chat-toggle:hover {
	transform: scale(1.05);
	background-color: var(--claude-chat-primary-hover);
}

#claude-chat-widget .claude-chat-toggle-icon {
	position: absolute;
	transition: opacity 0.2s ease, transform 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

#claude-chat-widget.is-open .claude-chat-icon-chat {
	opacity: 0;
	transform: rotate(90deg) scale(0);
}

#claude-chat-widget:not(.is-open) .claude-chat-icon-close {
	opacity: 0;
	transform: rotate(-90deg) scale(0);
}

/* Panel */
#claude-chat-widget .claude-chat-panel {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 380px;
	height: 680px;
	max-height: calc(100vh - 120px);
	background-color: var(--claude-chat-bg);
	border-radius: var(--claude-chat-radius);
	box-shadow: var(--claude-chat-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	border: 1px solid var(--claude-chat-border);
}

#claude-chat-widget.claude-chat-position-bottom-left .claude-chat-panel {
	right: auto;
	left: 0;
}

#claude-chat-widget.is-open .claude-chat-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Header */
#claude-chat-widget .claude-chat-header {
	padding: 16px;
	background-color: var(--claude-chat-primary);
	color: white;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#claude-chat-widget .claude-chat-title-area {
	display: flex;
	flex-direction: column;
}

#claude-chat-widget .claude-chat-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
	color: white;
	line-height: 1.2;
}

#claude-chat-widget .claude-chat-tokens {
	font-size: 12px;
	opacity: 0.9;
	margin-top: 2px;
	color: white;
}

#claude-chat-widget .claude-chat-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

#claude-chat-widget .claude-chat-minimize,
#claude-chat-widget .claude-chat-logout {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 4px;
	opacity: 0.8;
	transition: opacity 0.2s;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	min-width: auto;
	box-shadow: none;
}

#claude-chat-widget .claude-chat-minimize:hover,
#claude-chat-widget .claude-chat-logout:hover {
	opacity: 1;
	background-color: rgba(255, 255, 255, 0.1);
}

/* Auth View */
#claude-chat-widget .claude-chat-auth-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 32px;
	background-color: #f9fafb;
	overflow-y: auto;
}

#claude-chat-widget .claude-chat-auth-form {
	background: white;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin: auto 0;
}

/* Modern Onboarding View */
#claude-chat-widget .claude-chat-onboarding-view {
	background: #f8fafc;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10;
	padding: 32px 24px;
	background-image: radial-gradient(circle at 0 0, rgba(0,0,0,0.03) 1px, transparent 1px),
					  radial-gradient(circle at 100% 0, rgba(0,0,0,0.03) 1px, transparent 1px);
	background-size: 20px 20px;
}

#claude-chat-widget .claude-chat-onboarding-content {
	flex: 1;
	overflow-y: auto;
}

#claude-chat-widget .claude-chat-welcome {
	display: flex;
	flex-direction: column;
	align-items: center;
}

#claude-chat-widget .claude-chat-welcome-image {
	width: 120px;
	height: 120px;
	margin-bottom: 16px;
}

#claude-chat-widget .claude-chat-welcome-image img {
	width: 100%;
	height: auto;
	object-fit: contain;
}

#claude-chat-widget .claude-chat-welcome-title {
	font-size: 24px;
	font-weight: 700;
	text-align: center;
	color: #1e293b;
	line-height: 1.3;
	margin-bottom: 32px;
}

#claude-chat-widget .claude-chat-features {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
}

#claude-chat-widget .claude-chat-feature {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

#claude-chat-widget .claude-chat-feature-icon {
	width: 40px;
	height: 40px;
	background: #f1f5f9;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #f97316;
	flex-shrink: 0;
}

#claude-chat-widget .claude-chat-feature-title {
	font-weight: 600;
	color: #1e293b;
	font-size: 16px;
	margin-bottom: 4px;
}

#claude-chat-widget .claude-chat-feature-desc {
	color: #64748b;
	font-size: 14px;
	line-height: 1.4;
}

#claude-chat-widget .claude-chat-onboarding-view .claude-chat-btn {
	background-color: #f97316;
	padding: 14px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 8px;
	margin-top: auto;
}

#claude-chat-widget .claude-chat-onboarding-view .claude-chat-btn:hover {
	background-color: #ea580c;
}



#claude-chat-widget .claude-chat-auth-form h3 {
	margin-bottom: 20px;
	font-size: 20px;
	text-align: center;
	color: var(--claude-chat-text);
	font-weight: 600;
	line-height: 1.3;
}

#claude-chat-widget .claude-chat-field {
	margin-bottom: 16px;
}

#claude-chat-widget .claude-chat-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--claude-chat-text);
}

#claude-chat-widget .claude-chat-field input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--claude-chat-border);
	border-radius: 6px;
	font-size: 14px;
	transition: border-color 0.2s;
	background-color: white;
	color: var(--claude-chat-text);
	box-shadow: none;
	height: auto;
}

#claude-chat-widget .claude-chat-field input:focus {
	outline: none;
	border-color: var(--claude-chat-primary);
	box-shadow: 0 0 0 2px var(--claude-chat-primary-light);
}

#claude-chat-widget .claude-chat-btn {
	width: 100%;
	padding: 10px;
	background-color: var(--claude-chat-primary);
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
	text-shadow: none;
	box-shadow: none;
	background-image: none;
	margin-top: 8px;
	height: auto;
	line-height: 1.5;
}

#claude-chat-widget .claude-chat-btn:hover {
	background-color: var(--claude-chat-primary-hover);
	color: white;
}

#claude-chat-widget .claude-chat-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

#claude-chat-widget .claude-chat-btn-secondary {
	background-color: transparent;
	color: var(--claude-chat-primary);
	border: 1px solid var(--claude-chat-primary);
}

#claude-chat-widget .claude-chat-btn-secondary:hover {
	background-color: var(--claude-chat-primary-light);
	color: var(--claude-chat-primary-hover);
}

#claude-chat-widget .claude-chat-auth-switch {
	margin-top: 16px;
	text-align: center;
	font-size: 13px;
	color: var(--claude-chat-text-light);
}

#claude-chat-widget .claude-chat-auth-switch a {
	color: var(--claude-chat-primary);
	text-decoration: none;
	font-weight: 500;
	box-shadow: none;
}

#claude-chat-widget .claude-chat-auth-switch a:hover {
	text-decoration: underline;
}

#claude-chat-widget .claude-chat-auth-error {
	margin-top: 12px;
	padding: 10px;
	background-color: #fee2e2;
	color: #b91c1c;
	border-radius: 6px;
	font-size: 13px;
	display: none;
	text-align: center;
}

/* Chat View */
#claude-chat-widget #claude-chat-chat-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

#claude-chat-widget .claude-chat-messages {
	flex: 1;
	padding: 22px 16px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: flex;
	flex-direction: column;
	gap: 16px;
	background:
		radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 55%),
		linear-gradient(180deg, #fbfaf7 0%, #f5f4ef 100%);
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: rgba(15, 23, 42, 0.12) transparent;
}

#claude-chat-widget .claude-chat-messages::-webkit-scrollbar {
	width: 6px;
}

#claude-chat-widget .claude-chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

#claude-chat-widget .claude-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.12);
	border-radius: 999px;
}

#claude-chat-widget .claude-chat-messages::-webkit-scrollbar-thumb:hover {
	background: rgba(15, 23, 42, 0.22);
}

/* Tip Message */
.claude-chat-tip {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 16px;
	font-size: 13px;
	color: #9a3412;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	position: relative;
	animation: claude-chat-fade-in 0.3s ease;
}

.claude-chat-tip-icon {
	flex-shrink: 0;
	color: #ea580c;
	display: flex;
	margin-top: 2px;
}

.claude-chat-tip-content {
	line-height: 1.5;
	flex: 1;
	font-weight: 400;
}

.claude-chat-tip-close {
	background: none;
	border: none;
	color: #fb923c;
	cursor: pointer;
	padding: 4px;
	margin: -4px -4px 0 0;
	border-radius: 4px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.claude-chat-tip-close:hover {
	background-color: #ffedd5;
	color: #ea580c;
}

/* Legal Message */
#claude-chat-widget .claude-chat-legal {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 11px;
	color: #64748b;
	text-align: left;
	direction: ltr;
	padding: 12px 16px;
	line-height: 1.5;
	margin: 12px -12px -12px -12px;
	border-top: 1px solid #f1f5f9;
	background: #f8fafc;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
}

#claude-chat-widget .claude-chat-legal-icon {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	color: #94a3b8;
	margin-top: 1px;
}

#claude-chat-widget .claude-chat-legal-text {
	flex: 1;
}

#claude-chat-widget .claude-chat-legal a {
	color: #475569;
	text-decoration: underline;
	text-decoration-color: #cbd5e1;
	transition: all 0.2s ease;
	font-weight: 500;
}

#claude-chat-widget .claude-chat-legal a:hover {
	color: var(--claude-chat-primary);
	text-decoration-color: var(--claude-chat-primary);
}

/* ============================================================
 * Message bubbles
 * Asymmetric corners signal speaker direction; layered shadows
 * give bubbles a tactile, paper-like presence on the cream canvas.
 * ============================================================ */
#claude-chat-widget .claude-chat-message {
	max-width: 86%;
	padding: 11px 15px;
	font-size: 14.5px;
	line-height: 1.55;
	letter-spacing: -0.005em;
	word-wrap: break-word;
	position: relative;
	animation: claude-chat-bubble-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
	font-feature-settings: "kern", "liga", "ss01";
}

@keyframes claude-chat-bubble-in {
	0% {
		opacity: 0;
		transform: translateY(8px) scale(0.97);
		filter: blur(2px);
	}

	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
		filter: blur(0);
	}
}

/* User bubble — gradient with brand-tinted halo */
#claude-chat-widget .claude-chat-message--user {
	align-self: flex-end;
	background: linear-gradient(140deg,
			var(--claude-chat-primary) 0%,
			var(--claude-chat-primary-hover) 100%);
	color: #fff;
	border-radius: 20px 20px 4px 20px;
	font-weight: 450;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.08),
		0 10px 24px -10px color-mix(in srgb, var(--claude-chat-primary) 55%, transparent);
}

/* Agent bubble — paper card with identity badge */
#claude-chat-widget .claude-chat-message--agent {
	align-self: flex-start;
	background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
	color: #1c1917;
	border-radius: 4px 20px 20px 20px;
	padding: 13px 16px 12px;
	margin-left: 36px;
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.05),
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 14px 28px -18px rgba(15, 23, 42, 0.22);
}

/* AI identity badge — sparkle disc tucked at the bubble base */
#claude-chat-widget .claude-chat-message--agent::before,
#claude-chat-widget .claude-chat-loading::before,
#claude-chat-widget .claude-chat-message--error::before,
#claude-chat-widget .claude-chat-message--fallback::before {
	content: "";
	position: absolute;
	left: -36px;
	bottom: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.55), transparent 55%),
		linear-gradient(135deg, var(--claude-chat-primary) 0%, var(--claude-chat-primary-hover) 100%);
	box-shadow:
		0 0 0 2px #fff,
		0 4px 12px -3px color-mix(in srgb, var(--claude-chat-primary) 40%, transparent);
	background-image:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M12 2.5l1.8 6.5 6.5 1.8-6.5 1.8L12 19l-1.8-6.4-6.5-1.8 6.5-1.8L12 2.5z' opacity='0.95'/><path d='M18.5 3l.6 1.9 1.9.6-1.9.6-.6 1.9-.6-1.9-1.9-.6 1.9-.6.6-1.9z' opacity='0.75'/></svg>"),
		radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.55), transparent 55%),
		linear-gradient(135deg, var(--claude-chat-primary) 0%, var(--claude-chat-primary-hover) 100%);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px, cover, cover;
}

/* Override the shared badge for the error variant — red warning disc */
#claude-chat-widget .claude-chat-message--error::before {
	background-image:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M12 2L2 20h20L12 2zm0 5l6.5 11.5h-13L12 7zm-1 4v4h2v-4h-2zm0 5v2h2v-2h-2z'/></svg>"),
		radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.45), transparent 55%),
		linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
	box-shadow:
		0 0 0 2px #fff,
		0 4px 12px -3px rgba(239, 68, 68, 0.45);
}

/* Error bubble — left accent stripe, soft salmon */
#claude-chat-widget .claude-chat-message--error {
	align-self: flex-start;
	background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
	color: #991b1b;
	font-size: 13.5px;
	border-radius: 4px 16px 16px 16px;
	padding: 11px 14px 11px 15px;
	margin-left: 36px;
	max-width: 86%;
	border-left: 3px solid #ef4444;
	box-shadow:
		0 0 0 1px rgba(239, 68, 68, 0.12),
		0 6px 16px -8px rgba(239, 68, 68, 0.25);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 10px;
}

/* ============================================================
 * Markdown content inside agent bubbles
 * Editorial-grade typography: brand-colored markers, refined
 * inline code, terminal-style code blocks with traffic lights.
 * ============================================================ */
#claude-chat-widget .claude-chat-message--agent p {
	margin-bottom: 8px;
}

#claude-chat-widget .claude-chat-message--agent p:last-child {
	margin-bottom: 0;
}

#claude-chat-widget .claude-chat-message--agent strong {
	font-weight: 600;
	color: #0f172a;
}

#claude-chat-widget .claude-chat-message--agent em {
	font-style: italic;
	color: #334155;
}

#claude-chat-widget .claude-chat-message--agent ul,
#claude-chat-widget .claude-chat-message--agent ol {
	margin: 6px 0 8px;
	padding-left: 20px;
}

#claude-chat-widget .claude-chat-message--agent li {
	margin: 3px 0;
	padding-left: 2px;
}

#claude-chat-widget .claude-chat-message--agent li::marker {
	color: var(--claude-chat-primary);
	font-weight: 600;
}

#claude-chat-widget .claude-chat-message--agent h1,
#claude-chat-widget .claude-chat-message--agent h2,
#claude-chat-widget .claude-chat-message--agent h3,
#claude-chat-widget .claude-chat-message--agent h4 {
	margin: 12px 0 4px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: #0f172a;
}

#claude-chat-widget .claude-chat-message--agent h1 { font-size: 16px; }
#claude-chat-widget .claude-chat-message--agent h2 { font-size: 15px; }
#claude-chat-widget .claude-chat-message--agent h3,
#claude-chat-widget .claude-chat-message--agent h4 { font-size: 14px; }

#claude-chat-widget .claude-chat-message--agent h1:first-child,
#claude-chat-widget .claude-chat-message--agent h2:first-child,
#claude-chat-widget .claude-chat-message--agent h3:first-child,
#claude-chat-widget .claude-chat-message--agent h4:first-child {
	margin-top: 0;
}

#claude-chat-widget .claude-chat-message--agent code {
	background: rgba(15, 23, 42, 0.06);
	padding: 1.5px 6px;
	border-radius: 5px;
	font-family: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, monospace;
	font-size: 0.86em;
	color: #be185d;
	font-feature-settings: "ss01", "calt";
}

#claude-chat-widget .claude-chat-message--agent pre {
	margin: 10px -2px;
	background: linear-gradient(180deg, #0f172a 0%, #0b1120 100%);
	color: #e2e8f0;
	padding: 32px 14px 14px;
	border-radius: 10px;
	overflow-x: auto;
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.1),
		0 8px 20px -10px rgba(15, 23, 42, 0.45);
	position: relative;
}

/* Traffic-light header — gives code blocks editorial gravitas */
#claude-chat-widget .claude-chat-message--agent pre::before {
	content: "";
	position: absolute;
	top: 11px;
	left: 12px;
	width: 38px;
	height: 10px;
	background:
		radial-gradient(circle 4px at 5px 5px, #ff5f57 99%, transparent),
		radial-gradient(circle 4px at 19px 5px, #febc2e 99%, transparent),
		radial-gradient(circle 4px at 33px 5px, #28c840 99%, transparent);
	opacity: 0.85;
}

#claude-chat-widget .claude-chat-message--agent pre code {
	background: transparent;
	color: inherit;
	padding: 0;
	font-size: 12.5px;
	line-height: 1.5;
}

#claude-chat-widget .claude-chat-message--agent blockquote {
	border-left: 3px solid var(--claude-chat-primary);
	padding: 2px 0 2px 12px;
	margin: 8px 0;
	color: #475569;
	font-style: italic;
}

#claude-chat-widget .claude-chat-message--agent a {
	color: var(--claude-chat-primary);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--claude-chat-primary) 28%, transparent);
	text-underline-offset: 2px;
	text-decoration-thickness: 1.5px;
	transition: text-decoration-color 0.2s ease, color 0.2s ease;
	font-weight: 500;
}

#claude-chat-widget .claude-chat-message--agent a:hover {
	text-decoration-color: var(--claude-chat-primary);
	color: var(--claude-chat-primary-hover);
}

#claude-chat-widget .claude-chat-message--agent table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
	font-size: 13px;
}

#claude-chat-widget .claude-chat-message--agent th,
#claude-chat-widget .claude-chat-message--agent td {
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
	padding: 7px 8px;
	text-align: left;
}

#claude-chat-widget .claude-chat-message--agent th {
	font-weight: 600;
	color: #0f172a;
	background: rgba(15, 23, 42, 0.03);
	font-size: 12px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

#claude-chat-widget .claude-chat-message--agent hr {
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.15), transparent);
	margin: 12px 0;
}

/* Input Area */
#claude-chat-widget .claude-chat-input-area {
	padding: 12px;
	background-color: white;
	border-top: 1px solid var(--claude-chat-border);
}

#claude-chat-widget .claude-chat-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	background-color: #f3f4f6;
	border-radius: 24px;
	padding: 8px 12px;
	border: 1px solid transparent;
	transition: border-color 0.2s, background-color 0.2s;
}

#claude-chat-widget .claude-chat-form:focus-within {
	background-color: white;
	border-color: var(--claude-chat-primary);
	box-shadow: 0 0 0 2px var(--claude-chat-primary-light);
}

#claude-chat-widget .claude-chat-input {
	flex: 1;
	border: none;
	background: transparent;
	resize: none;
	padding: 4px 0;
	max-height: 120px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	outline: none;
	box-shadow: none;
}

#claude-chat-widget .claude-chat-send {
	background: none;
	border: none;
	color: var(--claude-chat-primary);
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s, opacity 0.2s;
	box-shadow: none;
	margin: 0;
}

#claude-chat-widget .claude-chat-send:hover {
	transform: scale(1.1);
}

#claude-chat-widget .claude-chat-send:disabled {
	opacity: 0.5;
	cursor: default;
	transform: none;
}

/* Pre-set Messages */
#claude-chat-widget .claude-chat-pre-messages {
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
	max-height: 200px;
	margin-bottom: 12px;
	padding-bottom: 8px;
	scrollbar-width: thin;
}

#claude-chat-widget .claude-chat-pre-messages::-webkit-scrollbar {
	width: 4px;
}

#claude-chat-widget .claude-chat-pre-messages::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 4px;
}

#claude-chat-widget .claude-chat-pre-message-btn {
	background: #ffffff;
	border: 1px solid var(--claude-chat-border);
	color: #1e293b;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
	text-align: left;
	line-height: 1.4;
	flex: 0 0 auto;
	white-space: normal;
}

#claude-chat-widget .claude-chat-pre-message-btn:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
	color: var(--claude-chat-primary);
}

#claude-chat-widget .claude-chat-pre-message-btn:active {
	transform: translateY(0);
	box-shadow: none;
}

/* Loading indicator — sits in the agent column with its own identity badge */
#claude-chat-widget .claude-chat-loading {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 14px 18px;
	background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
	border-radius: 4px 20px 20px 20px;
	align-self: flex-start;
	margin-left: 36px;
	width: fit-content;
	position: relative;
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.05),
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 12px 24px -16px rgba(15, 23, 42, 0.18);
	animation: claude-chat-bubble-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#claude-chat-widget .claude-chat-loading-dot {
	width: 6px;
	height: 6px;
	background: var(--claude-chat-primary);
	border-radius: 50%;
	opacity: 0.3;
	animation: claude-chat-typing 1.3s ease-in-out infinite;
}

#claude-chat-widget .claude-chat-loading-dot:nth-child(1) { animation-delay: 0s; }
#claude-chat-widget .claude-chat-loading-dot:nth-child(2) { animation-delay: 0.18s; }
#claude-chat-widget .claude-chat-loading-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes claude-chat-typing {
	0%, 60%, 100% {
		opacity: 0.25;
		transform: translateY(0);
	}

	30% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* Toast */
.claude-chat-toast-container {
	position: fixed;
	bottom: 100px;
	right: 20px;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.claude-chat-toast {
	padding: 12px 16px;
	border-radius: 8px;
	background-color: #333;
	color: white;
	font-size: 14px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.3s, transform 0.3s;
	max-width: 300px;
}

.claude-chat-toast.show {
	opacity: 1;
	transform: translateY(0);
}

.claude-chat-toast--success {
	background-color: #10b981;
}

.claude-chat-toast--error {
	background-color: #ef4444;
}

/* Tooltip */
#claude-chat-widget .claude-chat-tooltip {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 280px;
	background: #ffffff;
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	border: 1px solid #f1f5f9;
	opacity: 0;
	transform: translateY(10px) scale(0.95);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 1;
}

#claude-chat-widget.claude-chat-position-bottom-left .claude-chat-tooltip {
	right: auto;
	left: 0;
}

#claude-chat-widget:not(.is-open) .claude-chat-tooltip.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

#claude-chat-widget .claude-chat-tooltip-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
	box-shadow: none;
	margin: 0;
}

#claude-chat-widget .claude-chat-tooltip-close:hover {
	color: #475569;
}

#claude-chat-widget .claude-chat-tooltip-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

#claude-chat-widget .claude-chat-tooltip-icon {
	font-size: 24px;
	line-height: 1;
}

#claude-chat-widget .claude-chat-tooltip-title {
	font-weight: 700;
	font-size: 16px;
	color: #0f172a;
}

#claude-chat-widget .claude-chat-tooltip-text {
	color: #64748b;
	font-size: 14px;
	margin-bottom: 16px;
	line-height: 1.5;
}

#claude-chat-widget .claude-chat-tooltip-action {
	background-color: #f97316;
	color: white;
	border: none;
	border-radius: 24px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s;
	display: inline-flex;
	align-items: center;
	box-shadow: none;
	margin: 0;
}

#claude-chat-widget .claude-chat-tooltip-action:hover {
	background-color: #ea580c;
}

/* Mobile Responsive */
@media (max-width: 480px) {
	#claude-chat-widget .claude-chat-panel {
		position: fixed;
		/* Fix relative to viewport */
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		height: 100%;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
		transform: translateY(100%);
		border: none;
		padding-bottom: env(safe-area-inset-bottom, 20px);
		z-index: 100000;
		/* Ensure it's on top */
	}

	#claude-chat-widget.is-open .claude-chat-panel {
		transform: translateY(0);
	}

	#claude-chat-widget .claude-chat-toggle {
		/* Keep toggle visible or adjust if needed */
		z-index: 100001;
		bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		right: 20px;
	}

	#claude-chat-widget .claude-chat-header {
		padding-top: max(16px, env(safe-area-inset-top));
	}
}

/* Tablet / Small Desktop */
@media (min-width: 481px) and (max-width: 768px) {
	#claude-chat-widget .claude-chat-panel {
		width: 340px;
		height: 550px;
		max-height: calc(100vh - 100px);
	}
}
/* ============================================================
 * Seller Support fallback bubble
 * Lives in the agent column with the shared identity badge.
 * Left amber stripe + soft cream background reads as editorial
 * "advisory note" rather than a hard error.
 * ============================================================ */
#claude-chat-widget .claude-chat-message--fallback {
	align-self: flex-start;
	margin-left: 36px;
	max-width: 92%;
	padding: 14px 16px 12px;
	background: linear-gradient(180deg, #fffaf1 0%, #fff2dd 100%);
	color: #7c2d12;
	border-radius: 4px 18px 18px 18px;
	border-left: 3px solid #f97316;
	box-shadow:
		0 0 0 1px rgba(249, 115, 22, 0.12),
		0 12px 26px -14px rgba(249, 115, 22, 0.25);
}

/* Recolor the shared badge to amber for the fallback variant so the
   "advisory" signal extends to the identity disc too. */
#claude-chat-widget .claude-chat-message--fallback::before {
	background-image:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M12 3l9 16H3L12 3zm0 5.2L6.6 17h10.8L12 8.2zM11 12h2v3h-2v-3zm0 4h2v2h-2v-2z'/></svg>"),
		radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.5), transparent 55%),
		linear-gradient(135deg, #f97316 0%, #c2410c 100%);
	box-shadow:
		0 0 0 2px #fff,
		0 4px 12px -3px rgba(249, 115, 22, 0.5);
}

#claude-chat-widget .claude-chat-message--fallback .claude-chat-fallback-text {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.55;
	letter-spacing: -0.005em;
}

#claude-chat-widget .claude-chat-message--fallback .claude-chat-fallback-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#claude-chat-widget .claude-chat-message--fallback .claude-chat-fallback-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: linear-gradient(180deg, #25d366 0%, #1ebe5d 100%);
	color: #fff;
	text-decoration: none;
	padding: 9px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: -0.005em;
	box-shadow:
		0 1px 2px rgba(30, 175, 75, 0.3),
		0 8px 20px -6px rgba(37, 211, 102, 0.45);
	transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
}

#claude-chat-widget .claude-chat-message--fallback .claude-chat-fallback-btn:hover,
#claude-chat-widget .claude-chat-message--fallback .claude-chat-fallback-btn:focus {
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow:
		0 2px 4px rgba(30, 175, 75, 0.35),
		0 12px 24px -6px rgba(37, 211, 102, 0.55);
}

#claude-chat-widget .claude-chat-message--fallback .claude-chat-fallback-btn::before {
	content: "";
	width: 15px;
	height: 15px;
	flex-shrink: 0;
	background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20.52 3.48A11.93 11.93 0 0012 0C5.37 0 0 5.37 0 12c0 2.12.55 4.18 1.6 6L0 24l6.18-1.62A11.94 11.94 0 0012 24c6.63 0 12-5.37 12-12 0-3.19-1.25-6.19-3.48-8.52zM12 21.82a9.84 9.84 0 01-5.02-1.38l-.36-.22-3.66.96.98-3.57-.24-.37A9.83 9.83 0 0112 2.18 9.83 9.83 0 0121.82 12 9.83 9.83 0 0112 21.82zm5.41-7.36c-.3-.15-1.76-.87-2.04-.97-.27-.1-.47-.15-.67.15-.2.3-.77.97-.94 1.17-.17.2-.35.22-.65.07-.3-.15-1.26-.46-2.4-1.48a9 9 0 01-1.66-2.07c-.17-.3-.02-.46.13-.61.13-.13.3-.35.45-.52.15-.17.2-.3.3-.5.1-.2.05-.37-.02-.52-.07-.15-.67-1.61-.92-2.21-.24-.58-.49-.5-.67-.51l-.57-.01c-.2 0-.52.07-.79.37-.27.3-1.04 1.02-1.04 2.48 0 1.46 1.06 2.87 1.21 3.07.15.2 2.1 3.2 5.07 4.49.71.31 1.26.49 1.69.62.71.23 1.36.2 1.87.12.57-.08 1.76-.72 2.01-1.41.25-.7.25-1.29.17-1.41-.07-.13-.27-.2-.57-.35z"/></svg>') center/contain no-repeat;
}

