html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}
body {
	min-height: 100vh;
	height: 100vh;
	font-family: 'Saira', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: #fafafa;
	color: #1a1a1a;
	display: flex;
	flex-direction: column;
}

/* Page Loader */
.page-loader {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #fafafa;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.hidden {
	opacity: 0;
	visibility: hidden;
}

.page-loader .loader-logo {
	font-size: 2.5em;
	font-weight: 700;
	color: #000000;
	margin-bottom: 20px;
	letter-spacing: -0.02em;
}

.page-loader .loader-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e5e5;
	border-top-color: #000000;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.page-loader .loader-text {
	margin-top: 16px;
	font-size: 0.85em;
	color: #9ca3af;
	letter-spacing: 0.02em;
	animation: loaderTextPulse 2s ease-in-out infinite;
}

@keyframes loaderTextPulse {
	0%, 100% { opacity: 0.5; }
	50% { opacity: 1; }
}

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

/* Inline Loader */
.inline-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: #737373;
	font-size: 0.9em;
	padding: 40px 20px;
	min-height: 200px;
}

.inline-loader .spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #e5e5e5;
	border-top-color: #525252;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

/* Button Loading State */
.btn-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.btn-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

/* Button inline spinner (used inside button text) */
.btn-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}
.modal-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

/* Send button loading state */
.search-btn.send-loading {
	background: #404040;
	pointer-events: none;
}
.search-btn.send-loading .material-symbols-outlined {
	display: none;
}
.search-btn.send-loading::after {
	content: '';
	display: block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

/* Sidebar skeleton loader */
.sidebar-skeleton {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.skeleton-line {
	height: 38px;
	background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
	background-size: 200% 100%;
	border-radius: 8px;
	animation: skeletonShimmer 1.5s ease-in-out infinite;
}
.skeleton-line.short {
	width: 65%;
}

@keyframes skeletonShimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Tab deleting state */
.tab.tab-deleting {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}


/* Sidebar layout (ChatGPT-style) */
.sidebar-layout {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
}

.sidebar {
	width: 280px;
	background: #f9fafb;
	color: #1a1a1a;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #e5e5e5;
	transition: width 0.2s ease, transform 0.2s ease;
	overflow: hidden;
}

.sidebar.collapsed {
	width: 0;
	transform: translateX(-100%);
}

.sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 14px 10px 14px;
	gap: 8px;
}

.sidebar-toggle {
	border: none;
	background: transparent;
	color: #9ca3af;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover {
	background: #e5e7eb;
	color: #374151;
}

.sidebar-toggle.collapsed-only {
	position: fixed;
	top: 12px;
	left: 20px;
	z-index: 101;
	display: none;
}

.sidebar.collapsed + .main-shell .sidebar-toggle.collapsed-only {
	display: flex;
}

.new-chat-btn {
	flex: 1;
	border: 1px dashed #d1d5db;
	background: #ffffff;
	color: #374151;
	border-radius: 10px;
	padding: 10px 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 500;
	transition: all 0.2s ease;
}

.new-chat-btn .material-symbols-outlined {
	font-size: 20px;
}

.new-chat-btn:hover {
	background: #f0f0f0;
	border-color: #9ca3af;
	border-style: solid;
}

.new-chat-text {
	white-space: nowrap;
}

.chat-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 4px 10px 10px 10px;
}


.chat-list::-webkit-scrollbar {
	width: 4px;
}

.chat-list::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 999px;
}

.chat-list::-webkit-scrollbar-track {
	background: transparent;
}

.chat-list-label {
	font-size: 0.72em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9ca3af;
	padding: 12px 10px 6px 10px;
}

.tab {
	display: flex;
	align-items: center;
	padding: 10px 12px;
	margin: 2px 0;
	border-radius: 10px;
	font-size: 0.86em;
	color: #4b5563;
	cursor: pointer;
	border: none;
	background: transparent;
	transition: all 0.15s ease;
	gap: 10px;
}

.tab:hover:not(.active) {
	background: #ffffff;
	color: #111827;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tab.active {
	background: #ffffff;
	color: #111827;
	box-shadow: 0 1px 4px rgba(0,0,0,0.08);
	font-weight: 500;
}

.tab .tab-icon {
	font-size: 18px;
	color: #9ca3af;
	flex-shrink: 0;
}

