/* Chatbot container styles */
#chatbot {
	width: calc(80vw - 10px); /* Adjusted width considering possible scrollbar */
	height: calc(
		100vh - 10px
	); /* Adjusted height considering possible scrollbar */
	margin: 0 auto;
	padding: 10px;
	box-sizing: border-box;
	border-radius: 10px; /* Rounded corners */
	display: flex; /* Use flexbox */
	flex-direction: column; /* Arrange children vertically */
}

/* Chat window styles */
#chat-window {
	flex-grow: 1; /* Allow the chat window to grow to fill available space */
	position: relative; /* Make the logo container position relative */
	overflow-y: auto; /*Enable vertical scrolling */
	/*  border: 1px solid #009898;*/
	margin-top: 28px;
	margin-bottom: 10px;
	box-sizing: border-box;
	border-radius: 10px;
	/*  background-color: white;*/
	text-align: center; /* Center inline-block elements within the chat window */
}
#chat-window::-webkit-scrollbar {
	display: none; /* For Chrome, Safari, and Opera */
}

/* Placeholder styles for user input */
#user-input::placeholder {
	white-space: pre-wrap; /* Allow text to wrap */
}

/* Default state for Font Awesome microphone icon */
/* Microphone always stays inside input wrapper */
/* Shared base */
.microphone-icon {
	font-size: 20px;
	color: #009898;
	cursor: pointer;
}

/* Input mic (inside input field) */
.input-mic {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
}

/* Conversation list item styles */

#conversation {
	padding-left: 10px; /* Adjust left padding */
	padding-right: 10px; /* Adjust right padding */
	max-width: 100%;
	box-sizing: border-box;
}

#conversation li {
	list-style: none;
	margin-bottom: 10px;
	padding: 0 10px; /* Add horizontal padding */
	/* display: flex; Use Flexbox for alignment */
	justify-content: left; /* Default alignment to the left */
	font-size: 16px; /* or 18px, or any size you prefer */
}

/* User query text styles */
#conversation li.user {
	color: #333;
	background-color: #f0f0f0; /* Light grey background for user messages */
	justify-content: center; /* Align user messages to the center horizontally */
	align-items: center; /* Align text to the center vertically */
	border-radius: 5px; /* Rounded corners for user messages */
	text-align: center; /* Center text horizontally */
	min-height: 30px; /* Minimum height for consistency */
	display: flex; /* Use Flexbox for alignment */
	padding: 5px; /* Adjust padding as needed */
}

#conversation li.user {
	position: relative;
	padding-right: 76px;
	justify-content: center;
	padding: 8px 72px 8px 12px;
}

#conversation li.user .message-text {
	width: 100%;
	text-align: center;
	flex: 1;
}

#conversation li.user .message-time {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 11px;
	color: #777;
	white-space: nowrap;
}

#conversation li.bot .message-time {
	text-align: right;
	font-size: 11px;
	color: #999;
	margin-top: 4px;
}

/* Bot response text styles */
#conversation li.bot {
	color: #007777;
	/* background-color: #f0f0f0; Light grey background for bot messages */
	border-radius: 5px; /* Optional: rounded corners for bot messages */
	text-align: left;
	min-height: 50px; /* Minimum height for consistency */
}

/* Chatbot response styles */
img.response-image {
	max-width: 400px; /* Set maximum width of images to 400 pixels */
	width: 100%; /* Set width to 100% to ensure responsiveness */
	border-radius: 10px; /* Rounded corners */
}
.response-image {
	width: 200px;
	transition: transform 0.3s ease;
	/*cursor: pointer;*/
}
.large-image {
	width: 600px;
	height: auto;
}

.option-box {
	display: inline-block;
	border: 1px solid #009898;
	padding: 10px;
	margin: 5px 5px;
	border-radius: 5px;
	background-color: #f9f9f9;
	cursor: pointer; /* Make the options look clickable */
}

.option-box.correct {
	border-color: green;
	color: green;
}

.option-box.incorrect {
	border-color: red;
	color: red;
}

/*dividing line separate above navigation button in content */
hr {
	border: none; /* Remove default border */
	border-top: 2px dashed #dadce0; /* Dashed line with desired color */
	background-size: 6px 2px; /* Adjust size for dash pattern */
	height: 2px; /* Height of the dashed line */
	margin: 20px 0; /* Optional: Add spacing above and below */
	position: relative;
}
/* Apply styles to the table */
/* Make table responsive */
.table-wrapper {
	border-radius: 15px;
	border: 1px solid #ddd;
	overflow-x: auto; /* 👈 allow horizontal scroll */
	-webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
	max-width: 100%; /* keep inside screen */
}

/* Style table */
.table-wrapper table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	min-width: 500px; /* 👈 ensures columns don’t squish too much on small screens */
}

