/**
 * Arif AI Chat Widget Styles
 * Compatible with Mjara UI and Frappe v15
 * Version 2.0 - With Tool Status UI
 *
 * Uses Frappe CSS variables for native look
 * Supports both light and dark themes
 */

/* ===== CSS Variables ===== */
:root {
	--arif-ai-primary: var(--primary, #667eea);
	--arif-ai-primary-dark: var(--primary-dark, #5a67d8);
	--arif-ai-bg: var(--card-bg, #ffffff);
	--arif-ai-bg-dark: var(--bg-dark-gray, #1a1a2e);
	--arif-ai-text: var(--text-color, #333333);
	--arif-ai-text-muted: var(--text-muted, #8d99a6);
	--arif-ai-border: var(--border-color, #e2e8f0);
	--arif-ai-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	--arif-ai-radius: 16px;
	--arif-ai-radius-sm: 12px;
	--arif-ai-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--arif-ai-success: #48bb78;
	--arif-ai-error: #e53e3e;
	--arif-ai-tool-bg: rgba(102, 126, 234, 0.08);
}

/* Hide recommendations bell icon button in header */
#arif-ai-recommendations {
	display: none !important;
}

/* Dark theme variables */
[data-theme="dark"] {
	--arif-ai-bg: var(--card-bg, #1e1e2d);
	--arif-ai-bg-dark: #16162a;
	--arif-ai-text: var(--text-color, #e2e8f0);
	--arif-ai-text-muted: var(--text-muted, #a0aec0);
	--arif-ai-border: var(--border-color, #2d3748);
	--arif-ai-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	--arif-ai-tool-bg: rgba(102, 126, 234, 0.15);
}

/* ===== Container ===== */
#arif-ai-container {
	position: fixed;
	bottom: 32px;
	right: 32px;
	z-index: 99999;
	font-family: var(--font-stack, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* ===== Floating Action Button ===== */
.arif-ai-fab {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
	transition: var(--arif-ai-transition);
	position: relative;
	overflow: hidden;
}

.arif-ai-fab::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
	border-radius: 50%;
}

.arif-ai-fab:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.arif-ai-fab:active {
	transform: scale(0.95);
}

.arif-ai-fab-icon,
.arif-ai-fab-close {
	color: #ffffff;
	transition: var(--arif-ai-transition);
	position: absolute;
}

.arif-ai-fab-icon {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

.arif-ai-fab-close {
	width: 28px;
	height: 28px;
	opacity: 0;
	transform: scale(0.5) rotate(-90deg);
}

.arif-ai-fab.active .arif-ai-fab-icon {
	opacity: 0;
	transform: scale(0.5) rotate(90deg);
}

.arif-ai-fab.active .arif-ai-fab-close {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

/* ===== Chat Window ===== */
.arif-ai-chat {
	position: fixed;
	bottom: 112px;
	/* 32px container + 80px offset */
	right: 32px;
	width: 400px;
	max-width: calc(100vw - 48px);
	height: 680px;
	max-height: calc(100vh - 120px);
	background: var(--arif-ai-bg);
	border-radius: var(--arif-ai-radius);
	box-shadow: var(--arif-ai-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px) scale(0.95);
	transform-origin: bottom right;
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, width 0.3s ease, height 0.3s ease, bottom 0.3s ease;
	border: 1px solid var(--arif-ai-border);
	pointer-events: none;
	z-index: 100000;
}

.arif-ai-chat.open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Maximized state - expand from bottom-right */
.arif-ai-chat.maximized {
	bottom: 32px;
	right: 32px;
	width: calc(100vw - 64px);
	height: calc(100vh - 64px);
	max-width: calc(100vw - 64px);
	max-height: calc(100vh - 64px);
	border-radius: var(--arif-ai-radius);
}

.arif-ai-chat.maximized .arif-ai-header {
	border-radius: 0;
}

/* Maximized: more padding for spacious layout */
.arif-ai-chat.maximized .arif-ai-messages {
	padding: 24px;
}

/* Maximized: quick actions use 4 columns */
.arif-ai-chat.maximized .arif-ai-quick-actions-grid {
	grid-template-columns: repeat(4, 1fr);
}

/* ===== Header ===== */
.arif-ai-header {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	color: #ffffff;
	flex-shrink: 0;
}

.arif-ai-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.arif-ai-header-right {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: 12px;
}

.arif-ai-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}

.arif-ai-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.arif-ai-avatar svg {
	width: 22px;
	height: 22px;
}

.arif-ai-header-text {
	display: flex;
	flex-direction: column;
}

.arif-ai-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
}

.arif-ai-status {
	font-size: 11px;
	opacity: 0.9;
	display: flex;
	align-items: center;
	gap: 5px;
}

.arif-ai-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #48bb78;
	display: inline-block;
	animation: arif-ai-pulse 2s infinite;
}

.arif-ai-status-dot.thinking {
	background: #ffd93d;
	animation: arif-ai-thinking-pulse 0.8s infinite;
}

@keyframes arif-ai-pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.5;
	}
}

@keyframes arif-ai-thinking-pulse {

	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}

	50% {
		opacity: 0.6;
		transform: scale(0.8);
	}
}

/* Header circular buttons */
.arif-ai-header-btn {
	position: relative;
	width: 28px;
	height: 28px;
	min-width: 28px;
	min-height: 28px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--arif-ai-transition);
	padding: 0;
	flex-shrink: 0;
}

.arif-ai-header-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

.arif-ai-header-btn svg {
	width: 14px;
	height: 14px;
	color: #ffffff;
}

/* Notification badge */
.arif-ai-rec-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: #e53e3e;
	color: #ffffff;
	font-size: 11px;
	font-weight: 600;
	border-radius: 9px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* More dropdown container */
.arif-ai-more-container {
	position: relative;
}

.arif-ai-more-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 200px;
	background: #ffffff;
	border-radius: var(--arif-ai-radius-sm);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	border: 1px solid #f3f4f6;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: var(--arif-ai-transition);
	z-index: 1000;
	overflow: hidden;
	padding: 8px 0;
}

.arif-ai-more-dropdown.open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.arif-ai-more-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 16px;
	border: none;
	background: none;
	color: #374151;
	font-size: 14px;
	cursor: pointer;
	transition: var(--arif-ai-transition);
	text-align: left;
}

.arif-ai-more-item:hover {
	background: #f9fafb;
}

.arif-ai-more-item svg {
	width: 18px;
	height: 18px;
	color: #6b7280;
	flex-shrink: 0;
}

.arif-ai-more-item-danger {
	color: #ef4444;
}

.arif-ai-more-item-danger svg {
	color: #ef4444;
}

/* Legacy header actions (for backwards compatibility) */
.arif-ai-header-actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
	width: 100%;
	flex-wrap: wrap;
	overflow: visible;
}

.arif-ai-header-controls {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
	flex-wrap: nowrap;
}

.arif-ai-action-btn {
	position: relative;
	width: 28px;
	height: 28px;
	min-width: 28px;
	min-height: 28px;
	border: none;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	cursor: pointer;
	display: flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	align-items: center;
	justify-content: center;
	transition: var(--arif-ai-transition);
	flex-shrink: 0;
	padding: 0;
	margin: 0;
}

.arif-ai-action-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

.arif-ai-action-btn svg {
	width: 14px;
	height: 14px;
	color: #ffffff;
	display: block !important;
	visibility: visible !important;
}

/* Ensure specific header buttons are always visible - override any conflicting styles */
/* Use high specificity selectors to override Frappe/Mjara ERP desk styles */
.arif-ai-chat.open #arif-ai-history,
.arif-ai-chat.open #arif-ai-export,
.arif-ai-chat.open #arif-ai-search,
.arif-ai-chat.open #arif-ai-theme,
.arif-ai-chat.open #arif-ai-new-conversation,
.arif-ai-chat.open #arif-ai-clear,
.arif-ai-chat.open #arif-ai-recommendations,
.arif-ai-chat.open #arif-ai-setup-btn {
	display: flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 28px !important;
	height: 28px !important;
	min-width: 28px !important;
	min-height: 28px !important;
	pointer-events: auto !important;
	position: relative !important;
	flex-shrink: 0 !important;
	overflow: visible !important;
}

.arif-ai-chat:not(.open) .arif-ai-action-btn,
.arif-ai-chat:not(.open) .arif-ai-header-actions * {
	pointer-events: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
}


/* Ensure header-actions shows all children - high specificity */
.arif-ai-chat.open .arif-ai-header-actions {
	display: flex !important;
	flex-wrap: wrap !important;
	overflow: visible !important;
	visibility: visible !important;
	gap: 6px !important;
	max-width: none !important;
	width: 100% !important;
}

#arif-ai-container .arif-ai-header-actions>*,
.arif-ai-header-actions>* {
	display: flex !important;
	visibility: visible !important;
	flex-shrink: 0 !important;
}

/* ===== Messages Container ===== */
.arif-ai-messages {
	flex: 1;
	min-height: 120px;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f8fafc;
	scroll-behavior: smooth;
}

/* Custom scrollbar */
.arif-ai-messages::-webkit-scrollbar {
	width: 6px;
}

.arif-ai-messages::-webkit-scrollbar-track {
	background: transparent;
}

.arif-ai-messages::-webkit-scrollbar-thumb {
	background: var(--arif-ai-border);
	border-radius: 3px;
}

.arif-ai-messages::-webkit-scrollbar-thumb:hover {
	background: var(--arif-ai-text-muted);
}

/* ===== Message Bubbles ===== */
.arif-ai-message {
	display: flex;
	flex-direction: column;
	max-width: 85%;
	animation: arif-ai-fadeIn 0.3s ease;
	flex-shrink: 0;
}

@keyframes arif-ai-fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.arif-ai-message-user {
	align-self: flex-end;
}

.arif-ai-message-assistant {
	align-self: flex-start;
}

.arif-ai-message-content {
	padding: 12px 16px;
	border-radius: var(--arif-ai-radius-sm);
	line-height: 1.5;
	font-size: 14px;
	word-wrap: break-word;
}

.arif-ai-message-user .arif-ai-message-content {
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.arif-ai-message-assistant .arif-ai-message-content {
	background: #ffffff;
	color: #1f2937;
	border-bottom-left-radius: 4px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .arif-ai-message-assistant .arif-ai-message-content {
	background: rgba(102, 126, 234, 0.1);
	color: #e2e8f0;
	border: 1px solid rgba(102, 126, 234, 0.2);
}

.arif-ai-message-error .arif-ai-message-content {
	background: rgba(220, 53, 69, 0.1);
	border: 1px solid rgba(220, 53, 69, 0.3);
	color: #dc3545;
}

.arif-ai-message-time {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	margin-top: 4px;
	padding: 0 4px;
}

.arif-ai-message-user .arif-ai-message-time {
	text-align: right;
}

/* Code styling in messages */
.arif-ai-message-content code {
	background: rgba(0, 0, 0, 0.1);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'Monaco', 'Menlo', monospace;
	font-size: 13px;
}

[data-theme="dark"] .arif-ai-message-content code {
	background: rgba(255, 255, 255, 0.1);
}

.arif-ai-message-content pre {
	background: rgba(0, 0, 0, 0.05);
	padding: 12px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 8px 0;
}

[data-theme="dark"] .arif-ai-message-content pre {
	background: rgba(0, 0, 0, 0.3);
}

.arif-ai-message-content pre code {
	background: transparent;
	padding: 0;
}

/* ===== Tool Execution UI ===== */
.arif-ai-tool-execution {
	background: var(--arif-ai-tool-bg);
	border-radius: var(--arif-ai-radius-sm);
	margin: 4px 0;
	overflow: hidden;
	animation: arif-ai-fadeIn 0.3s ease;
	border: 1px solid rgba(102, 126, 234, 0.2);
	flex-shrink: 0;
	min-height: 44px;
}

.arif-ai-tool-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	min-height: 40px;
	cursor: pointer;
	transition: var(--arif-ai-transition);
	font-size: 13px;
	color: var(--arif-ai-primary);
	font-weight: 500;
	box-sizing: border-box;
}

.arif-ai-tool-header span {
	flex: 1;
}

.arif-ai-tool-header:hover {
	background: rgba(102, 126, 234, 0.1);
}

.arif-ai-tool-icon-main {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.arif-ai-tool-chevron {
	width: 16px;
	height: 16px;
	margin-left: auto;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.arif-ai-tool-header.expanded .arif-ai-tool-chevron {
	transform: rotate(180deg);
}

.arif-ai-tool-details {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, padding 0.3s ease;
	padding: 0 14px;
}

.arif-ai-tool-details.expanded {
	max-height: 600px;
	padding: 0 14px 14px 14px;
	overflow-y: auto;
}

.arif-ai-tool-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--arif-ai-bg);
	border-radius: 8px;
	margin-bottom: 6px;
	font-size: 13px;
}

.arif-ai-tool-item.success {
	border-left: 3px solid var(--arif-ai-success);
}

.arif-ai-tool-item.error {
	border-left: 3px solid var(--arif-ai-error);
}

.arif-ai-tool-icon {
	font-weight: bold;
	font-size: 14px;
}

.arif-ai-tool-item.success .arif-ai-tool-icon {
	color: var(--arif-ai-success);
}

.arif-ai-tool-item.error .arif-ai-tool-icon {
	color: var(--arif-ai-error);
}

.arif-ai-tool-name {
	flex: 1;
	font-weight: 500;
	color: var(--arif-ai-text);
}

.arif-ai-tool-time {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	background: rgba(0, 0, 0, 0.05);
	padding: 2px 6px;
	border-radius: 4px;
}

[data-theme="dark"] .arif-ai-tool-time {
	background: rgba(255, 255, 255, 0.1);
}

/* Tool Results */
.arif-ai-tool-results {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--arif-ai-border);
}

.arif-ai-tool-result {
	margin-bottom: 10px;
}

.arif-ai-tool-result:last-child {
	margin-bottom: 0;
}

.arif-ai-tool-result-header {
	font-size: 11px;
	font-weight: 600;
	color: var(--arif-ai-text-muted);
	text-transform: uppercase;
	margin-bottom: 6px;
}

.arif-ai-tool-result-content {
	background: var(--arif-ai-bg);
	padding: 10px 12px;
	border-radius: 6px;
	font-family: 'Monaco', 'Menlo', monospace;
	font-size: 11px;
	line-height: 1.5;
	overflow-x: auto;
	max-height: 200px;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-word;
	color: var(--arif-ai-text);
	margin: 0;
}

.arif-ai-tool-result-truncated {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	font-style: italic;
	margin-top: 4px;
}

/* ===== Typing Indicator ===== */
.arif-ai-loading .arif-ai-typing {
	display: flex;
	gap: 4px;
	padding: 8px 0;
}

.arif-ai-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--arif-ai-primary);
	animation: arif-ai-bounce 1.4s infinite ease-in-out both;
}