.tab.active .tab-icon {
	color: #000000;
}

.tab-name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: left;
	line-height: 1.3;
}

.tab .close-btn {
	margin-left: 4px;
	color: #9ca3af;
	cursor: pointer;
	background: none;
	border: none;
	outline: none;
	transition: all 0.2s ease;
	opacity: 0;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	flex-shrink: 0;
}

.tab .close-btn .material-symbols-outlined {
	font-size: 16px;
}

.tab:hover .close-btn {
	opacity: 1;
}

.tab .close-btn:hover {
	color: #dc2626;
	background: #fee2e2;
}

.tab.active .close-btn:hover {
	color: #dc2626;
	background: #fee2e2;
}

.sidebar-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	color: #9ca3af;
	text-align: center;
	gap: 8px;
}

.sidebar-empty .material-symbols-outlined {
	font-size: 32px;
	color: #d1d5db;
}

.sidebar-empty p {
	font-size: 0.85em;
	line-height: 1.5;
}

.tab-bar .add-btn {
	display: none; /* no plus button in list; we use New chat */
}

.main-shell {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	position: relative;
}
/* Auth Section Styles */
.auth-section {
	position: fixed;
	top: 8px;
	right: 20px;
	display: flex;
	align-items: center;
	flex-direction: row;
	gap: 10px;
	z-index: 100;
}



/* Auth Modal Styles */
.auth-modal {
	max-width: 400px;
	width: 90%;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin: 20px 0;
}

.auth-form input {
	padding: 12px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	font-size: 0.95em;
	font-family: 'Saira', sans-serif;
	transition: border-color 0.2s ease;
}

.auth-form input:focus {
	outline: none;
	border-color: #4a90e2;
}

.auth-switch {
	text-align: center;
	font-size: 0.9em;
	color: #737373;
	margin-top: 10px;
}

.auth-switch a {
	color: #4a90e2;
	text-decoration: none;
	font-weight: 500;
}

.auth-switch a:hover {
	text-decoration: underline;
}

.modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: none;
	border: none;
	font-size: 28px;
	color: #737373;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.modal-close:hover {
	color: #1a1a1a;
}

.full-width {
	width: 100%;
}

/* User Menu Styles */
.user-menu {
	position: fixed;
	top: 8px;
	right: 20px;
	z-index: 100;
}

.user-btn {
	background: transparent;
	color: #525252;
	border: none;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 0.9em;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: 'Saira', sans-serif;
	height: 36px;
	display: flex;
	align-items: center;
}

.user-btn:hover {
	background: #f5f5f5;
	color: #000000;
}

.admin-badge {
	display: inline-block;
	background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
	color: white;
	font-size: 0.65em;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
	margin-left: 6px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.user-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 8px;
	background: white;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	min-width: 200px;
	overflow: hidden;
}

.user-menu.active .user-dropdown {
	display: block;
}

.user-info {
	padding: 12px 16px;
	border-bottom: 1px solid #e5e5e5;
}

.user-name {
	font-weight: 600;
	color: #1a1a1a;
	margin-bottom: 4px;
}

.user-email {
	font-size: 0.85em;
	color: #737373;
}

.dropdown-item {
	width: 100%;
	background: none;
	border: none;
	padding: 12px 16px;
	text-align: left;
	cursor: pointer;
	color: #d32f2f;
	font-family: 'Saira', sans-serif;
	transition: background 0.2s ease;
}

.dropdown-item:hover {
	background: #f5f5f5;
}


.auth-btn {
	background: transparent;
	color: #525252;
	border: none;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 0.9em;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: 'Saira', sans-serif;
	height: 36px;
	display: flex;
	align-items: center;
}
.auth-btn:hover {
	background: #f5f5f5;
	color: #000000;
}
.main-area {
	flex: 1 1 auto;
	display: flex;
	flex-direction: row;
	height: 100%;
	min-height: 0;
	position: relative;
	gap: 0;
}
.chat-container {
	flex: 1 1 100%;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	margin: 0;
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	position: relative;
	overflow: hidden;
}
.main-area.empty-chat .chat-container {
	justify-content: center;
	align-items: center;
}
.branding {
	display: none;
	text-align: center;
	margin-bottom: 32px;
}
.main-area.empty-chat .branding {
	display: block;
}
.branding-title {
	font-size: 3em;
	font-weight: 600;
	color: #000000;
	margin: 0 0 12px 0;
	letter-spacing: -0.02em;
}
.branding-tagline {
	font-size: 1.1em;
	color: #737373;
	margin: 0;
	font-weight: 400;
}
.search-bar {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	padding: 32px 24px;
	background: transparent;
	max-width: 900px;
	width: 100%;
	margin: 0 auto;
	order: 2;
	gap: 0;
}
.main-area.empty-chat .search-bar {
	padding: 48px 24px;
	order: 0;
}