th,
td {
	padding: 8px;
	border: 1px solid #ddd;
	text-align: left;
}

th {
	background-color: #f2f2f2;
}

tr:last-child td {
	border-bottom: none;
}

tr:first-child th:first-child {
	border-top-left-radius: 10px;
}

tr:first-child th:last-child {
	border-top-right-radius: 10px;
}

tr:last-child td:first-child {
	border-bottom-left-radius: 10px;
}

tr:last-child td:last-child {
	border-bottom-right-radius: 10px;
}
#conversation table {
	width: 100%; /* Ensure the table fits within the container */
	table-layout: fixed; /* Prevent table from expanding beyond container width */
	border-collapse: collapse; /* Optional, for cleaner table design */
}

/* Optional: Prevent long text from causing overflow */
#conversation table td,
#conversation table th {
	word-wrap: break-word; /* Allow long words to break to next line */
	overflow-wrap: break-word; /* Ensure long content like URLs doesn't cause overflow */
}

/* Media Query for smaller screens */
@media screen and (max-width: 300px) {
	#chatbot {
		width: calc(
			100vw - 20px
		); /* Full width on smaller screens, considering padding */
	}
	#user-input-container {
		padding: 5px; /* Reduce padding on smaller screens */
		width: 100%; /* Full width on smaller screens */
	}

	#user-input {
		padding-left: 10px;
		padding-right: 30px; /* Adjust padding for smaller screens */
	}

	#chatbot {
		width: 95%; /* Adjusted width for mobile */
		padding: 5px;
	}

	#logo {
		width: 50px; /* Adjusted width for mobile */
	}

	#user-input {
		width: calc(100% - 100px); /* Adjusted width for mobile */
		margin-bottom: 10px;
		min-height: 50px;
		padding: 5px;
		border-radius: 10px; /* Rounded corners */
	}

	#send-button {
		padding: 4px 5px; /* Adjusted padding for mobile */
	}
}
/* Class for scaling the image on hover */
.clickable-image {
	transition: transform 0.3s ease-in-out;
	cursor: pointer;
}

/* Apply scaling when hovering */
.clickable-image:hover {
	transform: scale(1.9);
	align-items: center;
	justify-content: center;
}

@media (max-width: 768px) {
	#chatbot {
		width: calc(
			100vw - 20px
		); /* Full width on smaller screens, considering padding */
	}
	#conversation {
		padding-left: 15px; /* Adjust left padding for small screens */
		padding-right: 15px; /* Adjust right padding for small screens */
	}
	#conversation table {
		width: 100%; /* Ensure table adjusts properly on smaller screens */
	}
	#user-input-container {
		padding: 5px; /* Reduce padding on smaller screens */
		width: 100%; /* Full width on smaller screens */
	}

	#user-input {
		padding-left: 10px;
		padding-right: 30px; /* Adjust padding for smaller screens */
	}
	#send-button {
		padding: 8px 16px; /* Adjust padding for smaller screens */
	}
	div[style*="display: flex"] {
		flex-direction: column;
	}
}
@media (max-width: 600px) {
	#chatbot {
		width: calc(
			100vw - 20px
		); /* Full width on smaller screens, considering padding */
	}
	#conversation {
		padding-left: 10px;
		padding-right: 10px;
		overflow-x: auto; /* Allow horizontal scroll */
	}
	#conversation li {
		font-size: 12px; /* 16 for desktop */
	}
	#conversation table {
		width: 100%;
		min-width: 600px; /* Ensure the table is wide enough, but doesn't overflow */
		table-layout: auto; /* Allows the table to dynamically adjust based on content */
	}
	#user-input-container {
		padding: 5px; /* Reduce padding on smaller screens */
		width: 100%; /* Full width on smaller screens */
	}

	#user-input {
		padding-left: 10px;
		padding-right: 30px; /* Adjust padding for smaller screens */
	}
	#send-button {
		padding: 8px 16px; /* Adjust padding for smaller screens */
	}
	.response-image {
		width: 100%;
	}
	.response-image + div {
		flex: 100%;
		padding-right: 0;
	}
	.autofill.button-style {
		font-size: 12px; /* or 18px, or any size you prefer */
	}
}

.iframe-button {
	margin: 10px;
	padding: 10px 15px;
	border: 2px solid #1267a4;
	border-radius: 10px;
	background-color: #1267a4;
	color: white;
	cursor: pointer;
	outline: none;
	font-size: 16px;
	font-family: "Avenir Next", sans-serif;
}
.toggle-button {
	padding: 10px 15px;
	border-radius: 10px;
	background-color: #1267a4;
	color: white;
	cursor: pointer;
	outline: none;
	font-size: 16px;
	font-family: "Avenir Next", sans-serif;
}

