/**
 * Nuvia AI - Admin Styles
 * 
 * Modern, clean interface with smooth animations and improved UX.
 *
 * @package NuviaAI
 * @version 1.0.1
 * @since 1.0.0
 */

/* ==========================================================================
   Main Wrapper
   ========================================================================== */

.nuvia-ai-wrap {
	max-width: 1200px;
	margin: 20px 0;
}

/* ==========================================================================
   Header Styling
   ========================================================================== */

.nuvia-ai-header {
	background: linear-gradient(135deg, #2271b1 0%, #1d2327 100%);
	color: #fff;
	padding: 30px;
	border-radius: 12px;
	margin-bottom: 24px;
	box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.nuvia-ai-header .nuvia-title {
	color: #fff;
	margin: 0;
	font-size: 28px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.nuvia-ai-logo {
	display: inline-flex;
	width: 32px;
	height: 32px;
}

.nuvia-ai-subtitle {
	color: rgba(255, 255, 255, 0.9);
	margin: 8px 0 0;
	font-size: 14px;
}

/* ==========================================================================
   Container
   ========================================================================== */

.nuvia-shell {
	max-width: 1200px;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.nuvia-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 24px;
	border-bottom: 2px solid #f0f0f1;
	padding-bottom: 0;
}

.nuvia-tabs .button {
	border-radius: 8px 8px 0 0;
	border: 2px solid transparent;
	border-bottom: none;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	background: transparent;
	color: #50575e;
	margin-bottom: -2px;
}

.nuvia-tabs .button:hover {
	background: #f6f7f7;
	color: #1d2327;
}

.nuvia-tabs .button-primary {
	background: #fff;
	color: #2271b1;
	border-color: #f0f0f1;
	border-bottom-color: #fff;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.nuvia-tabs .button-primary:hover {
	background: #fff;
	color: #2271b1;
}

/* How to Use tab — subtle accent when inactive */
.nuvia-tabs .nuvia-tab-howto {
	color: #2271b1;
	border-color: transparent;
}

.nuvia-tabs .nuvia-tab-howto:hover {
	background: #f0f6fc;
	color: #135e96;
}

.nuvia-tabs .nuvia-tab-howto.button-primary {
	background: #fff;
	color: #2271b1;
	border-color: #f0f0f1;
	border-bottom-color: #fff;
}

/* ==========================================================================
   Content Wrapper
   ========================================================================== */

.nuvia-wrap {
	max-width: 1200px;
}

/* ==========================================================================
   Messages Container
   ========================================================================== */

.nuvia-messages {
	border: 2px solid #e5e7eb;
	background: #fafafa;
	padding: 20px;
	height: 500px;
	overflow-y: auto;
	border-radius: 12px;
	margin-bottom: 16px;
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
	scroll-behavior: smooth;
}

.nuvia-messages::-webkit-scrollbar {
	width: 8px;
}

.nuvia-messages::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.nuvia-messages::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 4px;
}

.nuvia-messages::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* ==========================================================================
   Message Bubbles
   ========================================================================== */

.nuvia-msg {
	padding: 14px 18px;
	border-radius: 12px;
	margin: 12px 0;
	word-wrap: break-word;
	line-height: 1.6;
	animation: messageSlideIn 0.3s ease;
	max-width: 85%;
	position: relative;
}

@keyframes messageSlideIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.nuvia-msg.user {
	background: linear-gradient(135deg, #2271b1 0%, #1d2327 100%);
	color: #fff;
	margin-left: auto;
	border-bottom-right-radius: 4px;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nuvia-msg.assistant {
	background: #fff;
	color: #1d2327;
	margin-right: auto;
	border-bottom-left-radius: 4px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	margin-inline-start: 27px;
}

.nuvia-msg.assistant::before {
	content: "✦";
	position: absolute;
	left: -32px;
	top: 12px;
	font-size: 20px;
	color: #2271b1;
}

/* Message content wrapper */
.nuvia-msg-content {
	white-space: pre-wrap;
	word-wrap: break-word;
}

.nuvia-msg-text-segment {
	white-space: pre-wrap;
	word-wrap: break-word;
}

/* ==========================================================================
   Code Editor Blocks
   ========================================================================== */

.nuvia-code-block {
	margin: 12px 0;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #30363d;
	background: #0d1117;
	font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
	font-size: 13px;
	line-height: 1.5;
	white-space: normal;
}

/* Code header bar */
.nuvia-code-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 14px;
	background: #161b22;
	border-bottom: 1px solid #30363d;
}

.nuvia-code-lang {
	font-size: 12px;
	color: #8b949e;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.nuvia-code-copy {
	background: transparent;
	border: 1px solid #30363d;
	color: #8b949e;
	padding: 4px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	font-family: inherit;
	transition: all 0.2s ease;
}

.nuvia-code-copy:hover {
	background: #30363d;
	color: #e6edf3;
	border-color: #484f58;
}

/* Code container: gutter + body */
.nuvia-code-container {
	display: flex;
	overflow-x: auto;
	max-height: 500px;
	overflow-y: auto;
}

.nuvia-code-container::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

.nuvia-code-container::-webkit-scrollbar-track {
	background: #161b22;
}

.nuvia-code-container::-webkit-scrollbar-thumb {
	background: #30363d;
	border-radius: 4px;
}

.nuvia-code-container::-webkit-scrollbar-thumb:hover {
	background: #484f58;
}

/* Line numbers gutter */
.nuvia-code-gutter {
	flex-shrink: 0;
	padding: 12px 0;
	text-align: right;
	user-select: none;
	-webkit-user-select: none;
	background: #0d1117;
	border-right: 1px solid #21262d;
	min-width: 40px;
}

.nuvia-code-line-num {
	padding: 0 12px 0 10px;
	color: #484f58;
	font-size: 12px;
	line-height: 1.5;
	font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

/* Code body */
.nuvia-code-body {
	flex: 1;
	margin: 0;
	padding: 12px 16px;
	overflow-x: auto;
	background: #0d1117;
	white-space: pre;
	word-wrap: normal;
}

.nuvia-code-body code {
	color: #e6edf3;
	font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
	font-size: 13px;
	line-height: 1.5;
	background: transparent;
	padding: 0;
	border: none;
}

/* ==========================================================================
   Syntax Highlighting (GitHub Dark)
   ========================================================================== */

.nuvia-hl-keyword {
	color: #ff7b72;
	font-weight: 600;
}

.nuvia-hl-string {
	color: #a5d6ff;
}

.nuvia-hl-comment {
	color: #8b949e;
	font-style: italic;
}

.nuvia-hl-number {
	color: #79c0ff;
}

.nuvia-hl-function {
	color: #d2a8ff;
}

.nuvia-hl-variable {
	color: #ffa657;
}

.nuvia-hl-property {
	color: #79c0ff;
}

.nuvia-hl-tag {
	color: #7ee787;
}

/* ==========================================================================
   Inline Code
   ========================================================================== */

.nuvia-inline-code {
	background: #eef0f4;
	color: #cf222e;
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
	font-size: 0.9em;
	border: 1px solid #d0d7de;
	white-space: nowrap;
}

.nuvia-msg.user .nuvia-inline-code {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.2);
}

.nuvia-msg.user .nuvia-code-block {
	border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Input Field
   ========================================================================== */

.nuvia-input {
	width: calc(100% - 32px);
	border-radius: 12px;
	margin-bottom: 16px;
	border: 2px solid #e5e7eb;
	padding: 14px 16px;
	font-size: 14px;
	line-height: 1.5;
	transition: all 0.2s ease;
	resize: vertical;
	min-height: 80px;
}

.nuvia-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
	outline: none;
}

/* ==========================================================================
   Controls Bar
   ========================================================================== */

.nuvia-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	background: #fff;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Toggle Switches
   ========================================================================== */

.nuvia-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #50575e;
	cursor: pointer;
	user-select: none;
}

.nuvia-toggle input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	border-radius: 4px;
}

.nuvia-toggle:hover {
	color: #1d2327;
}

/* ==========================================================================
   Hint Text
   ========================================================================== */

.nuvia-hint {
	font-size: 13px;
	color: #646970;
	margin-bottom: 12px;
	padding: 10px 14px;
	background: #f0f6fc;
	border-left: 3px solid #2271b1;
	border-radius: 4px;
}

/* ==========================================================================
   Row Layout
   ========================================================================== */

.nuvia-row {
	display: flex;
	gap: 12px;
	align-items: center;
	margin: 16px 0;
	flex-wrap: wrap;
}

.nuvia-field {
	display: grid;
	width: 100%;
}

.nuvia-grow {
	flex: 1;
	min-width: 200px;
	display: flex;
	align-items: center;
	gap: 5px;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

.nuvia-select,
.nuvia-text {
	width: 100%;
	max-width: 600px;
	border-radius: 8px;
	border: 2px solid #e5e7eb;
	padding: 10px 14px;
	font-size: 14px;
	transition: all 0.2s ease;
}

.nuvia-select:focus,
.nuvia-text:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
	outline: none;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.nuvia-card {
	border: 1px solid #e5e7eb;
	background: #fff;
	padding: 24px;
	border-radius: 12px;
	margin-top: 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	gap: 25px;
	align-items: start;
}

.nuvia-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nuvia-card h3 {
	margin: 0 0 0;
	color: #1d2327;
	font-size: 18px;
	font-weight: 600;
	border-bottom: 2px solid #f0f0f1;
	padding-bottom: 12px;
}

.nuvia-card label {
	display: block;
	margin: 0 0 8px;
	font-weight: 600;
	color: #1d2327;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ==========================================================================
   Preview Box
   ========================================================================== */

.nuvia-preview {
	border: 1px solid #e5e7eb;
	background: #fff;
	padding: 20px;
	border-radius: 12px;
	margin-top: 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nuvia-preview h3 {
	margin: 0 0 16px;
	color: #1d2327;
	font-size: 16px;
	font-weight: 600;
}

/* ==========================================================================
   Code/Pre Blocks (non-AI raw data)
   ========================================================================== */

.nuvia-pre {
	white-space: pre-wrap;
	background: #f6f7f7;
	padding: 14px;
	border-radius: 8px;
	overflow: auto;
	max-height: 300px;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-size: 12px;
	line-height: 1.6;
	border: 1px solid #e5e7eb;
	color: #1d2327;
}

.nuvia-pre::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

.nuvia-pre::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.nuvia-pre::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 4px;
}

/* ==========================================================================
   Key-Value Pairs
   ========================================================================== */

.nuvia-kv {
	margin: 10px 0;
	padding: 8px 12px;
	background: #f9fafb;
	border-radius: 6px;
	font-size: 13px;
	border-left: 3px solid #2271b1;
}

/* ==========================================================================
   Small Text
   ========================================================================== */

.nuvia-small {
	font-size: 12px;
	color: #646970;
	margin-top: 12px;
	padding: 10px;
	background: #f9fafb;
	border-radius: 6px;
	border-left: 3px solid #d4af37;
}

/* ==========================================================================
   Details/Summary
   ========================================================================== */

details {
	margin: 12px 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
}

summary {
	cursor: pointer;
	padding: 12px 16px;
	background: #f9fafb;
	font-weight: 600;
	color: #1d2327;
	user-select: none;
	transition: background 0.2s ease;
}

summary:hover {
	background: #f0f0f1;
}

details[open] summary {
	background: #2271b1;
	color: #fff;
	border-bottom: 1px solid #e5e7eb;
}

details .nuvia-pre {
	margin: 0;
	border-radius: 0;
	border: none;
	border-top: 1px solid #e5e7eb;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.nuvia-ai-wrap .button.button-primary {
	background: linear-gradient(135deg, #2271b1 0%, #1d2327 100%);
	color: #fff;
	border: none;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
	transition: all 0.3s ease;
	text-shadow: none;
	padding: 10px 24px;
	font-weight: 600;
}

.nuvia-ai-wrap .button.button-primary:hover,
.nuvia-ai-wrap .button.button-primary:focus {
	background: linear-gradient(135deg, #2271b1 0%, #1d2327 100%);
	box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
	transform: translateY(-1px);
}

.nuvia-ai-wrap .button.button-secondary {
	background: #fff;
	border: 2px solid #2271b1;
	color: #2271b1;
	transition: all 0.3s ease;
	padding: 8px 20px;
	font-weight: 600;
}

.nuvia-ai-wrap .button.button-secondary:hover {
	background: #2271b1;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.nuvia-loading {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: spin 0.8s linear infinite;
	margin-right: 8px;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Quick Questions Box
   ========================================================================== */

.nuvia-quick {
	margin: 12px 0;
	padding: 12px;
	background: #f9fafb;
	border: 1px dashed #e5e7eb;
	border-radius: 10px;
}

.nuvia-quick-title {
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 8px;
	color: #1d2327;
}

.nuvia-quick-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* ==========================================================================
   Page Health Box
   ========================================================================== */

.nuvia-health-box {
	background: #fff;
	border: 1px solid #ddd;
	padding: 16px;
	border-radius: 10px;
	margin-bottom: 16px;
}

.nuvia-score-big {
	font-size: 42px;
	font-weight: 700;
	display: inline;
}

.nuvia-badges {
	display: flex;
	gap: 8px;
	margin: 8px 0;
	flex-wrap: wrap;
}

.nuvia-badge {
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

.nuvia-badge.green {
	background: #e6f7ed;
	color: #137333;
}

.nuvia-badge.yellow {
	background: #fff7e0;
	color: #8a6d00;
}

.nuvia-badge.red {
	background: #fde8e8;
	color: #b42318;
}

.nuvia-issues li {
	margin-left: 16px;
}

.nuvia-empty-good {
	padding: 12px;
	background: #f0f6fc;
	border-radius: 6px;
	color: #1d2327;
	font-size: 13px;
}

/* ==========================================================================
   AI Conversation Box
   ========================================================================== */

.nuvia-ai-box-wrapper {
	margin-top: 20px;
}

.nuvia-ai-box {
	background: #fff;
	border: 2px solid #2271b1;
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.nuvia-ai-box pre {
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.nuvia-ai-header-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-radius: 10px 10px 0 0;
	font-weight: 600;
	font-size: 15px;
}

.nuvia-ai-header-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.nuvia-ai-header-bar .button.button-link.nuvia-clear-chat {
	color: #2271b1;
	text-decoration: none;
	font-size: 13px;
	border-radius: 6px;
	transition: all 0.2s ease;
	border: 1px solid #2271b1;
	padding: 10px 24px;
	font-weight: 600;
}

.nuvia-ai-header-bar .button.button-link.nuvia-clear-chat:hover {
	background: rgba(34, 113, 177, 0.1);
	border-color: #135e96;
	color: #135e96;
}

.nuvia-ai-conversation {
	max-height: 500px;
	overflow-y: auto;
	padding: 16px;
	background: #fafafa;
	border-radius: 0;
}

.nuvia-ai-conversation::-webkit-scrollbar {
	width: 8px;
}

.nuvia-ai-conversation::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.nuvia-ai-conversation::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 4px;
}

.nuvia-ai-conversation::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

.nuvia-ai-message {
	margin-bottom: 16px;
	animation: messageSlideIn 0.3s ease;
}

.nuvia-ai-message:last-child {
	margin-bottom: 0;
}

.nuvia-ai-message-label {
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	opacity: 0.8;
}

.nuvia-ai-message.user .nuvia-ai-message-label {
	color: #2271b1;
	text-align: right;
}

.nuvia-ai-message.assistant .nuvia-ai-message-label {
	color: #50575e;
}

.nuvia-ai-message-text {
	padding: 14px 18px;
	border-radius: 12px;
	word-wrap: break-word;
	line-height: 1.6;
	font-size: 14px;
}

.nuvia-ai-message.user .nuvia-ai-message-text {
	background: linear-gradient(135deg, #2271b1 0%, #1d2327 100%);
	color: #fff;
	margin-left: auto;
	max-width: 80%;
	border-bottom-right-radius: 4px;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
	text-align: left;
}

.nuvia-ai-message.assistant .nuvia-ai-message-text {
	background: #fff;
	color: #1d2327;
	margin-right: auto;
	max-width: 100%;
	border-bottom-left-radius: 4px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nuvia-ai-message-text.nuvia-thinking {
	display: flex;
	align-items: center;
	gap: 10px;
	font-style: italic;
	opacity: 0.9;
}

.nuvia-ai-followup {
	margin: 16px 16px 12px 16px;
	border-color: #ddd;
	background: #fff;
}

.nuvia-ai-followup:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nuvia-ai-box .button {
	margin: 0 16px 16px 16px;
}

/* ==========================================================================
   Classic Editor Metabox
   ========================================================================== */

.nuvia-ai-metabox {
	margin: -6px -12px -12px;
	padding: 12px;
}

.nuvia-ai-metabox-actions {
	margin-top: 10px;
	margin-bottom: 0;
}

.nuvia-ai-history {
	margin-bottom: 16px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fafafa;
	max-height: 400px;
	overflow-y: auto;
}

.nuvia-ai-history-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: #f0f0f1;
	border-bottom: 1px solid #e5e7eb;
	border-radius: 8px 8px 0 0;
}

.nuvia-ai-history-header strong {
	font-size: 13px;
	color: #1d2327;
}

#nuvia-ai-classic-messages {
	padding: 10px;
}

.nuvia-ai-history::-webkit-scrollbar {
	width: 6px;
}

.nuvia-ai-history::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.nuvia-ai-history::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 782px) {
	.nuvia-ai-header {
		padding: 20px;
	}

	.nuvia-ai-header h1 {
		font-size: 22px;
	}

	.nuvia-tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.nuvia-tabs .button {
		flex-shrink: 0;
		padding: 10px 16px;
		font-size: 13px;
	}

	.nuvia-messages {
		height: 400px;
	}

	.nuvia-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.nuvia-msg {
		max-width: 95%;
	}

	.nuvia-msg.assistant::before {
		position: static;
		display: inline-block;
		margin-right: 6px;
	}

	.nuvia-card {
		padding: 16px;
	}

	.nuvia-ai-message.user .nuvia-ai-message-text,
	.nuvia-ai-message.assistant .nuvia-ai-message-text {
		max-width: 95%;
	}

	.nuvia-ai-header-bar {
		flex-direction: column;
		gap: 10px;
		align-items: flex-start;
	}

	.nuvia-ai-header-actions {
		align-self: flex-end;
	}

	/* Code blocks: hide line numbers on mobile for space */
	.nuvia-code-gutter {
		display: none;
	}

	.nuvia-code-block {
		font-size: 12px;
	}
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

.nuvia-toggle:focus-within {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 4px;
}

.nuvia-ai-wrap .button:focus {
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* ==========================================================================
   Dark Mode Support 
   ========================================================================== */

@media (prefers-color-scheme: dark) {
	.nuvia-ai-wrap {
		color: #e5e7eb;
	}

	.nuvia-messages {
		background: #1a1a1a;
		border-color: #2d2d2d;
	}

	.nuvia-msg.assistant {
		background: #2d2d2d;
		color: #e5e7eb;
		border-color: #3d3d3d;
	}

	.nuvia-card,
	.nuvia-preview {
		background: #1a1a1a;
		border-color: #2d2d2d;
	}

	.nuvia-pre {
		background: #0d1117;
		border-color: #2d2d2d;
		color: #e5e7eb;
	}

	.nuvia-inline-code {
		background: #2d333b;
		color: #f47067;
		border-color: #373e47;
	}
}

/* ==========================================================================
   Status Bar
   ========================================================================== */

.nuvia-status-bar {
	padding: 8px 12px;
	margin: 8px 0;
	border-left: 4px solid;
	border-radius: 3px;
	font-size: 13px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.nuvia-status-bar button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	padding: 0 15px;
	line-height: 1;
}

.nuvia-status-success {
	background: #edfaef;
	border-color: #00a32a;
	color: #1a5e2a;
}

.nuvia-status-error {
	background: #fef0f0;
	border-color: #d63638;
	color: #8a1414;
}

.nuvia-status-info {
	background: #f0f6ff;
	border-color: #2271b1;
	color: #1a3a5c;
}

/* ==========================================================================
   How to Use Tab
   ========================================================================== */

/* Outer wrap */
.nuvia-howto {
	max-width: 780px;
	padding: 8px 0 40px;
}

/* Intro */
.nuvia-howto-intro {
	color: #50575e;
	font-size: 14px;
	margin: 0 0 24px;
}

/* ── Credits banner ─────────────────────────────────────────────────── */
.nuvia-howto-credits-banner {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: linear-gradient(135deg, #f0f6fc 0%, #e8f4fd 100%);
	border: 1px solid #c3d9f0;
	border-radius: 10px;
	padding: 20px 24px;
	margin-bottom: 32px;
}

.nuvia-howto-credits-icon {
	font-size: 32px;
	line-height: 1;
	flex-shrink: 0;
	margin-top: 2px;
}

.nuvia-howto-credits-text {
	flex: 1;
}

.nuvia-howto-credits-text strong {
	display: block;
	font-size: 15px;
	color: #1d2327;
	margin-bottom: 4px;
}

.nuvia-howto-credits-text p {
	color: #50575e;
	font-size: 13px;
	margin: 0 0 10px;
}

.nuvia-howto-credits-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nuvia-howto-credits-list li {
	font-size: 13px;
	color: #2271b1;
	font-weight: 600;
	padding: 2px 0;
}

.nuvia-howto-cta {
	align-self: center;
	white-space: nowrap;
	flex-shrink: 0;
	text-decoration: none !important;
}

/* ── Section wrapper ────────────────────────────────────────────────── */
.nuvia-howto-section {
	margin-bottom: 36px;
}

.nuvia-howto-section-title {
	font-size: 17px;
	font-weight: 600;
	color: #1d2327;
	border-bottom: 2px solid #e0e0e0;
	padding-bottom: 10px;
	margin: 0 0 24px;
}

/* ── Numbered steps ─────────────────────────────────────────────────── */
.nuvia-howto-step {
	display: flex;
	gap: 16px;
	margin-bottom: 28px;
}

.nuvia-howto-step-num {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: linear-gradient(135deg, #2271b1 0%, #1d2327 100%);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 2px;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.nuvia-howto-step-body {
	flex: 1;
}

.nuvia-howto-step-title {
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
	margin: 4px 0 8px;
}

.nuvia-howto-step-body > p {
	color: #50575e;
	font-size: 13px;
	margin: 0 0 12px;
	line-height: 1.6;
}

/* ── Cloud vs BYO mode cards ────────────────────────────────────────── */
.nuvia-howto-modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 12px;
}

.nuvia-howto-mode {
	border-radius: 8px;
	padding: 14px 16px;
	font-size: 13px;
	color: #50575e;
	border: 1px solid #ddd;
	background: #fafafa;
	transition: box-shadow 0.2s ease;
}

.nuvia-howto-mode:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nuvia-howto-mode p {
	margin: 6px 0 0;
	line-height: 1.55;
}

.nuvia-howto-mode--cloud {
	border-color: #c3d9f0;
	background: #f5f9fd;
}

.nuvia-howto-mode--byo {
	border-color: #d4d4d4;
	background: #fafafa;
}

.nuvia-howto-mode-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.nuvia-howto-mode-header strong {
	font-size: 13px;
	color: #1d2327;
}

.nuvia-howto-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	font-size: 15px;
}

.nuvia-howto-badge--cloud {
	background: #e8f4fd;
}

.nuvia-howto-badge--byo {
	background: #f0f0f0;
}

/* ── Bullet list ────────────────────────────────────────────────────── */
.nuvia-howto-list {
	margin: 8px 0 12px 20px;
	padding: 0;
	color: #50575e;
	font-size: 13px;
	line-height: 1.6;
}

.nuvia-howto-list li {
	margin-bottom: 5px;
}

/* ── Tip/callout box ────────────────────────────────────────────────── */
.nuvia-howto-tip {
	background: #fffbf0;
	border-left: 3px solid #f0b429;
	border-radius: 0 6px 6px 0;
	padding: 10px 14px;
	font-size: 13px;
	color: #6b5a1e;
	margin-top: 10px;
	line-height: 1.55;
}

/* ── FAQ / Quick Tips ───────────────────────────────────────────────── */
.nuvia-howto-faq {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nuvia-howto-faq-item {
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 14px 16px;
	transition: border-color 0.2s ease;
}

.nuvia-howto-faq-item:hover {
	border-color: #c3d9f0;
}

.nuvia-howto-faq-item strong {
	display: block;
	font-size: 13px;
	color: #1d2327;
	margin-bottom: 6px;
}

.nuvia-howto-faq-item p {
	font-size: 13px;
	color: #50575e;
	margin: 0;
	line-height: 1.55;
}

/* ── Dashboard CTA footer ───────────────────────────────────────────── */
.nuvia-howto-dash-cta {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 24px;
	border-top: 1px solid #e0e0e0;
	margin-top: 8px;
	font-size: 13px;
	color: #50575e;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media screen and (max-width: 782px) {
	.nuvia-howto-modes {
		grid-template-columns: 1fr;
	}

	.nuvia-howto-credits-banner {
		flex-direction: column;
	}

	.nuvia-howto-cta {
		align-self: flex-start;
	}

	.nuvia-howto-dash-cta {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ── Dark mode ──────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
	.nuvia-howto-credits-banner {
		background: linear-gradient(135deg, #1a2633 0%, #1a2030 100%);
		border-color: #2a4a6b;
	}

	.nuvia-howto-credits-text strong {
		color: #e5e7eb;
	}

	.nuvia-howto-credits-text p {
		color: #9ca3af;
	}

	.nuvia-howto-section-title {
		color: #e5e7eb;
		border-bottom-color: #2d2d2d;
	}

	.nuvia-howto-step-title {
		color: #e5e7eb;
	}

	.nuvia-howto-step-body > p,
	.nuvia-howto-list,
	.nuvia-howto-intro {
		color: #9ca3af;
	}

	.nuvia-howto-mode {
		background: #1a1a1a;
		border-color: #2d2d2d;
		color: #9ca3af;
	}

	.nuvia-howto-mode--cloud {
		background: #1a2030;
		border-color: #2a4a6b;
	}

	.nuvia-howto-mode-header strong {
		color: #e5e7eb;
	}

	.nuvia-howto-tip {
		background: #2a2000;
		color: #d4a842;
	}

	.nuvia-howto-faq-item {
		background: #1a1a1a;
		border-color: #2d2d2d;
	}

	.nuvia-howto-faq-item strong {
		color: #e5e7eb;
	}

	.nuvia-howto-faq-item p {
		color: #9ca3af;
	}

	.nuvia-howto-dash-cta {
		border-top-color: #2d2d2d;
		color: #9ca3af;
	}
}