.search-input {
	flex: 1;
	padding: 12px 18px;
	font-size: 0.95em;
	border: 1px solid #e5e5e5;
	border-right: none;
	border-radius: 10px 0 0 10px;
	outline: none;
	background: #ffffff;
	color: #1a1a1a;
	transition: border-color 0.2s ease, background 0.2s ease;
	font-family: 'Saira', sans-serif;
	min-height: 48px;
	max-height: 200px;
	height: auto;
	box-sizing: border-box;
	resize: none;
	overflow-y: auto;
	line-height: 1.5;
}
.search-input:focus {
	border-color: #d4d4d4;
	background: #fafafa;
}
.search-input::-webkit-scrollbar {
	width: 6px;
}
.search-input::-webkit-scrollbar-thumb {
	background: #d4d4d4;
	border-radius: 3px;
}
.search-input::-webkit-scrollbar-track {
	background: transparent;
}

.search-btn {
	padding: 12px 20px;
	font-size: 0.95em;
	background: #000000;
	color: #ffffff;
	border: 1px solid #000000;
	border-radius: 0 10px 10px 0;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	min-height: 48px;
	height: auto;
	box-sizing: border-box;
	align-self: flex-end;
}
.search-btn .material-symbols-outlined {
	font-size: 22px;
	font-variation-settings: 'FILL' 0, 'wght' 500;
}
.search-btn:hover:not(:disabled) {
	background: #262626;
	border-color: #262626;
}
.search-btn:active:not(:disabled) {
	background: #404040;
}
.search-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.chat-area {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow-y: auto;
	background: transparent;
	border-radius: 0;
	padding: 24px 24px 32px 24px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
	box-shadow: none;
	max-width: 900px;
	width: 100%;
	order: 1;
}
.main-area.empty-chat .chat-area {
	display: none;
}
.message {
	max-width: 85%;
	padding: 14px 18px;
	border-radius: 14px;
	font-size: 0.96em;
	line-height: 1.65;
	word-break: break-word;
	animation: slideIn 0.3s ease;
}
.message.bot {
	max-width: 100%;
}
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
/* Streaming response cursor */
.message.bot.streaming::after {
	content: '';
	display: inline-block;
	width: 2px;
	height: 1em;
	background: #525252;
	margin-left: 2px;
	vertical-align: text-bottom;
	animation: streamCursorBlink 0.6s step-end infinite;
}
@keyframes streamCursorBlink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0; }
}
.user {
	align-self: flex-end;
	background: #000000;
	color: #ffffff;
	border-bottom-right-radius: 6px;
}
.bot {
	align-self: flex-start;
	background: #f5f5f5;
	color: #1a1a1a;
	border: 1px solid #e5e5e5;
	border-bottom-left-radius: 6px;
}

/* Clarification multiple-choice buttons */
.clarification-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 14px;
}
.clarification-choice-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid #d0d0d0;
	background: #ffffff;
	color: #1a1a1a;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	font-size: 0.88em;
	line-height: 1.4;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.clarification-choice-btn:hover {
	border-color: #888;
	background: #f0f0f0;
}
.clarification-choice-btn.selected {
	border-color: #000;
	background: #000;
	color: #fff;
}
.clarification-choice-btn.selected .choice-label {
	background: #fff;
	color: #000;
}
.clarification-choice-btn.disabled:not(.selected) {
	opacity: 0.45;
	cursor: default;
}
.choice-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	border-radius: 6px;
	background: #e8e8e8;
	color: #333;
	font-weight: 600;
	font-size: 0.82em;
	flex-shrink: 0;
}
.choice-text {
	flex: 1;
}

