/**
 * Fairview Chat widget styles.
 *
 * Every rule is scoped under .fv-chat-* and every property the theme could
 * plausibly set is stated explicitly rather than inherited. A widget that
 * inherits typography, box-sizing and button styling from an unknown theme looks
 * different on every site and breaks on some of them.
 *
 * Palette follows fairview-na.com (sampled 2026-08-12): brand green #66cd00
 * (site buttons, white label), link green #00af3f, charcoal text on white
 * surfaces. The bright green carries only short bold labels — the site itself
 * never sets body text in white-on-green, so visitor bubbles use a light
 * green tint with charcoal text instead. Darker greens (#55ab00 hover,
 * #2e7d00 focus rings, #007a2c links on tint) are shades of the brand green,
 * needed because #66cd00 itself lacks contrast for those jobs.
 */

.fv-chat-launcher,
.fv-chat-panel,
.fv-chat-panel * {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Launcher
   -------------------------------------------------------------------------- */

.fv-chat-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	margin: 0;
	padding: 13px 22px;
	border: 0;
	border-radius: 999px;
	background: #66cd00;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.fv-chat-launcher:hover,
.fv-chat-launcher:focus {
	background: #55ab00;
	color: #fff;
}

.fv-chat-launcher:focus-visible {
	outline: 3px solid #2e7d00;
	outline-offset: 2px;
}

.fv-chat-launcher.is-open {
	transform: translateY(4px) scale(0.96);
	opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Teaser prompts (example questions above the launcher)
   -------------------------------------------------------------------------- */

.fv-chat-prompts {
	position: fixed;
	right: 20px;
	bottom: 76px;
	z-index: 99997;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	max-width: 300px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	animation: fv-chat-rise 0.25s ease-out;
}

.fv-chat-prompts[hidden] {
	display: none;
}

.fv-chat-prompts__chip {
	margin: 0;
	padding: 10px 14px;
	border: 1px solid #d9d9d9;
	border-radius: 14px 14px 4px 14px;
	background: #fff;
	color: #333333;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
	text-align: right;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fv-chat-prompts__chip:hover,
.fv-chat-prompts__chip:focus {
	background: #f0f9e6;
	border-color: #66cd00;
	color: #333333;
}

.fv-chat-prompts__chip:focus-visible {
	outline: 3px solid #2e7d00;
	outline-offset: 2px;
}

.fv-chat-prompts__dismiss {
	margin: 0 0 -2px;
	padding: 0;
	width: 22px;
	height: 22px;
	border: 1px solid #d9d9d9;
	border-radius: 50%;
	background: #fff;
	color: #6a6a6a;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.fv-chat-prompts__dismiss:hover,
.fv-chat-prompts__dismiss:focus {
	background: #f0f9e6;
	color: #333333;
}

.fv-chat-prompts__dismiss:focus-visible {
	outline: 2px solid #2e7d00;
	outline-offset: 2px;
}

@keyframes fv-chat-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
	.fv-chat-prompts {
		right: 14px;
		bottom: 68px;
		max-width: calc(100vw - 60px);
	}
}

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */

.fv-chat-panel {
	position: fixed;
	right: 20px;
	bottom: 82px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 120px);
	overflow: hidden;
	border: 1px solid #d9d9d9;
	border-radius: 12px;
	background: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: #333333;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.fv-chat-panel[hidden] {
	display: none;
}

/* Full-bleed on small screens; a 380px panel on a phone is unusable. */
@media (max-width: 520px) {
	.fv-chat-panel {
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border: 0;
		border-radius: 0;
	}

	.fv-chat-launcher {
		right: 14px;
		bottom: 14px;
	}
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.fv-chat-header {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 3px solid #66cd00;
	background: #fff;
}

.fv-chat-title {
	margin: 0;
	padding: 0;
	border: 0;
	color: #333333;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
}

.fv-chat-restart {
	margin: 0 2px 0 auto;
	padding: 3px 8px;
	border: 1px solid #c9c9c9;
	border-radius: 3px;
	background: transparent;
	color: #565656;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
	opacity: 0.85;
}

.fv-chat-restart:hover,
.fv-chat-restart:focus {
	background: #f0f9e6;
	color: #333333;
	opacity: 1;
}

.fv-chat-restart:focus-visible {
	outline: 2px solid #2e7d00;
	outline-offset: 2px;
}

.fv-chat-close {
	margin: 0;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: #565656;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
}

.fv-chat-close:hover,
.fv-chat-close:focus {
	background: transparent;
	color: #333333;
	opacity: 1;
}

.fv-chat-close:focus-visible {
	outline: 2px solid #2e7d00;
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Log
   -------------------------------------------------------------------------- */

.fv-chat-log {
	flex: 1 1 auto;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #f6f8f3;
	-webkit-overflow-scrolling: touch;
}

.fv-chat-msg {
	margin: 0 0 14px;
}

.fv-chat-msg__who {
	display: block;
	margin-bottom: 3px;
	color: #6a6a6a;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.fv-chat-msg__body {
	padding: 10px 13px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid #e2e2e2;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.fv-chat-msg--user .fv-chat-msg__body {
	background: #eef8e0;
	border-color: #66cd00;
	color: #333333;
	white-space: pre-wrap;
}

.fv-chat-msg__body p {
	margin: 0 0 0.7em;
	padding: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.fv-chat-msg__body p:last-child {
	margin-bottom: 0;
}

.fv-chat-msg__body ul {
	margin: 0 0 0.7em;
	padding-left: 1.2em;
	list-style: disc;
}

.fv-chat-msg__body ul:last-child {
	margin-bottom: 0;
}

.fv-chat-msg__body li {
	margin: 0 0 0.25em;
	padding: 0;
	list-style: disc;
}

.fv-chat-msg__body a {
	color: #00af3f;
	text-decoration: underline;
}

.fv-chat-msg--user .fv-chat-msg__body a {
	color: #007a2c;
}

/* --------------------------------------------------------------------------
   Notes (typing indicator, errors)
   -------------------------------------------------------------------------- */

.fv-chat-note {
	margin: 0 0 14px;
	padding: 0;
	color: #6a6a6a;
	font-size: 13px;
	line-height: 1.4;
}

.fv-chat-note--typing::after {
	content: "";
	display: inline-block;
	width: 4px;
	height: 4px;
	margin-left: 4px;
	border-radius: 50%;
	background: currentColor;
	animation: fv-chat-pulse 1s ease-in-out infinite;
}

.fv-chat-note--warn {
	color: #8c6800;
}

.fv-chat-note--error {
	padding: 9px 12px;
	border: 1px solid #f0d3d3;
	border-radius: 8px;
	background: #fdf4f4;
	color: #8a2b2b;
}

@keyframes fv-chat-pulse {
	0%, 100% { opacity: 0.25; }
	50%      { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Composer
   -------------------------------------------------------------------------- */

.fv-chat-form {
	display: flex;
	flex: 0 0 auto;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e5e5e5;
	background: #fff;
}

.fv-chat-input {
	flex: 1 1 auto;
	min-height: 42px;
	max-height: 120px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #c9c9c9;
	border-radius: 8px;
	background: #fff;
	color: #333333;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	resize: none;
	overflow-y: auto;
}

.fv-chat-input:focus {
	border-color: #55ab00;
	outline: 2px solid rgba(102, 205, 0, 0.35);
	outline-offset: 0;
}

.fv-chat-input:disabled {
	background: #f2f2f2;
	color: #8a8a8a;
}

.fv-chat-send {
	flex: 0 0 auto;
	margin: 0;
	padding: 11px 18px;
	border: 0;
	border-radius: 8px;
	background: #66cd00;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

.fv-chat-send:hover:not(:disabled),
.fv-chat-send:focus:not(:disabled) {
	background: #55ab00;
	color: #fff;
}

.fv-chat-send:focus-visible {
	outline: 3px solid #2e7d00;
	outline-offset: 2px;
}

.fv-chat-send:disabled {
	background: #b3b3b3;
	cursor: default;
}

/* --------------------------------------------------------------------------
   Accessibility preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.fv-chat-launcher,
	.fv-chat-note--typing::after,
	.fv-chat-prompts,
	.fv-chat-prompts__chip {
		transition: none;
		animation: none;
	}
}