.button-style:hover {
	background-color: var(--button-hover);
	color: white;
}

/* Define styles for the survey button */
.survey-button {
	background-color: #007777; /* Green */
	border: none;
	color: white;
	padding: 15px 32px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	font-size: 16px;
	margin: 4px 2px;
	cursor: pointer;
	border-radius: 8px;
}

/* Lightbox styles */
#lightbox {
	display: none;
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-content {
	position: relative;
	top: 50%; /* Set top to 50% of the viewport height */
	transform: translateY(
		-50%
	); /* Shift the lightbox up by half its own height */
	margin: auto;
	padding: 10px;
	width: 95%; /* Fill 90% of the browser width */
}
.rounded-img {
	width: 100%;
	border-radius: 15px; /* Rounded corners for images */
}

.close {
	position: absolute;
	top: 15px;
	right: 25px;
	color: #595959;
	font-size: 16px;
	cursor: pointer;
	background: none; /* Removes the background fill */
	border: none; /* Removes the border */
}

.slide {
	display: none;
}

.slide img {
	width: 100%;
	height: auto; /* Maintain aspect ratio */
	max-height: 90vh; /* Ensure the image does not exceed the viewport height */
}

.prev,
.next {
	cursor: pointer;
	position: absolute;
	top: 50%;
	width: auto;
	padding: 16px;
	margin-top: -22px;
	color: white;
	font-weight: bold;
	font-size: 18px;
	transition: 0.6s ease;
	border-radius: 0 3px 3px 0;
	user-select: none;
}

.next {
	right: 0;
	border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
	background-color: rgba(0, 0, 0, 0.8);
}

/* Button styles */
.toggle-button {
	background-color: #009898; /* Button fill color */
	color: white;
	border: none;
	padding: 10px 20px;
	cursor: pointer;
}

.bot-response-text {
	line-height: 1.45;
}

.bot-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 8px;
	opacity: 0.65;
	transition: opacity 0.2s ease;
}

#conversation li.bot:hover .bot-actions {
	opacity: 1;
}

.feedback-ask {
	font-size: 12px;
	color: #888;
	margin-right: 2px;
}

.bot-action-btn,
.feedback-save-btn {
	border: 1px solid #dadce0;
	background: #fff;
	color: #595959;
	border-radius: 999px;
	min-width: 28px;
	min-height: 28px;
	padding: 4px 8px;
	cursor: pointer;
	font-size: 13px;
	text-decoration: none;
	line-height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bot-action-btn:hover,
.feedback-save-btn:hover {
	border-color: #009898;
	color: #009898;
	background: #f7ffff;
}

.bot-action-status {
	font-size: 12px;
	color: #009898;
	margin-left: 4px;
}

.bot-response-text p {
	margin: 0 0 12px 0 !important;
	line-height: 1.5;
	padding: 0 !important;
}

.bot-response-text ul,
.bot-response-text ol {
	margin: 6px 0 8px 22px;
	padding-left: 18px;
}

.bot-response-text li {
	margin: 3px 0;
}

.bot-response-text br {
	display: block;
}

.bot-response-text b {
	font-weight: 700;
}

.bot-response-text i {
	font-style: italic;
}

.bot-name {
	font-weight: 700;
	display: inline;
}

.bot-response-text > p:first-child {
	display: block;
}

.bot-response-text > p:first-child::after {
	content: "";
	display: block;
	margin-bottom: 8px;
}

.feedback-panel {
	width: 100%;
	margin-top: 8px;
	padding: 8px;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	background: #fafafa;
}

.feedback-panel-title {
	font-size: 13px;
	color: #595959;
	margin-bottom: 6px;
}

.feedback-reason-text {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #dadce0;
	border-radius: 8px;
	padding: 8px;
	resize: vertical;
	font-family: inherit;
}

.feedback-save-btn {
	margin-top: 6px;
	border-radius: 8px;
}

.hidden {
	display: none !important;
}

.bot-action-btn i {
	font-size: 14px;
	pointer-events: none;
}

.share-whatsapp i {
	color: #25d366;
}

.share-email i {
	color: #666;
}

.share-copy i,
.share-native i {
	color: #009898;
}
.feedback-ask-row {
	width: 100%;
	margin-bottom: 6px;
}
.feedback-up.liked {
	background: #e8fff1;
	border-color: #25d366;
}

html,
body {
	height: 100%;
	overflow: hidden;
}

#chatbot {
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

#conversation {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	padding-right: 8px;
}

#conversation::-webkit-scrollbar {
	width: 8px;
}

#conversation::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.25);
	border-radius: 8px;
}

#chat-window {
	height: 100vh;
	overflow-y: auto !important;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

#chat-window::-webkit-scrollbar {
	width: 8px;
}