/* Bot action buttons (copy + regenerate) */
.bot-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-top: -10px;
	margin-bottom: 4px;
	padding-left: 4px;
	opacity: 0;
	transition: opacity 0.2s;
}
.message.bot:hover + .bot-actions,
.bot-actions:hover {
	opacity: 1;
}
.bot-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: #888;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, color 0.15s;
}
.bot-action-btn .material-symbols-outlined {
	font-size: 18px;
}
.bot-action-btn:hover {
	background: #e8e8e8;
	color: #333;
}
.bot-action-btn.copied {
	color: #22c55e;
}

/* ===== Temp Chat Panel ===== */
.temp-chat-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}
.temp-chat-overlay.active {
	display: flex;
}
.temp-chat-panel {
	width: 700px;
	max-width: 94vw;
	height: 85vh;
	max-height: 800px;
	background: #fff;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	animation: tempChatIn 0.25s ease;
}
@keyframes tempChatIn {
	from { opacity: 0; transform: translateY(20px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
.temp-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #e5e5e5;
	flex-shrink: 0;
}
.temp-chat-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 0.95em;
	color: #1a1a1a;
}
.temp-chat-title .material-symbols-outlined {
	font-size: 20px;
	color: #888;
}
.temp-chat-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #888;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.temp-chat-close:hover {
	background: #f0f0f0;
	color: #333;
}
.temp-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.temp-chat-messages .message {
	max-width: 90%;
}
.temp-chat-input-bar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid #e5e5e5;
	flex-shrink: 0;
}
.temp-chat-input {
	flex: 1;
	resize: none;
	border: 1px solid #d0d0d0;
	border-radius: 10px;
	padding: 10px 14px;
	font-family: 'Saira', sans-serif;
	font-size: 0.9em;
	line-height: 1.5;
	outline: none;
	max-height: 120px;
	transition: border-color 0.2s;
}
.temp-chat-input:focus {
	border-color: #888;
}
.temp-chat-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 10px;
	background: #000;
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s;
}
.temp-chat-send:hover {
	background: #333;
}
.temp-chat-send:disabled {
	opacity: 0.5;
	cursor: default;
}
.temp-chat-send .material-symbols-outlined {
	font-size: 20px;
}

.bot pre {
	background: #1e1e1e;
	color: #d4d4d4;
	padding: 0;
	border-radius: 8px;
	overflow: hidden;
	margin: 10px 0;
	border: 1px solid #333;
	position: relative;
}
.bot pre code {
	display: block;
	padding: 14px 16px;
	overflow-x: auto;
	background: none;
	color: inherit;
	border-radius: 0;
	font-size: 0.88em;
	line-height: 1.6;
	tab-size: 4;
}
.bot code {
	background: #e8e8e8;
	color: #1a1a1a;
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
	font-size: 0.88em;
}

/* Code block header with language label + copy button */
.code-block-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #2d2d2d;
	padding: 6px 12px 6px 16px;
	font-size: 0.78em;
	color: #999;
	border-bottom: 1px solid #333;
	user-select: none;
}
.code-block-lang {
	text-transform: lowercase;
	font-weight: 500;
	letter-spacing: 0.03em;
}
.code-copy-btn {
	background: none;
	border: 1px solid transparent;
	color: #999;
	cursor: pointer;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 1em;
	font-family: 'Saira', sans-serif;
	display: flex;
	align-items: center;
	gap: 4px;
	transition: all 0.2s ease;
}
.code-copy-btn:hover {
	background: rgba(255,255,255,0.08);
	color: #ccc;
	border-color: #555;
}
.code-copy-btn.copied {
	color: #4ade80;
	border-color: transparent;
}
.code-copy-btn .material-symbols-outlined {
	font-size: 15px;
}
.bot pre code::-webkit-scrollbar {
	height: 6px;
}
.bot pre code::-webkit-scrollbar-thumb {
	background: #555;
	border-radius: 3px;
}
.bot pre code::-webkit-scrollbar-track {
	background: transparent;
}
.typing-indicator {
	display: none;
	align-self: flex-start;
	padding: 12px 16px;
	background: #f5f5f5;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	max-width: 80px;
}
.typing-indicator.active {
	display: flex;
	gap: 5px;
	align-items: center;
}
.typing-indicator span {
	width: 7px;
	height: 7px;
	background: #525252;
	border-radius: 50%;
	animation: typing 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) {
	animation-delay: 0.15s;
}
.typing-indicator span:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes typing {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.3;
	}
	30% {
		transform: translateY(-8px);
		opacity: 1;
	}
}
.footer {
	text-align: center;
	color: #a3a3a3;
	font-size: 0.85em;
	margin: 0;
	padding: 16px 0 12px 0;
	background: transparent;
	border-top: none;
	letter-spacing: 0.01em;
}