.arif-ai-typing span:nth-child(1) {
	animation-delay: -0.32s;
}

.arif-ai-typing span:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes arif-ai-bounce {

	0%,
	80%,
	100% {
		transform: scale(0.6);
		opacity: 0.6;
	}

	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* ===== Input Area ===== */
.arif-ai-input-area {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	padding: 16px 20px;
	border-top: 1px solid var(--arif-ai-border);
	background: var(--arif-ai-bg);
	flex-shrink: 0;
}

/* Input wrapper for gradient border in dark mode */
.arif-ai-input-wrapper {
	flex: 1;
	position: relative;
	border-radius: 24px;
}

.arif-ai-input {
	width: 100%;
	height: 44px;
	padding: 0 18px;
	border: 1px solid #e5e7eb;
	border-radius: 24px;
	background: #f9fafb;
	color: var(--arif-ai-text);
	font-size: 14px;
	line-height: 44px;
	resize: none;
	outline: none;
	transition: var(--arif-ai-transition);
	font-family: inherit;
	overflow: hidden;
}

.arif-ai-input:hover {
	border-color: #d1d5db;
}

.arif-ai-input:focus {
	border-color: #a78bfa;
	background: #ffffff;
}

.arif-ai-input::placeholder {
	color: #9ca3af;
}

.arif-ai-send-btn {
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--arif-ai-transition);
	flex-shrink: 0;
}