#chat-window::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.28);
	border-radius: 8px;
}

#user-input-container {
	display: flex;
	align-items: center;
	gap: 8px;
}

#clear-chat-button {
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 18px;
	background: rgba(0, 152, 152, 0.12);
	color: #008c8c;
	cursor: pointer;
	font-size: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#clear-chat-button:hover {
	background: rgba(0, 152, 152, 0.22);
}

#send-button.loading {
	background-color: #007272;
	cursor: wait;
}

.message-separator {
	display: inline-block;
	text-align: center;
	background-color: #eeeae3; /* Light beige background color */
	border-radius: 15px; /* Rounded corners */
	padding: 5px 10px; /* Padding inside the rectangle */
	color: #888; /* Grey text color */
	font-style: italic;
	margin: 10px auto; /* Center the separator and add space above and below */
}

.message-time {
	font-style: italic;
	font-size: 10px;
	opacity: 0.6;
	margin-top: 1px;
	text-align: right;
	align-self: flex-end;
}

/* Story carousel - keep this near the very bottom of main.css */
.story-carousel {
	width: 100% !important;
	max-width: 700px;
	margin: 15px auto;
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background: #000;
	touch-action: pan-y;
}

.story-carousel-track {
	display: flex !important;
	width: 100%;
	transition: transform 0.3s ease;
	align-items: flex-start !important;
}

.story-carousel-slide {
	min-width: 100% !important;
	width: 100% !important;
	flex: 0 0 100% !important;
	display: flex !important;
	align-items: flex-start;
	justify-content: center;
	background: #000;
}

.story-carousel-image {
	width: 100% !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: none !important;
	object-fit: contain !important;
	display: block !important;
	border-radius: 0 !important;
}

.story-carousel-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	padding: 8px 12px;
	cursor: pointer;
	z-index: 10;
}

.story-carousel-btn.prev {
	left: 10px;
}

.story-carousel-btn.next {
	right: 10px;
}

#user-input-container {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
}

.input-wrapper {
	position: relative !important;
	flex: 1 1 auto !important;
	width: 100% !important;
	display: block !important;
}

#user-input {
	width: 100% !important;
	height: 56px !important;
	box-sizing: border-box !important;
	padding: 0 92px 0 18px !important;
}

#mic-button,
#send-button {
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 34px !important;
	height: 34px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	background: transparent !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	z-index: 20 !important;
}

#mic-button {
	right: 48px !important;
}

#send-button {
	right: 10px !important;
}

#clear-chat-button {
	flex: 0 0 52px !important;
}

.recipe-results-group {
	margin: 10px 0 4px;
}

.recipe-button-list {
	margin: 8px 0 !important;
	padding: 0 !important;
}

.recipe-button-list li {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 8px !important;
	padding: 0 !important;
	margin: 0 !important;
}

.recipe-image-button {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	width: auto !important;
	min-height: 54px !important;
	padding: 5px 8px !important;
	margin: 0 !important;
	text-align: left !important;
	white-space: normal !important;
	box-sizing: border-box !important;
}

.recipe-button-thumb {
	width: 44px !important;
	height: 44px !important;
	border-radius: 7px !important;
	flex: 0 0 44px !important;
	object-fit: cover !important;
	display: block;
}

.recipe-button-placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f3f7f6;
	font-size: 20px;
}

.recipe-button-title {
	color: inherit;
	line-height: 1.2;
	font-size: 13px;
}

.recipe-text-button {
	display: inline-flex;
	align-items: center;
	width: auto;
	min-height: 34px;
	margin: 0 !important;
	padding: 7px 12px !important;
	box-sizing: border-box;
}

.recipe-page-hidden {
	display: none !important;
}

.recipe-results-footer {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

.recipe-results-count {
	font-size: 12px;
	color: #6f7777;
}

.recipe-show-more {
	border: 1px solid #d5dddd;
	background: #fff;
	color: #007777;
	border-radius: 10px;
	min-height: 34px;
	padding: 6px 12px !important;
	margin: 0 !important;
	font: inherit;
	font-size: 13px !important;
	cursor: pointer;
}

.recipe-show-more:hover,
.recipe-show-more:focus-visible {
	border-color: #009898 !important;
	background: #f7ffff !important;
	color: #007777 !important;
	outline: none;
}

@media (max-width: 600px) {
	.recipe-button-list li {
		grid-template-columns: 1fr !important;
	}
	.recipe-image-button {
		width: 100% !important;
	}
}

.pending-bot {
	opacity: 0.8;
}

.pending-loader {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.pending-loader .fa-spinner {
	font-size: 0.95em;
}

.bot-error {
	opacity: 0.85;
}
/* =========================================================
   SAGE USER MESSAGE / CLICKABLE PROFILE NAME
   ========================================================= */

#conversation li.user {
	text-align: left;
}

#conversation li.user .message-text {
	text-align: left;
	width: 100%;
}