.footer-separator {
	margin: 0 8px;
	color: #d4d4d4;
}

.bug-report-link {
	color: #737373;
	text-decoration: none;
	transition: color 0.2s ease;
	cursor: pointer;
}

.bug-report-link:hover {
	color: #000000;
	text-decoration: underline;
}
/* Modal Styles */
.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 1000;
	justify-content: center;
	align-items: flex-start;
	overflow-y: auto;
	padding: 40px 0;
}
.modal-overlay.active {
	display: flex;
}
.modal {
	background: #ffffff;
	border-radius: 16px;
	padding: 32px;
	max-width: 480px;
	width: 90%;
	margin: auto;
	flex-shrink: 0;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	animation: modalSlideIn 0.25s ease;
}
@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.modal-title {
	font-size: 1.3em;
	color: #1a1a1a;
	margin-bottom: 12px;
	font-weight: 500;
}

.modal-subtitle {
	font-size: 0.9em;
	color: #737373;
	margin: -8px 0 20px 0;
	line-height: 1.4;
}

.modal-message {
	font-size: 0.95em;
	color: #525252;
	margin-bottom: 20px;
	line-height: 1.5;
}
.modal-input {
	display: none;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	font-size: 0.95em;
	margin-bottom: 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
	box-sizing: border-box;
}
.modal-input.active {
	display: block;
}
.modal-input:focus {
	outline: none;
	border-color: #525252;
}
.modal-buttons {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 20px;
	flex-shrink: 0;
}
.modal-btn {
	padding: 11px 24px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.92em;
	font-weight: 500;
	transition: all 0.2s ease;
	font-family: 'Saira', sans-serif;
}
.modal-btn.confirm {
	background: #000000;
	color: #ffffff;
}
.modal-btn.confirm:hover {
	background: #262626;
}
.modal-btn.primary {
	background: #000000;
	color: #ffffff;
}
.modal-btn.primary:hover {
	background: #262626;
}
.modal-btn.confirm.danger {
	background: #dc2626;
}
.modal-btn.confirm.danger:hover {
	background: #b91c1c;
}
.modal-btn.cancel {
	background: #f5f5f5;
	color: #525252;
}
.modal-btn.cancel:hover {
	background: #e5e5e5;
}

/* Form Elements */
.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	font-weight: 500;
	color: #1a1a1a;
	margin-bottom: 8px;
	font-size: 0.9em;
}

.form-group .required {
	color: #dc2626;
	font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	font-size: 0.95em;
	font-family: 'Saira', sans-serif;
	box-sizing: border-box;
	transition: all 0.2s ease;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
	outline: none;
	border-color: #525252;
	background: #fafafa;
}
.form-textarea {
	resize: vertical;
	min-height: 80px;
}
.form-select {
	cursor: pointer;
	background-color: #ffffff;
}
.form-hint {
	display: block;
	font-size: 0.8em;
	color: #a3a3a3;
	margin-top: 4px;
	font-style: italic;
}
.form-buttons {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}
.form-buttons .modal-btn {
	flex: 1;
}

/* Mobile Responsive Styles */
@media (max-width: 800px) {
	/* Sidebar */
	.sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 100;
	}
	
	.sidebar-layout {
		flex-direction: column;
	}
	
	.sidebar-toggle.collapsed-only {
		display: flex;
	}
	
	/* Fixed Buttons - Stack vertically on mobile */
	.auth-section {
		top: 8px;
		right: 12px;
	}
	
	.auth-btn {
		padding: 10px 16px;
		font-size: 0.85em;
		min-height: 44px;
	}
	
	.user-menu {
		top: 8px;
		right: 12px;
	}
	
	.user-btn {
		padding: 10px 14px;
		font-size: 0.85em;
		min-height: 44px;
	}
	