.arif-ai-send-btn:hover:not(:disabled) {
	transform: scale(1.05);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.arif-ai-send-btn:active:not(:disabled) {
	transform: scale(0.95);
}

.arif-ai-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.arif-ai-send-btn svg {
	width: 20px;
	height: 20px;
}

/* ===== R6l: Enhanced AI Disclaimer Footer ===== */
.arif-ai-disclaimer {
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-muted, #666);
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--arif-ai-border);
    line-height: 1.3;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.arif-ai-disclaimer-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    color: var(--arif-ai-primary, #0066cc);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arif-ai-disclaimer-icon svg {
    width: 100%;
    height: 100%;
}

.arif-ai-disclaimer-text {
    letter-spacing: 0.01em;
}

[data-theme="dark"] .arif-ai-disclaimer {
    color: var(--text-muted, #888);
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .arif-ai-disclaimer-icon {
    color: var(--arif-ai-primary-light, #4da3ff);
    opacity: 0.8;
}

/* ===== C21: Privacy Consent Modal ===== */
.arif-ai-privacy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(2px);
}

.arif-ai-privacy-modal {
    background: var(--arif-ai-bg, #fff);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: arif-ai-modal-in 0.2s ease-out;
}

@keyframes arif-ai-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.arif-ai-privacy-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--arif-ai-text, #1a1a1a);
}

.arif-ai-privacy-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--arif-ai-text-muted, #666);
}

.arif-ai-privacy-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.arif-ai-privacy-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.arif-ai-privacy-decline {
    background: var(--arif-ai-surface, #f5f5f5);
    color: var(--arif-ai-text-muted, #666);
}

.arif-ai-privacy-decline:hover {
    background: var(--arif-ai-border, #e0e0e0);
}

.arif-ai-privacy-accept {
    background: var(--arif-ai-primary, #0066cc);
    color: white;
}

.arif-ai-privacy-accept:hover {
    background: var(--arif-ai-primary-dark, #0052a3);
}

[data-theme="dark"] .arif-ai-privacy-modal {
    background: var(--arif-ai-bg, #1a1a1a);
}

[data-theme="dark"] .arif-ai-privacy-decline {
    background: var(--arif-ai-surface, #2a2a2a);
    color: var(--arif-ai-text-muted, #999);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
	#arif-ai-container {
		bottom: 16px;
		right: 16px;
	}

	.arif-ai-fab {
		width: 56px;
		height: 56px;
	}

	.arif-ai-chat {
		width: calc(100vw - 32px);
		height: calc(100vh - 100px);
		bottom: 88px;
		/* 16px container + 72px offset */
		right: 8px;
		/* 16px container - 8px offset */
	}

	.arif-ai-header {
		padding: 10px 12px;
		gap: 8px;
	}

	.arif-ai-header-actions {
		gap: 4px;
	}

	.arif-ai-action-btn {
		width: 28px;
		height: 28px;
		min-width: 28px;
	}

	.arif-ai-messages {
		padding: 16px;
	}

	.arif-ai-input-area {
		padding: 12px 16px;
	}

	.arif-ai-tool-details.expanded {
		max-height: 300px;
	}
}

/* ===== RTL (Right-to-Left) Support ===== */
[dir="rtl"] #arif-ai-container,
html[dir="rtl"] #arif-ai-container,
body[dir="rtl"] #arif-ai-container {
	right: auto !important;
	left: 32px !important;
}

[dir="rtl"] .arif-ai-chat,
html[dir="rtl"] .arif-ai-chat,
body[dir="rtl"] .arif-ai-chat {
	right: auto !important;
	left: 32px !important;
	transform-origin: bottom left !important;
}

[dir="rtl"] .arif-ai-chat.maximized,
html[dir="rtl"] .arif-ai-chat.maximized,
body[dir="rtl"] .arif-ai-chat.maximized {
	right: auto !important;
	left: 32px !important;
}

[dir="rtl"] .arif-ai-toast,
html[dir="rtl"] .arif-ai-toast,
body[dir="rtl"] .arif-ai-toast {
	right: auto !important;
	left: 24px !important;
}

[dir="rtl"] .arif-ai-header-right,
html[dir="rtl"] .arif-ai-header-right,
body[dir="rtl"] .arif-ai-header-right {
	margin-left: 0 !important;
	margin-right: 12px !important;
}

/* Dropdown in RTL - open to the left instead of right */
[dir="rtl"] .arif-ai-more-dropdown,
html[dir="rtl"] .arif-ai-more-dropdown,
body[dir="rtl"] .arif-ai-more-dropdown {
	right: auto !important;
	left: 0 !important;
}

/* Dropdown items in RTL - reverse icon/text order */
[dir="rtl"] .arif-ai-more-item,
html[dir="rtl"] .arif-ai-more-item,
body[dir="rtl"] .arif-ai-more-item {
	flex-direction: row-reverse !important;
	text-align: right !important;
}

/* RTL Mobile */
@media (max-width: 480px) {

	[dir="rtl"] #arif-ai-container,
	html[dir="rtl"] #arif-ai-container,
	body[dir="rtl"] #arif-ai-container {
		right: auto !important;
		left: 16px !important;
	}

	[dir="rtl"] .arif-ai-chat,
	html[dir="rtl"] .arif-ai-chat,
	body[dir="rtl"] .arif-ai-chat {
		right: auto !important;
		left: 8px !important;
	}
}

/* ===== Print ===== */
@media print {
	#arif-ai-container {
		display: none !important;
	}
}

/* ===== Toast Notifications (for Vue apps) ===== */
.arif-ai-toast {
	position: fixed;
	bottom: 100px;
	right: 24px;
	padding: 12px 24px;
	border-radius: 8px;
	background: #333;
	color: #fff;
	font-size: 14px;
	z-index: 999999;
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.3s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.arif-ai-toast.show {
	opacity: 1;
	transform: translateY(0);
}

.arif-ai-toast-success {
	background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.arif-ai-toast-error {
	background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
}

.arif-ai-toast-info {
	background: linear-gradient(135deg, var(--arif-ai-primary, #667eea) 0%, #764ba2 100%);
}

/* ===== Implementor Wizard Styles ===== */

/* Setup Button in Header */
.arif-ai-setup-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 6px;
	color: #ffffff;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-setup-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

.arif-ai-setup-btn svg {
	width: 14px;
	height: 14px;
}

.arif-ai-setup-btn .arif-ai-badge {
	background: #ffc107;
	color: #000;
	padding: 2px 6px;
	border-radius: 10px;
	font-size: 10px;
	font-weight: 600;
	margin-left: 4px;
}

/* Module Status Banner */
.arif-ai-module-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
	border-bottom: 1px solid var(--arif-ai-border);
	animation: arif-ai-fadeIn 0.3s ease;
}

[data-theme="dark"] .arif-ai-module-banner {
	background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%);
}

.arif-ai-module-banner-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.arif-ai-module-banner-title {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

[data-theme="dark"] .arif-ai-module-banner-title {
	color: #ffc107;
}

.arif-ai-module-banner-subtitle {
	font-size: 11px;
	color: #666;
}

[data-theme="dark"] .arif-ai-module-banner-subtitle {
	color: var(--arif-ai-text-muted);
}

/* Config Button Style */
.arif-ai-config-btn {
	padding: 8px 14px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	border-radius: 6px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-config-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Primary Button Style */
.arif-ai-btn-primary {
	padding: 10px 18px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	border-radius: 8px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.arif-ai-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.arif-ai-btn-primary:active {
	transform: translateY(0);
}

.arif-ai-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Success Button Style */
.arif-ai-btn-success {
	padding: 10px 18px;
	background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
	border: none;
	border-radius: 8px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-btn-success:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.arif-ai-module-banner-btn {
	padding: 8px 16px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	border-radius: 6px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-module-banner-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.arif-ai-module-banner-dismiss {
	position: absolute;
	top: 6px;
	right: 6px;
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	padding: 4px;
	line-height: 1;
}

.arif-ai-module-banner-dismiss:hover {
	color: #666;
}

/* Module Selection Grid */
.arif-ai-module-select {
	padding: 20px;
}

.arif-ai-module-select h4 {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 16px;
	color: var(--arif-ai-text);
}

.arif-ai-module-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	padding: 4px;
}

.arif-ai-module-card {
	padding: 16px 14px;
	background: var(--arif-ai-bg);
	border: 2px solid var(--arif-ai-border);
	border-radius: 12px;
	cursor: pointer;
	transition: var(--arif-ai-transition);
	text-align: center;
}

.arif-ai-module-card:hover {
	border-color: var(--arif-ai-primary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.arif-ai-module-card.configured {
	background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.1) 100%);
	border-color: #48bb78;
}

.arif-ai-module-card.needs-config {
	background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
	border-color: #ffc107;
}

.arif-ai-module-card-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--arif-ai-text);
	margin-bottom: 4px;
}

.arif-ai-module-card-status {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-module-card-status .badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 10px;
	font-weight: 600;
}

.arif-ai-module-card-status .badge-success {
	background: #48bb78;
	color: #fff;
}

.arif-ai-module-card-status .badge-warning {
	background: #ffc107;
	color: #000;
}

/* Wizard Mode UI */
.arif-ai-wizard-mode {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.arif-ai-wizard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
	border-bottom: 1px solid var(--arif-ai-border);
}

.arif-ai-wizard-header-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.arif-ai-wizard-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--arif-ai-text);
}

.arif-ai-wizard-subtitle {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-wizard-back-btn,
.arif-ai-btn-cancel,
.arif-ai-btn-secondary {
	padding: 10px 18px;
	background: rgba(102, 126, 234, 0.1);
	border: 2px solid rgba(102, 126, 234, 0.25);
	border-radius: 8px;
	color: var(--arif-ai-primary);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-wizard-back-btn:hover,
.arif-ai-btn-cancel:hover,
.arif-ai-btn-secondary:hover {
	background: rgba(102, 126, 234, 0.18);
	border-color: var(--arif-ai-primary);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .arif-ai-wizard-back-btn,
[data-theme="dark"] .arif-ai-btn-cancel,
[data-theme="dark"] .arif-ai-btn-secondary {
	background: rgba(102, 126, 234, 0.15);
	border-color: rgba(102, 126, 234, 0.35);
}

/* Wizard Progress */
.arif-ai-wizard-progress {
	padding: 16px;
	border-bottom: 1px solid var(--arif-ai-border);
}

.arif-ai-wizard-progress-info {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 12px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-wizard-progress-bar {
	height: 6px;
	background: var(--arif-ai-border);
	border-radius: 3px;
	overflow: hidden;
}

.arif-ai-wizard-progress-fill {
	height: 100%;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border-radius: 3px;
	transition: width 0.3s ease;
}

/* Wizard Question */
.arif-ai-wizard-question {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}

.arif-ai-wizard-check-info {
	padding: 12px;
	background: rgba(102, 126, 234, 0.08);
	border-radius: 8px;
	margin-bottom: 16px;
	border-left: 3px solid var(--arif-ai-primary);
}

.arif-ai-wizard-check-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--arif-ai-primary);
	margin-bottom: 4px;
}

.arif-ai-wizard-check-intro {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
	line-height: 1.4;
}

.arif-ai-wizard-question-text {
	font-size: 15px;
	font-weight: 600;
	color: var(--arif-ai-text);
	margin-bottom: 8px;
	line-height: 1.4;
}

.arif-ai-wizard-question-help {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
	margin-bottom: 16px;
}

/* Wizard Answer Input */
.arif-ai-wizard-answer {
	margin-bottom: 16px;
}

.arif-ai-wizard-input {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid rgba(102, 126, 234, 0.4);
	border-radius: 10px;
	background: rgba(102, 126, 234, 0.08);
	color: var(--arif-ai-text);
	font-size: 15px;
	font-weight: 500;
	transition: var(--arif-ai-transition);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .arif-ai-wizard-input {
	background: rgba(102, 126, 234, 0.12);
	border-color: rgba(102, 126, 234, 0.5);
}

.arif-ai-wizard-input:hover {
	border-color: rgba(102, 126, 234, 0.6);
	background: rgba(102, 126, 234, 0.12);
}

.arif-ai-wizard-input:focus {
	outline: none;
	border-color: var(--arif-ai-primary);
	background: rgba(102, 126, 234, 0.15);
	box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.arif-ai-wizard-input::placeholder {
	color: var(--arif-ai-text-muted);
	font-style: italic;
	font-weight: 400;
}

/* Pulse animation for wizard inputs that need attention */
.arif-ai-wizard-input:not(:focus):placeholder-shown {
	animation: inputPulse 2s ease-in-out infinite;
}

/* Textarea for SmallText/Text fields */
.arif-ai-wizard-textarea {
	min-height: 100px;
	resize: vertical;
	font-family: inherit;
	line-height: 1.5;
}

/* Select Options */
.arif-ai-wizard-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.arif-ai-wizard-option {
	padding: 12px 14px;
	background: var(--arif-ai-bg);
	border: 2px solid var(--arif-ai-border);
	border-radius: 8px;
	cursor: pointer;
	transition: var(--arif-ai-transition);
	font-size: 14px;
	color: var(--arif-ai-text);
}

.arif-ai-wizard-option:hover {
	border-color: var(--arif-ai-primary);
	background: rgba(102, 126, 234, 0.05);
}

.arif-ai-wizard-option.selected {
	border-color: var(--arif-ai-primary);
	background: rgba(102, 126, 234, 0.1);
	color: var(--arif-ai-primary);
	font-weight: 500;
}

/* Checkbox Option */
.arif-ai-wizard-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.arif-ai-wizard-checkbox input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--arif-ai-primary);
}

.arif-ai-wizard-checkbox label {
	font-size: 14px;
	color: var(--arif-ai-text);
	cursor: pointer;
}

/* Wizard Actions */
.arif-ai-wizard-actions {
	padding: 16px;
	border-top: 1px solid var(--arif-ai-border);
	background: var(--arif-ai-bg);
}

.arif-ai-wizard-submit-btn {
	width: 100%;
	padding: 12px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	border-radius: 8px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.arif-ai-wizard-submit-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.arif-ai-wizard-submit-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Wizard Completion */
.arif-ai-wizard-complete {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
}

.arif-ai-wizard-complete-icon {
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
}

.arif-ai-wizard-complete-icon svg {
	width: 32px;
	height: 32px;
	color: #fff;
}

.arif-ai-wizard-complete h4 {
	font-size: 18px;
	font-weight: 600;
	color: var(--arif-ai-text);
	margin-bottom: 8px;
}

.arif-ai-wizard-complete p {
	font-size: 13px;
	color: var(--arif-ai-text-muted);
	margin-bottom: 20px;
}

.arif-ai-wizard-execute-btn {
	padding: 12px 24px;
	background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
	border: none;
	border-radius: 8px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-wizard-execute-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

/* Wizard Summary */
.arif-ai-wizard-summary {
	width: 100%;
	max-height: 200px;
	overflow-y: auto;
	background: var(--arif-ai-bg);
	border: 1px solid var(--arif-ai-border);
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 16px;
	text-align: left;
}

.arif-ai-wizard-summary-item {
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--arif-ai-border);
}

.arif-ai-wizard-summary-item:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.arif-ai-wizard-summary-title {
	font-size: 12px;
	font-weight: 600;
	color: var(--arif-ai-primary);
	margin-bottom: 6px;
}

.arif-ai-wizard-summary-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.arif-ai-wizard-summary-list li {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	padding: 2px 0;
}

/* Execution Result */
.arif-ai-execution-result {
	padding: 16px;
}

.arif-ai-execution-success {
	text-align: center;
}

.arif-ai-execution-success h4 {
	color: #48bb78;
	margin-bottom: 12px;
}

.arif-ai-created-docs {
	text-align: left;
	background: var(--arif-ai-bg);
	border: 1px solid var(--arif-ai-border);
	border-radius: 8px;
	padding: 12px;
	margin: 12px 0;
}

.arif-ai-created-doc {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid var(--arif-ai-border);
}

.arif-ai-created-doc:last-child {
	border-bottom: none;
}

.arif-ai-created-doc-icon {
	color: #48bb78;
	font-weight: bold;
}

.arif-ai-created-doc-type {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	background: rgba(0, 0, 0, 0.05);
	padding: 2px 6px;
	border-radius: 4px;
}

.arif-ai-created-doc-name {
	font-size: 13px;
	color: var(--arif-ai-text);
	font-weight: 500;
}

/* Loading Spinner in Wizard */
.arif-ai-wizard-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px;
	gap: 16px;
}

.arif-ai-wizard-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--arif-ai-border);
	border-top-color: var(--arif-ai-primary);
	border-radius: 50%;
	animation: arif-ai-spin 1s linear infinite;
}

@keyframes arif-ai-spin {
	to {
		transform: rotate(360deg);
	}
}

.arif-ai-wizard-loading-text {
	font-size: 14px;
	color: var(--arif-ai-text-muted);
}

/* Mobile Responsive for Wizard */
@media (max-width: 480px) {
	.arif-ai-module-grid {
		grid-template-columns: 1fr;
	}

	.arif-ai-wizard-question-text {
		font-size: 14px;
	}

	.arif-ai-wizard-option {
		padding: 10px 12px;
		font-size: 13px;
	}
}

/* ===== Module Page AI Setup Button ===== */
.arif-ai-module-setup-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	border-radius: 8px;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
	margin-right: 10px;
}

.arif-ai-module-setup-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.arif-ai-module-setup-btn:active {
	transform: translateY(0);
}

.arif-ai-module-setup-btn svg {
	flex-shrink: 0;
}

.arif-ai-module-setup-btn .arif-ai-module-progress {
	background: rgba(255, 255, 255, 0.2);
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
}

/* Animation for the button */
@keyframes arifAiPulse {

	0%,
	100% {
		box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
	}

	50% {
		box-shadow: 0 2px 15px rgba(102, 126, 234, 0.5);
	}
}

.arif-ai-module-setup-btn {
	animation: arifAiPulse 2s ease-in-out infinite;
}

.arif-ai-module-setup-btn:hover {
	animation: none;
}

/* ===== File Attachment Styles ===== */

/* Hidden file input */
.arif-ai-file-input {
	display: none;
}

/* Attachment button */
.arif-ai-attach-btn {
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	color: var(--arif-ai-text-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: var(--arif-ai-transition);
	flex-shrink: 0;
}

.arif-ai-attach-btn:hover {
	background: var(--arif-ai-tool-bg);
	color: var(--arif-ai-primary);
}

.arif-ai-attach-btn svg {
	width: 20px;
	height: 20px;
}

/* File preview area */
.arif-ai-file-preview {
	display: none;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 12px;
	border-top: 1px solid var(--arif-ai-border);
	background: var(--arif-ai-bg);
	max-height: 120px;
	overflow-y: auto;
}

/* File preview items */
.arif-ai-file-item {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	background: var(--arif-ai-tool-bg);
	border: 1px solid var(--arif-ai-border);
}

.arif-ai-file-image {
	width: 60px;
	height: 60px;
}

.arif-ai-file-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.arif-ai-file-doc {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	max-width: 180px;
}

.arif-ai-file-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	color: var(--arif-ai-primary);
}

.arif-ai-file-icon svg {
	width: 100%;
	height: 100%;
}

.arif-ai-file-info {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-width: 0;
}

.arif-ai-file-name {
	font-size: 12px;
	font-weight: 500;
	color: var(--arif-ai-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.arif-ai-file-size {
	font-size: 10px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-file-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	border: none;
	background: rgba(0, 0, 0, 0.6);
	color: white;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: var(--arif-ai-transition);
}

.arif-ai-file-item:hover .arif-ai-file-remove {
	opacity: 1;
}

.arif-ai-file-remove svg {
	width: 12px;
	height: 12px;
}

/* Message attachments */
.arif-ai-message-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.arif-ai-msg-attachment {
	border-radius: 8px;
	overflow: hidden;
}

.arif-ai-msg-attachment-image {
	max-width: 200px;
	max-height: 150px;
	cursor: pointer;
}

.arif-ai-msg-attachment-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
	transition: var(--arif-ai-transition);
}

.arif-ai-msg-attachment-image img:hover {
	opacity: 0.9;
	transform: scale(1.02);
}

.arif-ai-msg-attachment-file {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: var(--arif-ai-tool-bg);
	border: 1px solid var(--arif-ai-border);
	font-size: 12px;
	color: var(--arif-ai-text);
}

.arif-ai-msg-attachment-file svg {
	width: 16px;
	height: 16px;
	color: var(--arif-ai-primary);
}

/* Image preview modal */
.arif-ai-image-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.arif-ai-image-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.85);
	cursor: pointer;
}

.arif-ai-image-modal-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	z-index: 1;
}

.arif-ai-image-modal-content img {
	max-width: 100%;
	max-height: 90vh;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.arif-ai-image-modal-close {
	position: absolute;
	top: -40px;
	right: 0;
	width: 36px;
	height: 36px;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: white;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--arif-ai-transition);
}

.arif-ai-image-modal-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

.arif-ai-image-modal-close svg {
	width: 20px;
	height: 20px;
}

/* Update input area to include attach button */
.arif-ai-input-area {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--arif-ai-border);
	background: var(--arif-ai-bg);
}

/* ===== Quick Actions Panel ===== */
.arif-ai-quick-actions {
	padding: 12px;
	background: #f8fafc;
	flex-shrink: 1;
	overflow: hidden;
}

.arif-ai-quick-actions-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

/* Card-style quick actions with icon on TOP */
.arif-ai-quick-action-card {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 12px 8px;
	background: #ffffff;
	border: 1px solid #ddd6fe;
	border-radius: var(--arif-ai-radius-sm);
	box-shadow: 0 1px 2px rgba(139, 92, 246, 0.06);
	cursor: pointer;
	transition: var(--arif-ai-transition);
	text-align: center;
}

.arif-ai-quick-action-card:hover {
	border-color: #a78bfa;
	background: #faf5ff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.arif-ai-quick-action-card .arif-ai-quick-action-icon {
	color: #8b5cf6;
}

.arif-ai-quick-action-card .arif-ai-quick-action-icon svg {
	width: 24px;
	height: 24px;
}

.arif-ai-quick-action-card .arif-ai-quick-action-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--arif-ai-text);
	line-height: 1.2;
}

.arif-ai-quick-action-card .arif-ai-quick-action-desc {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	line-height: 1.3;
}

/* Legacy btn style (backwards compatibility) */
.arif-ai-quick-action-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 12px 8px;
	border: 1px solid var(--arif-ai-border);
	border-radius: var(--arif-ai-radius-sm);
	background: var(--arif-ai-bg);
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-quick-action-btn:hover {
	background: var(--arif-ai-tool-bg);
	border-color: var(--arif-ai-primary);
	transform: translateY(-2px);
}

.arif-ai-quick-action-icon {
	font-size: 20px;
	line-height: 1;
}

.arif-ai-quick-action-label {
	font-size: 11px;
	font-weight: 500;
	color: var(--arif-ai-text);
	text-align: center;
	line-height: 1.2;
}

/* Dark theme quick actions */
[data-theme="dark"] .arif-ai-quick-action-card,
[data-theme="dark"] .arif-ai-quick-action-btn {
	background: var(--arif-ai-bg-dark);
	border-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-quick-action-card:hover,
[data-theme="dark"] .arif-ai-quick-action-btn:hover {
	background: var(--arif-ai-tool-bg);
	border-color: var(--arif-ai-primary);
}

[data-theme="dark"] .arif-ai-quick-action-card .arif-ai-quick-action-icon {
	color: #a78bfa;
}

/* ===== Complete Dark Mode Styles ===== */

/* Chat window */
[data-theme="dark"] .arif-ai-chat {
	background: #1a1a2e;
	border: 1px solid #2d2d44;
}

/* Header - Keep same gradient as light mode */
[data-theme="dark"] .arif-ai-header {
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
}

[data-theme="dark"] .arif-ai-header-text {
	color: #ffffff;
}

[data-theme="dark"] .arif-ai-action-btn {
	color: #ffffff;
}

[data-theme="dark"] .arif-ai-action-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* Header buttons dark mode */
[data-theme="dark"] .arif-ai-header-btn {
	background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .arif-ai-header-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* More dropdown dark mode */
[data-theme="dark"] .arif-ai-more-dropdown {
	background: #1a1a2e;
	border-color: #2d2d44;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
	padding: 8px;
}

[data-theme="dark"] .arif-ai-more-item {
	color: #e2e8f0;
	border-radius: 8px;
}

[data-theme="dark"] .arif-ai-more-item:hover {
	background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .arif-ai-more-item svg {
	color: #9ca3af;
}

[data-theme="dark"] .arif-ai-more-item-danger {
	color: #ef4444;
}

[data-theme="dark"] .arif-ai-more-item-danger svg {
	color: #ef4444;
}

/* Messages container */
[data-theme="dark"] .arif-ai-messages {
	background: #1a1a2e;
}

/* Assistant messages in dark mode */
[data-theme="dark"] .arif-ai-message-assistant .arif-ai-message-content {
	background: #252538;
	color: #e2e8f0;
	border: 1px solid #2d2d44;
}

/* User messages */
[data-theme="dark"] .arif-ai-message-user .arif-ai-message-content {
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	color: #ffffff;
}

/* Tool messages */
[data-theme="dark"] .arif-ai-message-tool .arif-ai-message-content {
	background: #1a365d;
	border: 1px solid #2b6cb0;
	color: #e2e8f0;
}

/* Quick action cards dark mode - with gradient border */
[data-theme="dark"] .arif-ai-quick-action-card {
	background: #1e1e2d;
	border: 1px solid transparent;
	background-clip: padding-box;
	position: relative;
}

[data-theme="dark"] .arif-ai-quick-action-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(135deg, #4ade80 0%, #22d3ee 50%, #818cf8 100%);
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

[data-theme="dark"] .arif-ai-quick-action-card:hover {
	background: #252538;
}

[data-theme="dark"] .arif-ai-quick-action-card .arif-ai-quick-action-label {
	color: #ffffff;
}

[data-theme="dark"] .arif-ai-quick-action-card .arif-ai-quick-action-desc {
	color: #a0aec0;
}

[data-theme="dark"] .arif-ai-quick-action-card .arif-ai-quick-action-icon {
	color: #a78bfa;
}

/* Quick actions panel dark mode */
[data-theme="dark"] .arif-ai-quick-actions {
	background: #1a1a2e;
}

/* Input area dark mode */
[data-theme="dark"] .arif-ai-input-area {
	background: #1a1a2e;
	border-top: 1px solid #2d2d44;
}

/* Input in dark mode */
[data-theme="dark"] .arif-ai-input {
	background: #252538;
	color: #e2e8f0;
	border: 1px solid #3d3d5c;
}

[data-theme="dark"] .arif-ai-input:hover {
	border-color: #4d4d6a;
}

[data-theme="dark"] .arif-ai-input:focus {
	border-color: #667eea;
	background: #2a2a42;
}

[data-theme="dark"] .arif-ai-input::placeholder {
	color: #6b7280;
}

/* Attach button */
[data-theme="dark"] .arif-ai-attach-btn {
	color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-attach-btn:hover {
	color: var(--arif-ai-primary);
	background: rgba(102, 126, 234, 0.1);
}

/* Tool execution */
[data-theme="dark"] .arif-ai-tool-execution {
	background: #1a202c;
	border: 1px solid #2d3748;
}

[data-theme="dark"] .arif-ai-tool-header {
	color: #e2e8f0;
}

[data-theme="dark"] .arif-ai-tool-result {
	background: #0d1117;
	color: #c9d1d9;
	border: 1px solid #30363d;
}

/* File preview */
[data-theme="dark"] .arif-ai-file-preview {
	background: var(--arif-ai-bg-dark);
	border-top: 1px solid var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-file-preview-item {
	background: #2d3748;
	color: #e2e8f0;
}

/* Loading indicator */
[data-theme="dark"] .arif-ai-loading-dots span {
	background: var(--arif-ai-text-muted);
}

/* Scrollbar */
[data-theme="dark"] .arif-ai-messages::-webkit-scrollbar-track {
	background: var(--arif-ai-bg-dark);
}

[data-theme="dark"] .arif-ai-messages::-webkit-scrollbar-thumb {
	background: #4a5568;
}

[data-theme="dark"] .arif-ai-messages::-webkit-scrollbar-thumb:hover {
	background: var(--arif-ai-primary);
}

/* Welcome message */
[data-theme="dark"] .arif-ai-welcome {
	color: var(--arif-ai-text);
}

[data-theme="dark"] .arif-ai-welcome-suggestions button {
	background: var(--arif-ai-bg-dark);
	color: var(--arif-ai-text);
	border: 1px solid var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-welcome-suggestions button:hover {
	background: var(--arif-ai-tool-bg);
	border-color: var(--arif-ai-primary);
}

/* ===== Search Panel Styles ===== */

.arif-ai-search-panel {
	position: absolute;
	top: 60px;
	left: 0;
	right: 0;
	bottom: 60px;
	display: flex;
	flex-direction: column;
	background: var(--arif-ai-bg, #ffffff);
	z-index: 10;
	overflow: hidden;
}

.arif-ai-search-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border-bottom: 1px solid var(--arif-ai-border, #e5e7eb);
	background: var(--arif-ai-bg, #ffffff);
}

.arif-ai-search-input-wrapper {
	display: flex;
	align-items: center;
	flex: 1;
	position: relative;
	background: var(--arif-ai-bg-dark, #f3f4f6);
	border-radius: 8px;
	border: 1px solid var(--arif-ai-border, #e5e7eb);
	padding: 0 8px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.arif-ai-search-input-wrapper:focus-within {
	border-color: var(--arif-ai-primary, #667eea);
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.arif-ai-search-icon {
	width: 18px;
	height: 18px;
	color: var(--arif-ai-text-muted, #9ca3af);
	flex-shrink: 0;
}

.arif-ai-search-input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 8px;
	font-size: 14px;
	color: var(--arif-ai-text, #1f2937);
	outline: none;
}

.arif-ai-search-input::placeholder {
	color: var(--arif-ai-text-muted, #9ca3af);
}

.arif-ai-search-clear {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 0;
	border: none;
	background: var(--arif-ai-text-muted, #9ca3af);
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s;
}

.arif-ai-search-clear:hover {
	opacity: 1;
}

.arif-ai-search-clear svg {
	width: 12px;
	height: 12px;
	color: white;
}

.arif-ai-search-close {
	padding: 8px 12px;
	border: none;
	background: transparent;
	color: var(--arif-ai-primary, #667eea);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.2s;
}

.arif-ai-search-close:hover {
	background: rgba(102, 126, 234, 0.1);
}

.arif-ai-search-results {
	flex: 1;
	min-height: 0;
	/* Required for flexbox overflow scrolling */
	overflow-y: auto;
	padding: 8px;
}

/* Scrollbar styling for search results */
.arif-ai-search-results::-webkit-scrollbar {
	width: 6px;
}

.arif-ai-search-results::-webkit-scrollbar-track {
	background: transparent;
}

.arif-ai-search-results::-webkit-scrollbar-thumb {
	background-color: var(--arif-ai-border);
	border-radius: 3px;
}

.arif-ai-search-results::-webkit-scrollbar-thumb:hover {
	background-color: var(--arif-ai-text-muted);
}

/* Search placeholder and states */
.arif-ai-search-placeholder,
.arif-ai-search-loading,
.arif-ai-search-empty,
.arif-ai-search-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 200px;
	text-align: center;
	color: var(--arif-ai-text-muted, #9ca3af);
	padding: 20px;
}

.arif-ai-search-empty svg,
.arif-ai-search-error svg {
	width: 48px;
	height: 48px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.arif-ai-search-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid var(--arif-ai-border, #e5e7eb);
	border-top-color: var(--arif-ai-primary, #667eea);
	border-radius: 50%;
	animation: arif-ai-spin 0.8s linear infinite;
	margin-bottom: 12px;
}

@keyframes arif-ai-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Search results */
.arif-ai-search-result {
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 8px;
	background: var(--arif-ai-bg-dark, #f3f4f6);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
}

.arif-ai-search-result:hover {
	background: var(--arif-ai-tool-bg, #f0f0f0);
	border-color: var(--arif-ai-primary, #667eea);
}

.arif-ai-search-result:last-child {
	margin-bottom: 0;
}

.arif-ai-search-result-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 4px;
}

.arif-ai-search-result-title {
	font-weight: 500;
	font-size: 14px;
	color: var(--arif-ai-text, #1f2937);
	flex: 1;
	word-break: break-word;
}

.arif-ai-search-result-time {
	font-size: 12px;
	color: var(--arif-ai-text-muted, #9ca3af);
	white-space: nowrap;
}

.arif-ai-search-result-snippet {
	font-size: 13px;
	color: var(--arif-ai-text-muted, #6b7280);
	margin-top: 6px;
	line-height: 1.4;
	word-break: break-word;
}

.arif-ai-search-result-role {
	font-weight: 500;
	color: var(--arif-ai-primary, #667eea);
	text-transform: capitalize;
}

.arif-ai-search-result-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.arif-ai-search-result-status {
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 4px;
	text-transform: uppercase;
	font-weight: 500;
}

.arif-ai-search-result-status.active {
	background: #d1fae5;
	color: #065f46;
}

.arif-ai-search-result-status.archived {
	background: #fef3c7;
	color: #92400e;
}

.arif-ai-search-result-status.deleted {
	background: #fee2e2;
	color: #991b1b;
}

.arif-ai-search-result-count {
	font-size: 12px;
	color: var(--arif-ai-text-muted, #9ca3af);
}

/* Search highlight */
.arif-ai-search-highlight {
	background: #fef08a;
	color: #1f2937;
	padding: 0 2px;
	border-radius: 2px;
}

/* Loading conversation */
.arif-ai-loading-conversation {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--arif-ai-text-muted, #9ca3af);
}

/* ===== Dark Mode Search Styles ===== */

[data-theme="dark"] .arif-ai-search-panel {
	background: var(--arif-ai-bg);
}

[data-theme="dark"] .arif-ai-search-header {
	background: var(--arif-ai-bg);
	border-bottom-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-search-input-wrapper {
	background: var(--arif-ai-bg-dark);
	border-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-search-input {
	color: var(--arif-ai-text);
}

[data-theme="dark"] .arif-ai-search-result {
	background: var(--arif-ai-bg-dark);
}

[data-theme="dark"] .arif-ai-search-result:hover {
	background: var(--arif-ai-tool-bg);
}

[data-theme="dark"] .arif-ai-search-result-title {
	color: var(--arif-ai-text);
}

[data-theme="dark"] .arif-ai-search-result-snippet {
	color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-search-highlight {
	background: #854d0e;
	color: #fef9c3;
}

[data-theme="dark"] .arif-ai-search-result-status.active {
	background: #064e3b;
	color: #6ee7b7;
}

[data-theme="dark"] .arif-ai-search-result-status.archived {
	background: #78350f;
	color: #fcd34d;
}

[data-theme="dark"] .arif-ai-search-result-status.deleted {
	background: #7f1d1d;
	color: #fca5a5;
}

[data-theme="dark"] .arif-ai-search-results::-webkit-scrollbar-thumb {
	background-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-search-results::-webkit-scrollbar-thumb:hover {
	background-color: var(--arif-ai-text-muted);
}

/* =========================================================================
   STREAMING RESPONSE STYLES
   ========================================================================= */

/* Streaming message container */
.arif-ai-message.arif-ai-streaming {
	min-height: 40px;
}

/* Streaming cursor animation */
.arif-ai-streaming-cursor {
	display: inline-block;
	width: 2px;
	height: 1em;
	background-color: var(--arif-ai-primary);
	margin-left: 2px;
	animation: arif-ai-blink 1s step-end infinite;
	vertical-align: text-bottom;
}

@keyframes arif-ai-blink {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0;
	}
}

/* Status dot for streaming */
.arif-ai-status-dot.streaming {
	background-color: #f59e0b;
	animation: arif-ai-pulse 1.5s ease-in-out infinite;
}

@keyframes arif-ai-pulse {

	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(1.2);
		opacity: 0.7;
	}
}

/* Tool indicator during streaming (hidden — replaced by summary badge) */
.arif-ai-tool-indicator {
	display: none !important;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--arif-ai-bg-light);
	border-radius: 8px;
	margin-bottom: 8px;
	font-size: 13px;
	color: var(--arif-ai-text-muted);
	border: 1px dashed var(--arif-ai-border);
}

.arif-ai-tool-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid var(--arif-ai-border);
	border-top-color: var(--arif-ai-primary);
	border-radius: 50%;
	animation: arif-ai-spin 0.8s linear infinite;
}

@keyframes arif-ai-spin {
	to {
		transform: rotate(360deg);
	}
}

.arif-ai-tool-check {
	color: #10b981;
	font-weight: bold;
	font-size: 14px;
}

.arif-ai-tool-error {
	color: #ef4444;
	font-weight: bold;
	font-size: 14px;
}

.arif-ai-tool-indicator.executing {
	border-color: var(--arif-ai-primary);
	background: rgba(102, 126, 234, 0.05);
}

.arif-ai-tool-indicator.success {
	border-color: #10b981;
	background: rgba(16, 185, 129, 0.05);
}

.arif-ai-tool-indicator.error {
	border-color: #ef4444;
	background: rgba(239, 68, 68, 0.05);
}

/* Dark mode streaming styles */
[data-theme="dark"] .arif-ai-streaming-cursor {
	background-color: var(--arif-ai-primary-light);
}

[data-theme="dark"] .arif-ai-tool-indicator {
	background: var(--arif-ai-bg-dark);
	border-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-tool-spinner {
	border-color: var(--arif-ai-border);
	border-top-color: var(--arif-ai-primary-light);
}

/* =========================================================================
   CHAT HISTORY PANEL STYLES
   ========================================================================= */

.arif-ai-history-panel {
	display: none;
	flex-direction: column;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--arif-ai-bg);
	z-index: 10;
}

.arif-ai-history-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid var(--arif-ai-border);
	flex-shrink: 0;
}

.arif-ai-history-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--arif-ai-text);
}

.arif-ai-history-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.arif-ai-history-new-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: var(--arif-ai-primary);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: var(--arif-ai-transition);
}

.arif-ai-history-new-btn:hover {
	background: var(--arif-ai-primary-dark);
	transform: translateY(-1px);
}

.arif-ai-history-new-btn svg {
	width: 14px;
	height: 14px;
}

.arif-ai-history-close {
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	color: var(--arif-ai-text-muted);
	border-radius: 6px;
	transition: var(--arif-ai-transition);
}

.arif-ai-history-close:hover {
	background: var(--arif-ai-bg-light);
	color: var(--arif-ai-text);
}

.arif-ai-history-close svg {
	width: 18px;
	height: 18px;
}

.arif-ai-history-list {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
}

.arif-ai-history-loading,
.arif-ai-history-error,
.arif-ai-history-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	text-align: center;
	color: var(--arif-ai-text-muted);
}

.arif-ai-history-empty svg {
	width: 48px;
	height: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.arif-ai-history-empty p {
	margin: 0 0 8px 0;
	font-size: 15px;
	font-weight: 500;
	color: var(--arif-ai-text);
}

.arif-ai-history-empty span {
	font-size: 13px;
}

.arif-ai-history-spinner {
	width: 24px;
	height: 24px;
	border: 2px solid var(--arif-ai-border);
	border-top-color: var(--arif-ai-primary);
	border-radius: 50%;
	animation: arif-ai-spin 0.8s linear infinite;
	margin-bottom: 12px;
}

.arif-ai-history-group {
	margin-bottom: 16px;
}

.arif-ai-history-date {
	font-size: 12px;
	font-weight: 600;
	color: var(--arif-ai-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 8px 12px 8px 0;
	margin-bottom: 4px;
}

.arif-ai-history-item {
	display: flex;
	align-items: stretch;
	background: var(--arif-ai-bg-light);
	border-radius: 10px;
	margin-bottom: 8px;
	overflow: hidden;
	transition: var(--arif-ai-transition);
	border: 1px solid transparent;
}

.arif-ai-history-item:hover {
	background: var(--arif-ai-bg);
	border-color: var(--arif-ai-border);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.arif-ai-history-item.active {
	border-color: var(--arif-ai-primary);
	background: rgba(102, 126, 234, 0.05);
}

.arif-ai-history-item-content {
	flex: 1;
	padding: 12px 14px;
	cursor: pointer;
	min-width: 0;
}

.arif-ai-history-item-title {
	font-size: 14px;
	font-weight: 500;
	color: var(--arif-ai-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 4px;
}

.arif-ai-history-item-preview {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.4;
}

.arif-ai-history-item-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	padding: 10px 12px;
	flex-shrink: 0;
}

.arif-ai-history-item-time {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-history-item-delete {
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: var(--arif-ai-text-muted);
	border-radius: 6px;
	opacity: 0;
	transition: var(--arif-ai-transition);
}

.arif-ai-history-item:hover .arif-ai-history-item-delete {
	opacity: 1;
}

.arif-ai-history-item-delete:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
}

.arif-ai-history-item-delete svg {
	width: 14px;
	height: 14px;
}

/* Dark mode history panel */
[data-theme="dark"] .arif-ai-history-panel {
	background: var(--arif-ai-bg-dark);
}

[data-theme="dark"] .arif-ai-history-header {
	border-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-history-item {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-history-item:hover {
	background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .arif-ai-history-item.active {
	background: rgba(102, 126, 234, 0.15);
}

/* =========================================================================
   CODE BLOCKS, TABLES, AND CHARTS STYLES
   ========================================================================= */

/* Markdown Typography */
.arif-ai-h2 {
	font-size: 18px;
	font-weight: 600;
	margin: 16px 0 8px 0;
	color: var(--arif-ai-text);
}

.arif-ai-h3 {
	font-size: 16px;
	font-weight: 600;
	margin: 14px 0 6px 0;
	color: var(--arif-ai-text);
}

.arif-ai-h4 {
	font-size: 14px;
	font-weight: 600;
	margin: 12px 0 4px 0;
	color: var(--arif-ai-text);
}

.arif-ai-hr {
	border: none;
	border-top: 1px solid var(--arif-ai-border);
	margin: 16px 0;
}

.arif-ai-list {
	margin: 8px 0;
	padding-left: 24px;
}

.arif-ai-list li {
	margin: 4px 0;
	line-height: 1.5;
}

.arif-ai-blockquote {
	border-left: 3px solid var(--arif-ai-primary);
	margin: 12px 0;
	padding: 8px 16px;
	background: var(--arif-ai-bg-light);
	border-radius: 0 8px 8px 0;
	color: var(--arif-ai-text-muted);
	font-style: italic;
}

.arif-ai-link {
	color: var(--arif-ai-primary);
	text-decoration: none;
}

.arif-ai-link:hover {
	text-decoration: underline;
}

/* Images */
.arif-ai-image-wrapper {
	margin: 12px 0;
	text-align: center;
}

.arif-ai-image {
	max-width: 100%;
	max-height: 300px;
	border-radius: 8px;
	border: 1px solid var(--arif-ai-border);
	object-fit: contain;
}

.arif-ai-image-error {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
	border: 1px solid #fecaca;
	border-radius: 10px;
	color: #991b1b;
	font-size: 13px;
}

.arif-ai-image-error svg {
	flex-shrink: 0;
	opacity: 0.7;
}

/* Inline Code */
.arif-ai-inline-code {
	background: rgba(102, 126, 234, 0.1);
	color: #e53e3e;
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
	font-size: 0.9em;
}

/* Code Blocks */
.arif-ai-code-block {
	margin: 12px 0;
	border-radius: 10px;
	overflow: hidden;
	background: #1e1e1e;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.arif-ai-code-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px;
	background: rgba(255, 255, 255, 0.05);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.arif-ai-code-lang {
	font-size: 12px;
	color: #888;
	text-transform: uppercase;
	font-weight: 500;
}

.arif-ai-code-copy {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 6px;
	color: #aaa;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.arif-ai-code-copy:hover {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.arif-ai-code-copy.copied {
	background: rgba(16, 185, 129, 0.2);
	color: #10b981;
}

.arif-ai-pre {
	margin: 0;
	padding: 14px;
	overflow-x: auto;
	max-height: 400px;
	overflow-y: auto;
}

.arif-ai-code {
	font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
	font-size: 13px;
	line-height: 1.5;
	color: #d4d4d4;
	white-space: pre;
	tab-size: 4;
}

/* Syntax Highlighting */
.arif-ai-hl-keyword {
	color: #c586c0;
}

.arif-ai-hl-string {
	color: #ce9178;
}

.arif-ai-hl-number {
	color: #b5cea8;
}

.arif-ai-hl-comment {
	color: #6a9955;
	font-style: italic;
}

.arif-ai-hl-function {
	color: #dcdcaa;
}

.arif-ai-hl-tag {
	color: #569cd6;
}

.arif-ai-hl-attr {
	color: #9cdcfe;
}

.arif-ai-hl-key {
	color: #9cdcfe;
}

.arif-ai-hl-selector {
	color: #d7ba7d;
}

.arif-ai-hl-property {
	color: #9cdcfe;
}

.arif-ai-hl-value {
	color: #ce9178;
}

.arif-ai-hl-decorator {
	color: #dcdcaa;
}

.arif-ai-hl-command {
	color: #569cd6;
}

.arif-ai-hl-variable {
	color: #4ec9b0;
}

.arif-ai-hl-flag {
	color: #9cdcfe;
}

/* Tables */
.arif-ai-table-wrapper {
	margin: 12px 0;
	overflow-x: auto;
	border-radius: 10px;
	border: 1px solid var(--arif-ai-border);
}

.arif-ai-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.arif-ai-table th,
.arif-ai-table td {
	padding: 10px 14px;
	border-bottom: 1px solid var(--arif-ai-border);
}

.arif-ai-table th {
	background: var(--arif-ai-bg-light);
	font-weight: 600;
	color: var(--arif-ai-text);
	text-align: left;
}

.arif-ai-table tbody tr:hover {
	background: var(--arif-ai-bg-light);
}

.arif-ai-table tbody tr:last-child td {
	border-bottom: none;
}

/* Charts */
.arif-ai-chart {
	margin: 12px 0;
	padding: 16px;
	background: var(--arif-ai-bg-light);
	border-radius: 10px;
	border: 1px solid var(--arif-ai-border);
}

.arif-ai-chart-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--arif-ai-text);
	margin-bottom: 12px;
	text-align: center;
}

.arif-ai-chart-svg {
	width: 100%;
	height: auto;
	max-width: 400px;
	display: block;
	margin: 0 auto;
}

.arif-ai-chart-svg-pie {
	max-width: 200px;
}

.arif-ai-chart-label {
	font-size: 11px;
	fill: var(--arif-ai-text-muted);
	font-family: inherit;
}

.arif-ai-chart-pie-container {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	flex-wrap: wrap;
}

.arif-ai-chart-legend {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.arif-ai-chart-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.arif-ai-chart-legend-color {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	flex-shrink: 0;
}

.arif-ai-chart-legend-label {
	color: var(--arif-ai-text);
}

/* Dark mode adjustments for formatted content */
[data-theme="dark"] .arif-ai-inline-code {
	background: rgba(102, 126, 234, 0.2);
	color: #f87171;
}

[data-theme="dark"] .arif-ai-blockquote {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-table th {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-chart {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-chart-label {
	fill: #9ca3af;
}

/* =========================================================================
   PROACTIVE RECOMMENDATIONS STYLES
   ========================================================================= */

/* Recommendation badge */
.arif-ai-rec-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: #2563eb;
	color: white;
	font-size: 9px;
	font-weight: 600;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.arif-ai-rec-badge.critical {
	background: #dc2626;
	animation: arif-ai-pulse 2s infinite;
}

.arif-ai-rec-badge.high {
	background: #ea580c;
}

/* Recommendations panel */
.arif-ai-recommendations-panel {
	position: absolute;
	top: 60px;
	left: 0;
	right: 0;
	bottom: 60px;
	display: flex;
	flex-direction: column;
	background: var(--arif-ai-bg, #ffffff);
	z-index: 10;
	overflow: hidden;
}

.arif-ai-recommendations-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--arif-ai-bg);
	border-bottom: 1px solid var(--arif-ai-border);
	flex-shrink: 0;
	/* Prevent header from shrinking */
}

.arif-ai-recommendations-header h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--arif-ai-text);
}

.arif-ai-rec-refresh,
.arif-ai-rec-close {
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: var(--arif-ai-text-muted);
	border-radius: 4px;
	transition: all 0.2s;
}

.arif-ai-rec-refresh:hover,
.arif-ai-rec-close:hover {
	background: var(--arif-ai-bg-light);
	color: var(--arif-ai-text);
}

.arif-ai-rec-refresh svg,
.arif-ai-rec-close svg {
	width: 18px;
	height: 18px;
}

.arif-ai-rec-refresh.spinning svg {
	animation: arif-ai-spin 1s linear infinite;
}

/* Recommendations content */
.arif-ai-rec-content {
	flex: 1 1 0;
	/* Explicit flex-grow, flex-shrink, flex-basis */
	min-height: 0;
	/* Required for flexbox overflow scrolling */
	height: 0;
	/* Force height calculation in flex context */
	overflow-y: auto;
	overflow-x: hidden;
	padding: 12px;
}

/* Scrollbar styling for recommendations */
.arif-ai-rec-content::-webkit-scrollbar {
	width: 6px;
}

.arif-ai-rec-content::-webkit-scrollbar-track {
	background: transparent;
}

.arif-ai-rec-content::-webkit-scrollbar-thumb {
	background-color: var(--arif-ai-border);
	border-radius: 3px;
}

.arif-ai-rec-content::-webkit-scrollbar-thumb:hover {
	background-color: var(--arif-ai-text-muted);
}

.arif-ai-rec-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 200px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-rec-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid var(--arif-ai-border);
	border-top-color: var(--arif-ai-primary);
	border-radius: 50%;
	animation: arif-ai-spin 1s linear infinite;
	margin-bottom: 12px;
}

.arif-ai-rec-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 200px;
	color: var(--arif-ai-text-muted);
	text-align: center;
	padding: 20px;
}

.arif-ai-rec-empty svg {
	width: 48px;
	height: 48px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.arif-ai-rec-empty p {
	margin: 0 0 4px;
	font-weight: 500;
}

.arif-ai-rec-empty span {
	font-size: 13px;
}

/* Recommendations list */
.arif-ai-rec-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.arif-ai-rec-summary {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 8px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--arif-ai-border);
}

.arif-ai-rec-summary span {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 4px;
}

.arif-ai-rec-summary span.critical {
	background: #fef2f2;
	color: #dc2626;
}

.arif-ai-rec-summary span.high {
	background: #fff7ed;
	color: #ea580c;
}

.arif-ai-rec-summary span.medium {
	background: #fefce8;
	color: #ca8a04;
}

.arif-ai-rec-summary span.low {
	background: #f0fdf4;
	color: #16a34a;
}

/* Recommendation item */
.arif-ai-rec-item {
	background: var(--arif-ai-bg);
	border: 1px solid var(--arif-ai-border);
	border-radius: 8px;
	padding: 12px;
	transition: all 0.3s ease;
}

.arif-ai-rec-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.arif-ai-rec-item.critical {
	border-left: 3px solid #dc2626;
}

.arif-ai-rec-item.high {
	border-left: 3px solid #ea580c;
}

.arif-ai-rec-item.medium {
	border-left: 3px solid #ca8a04;
}

.arif-ai-rec-item.low {
	border-left: 3px solid #16a34a;
}

.arif-ai-rec-item.info {
	border-left: 3px solid #2563eb;
}

.arif-ai-rec-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.arif-ai-rec-category {
	font-size: 11px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-rec-priority {
	font-size: 10px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
	text-transform: uppercase;
}

.arif-ai-rec-priority.critical {
	background: #fef2f2;
	color: #dc2626;
}

.arif-ai-rec-priority.high {
	background: #fff7ed;
	color: #ea580c;
}

.arif-ai-rec-priority.medium {
	background: #fefce8;
	color: #ca8a04;
}

.arif-ai-rec-priority.low {
	background: #f0fdf4;
	color: #16a34a;
}

.arif-ai-rec-priority.info {
	background: #eff6ff;
	color: #2563eb;
}

.arif-ai-rec-title {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--arif-ai-text);
}

.arif-ai-rec-description {
	font-size: 13px;
	color: var(--arif-ai-text-muted);
	line-height: 1.5;
	margin-bottom: 12px;
}

.arif-ai-rec-description p {
	margin: 0 0 8px;
}

.arif-ai-rec-description ul,
.arif-ai-rec-description ol {
	margin: 8px 0;
	padding-left: 20px;
}

.arif-ai-rec-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.arif-ai-rec-action-btn {
	flex: 1;
	padding: 8px 12px;
	background: var(--arif-ai-primary);
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.arif-ai-rec-action-btn:hover {
	background: var(--arif-ai-primary-dark);
}

.arif-ai-rec-dismiss-btn {
	padding: 8px;
	background: none;
	border: 1px solid var(--arif-ai-border);
	border-radius: 6px;
	cursor: pointer;
	color: var(--arif-ai-text-muted);
	transition: all 0.2s;
}

.arif-ai-rec-dismiss-btn:hover {
	background: #fef2f2;
	border-color: #fecaca;
	color: #dc2626;
}

.arif-ai-rec-dismiss-btn svg {
	width: 14px;
	height: 14px;
}

/* Recommendation toast notification */
.arif-ai-rec-toast {
	position: fixed;
	bottom: 100px;
	right: 20px;
	width: 320px;
	max-width: calc(100vw - 40px);
	background: white;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	border-left: 4px solid #2563eb;
	padding: 12px;
	z-index: 1000000;
	animation: arif-ai-slide-in 0.3s ease;
	transition: opacity 0.3s ease;
}

@keyframes arif-ai-slide-in {
	from {
		transform: translateX(100%);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.arif-ai-rec-toast-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.arif-ai-rec-toast-category {
	font-size: 11px;
	color: #6b7280;
}

.arif-ai-rec-toast-header button {
	background: none;
	border: none;
	font-size: 18px;
	color: #9ca3af;
	cursor: pointer;
	line-height: 1;
}

.arif-ai-rec-toast-title {
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 4px;
}

.arif-ai-rec-toast-desc {
	font-size: 12px;
	color: #6b7280;
	margin-bottom: 8px;
	line-height: 1.4;
}

.arif-ai-rec-toast-view {
	width: 100%;
	padding: 8px;
	background: #f3f4f6;
	border: none;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	transition: all 0.2s;
}

.arif-ai-rec-toast-view:hover {
	background: #e5e7eb;
}

/* Dark mode recommendations styles */
[data-theme="dark"] .arif-ai-recommendations-panel {
	background: var(--arif-ai-bg);
}

[data-theme="dark"] .arif-ai-recommendations-header {
	background: var(--arif-ai-bg);
	border-bottom-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-rec-content::-webkit-scrollbar-thumb {
	background-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-rec-content::-webkit-scrollbar-thumb:hover {
	background-color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-rec-item {
	background: var(--arif-ai-bg-dark);
	border-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-rec-title {
	color: var(--arif-ai-text);
}

[data-theme="dark"] .arif-ai-rec-description {
	color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-rec-summary span.critical {
	background: rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .arif-ai-rec-summary span.high {
	background: rgba(234, 88, 12, 0.2);
}

[data-theme="dark"] .arif-ai-rec-summary span.medium {
	background: rgba(202, 138, 4, 0.2);
}

[data-theme="dark"] .arif-ai-rec-summary span.low {
	background: rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .arif-ai-rec-toast {
	background: var(--arif-ai-bg-dark);
}

[data-theme="dark"] .arif-ai-rec-toast-title {
	color: var(--arif-ai-text);
}

[data-theme="dark"] .arif-ai-rec-toast-desc {
	color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-rec-toast-view {
	background: var(--arif-ai-bg);
	color: var(--arif-ai-text);
}

/* ==========================================
   Edit/Regenerate/Version System Styles
   ========================================== */

/* Message wrapper for positioning actions */
.arif-ai-message-wrapper {
	position: relative;
}

/* Message action buttons container */
.arif-ai-message-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	opacity: 0;
	transition: opacity 0.2s ease;
	margin-top: 6px;
}

.arif-ai-message:hover .arif-ai-message-actions {
	opacity: 1;
}

/* Touch devices: always show actions */
@media (hover: none) {
	.arif-ai-message-actions {
		opacity: 1;
	}
}

/* Individual action button */
.arif-ai-msg-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 4px 8px;
	border: none;
	background: rgba(0, 0, 0, 0.05);
	color: var(--arif-ai-text-muted);
	font-size: 11px;
	font-weight: 500;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.arif-ai-msg-action-btn:hover {
	background: var(--arif-ai-tool-bg);
	color: var(--arif-ai-primary);
}

.arif-ai-msg-action-btn svg {
	width: 12px;
	height: 12px;
}

/* User message action buttons - use standard colors since buttons are outside the gradient */
.arif-ai-message-user .arif-ai-msg-action-btn {
	background: rgba(102, 126, 234, 0.1);
	color: var(--arif-ai-primary);
}

.arif-ai-message-user .arif-ai-msg-action-btn:hover {
	background: rgba(102, 126, 234, 0.2);
	color: var(--arif-ai-primary);
}

/* Version navigation container */
.arif-ai-version-nav {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 8px;
	padding: 2px 6px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	font-size: 11px;
}

.arif-ai-message-user .arif-ai-version-nav {
	background: rgba(102, 126, 234, 0.1);
}

/* Version navigation arrows */
.arif-ai-version-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border: none;
	background: transparent;
	color: var(--arif-ai-text-muted);
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.2s ease;
	padding: 0;
}

.arif-ai-version-arrow:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.1);
	color: var(--arif-ai-primary);
}

.arif-ai-version-arrow:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.arif-ai-version-arrow svg {
	width: 12px;
	height: 12px;
}

/* User message version arrows */
.arif-ai-message-user .arif-ai-version-arrow {
	color: var(--arif-ai-primary);
}

.arif-ai-message-user .arif-ai-version-arrow:hover:not(:disabled) {
	background: rgba(102, 126, 234, 0.2);
	color: var(--arif-ai-primary);
}

/* Version indicator text */
.arif-ai-version-indicator {
	font-weight: 600;
	color: var(--arif-ai-text-muted);
	min-width: 24px;
	text-align: center;
}

.arif-ai-message-user .arif-ai-version-indicator {
	color: var(--arif-ai-primary);
}

/* ===== Edit Mode Styles ===== */

.arif-ai-edit-mode {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.arif-ai-edit-textarea {
	width: 100%;
	min-height: 80px;
	max-height: 200px;
	padding: 10px 12px;
	border: 2px solid var(--arif-ai-primary);
	border-radius: 8px;
	background: var(--arif-ai-bg);
	color: var(--arif-ai-text);
	font-size: 14px;
	font-family: inherit;
	line-height: 1.5;
	resize: vertical;
	outline: none;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.arif-ai-edit-textarea:focus {
	border-color: var(--arif-ai-primary);
	box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.arif-ai-edit-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.arif-ai-edit-cancel,
.arif-ai-edit-save {
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.arif-ai-edit-cancel {
	background: transparent;
	border: 1px solid var(--arif-ai-border);
	color: var(--arif-ai-text-muted);
}

.arif-ai-edit-cancel:hover {
	background: var(--arif-ai-tool-bg);
	border-color: var(--arif-ai-text-muted);
}

.arif-ai-edit-save {
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border: none;
	color: #ffffff;
}

.arif-ai-edit-save:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.arif-ai-edit-save:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* ===== Regenerating State ===== */

.arif-ai-regenerating {
	position: relative;
}

.arif-ai-regenerating .arif-ai-message-content {
	opacity: 0.6;
}

/* Loading indicator inside the message */
.arif-ai-regenerate-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	color: var(--arif-ai-text-secondary);
	font-size: 13px;
}

.arif-ai-regenerate-loading .arif-ai-loading-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid var(--arif-ai-border);
	border-top-color: var(--arif-ai-primary);
	border-radius: 50%;
	animation: arif-ai-regenerate-spin 0.8s linear infinite;
}

@keyframes arif-ai-regenerate-spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* ===== Toast Notifications ===== */

.arif-ai-toast-container {
	position: fixed;
	bottom: 100px;
	right: 24px;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

.arif-ai-toast {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: var(--arif-ai-bg);
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	border: 1px solid var(--arif-ai-border);
	font-size: 13px;
	color: var(--arif-ai-text);
	animation: arif-ai-toast-in 0.3s ease;
	pointer-events: auto;
}

.arif-ai-toast.success {
	border-left: 3px solid var(--arif-ai-success);
}

.arif-ai-toast.error {
	border-left: 3px solid var(--arif-ai-error);
}

.arif-ai-toast.info {
	border-left: 3px solid var(--arif-ai-primary);
}

.arif-ai-toast-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.arif-ai-toast.success .arif-ai-toast-icon {
	color: var(--arif-ai-success);
}

.arif-ai-toast.error .arif-ai-toast-icon {
	color: var(--arif-ai-error);
}

.arif-ai-toast.info .arif-ai-toast-icon {
	color: var(--arif-ai-primary);
}

@keyframes arif-ai-toast-in {
	from {
		opacity: 0;
		transform: translateX(50px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.arif-ai-toast-out {
	animation: arif-ai-toast-out 0.3s ease forwards;
}

@keyframes arif-ai-toast-out {
	from {
		opacity: 1;
		transform: translateX(0);
	}

	to {
		opacity: 0;
		transform: translateX(50px);
	}
}

/* ===== Message Attachments Display ===== */

.arif-ai-message-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.arif-ai-attachment-thumb {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 6px;
	font-size: 12px;
	color: var(--arif-ai-text);
	cursor: pointer;
	transition: all 0.2s ease;
	max-width: 150px;
}

.arif-ai-attachment-thumb:hover {
	background: rgba(0, 0, 0, 0.12);
}

.arif-ai-message-user .arif-ai-attachment-thumb {
	background: rgba(255, 255, 255, 0.15);
	color: rgba(255, 255, 255, 0.9);
}

.arif-ai-message-user .arif-ai-attachment-thumb:hover {
	background: rgba(255, 255, 255, 0.25);
}

.arif-ai-attachment-thumb svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.arif-ai-attachment-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.arif-ai-attachment-image-thumb {
	width: 60px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.2s ease;
}

.arif-ai-attachment-image-thumb:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.arif-ai-attachment-image-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ===== Dark Mode for Edit/Version Styles ===== */

[data-theme="dark"] .arif-ai-msg-action-btn {
	background: rgba(255, 255, 255, 0.08);
	color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-msg-action-btn:hover {
	background: rgba(102, 126, 234, 0.2);
	color: var(--arif-ai-primary);
}

[data-theme="dark"] .arif-ai-version-nav {
	background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .arif-ai-version-arrow:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .arif-ai-edit-textarea {
	background: var(--arif-ai-bg-dark);
	border-color: var(--arif-ai-primary);
	color: var(--arif-ai-text);
}

[data-theme="dark"] .arif-ai-edit-cancel {
	background: rgba(255, 255, 255, 0.05);
	border-color: var(--arif-ai-border);
	color: var(--arif-ai-text-muted);
}

[data-theme="dark"] .arif-ai-edit-cancel:hover {
	background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .arif-ai-toast {
	background: var(--arif-ai-bg-dark);
	border-color: var(--arif-ai-border);
}

[data-theme="dark"] .arif-ai-attachment-thumb {
	background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .arif-ai-attachment-thumb:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* ===== Responsive Adjustments ===== */

@media (max-width: 480px) {
	.arif-ai-message-actions {
		opacity: 1;
		/* Always show on mobile */
	}

	.arif-ai-msg-action-btn {
		padding: 6px 10px;
		font-size: 12px;
	}

	.arif-ai-version-nav {
		margin-left: 4px;
	}

	.arif-ai-toast-container {
		left: 16px;
		right: 16px;
		bottom: 80px;
	}

	.arif-ai-toast {
		width: 100%;
	}
}

/* ===== Export Dropdown ===== */
.arif-ai-export-dropdown {
	position: absolute;
	top: 60px;
	right: 16px;
	background: var(--arif-ai-bg);
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
	border: 1px solid var(--arif-ai-border);
	z-index: 1000;
	min-width: 200px;
	overflow: hidden;
	animation: arif-ai-dropdown-in 0.2s ease;
}

@keyframes arif-ai-dropdown-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.arif-ai-export-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	cursor: pointer;
	transition: background 0.15s ease;
	color: var(--arif-ai-text);
	font-size: 14px;
}

.arif-ai-export-option:hover {
	background: var(--arif-ai-bg-light);
}

.arif-ai-export-option:active {
	background: var(--arif-ai-tool-bg);
}

.arif-ai-export-option svg {
	width: 18px;
	height: 18px;
	color: var(--arif-ai-primary);
	flex-shrink: 0;
}

.arif-ai-export-option span {
	flex: 1;
}

.arif-ai-export-option:not(:last-child) {
	border-bottom: 1px solid var(--arif-ai-border);
}

/* ===== Slash Command Suggestions ===== */
.arif-ai-command-suggestions {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 20px;
	right: 20px;
	background: var(--arif-ai-bg);
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
	border: 1px solid var(--arif-ai-border);
	z-index: 1000;
	max-height: 280px;
	overflow-y: auto;
	animation: arif-ai-suggestions-in 0.2s ease;
}

@keyframes arif-ai-suggestions-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.arif-ai-command-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.arif-ai-command-item:hover,
.arif-ai-command-item.selected {
	background: var(--arif-ai-bg-light);
}

.arif-ai-command-item:active {
	background: var(--arif-ai-tool-bg);
}

.arif-ai-command-icon {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
	border-radius: 8px;
	flex-shrink: 0;
}

.arif-ai-command-icon svg {
	width: 16px;
	height: 16px;
	color: var(--arif-ai-primary);
}

.arif-ai-command-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.arif-ai-command-name {
	font-weight: 600;
	font-size: 14px;
	color: var(--arif-ai-text);
}

.arif-ai-command-desc {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.arif-ai-command-item:not(:last-child) {
	border-bottom: 1px solid var(--arif-ai-border);
}

/* Dark mode for export and commands */
[data-theme="dark"] .arif-ai-export-dropdown {
	background: #1a1a2e;
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .arif-ai-export-option:hover {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-command-suggestions {
	background: #1a1a2e;
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .arif-ai-command-item:hover,
[data-theme="dark"] .arif-ai-command-item.selected {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-command-icon {
	background: rgba(102, 126, 234, 0.15);
}

/* ===== Blueprint Execution Progress ===== */
.arif-ai-blueprint-progress {
	background: var(--arif-ai-surface);
	border: 1px solid var(--arif-ai-border);
	border-radius: 12px;
	padding: 16px;
	margin: 12px 0;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.arif-ai-blueprint-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 12px;
}

.arif-ai-blueprint-icon {
	width: 40px;
	height: 40px;
	background: linear-gradient(135deg, var(--arif-ai-primary) 0%, #764ba2 100%);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.arif-ai-blueprint-icon svg {
	width: 22px;
	height: 22px;
	color: white;
}

.arif-ai-blueprint-title {
	flex: 1;
	min-width: 0;
}

.arif-ai-blueprint-name {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: var(--arif-ai-text);
	margin-bottom: 4px;
}

.arif-ai-blueprint-status {
	display: block;
	font-size: 12px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-blueprint-status-success {
	color: #10b981 !important;
}

.arif-ai-blueprint-status-warning {
	color: #f59e0b !important;
}

.arif-ai-blueprint-status-error {
	color: #ef4444 !important;
}

/* Progress Bar */
.arif-ai-blueprint-progress-bar {
	height: 6px;
	background: var(--arif-ai-tool-bg);
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 16px;
}

.arif-ai-blueprint-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--arif-ai-primary), #764ba2);
	border-radius: 3px;
	transition: width 0.3s ease;
}

.arif-ai-blueprint-progress-error {
	background: #ef4444 !important;
}

/* Sections List */
.arif-ai-blueprint-sections {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.arif-ai-blueprint-section {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--arif-ai-tool-bg);
	border-radius: 8px;
	transition: background 0.2s ease;
}

.arif-ai-blueprint-section-processing {
	background: rgba(102, 126, 234, 0.1);
}

.arif-ai-blueprint-section-success {
	background: rgba(16, 185, 129, 0.1);
}

.arif-ai-blueprint-section-error {
	background: rgba(239, 68, 68, 0.1);
}

.arif-ai-blueprint-section-skipped {
	background: rgba(156, 163, 175, 0.1);
}

.arif-ai-blueprint-section-warning {
	background: rgba(245, 158, 11, 0.1);
}

.arif-ai-blueprint-section-icon {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	flex-shrink: 0;
}

.arif-ai-blueprint-check {
	color: #10b981;
	font-weight: bold;
}

.arif-ai-blueprint-x {
	color: #ef4444;
	font-weight: bold;
}

.arif-ai-blueprint-skip {
	color: #9ca3af;
}

.arif-ai-blueprint-warn {
	color: #f59e0b;
}

/* Spinner animation */
.arif-ai-blueprint-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid var(--arif-ai-primary);
	border-top-color: transparent;
	border-radius: 50%;
	animation: blueprint-spin 0.8s linear infinite;
}

@keyframes blueprint-spin {
	to {
		transform: rotate(360deg);
	}
}

.arif-ai-blueprint-section-name {
	flex: 1;
	font-size: 13px;
	font-weight: 500;
	color: var(--arif-ai-text);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.arif-ai-blueprint-section-detail {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
	flex-shrink: 0;
}

.arif-ai-blueprint-count {
	color: #10b981;
	font-weight: 500;
}

.arif-ai-blueprint-error-msg {
	color: #ef4444;
}

.arif-ai-blueprint-skip-msg {
	color: #9ca3af;
	font-style: italic;
}

.arif-ai-blueprint-warn-msg {
	color: #f59e0b;
}

/* Summary */
.arif-ai-blueprint-summary {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--arif-ai-border);
}

.arif-ai-blueprint-summary-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	font-size: 13px;
	color: var(--arif-ai-text);
}

.arif-ai-blueprint-summary-icon {
	font-weight: bold;
}

.arif-ai-blueprint-summary-item:first-child .arif-ai-blueprint-summary-icon {
	color: #10b981;
}

.arif-ai-blueprint-summary-error .arif-ai-blueprint-summary-icon {
	color: #ef4444;
}

.arif-ai-blueprint-summary-skipped .arif-ai-blueprint-summary-icon {
	color: #9ca3af;
}

.arif-ai-blueprint-summary-actions {
	margin-top: 12px;
}

.arif-ai-blueprint-rollback-msg {
	color: #10b981;
	font-weight: 500;
	padding: 8px;
	background: rgba(16, 185, 129, 0.1);
	border-radius: 6px;
	text-align: center;
}

/* Confirmation Dialog */
.arif-ai-blueprint-confirm {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px;
	background: rgba(245, 158, 11, 0.1);
	border: 1px solid rgba(245, 158, 11, 0.3);
	border-radius: 12px;
	margin: 12px 0;
	flex-shrink: 0;
}

.arif-ai-blueprint-confirm-icon {
	font-size: 24px;
	flex-shrink: 0;
}

.arif-ai-blueprint-confirm-content {
	flex: 1;
	min-width: 0;
}

.arif-ai-blueprint-confirm-title {
	font-weight: 600;
	font-size: 14px;
	color: #b45309;
	margin-bottom: 4px;
}

.arif-ai-blueprint-confirm-msg {
	font-size: 13px;
	color: var(--arif-ai-text);
	margin-bottom: 8px;
}

.arif-ai-blueprint-confirm-section {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-blueprint-confirm-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* Button styles */
.arif-ai-btn {
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
}

.arif-ai-btn-primary {
	background: var(--arif-ai-primary);
	color: white;
}

.arif-ai-btn-primary:hover {
	background: #5a6fd6;
}

.arif-ai-btn-secondary {
	background: var(--arif-ai-tool-bg);
	color: var(--arif-ai-text);
	border: 1px solid var(--arif-ai-border);
}

.arif-ai-btn-secondary:hover {
	background: var(--arif-ai-border);
}

.arif-ai-btn-link {
	background: transparent;
	color: var(--arif-ai-primary);
	padding: 4px 8px;
}

.arif-ai-btn-link:hover {
	text-decoration: underline;
}

/* Complete state animation */
.arif-ai-blueprint-complete .arif-ai-blueprint-progress-fill {
	background: linear-gradient(90deg, #10b981, #059669);
}

.arif-ai-blueprint-error .arif-ai-blueprint-progress-fill {
	background: #ef4444;
}

/* Dark mode for blueprint */
[data-theme="dark"] .arif-ai-blueprint-progress {
	background: #1a1a2e;
	border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .arif-ai-blueprint-section {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-blueprint-section-processing {
	background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .arif-ai-blueprint-section-success {
	background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .arif-ai-blueprint-section-error {
	background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .arif-ai-blueprint-confirm {
	background: rgba(245, 158, 11, 0.15);
	border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .arif-ai-blueprint-confirm-title {
	color: #fbbf24;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Interactive Blueprint Execution (New Flow)
   ═══════════════════════════════════════════════════════════════════════════ */

.arif-ai-blueprint-interactive {
	border-left: 3px solid var(--arif-ai-accent);
}

.arif-ai-blueprint-actions-container {
	padding: 12px;
	border-top: 1px solid var(--arif-ai-border);
}

.arif-ai-blueprint-preview {
	background: var(--arif-ai-bg-secondary);
	border-radius: 8px;
	padding: 12px;
}

.arif-ai-blueprint-preview-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.arif-ai-blueprint-preview-index {
	background: var(--arif-ai-accent);
	color: white;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
}

.arif-ai-blueprint-preview-title {
	font-weight: 600;
	font-size: 14px;
	color: var(--arif-ai-text);
}

.arif-ai-blueprint-preview-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.arif-ai-blueprint-tool-badge {
	background: var(--arif-ai-bg);
	border: 1px solid var(--arif-ai-border);
	padding: 4px 10px;
	border-radius: 16px;
	font-size: 12px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-blueprint-tool-badge small {
	opacity: 0.7;
	margin-left: 4px;
}

.arif-ai-blueprint-preview-count {
	font-size: 12px;
	color: var(--arif-ai-text-muted);
	margin-bottom: 12px;
}

.arif-ai-blueprint-preview-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.arif-ai-blueprint-processing {
	text-align: center;
	padding: 12px;
	color: var(--arif-ai-text-muted);
	font-size: 13px;
}

.arif-ai-btn-danger {
	background: #ef4444;
	color: white;
	border: none;
}

.arif-ai-btn-danger:hover {
	background: #dc2626;
}

/* Dark theme for interactive blueprint */
[data-theme="dark"] .arif-ai-blueprint-preview {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-blueprint-tool-badge {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Blueprint Sections Panel (New Section-by-Section Flow)
   ═══════════════════════════════════════════════════════════════════════════ */

.arif-ai-blueprint-panel {
	background: var(--arif-ai-bg);
	border-radius: 12px;
	border: 1px solid var(--arif-ai-border);
	margin: 8px 0;
	overflow: hidden;
	flex-shrink: 0;
}

.arif-ai-bp-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: linear-gradient(135deg, var(--arif-ai-accent, var(--arif-ai-primary)) 0%, #6366f1 100%);
	color: white;
}

.arif-ai-bp-icon svg {
	width: 22px;
	height: 22px;
	stroke: white;
}

.arif-ai-bp-title-container {
	flex: 1;
}

.arif-ai-bp-title {
	font-weight: 600;
	font-size: 14px;
	display: block;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.arif-ai-bp-subtitle {
	font-size: 12px;
	opacity: 0.85;
}

.arif-ai-bp-progress-bar {
	height: 4px;
	background: var(--arif-ai-border);
}

.arif-ai-bp-progress-fill {
	height: 100%;
	background: var(--arif-ai-accent);
	transition: width 0.3s ease;
}

.arif-ai-bp-global-actions {
	padding: 10px 14px;
	background: var(--arif-ai-bg-secondary, #f8fafc);
	border-bottom: 1px solid var(--arif-ai-border);
	display: flex;
	gap: 8px;
}

.arif-ai-bp-sections {
	max-height: 300px;
	overflow-y: auto;
}

.arif-ai-chat.maximized .arif-ai-bp-sections {
	max-height: 50vh;
}

.arif-ai-bp-section {
	padding: 10px 14px;
	border-bottom: 1px solid var(--arif-ai-border);
	transition: background 0.2s ease;
}

.arif-ai-bp-section:hover {
	background: var(--arif-ai-bg-secondary);
}

.arif-ai-bp-section:last-child {
	border-bottom: none;
}

.arif-ai-bp-section-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.arif-ai-bp-section-num {
	background: var(--arif-ai-accent);
	color: white;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	flex-shrink: 0;
}

.arif-ai-bp-section-title {
	flex: 1;
	font-weight: 500;
	font-size: 14px;
	color: var(--arif-ai-text);
}

.arif-ai-bp-section-status {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 12px;
	background: var(--arif-ai-bg-secondary);
}

.arif-ai-bp-section-status.pending {
	color: #f59e0b;
	background: rgba(245, 158, 11, 0.1);
}

.arif-ai-bp-section-status.executing {
	color: #3b82f6;
	background: rgba(59, 130, 246, 0.1);
}

.arif-ai-bp-section-status.completed {
	color: #10b981;
	background: rgba(16, 185, 129, 0.1);
}

.arif-ai-bp-section-status.failed {
	color: #ef4444;
	background: rgba(239, 68, 68, 0.1);
}

.arif-ai-bp-section-status.skipped {
	color: #6b7280;
	background: rgba(107, 114, 128, 0.1);
}

.arif-ai-bp-section-status.not-executable {
	color: #9ca3af;
	background: rgba(156, 163, 175, 0.1);
}

.arif-ai-bp-section-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.arif-ai-bp-tool-badge {
	background: var(--arif-ai-bg-secondary);
	border: 1px solid var(--arif-ai-border);
	padding: 4px 10px;
	border-radius: 16px;
	font-size: 11px;
	color: var(--arif-ai-text-muted);
}

.arif-ai-bp-record-count {
	color: var(--arif-ai-text-muted);
	font-size: 11px;
}

.arif-ai-bp-destructive-badge {
	color: #f59e0b;
	font-size: 11px;
}

.arif-ai-bp-section-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.arif-ai-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

.arif-ai-btn-ghost {
	background: transparent;
	border: 1px solid var(--arif-ai-border);
	color: var(--arif-ai-text-muted);
}

.arif-ai-btn-ghost:hover {
	background: var(--arif-ai-bg-secondary);
}

.arif-ai-bp-section-details {
	margin-top: 10px;
	padding: 10px;
	background: var(--arif-ai-bg-secondary);
	border-radius: 8px;
	border: 1px solid var(--arif-ai-border);
}

.arif-ai-bp-params {
	margin: 0;
	font-size: 11px;
	color: var(--arif-ai-text-muted);
	white-space: pre-wrap;
	word-break: break-word;
	max-height: 200px;
	overflow-y: auto;
}

.arif-ai-bp-section-result {
	margin-top: 8px;
	font-size: 12px;
}

.arif-ai-bp-success {
	color: #10b981;
}

.arif-ai-bp-error {
	color: #ef4444;
	background: rgba(239, 68, 68, 0.1);
	padding: 8px;
	border-radius: 6px;
}

.arif-ai-bp-summary {
	padding: 16px;
	background: var(--arif-ai-bg-secondary);
	border-top: 1px solid var(--arif-ai-border);
}

.arif-ai-bp-summary-content {
	text-align: center;
}

.arif-ai-bp-summary-content strong {
	display: block;
	margin-bottom: 8px;
	color: var(--arif-ai-text);
}

.arif-ai-bp-summary-stats {
	display: flex;
	justify-content: center;
	gap: 16px;
	font-size: 13px;
}

.arif-ai-bp-summary-stats .stat-success {
	color: #10b981;
}

.arif-ai-bp-summary-stats .stat-failed {
	color: #ef4444;
}

.arif-ai-bp-summary-stats .stat-skipped {
	color: #6b7280;
}

/* Section status indicators for completed sections */
.arif-ai-bp-section[data-status="completed"] .arif-ai-bp-section-num {
	background: #10b981;
}

.arif-ai-bp-section[data-status="failed"] .arif-ai-bp-section-num {
	background: #ef4444;
}

.arif-ai-bp-section[data-status="skipped"] .arif-ai-bp-section-num {
	background: #6b7280;
}

.arif-ai-bp-section[data-status="executing"] .arif-ai-bp-section-num {
	background: #3b82f6;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.6;
	}
}

/* Dark theme for Blueprint Panel */
[data-theme="dark"] .arif-ai-blueprint-panel {
	background: var(--arif-ai-bg);
	border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .arif-ai-bp-section:hover {
	background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arif-ai-bp-section-details {
	background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .arif-ai-bp-summary {
	background: rgba(0, 0, 0, 0.2);
}

/* =========================================================================
   Escalation Banner
   ========================================================================= */

.arif-escalation-banner {
	position: relative;
	background: var(--arif-escalation-bg, #FEF3C7);
	border-top: 1px solid var(--arif-escalation-border, #F59E0B);
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 200ms ease-out, padding 200ms ease-out;
}

.arif-escalation-banner.arif-escalation-visible {
	max-height: 60px;
	padding: 8px 12px;
}

.arif-escalation-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.arif-escalation-text {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--arif-escalation-text, #92400E);
}

.arif-escalation-icon {
	flex-shrink: 0;
	color: var(--arif-escalation-icon, #D97706);
}

.arif-escalation-btn {
	flex-shrink: 0;
	background: var(--arif-escalation-btn-bg, #D97706);
	color: white;
	border: none;
	border-radius: 6px;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: background 150ms;
}

.arif-escalation-btn:hover {
	background: var(--arif-escalation-btn-hover, #B45309);
}

.arif-escalation-close {
	flex-shrink: 0;
	background: none;
	border: none;
	color: var(--arif-escalation-text, #92400E);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	opacity: 0.6;
}

.arif-escalation-close:hover {
	opacity: 1;
}

/* Dark mode */
[data-theme="dark"] .arif-escalation-banner {
	--arif-escalation-bg: #422006;
	--arif-escalation-border: #B45309;
	--arif-escalation-text: #FDE68A;
	--arif-escalation-icon: #FBBF24;
	--arif-escalation-btn-bg: #B45309;
	--arif-escalation-btn-hover: #D97706;
}

/* Responsive - narrow widget */
@media (max-width: 360px) {
	.arif-escalation-text span {
		display: none;
	}
	.arif-escalation-text::after {
		content: "Need help?";
		font-size: 13px;
	}
}

/* Embedded Support View */
.arif-support-view {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.arif-support-view.arif-support-visible {
	opacity: 1;
}

.arif-support-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--arif-support-header-bg, #F0F9FF);
	border-bottom: 1px solid var(--arif-support-header-border, #BAE6FD);
}

.arif-support-back-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	border-radius: 6px;
	cursor: pointer;
	color: var(--arif-support-back-color, #0369A1);
	transition: background 0.15s;
}

.arif-support-back-btn:hover {
	background: var(--arif-support-back-hover, rgba(3, 105, 161, 0.1));
}

.arif-support-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--arif-support-title-color, #0C4A6E);
	flex: 1;
}

.arif-support-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22C55E;
	flex-shrink: 0;
}

.arif-support-iframe-wrap {
	flex: 1;
	min-height: 0;
	position: relative;
}

.arif-support-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

.arif-support-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: var(--arif-support-title-color, #0C4A6E);
	font-size: 13px;
	background: var(--arif-support-header-bg, #F0F9FF);
	z-index: 1;
}

.arif-support-loading-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid var(--arif-support-header-border, #BAE6FD);
	border-top-color: var(--arif-support-back-color, #0369A1);
	border-radius: 50%;
	animation: arif-support-spin 0.8s linear infinite;
}

@keyframes arif-support-spin {
	to { transform: rotate(360deg); }
}

.arif-support-status-dot.arif-support-status-active {
	animation: arif-support-pulse 1.5s ease infinite;
}

@keyframes arif-support-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

/* Dark mode */
[data-theme="dark"] .arif-support-header {
	--arif-support-header-bg: #0C4A6E;
	--arif-support-header-border: #075985;
	--arif-support-back-color: #7DD3FC;
	--arif-support-back-hover: rgba(125, 211, 252, 0.1);
	--arif-support-title-color: #E0F2FE;
}