#conversation .sage-user-name {
	display: inline;
	font-weight: 700;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

#conversation .sage-user-name:hover {
	text-decoration: underline;
}

#conversation .sage-user-name:focus {
	text-decoration: underline;
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

#conversation .user-message-content {
	font-weight: normal;
}

/*
 * Do NOT reposition .message-time here.
 * Existing timestamp positioning remains in force.
 */

/* ============================================================
   My SAGE Quest interaction controls - Phase 7
   These styles are additive and do not alter the existing chat layout.
   ============================================================ */
.bot-action-divider {
	width: 1px;
	height: 22px;
	background: #dfe6e2;
	margin: 0 2px;
	align-self: center;
}
.bot-action-btn span {
	font-size: 12px;
	font-weight: 650;
}
.bot-action-btn.quest-save,
.bot-action-btn.quest-complete,
.bot-action-btn.quest-note,
.bot-action-btn.quest-plan-recipe,
.bot-action-btn.quest-made-recipe,
.bot-action-btn.quest-start-practice,
.bot-action-btn.quest-did-practice {
	gap: 4px;
	padding-inline: 9px;
}
.bot-action-btn.active {
	background: #e9f8f4;
	border-color: #87cfc2;
	color: #006e67;
}
.sage-quest-modal {
	position: fixed;
	inset: 0;
	z-index: 20000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 32, 31, 0.48);
	backdrop-filter: blur(3px);
}
.sage-quest-modal.hidden {
	display: none !important;
}
.sage-quest-modal-card {
	width: min(560px, 100%);
	background: #fff;
	border: 1px solid #dfe7e1;
	border-radius: 20px;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.22);
	padding: 22px;
	text-align: left;
	color: #202322;
}
.sage-quest-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
}
.sage-quest-modal-head h3 {
	margin: 2px 0 0;
	font-size: 1.25rem;
}
.sage-quest-kicker {
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #007b78;
}
.sage-quest-modal-copy {
	color: #68717d;
	line-height: 1.5;
}
.sage-quest-modal-close {
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #65706c;
}
.sage-quest-note-text {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ccd8d2;
	border-radius: 12px;
	padding: 12px;
	font: inherit;
	resize: vertical;
	min-height: 120px;
}
.sage-quest-note-text:focus {
	outline: 3px solid rgba(0, 152, 152, 0.16);
	border-color: #009898;
}
.sage-quest-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
}
.sage-quest-modal-actions button {
	border-radius: 10px;
	padding: 10px 14px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.sage-quest-cancel {
	background: #fff;
	border: 1px solid #d7dfdb;
}
.sage-quest-save-note {
	background: #009898;
	color: #fff;
	border: 1px solid #009898;
}
@media (max-width: 600px) {
	.bot-action-divider {
		display: none;
	}
	.bot-actions {
		gap: 5px;
	}
	.bot-action-btn span {
		display: none;
	}
	.bot-action-btn.quest-plan-recipe span,
	.bot-action-btn.quest-made-recipe span,
	.bot-action-btn.quest-start-practice span,
	.bot-action-btn.quest-did-practice span {
		display: inline;
	}
}

/* Phase 9.1 graceful response recovery */
.bot-error .bot-response-text {
	color: inherit;
}
.bot-error-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.bot-error-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 2px;
}
.bot-error-actions button {
	border: 0;
	background: transparent;
	padding: 4px 2px;
	color: #007d7b;
	font: inherit;
	font-weight: 750;
	cursor: pointer;
	text-decoration: none;
}
.bot-error-actions button + button::before {
	content: "·";
	color: #89938f;
	margin-right: 10px;
	font-weight: 400;
}
.bot-error-actions button:hover,
.bot-error-actions button:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
	outline: none;
}
@media (max-width: 520px) {
	.bot-error-actions {
		gap: 6px;
	}
	.bot-error-actions button {
		font-size: 0.94rem;
	}
}

/* ============================================================
   Phase 9.3 - My Quest Log dialog polish
   Clear grouping, consistent spacing, and one obvious primary action.
   ============================================================ */