/* Branding */
	.branding-title {
		font-size: 2em;
	}
	
	.branding-tagline {
		font-size: 0.95em;
	}
	
	/* Search Bar */
	.search-bar {
		max-width: 100%;
		padding: 16px 12px;
		flex-wrap: nowrap;
	}
	
	.main-area.empty-chat .search-bar {
		padding: 32px 12px;
	}
	
	.search-input {
		padding: 12px 14px;
		font-size: 0.9em;
		min-height: 44px;
	}
	
	.search-btn {
		padding: 12px 16px;
		min-width: 50px;
		min-height: 44px;
		border-radius: 0 8px 8px 0;
	}
	
	/* Chat Area */
	.chat-area {
		max-width: 100%;
		padding: 16px 12px;
		gap: 14px;
	}
	
	.message {
		max-width: 90%;
		padding: 12px 16px;
		font-size: 0.9em;
		border-radius: 12px;
	}
	
	.bot pre code {
		padding: 10px 12px;
		font-size: 0.82em;
	}
	
	.bot code {
		font-size: 0.82em;
	}
	
	/* Modal */
	.modal-content {
		width: 95%;
		max-width: 95%;
		margin: 10px;
		max-height: 90vh;
		overflow-y: auto;
	}
	
	.modal-header h2 {
		font-size: 1.3em;
	}
	
	.modal-body {
		padding: 20px 16px;
	}
	
	/* User Dropdown */
	.user-dropdown {
		right: -10px;
		min-width: 180px;
	}
	
	.user-info {
		padding: 10px 14px;
	}
	
	.dropdown-item {
		padding: 10px 14px;
		font-size: 0.9em;
		min-height: 44px;
	}
	
	input[type="text"],
	input[type="email"],
	textarea,
	select {
		font-size: 16px !important; /* Prevents zoom on iOS */
		min-height: 44px;
	}
	
	/* Bug Report Modal */
	#bugCategory,
	#bugDescription {
		font-size: 16px !important;
	}
}

/* Extra Small Devices */
@media (max-width: 480px) {
	.tab {
		min-width: 80px;
		padding: 8px 12px;
		font-size: 0.8em;
	}
	
	.branding-title {
		font-size: 1.8em;
	}
	
	.branding-tagline {
		font-size: 0.9em;
	}
	
	.search-bar {
		padding: 12px 8px;
	}
	
	.chat-area {
		padding: 12px 8px;
	}
	
	.message {
		padding: 10px 14px;
		font-size: 0.85em;
	}
	
	.clarification-choices {
		grid-template-columns: 1fr;
	}
	
	.modal-content {
		width: 98%;
		margin: 5px;
	}
	
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
	.branding {
		margin-bottom: 16px;
	}
	
	.branding-title {
		font-size: 1.8em;
		margin-bottom: 6px;
	}
	
	.branding-tagline {
		font-size: 0.9em;
	}
	
	.main-area.empty-chat .search-bar {
		padding: 24px 12px;
	}
	
	.modal-content {
		max-height: 85vh;
	}
}

/* Theme Toggle Button (guest) */
.theme-toggle-btn {
	background: transparent;
	border: none;
	color: #525252;
	cursor: pointer;
	padding: 8px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	height: 36px;
	width: 36px;
}
.theme-toggle-btn:hover {
	background: #f5f5f5;
	color: #000000;
}
.theme-toggle-btn .material-symbols-outlined {
	font-size: 20px;
}

/* Theme Toggle in dropdown */
.dropdown-item.theme-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #374151;
}
.dropdown-item.theme-toggle .material-symbols-outlined {
	font-size: 20px;
}

/* =========================================
   DARK MODE
   ========================================= */
body[data-theme="dark"] {
	background: #0f0f0f;
	color: #e5e5e5;
}

/* Page Loader */
body[data-theme="dark"] .page-loader {
	background: #0f0f0f;
}
body[data-theme="dark"] .page-loader .loader-logo {
	color: #ffffff;
}
body[data-theme="dark"] .page-loader .loader-spinner {
	border-color: #333;
	border-top-color: #ffffff;
}

/* Sidebar */
body[data-theme="dark"] .sidebar {
	background: #161616;
	border-right-color: #2a2a2a;
}
body[data-theme="dark"] .sidebar-toggle:hover {
	background: #2a2a2a;
	color: #e5e5e5;
}
body[data-theme="dark"] .new-chat-btn {
	background: #1e1e1e;
	color: #d4d4d4;
	border-color: #333;
}
body[data-theme="dark"] .new-chat-btn:hover {
	background: #2a2a2a;
	border-color: #555;
}
body[data-theme="dark"] .chat-list-label {
	color: #666;
}
body[data-theme="dark"] .tab {
	color: #a3a3a3;
}
body[data-theme="dark"] .tab:hover:not(.active) {
	background: #1e1e1e;
	color: #e5e5e5;
	box-shadow: none;
}
body[data-theme="dark"] .tab.active {
	background: #1e1e1e;
	color: #ffffff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
body[data-theme="dark"] .tab .tab-icon {
	color: #666;
}
body[data-theme="dark"] .tab.active .tab-icon {
	color: #ffffff;
}
body[data-theme="dark"] .tab .close-btn:hover {
	background: #3b1515;
	color: #f87171;
}
body[data-theme="dark"] .chat-list::-webkit-scrollbar-thumb {
	background: #333;
}

/* Sidebar skeleton */
body[data-theme="dark"] .skeleton-line {
	background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
	background-size: 200% 100%;
}

/* Branding */
body[data-theme="dark"] .branding-title {
	color: #ffffff;
}
body[data-theme="dark"] .branding-tagline {
	color: #737373;
}

/* Search Bar */
body[data-theme="dark"] .search-input {
	background: #1a1a1a;
	color: #e5e5e5;
	border-color: #333;
}
body[data-theme="dark"] .search-input:focus {
	border-color: #555;
	background: #1e1e1e;
}
body[data-theme="dark"] .search-input::-webkit-scrollbar-thumb {
	background: #444;
}
body[data-theme="dark"] .search-btn {
	background: #e5e5e5;
	color: #0f0f0f;
	border-color: #e5e5e5;
}
body[data-theme="dark"] .search-btn:hover:not(:disabled) {
	background: #ffffff;
	border-color: #ffffff;
}
body[data-theme="dark"] .search-btn.send-loading {
	background: #555;
}
body[data-theme="dark"] .search-btn.send-loading::after {
	border-color: rgba(0,0,0,0.3);
	border-top-color: #000;
}

/* Chat Messages */
body[data-theme="dark"] .user {
	background: #e5e5e5;
	color: #0f0f0f;
}
body[data-theme="dark"] .bot {
	background: #1a1a1a;
	color: #d4d4d4;
	border-color: #2a2a2a;
}
body[data-theme="dark"] .message.bot.streaming::after {
	background: #999;
}

/* Dark mode clarification choices */
body[data-theme="dark"] .clarification-choice-btn {
	background: #252525;
	color: #d4d4d4;
	border-color: #3a3a3a;
}
body[data-theme="dark"] .clarification-choice-btn:hover {
	border-color: #666;
	background: #2f2f2f;
}
body[data-theme="dark"] .clarification-choice-btn.selected {
	border-color: #e5e5e5;
	background: #e5e5e5;
	color: #0f0f0f;
}
body[data-theme="dark"] .clarification-choice-btn.selected .choice-label {
	background: #0f0f0f;
	color: #e5e5e5;
}
body[data-theme="dark"] .choice-label {
	background: #333;
	color: #ccc;
}

/* Dark mode bot action buttons */
body[data-theme="dark"] .bot-action-btn {
	color: #666;
}
body[data-theme="dark"] .bot-action-btn:hover {
	background: #2a2a2a;
	color: #ccc;
}
body[data-theme="dark"] .bot-action-btn.copied {
	color: #22c55e;
}

/* Dark mode Temp Chat */
body[data-theme="dark"] .temp-chat-overlay {
	background: rgba(0, 0, 0, 0.55);
}
body[data-theme="dark"] .temp-chat-panel {
	background: #1a1a1a;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
body[data-theme="dark"] .temp-chat-header {
	border-bottom-color: #2a2a2a;
}
body[data-theme="dark"] .temp-chat-title {
	color: #d4d4d4;
}
body[data-theme="dark"] .temp-chat-close {
	color: #888;
}
body[data-theme="dark"] .temp-chat-close:hover {
	background: #2a2a2a;
	color: #ccc;
}
body[data-theme="dark"] .temp-chat-input-bar {
	border-top-color: #2a2a2a;
}
body[data-theme="dark"] .temp-chat-input {
	background: #252525;
	border-color: #3a3a3a;
	color: #d4d4d4;
}
body[data-theme="dark"] .temp-chat-input:focus {
	border-color: #666;
}
body[data-theme="dark"] .temp-chat-send {
	background: #e5e5e5;
	color: #0f0f0f;
}
body[data-theme="dark"] .temp-chat-send:hover {
	background: #ccc;
}

/* Bot code blocks */
body[data-theme="dark"] .bot code {
	background: #2a2a2a;
	color: #d4d4d4;
}
body[data-theme="dark"] .bot pre {
	border-color: #333;
}
body[data-theme="dark"] .code-block-header {
	background: #252525;
	border-bottom-color: #333;
}

/* Typing indicator */
body[data-theme="dark"] .typing-indicator {
	background: #1a1a1a;
	border-color: #2a2a2a;
}
body[data-theme="dark"] .typing-indicator span {
	background: #888;
}

/* Auth buttons */
body[data-theme="dark"] .auth-btn {
	color: #d4d4d4;
}
body[data-theme="dark"] .auth-btn:hover {
	background: #1e1e1e;
	color: #ffffff;
}
body[data-theme="dark"] .theme-toggle-btn {
	color: #d4d4d4;
}
body[data-theme="dark"] .theme-toggle-btn:hover {
	background: #1e1e1e;
	color: #ffffff;
}

/* User menu */
body[data-theme="dark"] .user-btn {
	color: #d4d4d4;
}
body[data-theme="dark"] .user-btn:hover {
	background: #1e1e1e;
	color: #ffffff;
}
body[data-theme="dark"] .user-dropdown {
	background: #1a1a1a;
	border-color: #2a2a2a;
	box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
body[data-theme="dark"] .user-info {
	border-bottom-color: #2a2a2a;
}
body[data-theme="dark"] .user-name {
	color: #e5e5e5;
}
body[data-theme="dark"] .user-email {
	color: #888;
}
body[data-theme="dark"] .dropdown-item {
	color: #d4d4d4;
}
body[data-theme="dark"] .dropdown-item:hover {
	background: #252525;
}
body[data-theme="dark"] .dropdown-item.theme-toggle {
	color: #d4d4d4;
}

/* Modals */
body[data-theme="dark"] .modal-overlay {
	background: rgba(0,0,0,0.6);
}
body[data-theme="dark"] .modal {
	background: #1a1a1a;
	box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
body[data-theme="dark"] .modal-title {
	color: #e5e5e5;
}
body[data-theme="dark"] .modal-message {
	color: #a3a3a3;
}
body[data-theme="dark"] .modal-btn {
	border-color: #333;
	color: #d4d4d4;
}
body[data-theme="dark"] .modal-btn:hover {
	background: #252525;
}
body[data-theme="dark"] .modal-btn.primary {
	background: #e5e5e5;
	color: #0f0f0f;
	border-color: #e5e5e5;
}
body[data-theme="dark"] .modal-btn.primary:hover {
	background: #ffffff;
}
body[data-theme="dark"] .modal-btn.danger {
	background: #dc2626;
	border-color: #dc2626;
	color: #ffffff;
}
body[data-theme="dark"] .modal-input {
	background: #252525;
	color: #e5e5e5;
	border-color: #333;
}

/* Form elements */
body[data-theme="dark"] .form-group label {
	color: #d4d4d4;
}
body[data-theme="dark"] .form-input,
body[data-theme="dark"] .form-textarea,
body[data-theme="dark"] .form-select {
	background: #252525;
	color: #e5e5e5;
	border-color: #333;
}
body[data-theme="dark"] .form-input:focus,
body[data-theme="dark"] .form-textarea:focus,
body[data-theme="dark"] .form-select:focus {
	border-color: #555;
	background: #2a2a2a;
}
body[data-theme="dark"] .form-hint {
	color: #666;
}

/* Footer */
body[data-theme="dark"] .footer {
	color: #555;
}
body[data-theme="dark"] .footer-separator {
	color: #333;
}
body[data-theme="dark"] .bug-report-link {
	color: #666;
}
body[data-theme="dark"] .bug-report-link:hover {
	color: #e5e5e5;
}

/* Sidebar empty state */
body[data-theme="dark"] .sidebar-empty {
	color: #555;
}
body[data-theme="dark"] .sidebar-empty .material-symbols-outlined {
	color: #444;
}

/* Inline loader */
body[data-theme="dark"] .inline-loader {
	color: #888;
}
body[data-theme="dark"] .inline-loader .spinner {
	border-color: #333;
	border-top-color: #888;
}