.sage-quest-log-card {
	width: min(620px, calc(100vw - 32px));
	padding: 28px;
	border-radius: 22px;
}
.sage-quest-log-card .sage-quest-modal-head {
	margin-bottom: 8px;
}
.sage-quest-log-card .sage-evidence-title {
	margin-top: 4px;
	font-size: clamp(1.35rem, 2vw, 1.7rem);
	line-height: 1.2;
}
.sage-evidence-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 20px;
}
.sage-evidence-label {
	display: grid;
	gap: 7px;
	color: #26302d;
	font: inherit;
	font-weight: 600;
}
.sage-evidence-label > span {
	display: flex;
	align-items: baseline;
	gap: 6px;
}
.sage-evidence-label small {
	color: #77817d;
	font-size: 0.82em;
	font-weight: 400;
}
.sage-evidence-url,
.sage-evidence-note {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #cbd7d2;
	border-radius: 12px;
	background: #fff;
	color: #202522;
	padding: 11px 12px;
	font: inherit;
	font-weight: 400;
	line-height: 1.45;
}
.sage-evidence-note {
	min-height: 116px;
	resize: vertical;
}
.sage-evidence-url:focus,
.sage-evidence-note:focus {
	outline: 3px solid rgba(0, 152, 152, 0.14);
	border-color: #009898;
}
.sage-quest-log-card .sage-quest-modal-actions {
	gap: 10px;
	margin-top: 22px;
}
.sage-quest-log-card .sage-quest-modal-actions button {
	min-height: 42px;
	padding: 10px 16px;
	border-radius: 11px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
}
.sage-btn-secondary {
	background: #fff;
	color: #303632;
	border: 1px solid #cbd4d0;
}
.sage-btn-secondary:hover,
.sage-btn-secondary:focus-visible {
	background: #f5f8f7;
	border-color: #aebbb5;
}
.sage-btn-primary {
	background: #009b98;
	color: #fff;
	border: 1px solid #009b98;
}
.sage-btn-primary:hover,
.sage-btn-primary:focus-visible {
	background: #008582;
	border-color: #008582;
}
.sage-btn-primary:disabled {
	opacity: 0.58;
	cursor: wait;
}

/* A visible conversation always suppresses the large welcome copy;
   the faint logo watermark remains available behind the conversation. */
#conversation:not(:empty) ~ #welcome-message,
#conversation:not(:empty) ~ #hint-message {
	display: none;
}

@media (max-width: 600px) {
	.sage-quest-modal {
		padding: 12px;
		align-items: flex-end;
	}
	.sage-quest-log-card {
		padding: 20px 18px;
		border-radius: 20px 20px 14px 14px;
		max-height: 88vh;
		overflow: auto;
	}
	.sage-quest-log-card .sage-quest-modal-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}
	.sage-quest-log-card .sage-quest-modal-actions button {
		width: 100%;
	}
}

/* Phase 11.0 — guest activity reminder */
.sage-guest-account-card {
	max-width: 620px;
}
.sage-guest-account-card h3 {
	font-weight: 700;
	letter-spacing: -0.01em;
}
.sage-guest-account-benefits {
	display: grid;
	gap: 8px;
	margin: 16px 0;
	color: #47605c;
	font-size: 0.95rem;
}
.sage-btn-primary {
	background: #009f9a !important;
	color: #fff !important;
	border-color: #009f9a !important;
	font-weight: 600 !important;
}
.sage-btn-primary:hover {
	filter: brightness(0.96);
}
.sage-btn-secondary {
	background: #fff !important;
	color: #303838 !important;
	border: 1px solid #cfd8d5 !important;
	font-weight: 500 !important;
}
@media (max-width: 600px) {
	.sage-guest-account-card .sage-quest-modal-actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.sage-guest-account-card .sage-quest-modal-actions button {
		width: 100%;
	}
}


/* Stage 24.2 - stable local loading indicator; no rotating font glyph distortion */
.sage-thinking-spinner{display:inline-block;width:.9em;height:.9em;flex:0 0 .9em;box-sizing:border-box;border:.14em solid currentColor;border-right-color:transparent;border-radius:50%;animation:sage-thinking-spin .75s linear infinite;vertical-align:-.08em}
.sage-thinking-spinner--button{width:1em;height:1em;flex-basis:1em}
@keyframes sage-thinking-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.sage-thinking-spinner{animation-duration:1.5s}}

/* === SAGE Stage 27.6.9.4: Quest action motion + saved/completed states === */
:root{
  --sage-quest-teal:#8fd1ca;
  --sage-quest-teal-dark:#007b78;
  --sage-quest-teal-soft:rgba(0,152,152,.18);
  --sage-quest-action-grey:#b8c0c3;
  --sage-quest-action-grey-text:#6f787b;
}

/* Save + Complete begin as quiet neutral-outline actions. */
.bot-action-btn.quest-save,
.bot-action-btn.quest-complete{
  position:relative;
  border-color:var(--sage-quest-action-grey) !important;
  background:#fff !important;
  color:var(--sage-quest-action-grey-text) !important;
  transition:
    background-color .22s ease,
    border-color .22s ease,
    color .22s ease,
    box-shadow .22s ease,
    transform .18s ease;
}

/* "Complete" gently calls attention once per 5-second cycle while incomplete. */
.bot-action-btn.quest-complete:not(.active):not(.is-active):not(:disabled){
  animation:sage-quest-complete-nudge 5s ease-in-out infinite;
}

/* Saved / Completed become settled SAGE teal and stop attracting attention. */
.bot-action-btn.quest-save.active,
.bot-action-btn.quest-save.is-active,
.bot-action-btn.quest-complete.active,
.bot-action-btn.quest-complete.is-active{
  animation:none !important;
  border-color:var(--sage-quest-teal) !important;
  background:var(--sage-quest-teal) !important;
  color:#fff !important;
  box-shadow:0 2px 8px rgba(0,152,152,.18);
}

/* Tactile but restrained interaction. */
.bot-action-btn.quest-save:hover,
.bot-action-btn.quest-complete:hover{
  border-color:var(--sage-quest-teal) !important;
  color:var(--sage-quest-teal-dark) !important;
}
.bot-action-btn.quest-save.active:hover,
.bot-action-btn.quest-save.is-active:hover,
.bot-action-btn.quest-complete.active:hover,
.bot-action-btn.quest-complete.is-active:hover{
  color:#fff !important;
  background:var(--sage-quest-teal-dark) !important;
  border-color:var(--sage-quest-teal-dark) !important;
}
.bot-action-btn.quest-save:active,
.bot-action-btn.quest-complete:active{
  transform:scale(.94);
}

/* Accessible keyboard focus, still in the SAGE visual language. */
.bot-action-btn.quest-save:focus-visible,
.bot-action-btn.quest-complete:focus-visible{
  outline:3px solid rgba(0,152,152,.22);
  outline-offset:3px;
}

/*
 * 0-16%: one soft pulse (~800ms)
 * 16-100%: completely still for the rest of the 5-second cycle
 */
@keyframes sage-quest-complete-nudge{
  0%,16%,100%{
    box-shadow:0 0 0 0 rgba(0,152,152,0);
    transform:scale(1);
  }
  5%{
    box-shadow:0 0 0 5px rgba(0,152,152,.13);
    transform:scale(1.035);
  }
  10%{
    box-shadow:0 0 0 9px rgba(0,152,152,0);
    transform:scale(1);
  }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce){
  .bot-action-btn.quest-complete:not(.active):not(.is-active):not(:disabled){
    animation:none !important;
    box-shadow:0 0 0 2px rgba(0,152,152,.10);
  }
}
/* === /SAGE Stage 27.6.9.4 === */

/* === SAGE Stage 27.6.9.4a: Quest action visual refinement === */

/* Settled Saved / Completed state: soft teal fill, dark teal icon, no halo. */
.bot-action-btn.quest-save.active,
.bot-action-btn.quest-save.is-active,
.bot-action-btn.quest-complete.active,
.bot-action-btn.quest-complete.is-active,
.bot-action-btn.quest-save.active:hover,
.bot-action-btn.quest-save.is-active:hover,
.bot-action-btn.quest-complete.active:hover,
.bot-action-btn.quest-complete.is-active:hover {
  background:#8fd1ca !important;
  border-color:#8fd1ca !important;
  color:#007b78 !important;
  box-shadow:none !important;
  animation:none !important;
  transform:none;
}

/* Ensure icon inherits the darker teal rather than white. */
.bot-action-btn.quest-save.active i,
.bot-action-btn.quest-save.is-active i,
.bot-action-btn.quest-complete.active i,
.bot-action-btn.quest-complete.is-active i {
  color:#007b78 !important;
}

/* Mouse/touch focus should not leave a large visual ring after activation. */
.bot-action-btn.quest-save:focus:not(:focus-visible),
.bot-action-btn.quest-complete:focus:not(:focus-visible) {
  outline:none !important;
  box-shadow:none !important;
}

/* Keep a restrained keyboard-only focus treatment for accessibility. */
.bot-action-btn.quest-save:focus-visible,
.bot-action-btn.quest-complete:focus-visible {
  outline:2px solid #8fd1ca !important;
  outline-offset:2px;
  box-shadow:none !important;
}

/* Incomplete Complete button: the only element that should pulse. */
.bot-action-btn.quest-complete:not(.active):not(.is-active):not(:disabled) {
  animation:sage-quest-complete-nudge-soft 5s ease-in-out infinite !important;
}

@keyframes sage-quest-complete-nudge-soft {
  0%,16%,100% {
    box-shadow:0 0 0 0 rgba(143,209,202,0);
    transform:scale(1);
  }
  5% {
    box-shadow:0 0 0 5px rgba(143,209,202,.30);
    transform:scale(1.025);
  }
  10% {
    box-shadow:0 0 0 8px rgba(143,209,202,0);
    transform:scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bot-action-btn.quest-complete:not(.active):not(.is-active):not(:disabled) {
    animation:none !important;
    box-shadow:0 0 0 2px rgba(143,209,202,.18) !important;
  }
}
/* === /SAGE Stage 27.6.9.4a === */

/* === SAGE Stage 27.6.9.4b: Quest action final states === */

/* Bookmark never pulses. */
.bot-action-btn.quest-save,
.bot-action-btn.quest-save:not(.active):not(.is-active),
.bot-action-btn.quest-save.active,
.bot-action-btn.quest-save.is-active {
  animation:none !important;
}

/* Saved bookmark: solid SAGE teal circle + white icon. */
.bot-action-btn.quest-save.active,
.bot-action-btn.quest-save.is-active,
.bot-action-btn.quest-save.active:hover,
.bot-action-btn.quest-save.is-active:hover {
  background:#009898 !important;
  border-color:#009898 !important;
  color:#fff !important;
  box-shadow:none !important;
  animation:none !important;
}
.bot-action-btn.quest-save.active i,
.bot-action-btn.quest-save.is-active i {
  color:#fff !important;
}

/* Completed: solid SAGE teal circle + white check, and pulse stops. */
.bot-action-btn.quest-complete.active,
.bot-action-btn.quest-complete.is-active,
.bot-action-btn.quest-complete.active:hover,
.bot-action-btn.quest-complete.is-active:hover {
  background:#009898 !important;
  border-color:#009898 !important;
  color:#fff !important;
  box-shadow:none !important;
  animation:none !important;
}
.bot-action-btn.quest-complete.active i,
.bot-action-btn.quest-complete.is-active i {
  color:#fff !important;
}

/* ONLY the incomplete Complete button pulses every five seconds. */
.bot-action-btn.quest-complete:not(.active):not(.is-active):not(:disabled) {
  animation:sage-quest-complete-only-pulse 5s ease-in-out infinite !important;
}
@keyframes sage-quest-complete-only-pulse {
  0%,16%,100% { box-shadow:0 0 0 0 rgba(143,209,202,0); transform:scale(1); }
  5% { box-shadow:0 0 0 5px rgba(143,209,202,.32); transform:scale(1.025); }
  10% { box-shadow:0 0 0 8px rgba(143,209,202,0); transform:scale(1); }
}

/* Do not leave a mouse/touch halo after clicking. */
.bot-action-btn.quest-save:focus:not(:focus-visible),
.bot-action-btn.quest-complete:focus:not(:focus-visible) {
  outline:none !important;
  box-shadow:none !important;
}

/* Keyboard accessibility remains visible. */
.bot-action-btn.quest-save:focus-visible,
.bot-action-btn.quest-complete:focus-visible {
  outline:2px solid #8fd1ca !important;
  outline-offset:2px;
}

@media (prefers-reduced-motion: reduce) {
  .bot-action-btn.quest-complete:not(.active):not(.is-active):not(:disabled) {
    animation:none !important;
    box-shadow:0 0 0 2px rgba(143,209,202,.20) !important;
  }
}
/* === /SAGE Stage 27.6.9.4b === */

/* SAGE FOOD TABLE FIX 2026-09-27 START */
/* SAGE food table display fix 2026-09-27
   Central styling for bot-response tables rendered without .table-wrapper. */
#conversation .bot-response-text table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #ddd !important;
    border-radius: 15px !important;
    overflow: hidden;
    background: transparent;
}

#conversation .bot-response-text table th,
#conversation .bot-response-text table td {
    border: 0 !important;
    border-right: 1px solid #ddd !important;
    border-bottom: 1px solid #ddd !important;
    padding: 8px;
    text-align: left;
    overflow-wrap: break-word;
}

#conversation .bot-response-text table th:last-child,
#conversation .bot-response-text table td:last-child {
    border-right: 0 !important;
}

#conversation .bot-response-text table tr:last-child td,
#conversation .bot-response-text table tr:last-child th {
    border-bottom: 0 !important;
}

#conversation .bot-response-text table tr:first-child th:first-child,
#conversation .bot-response-text table tr:first-child td:first-child {
    border-top-left-radius: 14px;
}

#conversation .bot-response-text table tr:first-child th:last-child,
#conversation .bot-response-text table tr:first-child td:last-child {
    border-top-right-radius: 14px;
}

#conversation .bot-response-text table tr:last-child td:first-child,
#conversation .bot-response-text table tr:last-child th:first-child {
    border-bottom-left-radius: 14px;
}

#conversation .bot-response-text table tr:last-child td:last-child,
#conversation .bot-response-text table tr:last-child th:last-child {
    border-bottom-right-radius: 14px;
}
/* SAGE FOOD TABLE FIX 2026-09-27 END */
