/* AI Chat with Multiple Documents - Styles for תיק.asp */

/* Color Palette Variables */
:root {
	--color-primary-green: #10B981;
	--color-primary-green-dark: #059669;
	--color-secondary-orange: #F59E0B;
	--color-secondary-orange-dark: #D97706;
	--color-special-purple: #8B5CF6;
	--color-special-purple-dark: #7C3AED;
	--color-warning-red: #EF4444;
	--color-warning-red-dark: #DC2626;
	--color-info-blue: #3B82F6;
	--color-info-blue-dark: #2563EB;
	--color-teal: #14B8A6;
	--color-teal-dark: #0D9488;
	--color-yellow: #FBBF24;
	--color-pink: #EC4899;
	--color-pink-dark: #DB2777;
}

/* Inline form error message (e.g. duplicate workspace name) */
.inline-form-error {
	color: var(--color-warning-red);
	font-size: 0.9em;
	margin-top: 6px;
	text-align: right;
}

/* Document Selection Checkbox Column */
.docSelectCol {
	width: 40px;
	text-align: center;
}

#eSvdItmsContainer .researchAgentBtn {
	display: inline-block;
	width: 28px;
	height: 28px;
	background: #0e85b7 url(../images/personalAssistantAdd.png) no-repeat center;
	background-size: 20px;
	border-radius: 4px;
	cursor: pointer;
	vertical-align: middle;
}
#eSvdItmsContainer .researchAgentBtn:hover {
	background-color: #0b6a96;
}
#eSvdItmsContainer .researchAgentBtn.selected {
	background-color: #e67315;
	opacity: 0.9;
}

#selectAllDocs {
	cursor: pointer;
	width: 18px;
	height: 18px;
}

/* Floating Action Button */
.ai-chat-fab {
	position: fixed;
	bottom: 30px;
	left: 30px;
	background: #0e85b7;
	color: white;
	box-shadow: 0 4px 15px rgba(248, 82, 7, 0.4);
	cursor: pointer;
	z-index: 999;
	transition: all 0.3s ease;
	animation: fadeInUp 0.5s ease;
}

.ai-chat-fab:hover {
	background: #0e85b7;
	box-shadow: 0 6px 20px rgba(248, 82, 7, 0.5);
	transform: translateY(-3px);
}

.ai-chat-fab .fab-icon {
	font-size: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-chat-fab .fab-icon img {
	width: 28px;
	height: 28px;
	display: block;
}

@media only screen and (min-width: 1281px) {
	.ai-chat-fab {
		padding: 15px 25px;
		border-radius: 50px;
	}
	.ai-chat-fab .fab-content {
		display: flex;
		align-items: center;
		gap: 10px;
		font-size: 1rem;
		font-weight: bold;
	}
	.ai-chat-fab .fab-badge {
		background: #0e85b7;
		color: white;
		border-radius: 50%;
		width: 26px;
		height: 26px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 1rem;
		font-weight: bold;
	}
}
@media screen and (max-width: 1280px) {
	.ai-chat-fab {
		padding: 1rem;
		border-radius: 0.2rem;
	}
	.ai-chat-fab .fab-text,.ai-chat-fab .fab-badge {
		display: none !important;
	}
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* AI Chat Panel Overlay */
.ai-chat-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.ai-chat-overlay.hideMe {
	display: none;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* AI Chat Panel */
.ai-chat-panel {
	position: relative;
	background: white;
	width: 95%;
	height: 95vh;
	border-radius: 15px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: slideUp 0.3s ease;
	direction: rtl;
}

@keyframes slideUp {
	from {
		transform: translateY(50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* AI Chat Header */
.ai-chat-header {
	background: #0e85b7;
	color: white;
	padding: 20px 25px;
	display: flex;
	align-items: center;
	gap: 15px;
	flex-shrink: 0;
	position: relative;
	width:100%;
	box-sizing:border-box;
}

.ai-chat-header h2 {
	margin: 0;
	font-size: 22px;
	order: 1;
}

.workspace-name-display {
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.9);
	padding: 5px 15px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.15);
	order: 2;
	white-space: nowrap;
	margin-right: 2rem;
}

.workspace-name-display:empty {
	display: none;
}

.ai-chat-close {
	color: white;
	text-decoration: none;
	font-size: 28px;
	font-weight: bold;
	width: 35px;
	height: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
	flex-shrink: 0;
	order: 4;
}

.ai-chat-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

.ai-chat-close img {
	width: 20px;
	height: 20px;
	display: block;
	filter: brightness(0) invert(1);
}

/* AI Chat Header Strip - Minimal header */
.ai-chat-header-strip {
	background: #f8f9fa;
	padding: 0 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	box-sizing: border-box;
	flex-shrink: 0;
}

.ai-chat-header-strip .workspace-name-display {
	font-size: 0.9rem;
	color: #666;
	padding: 2px 10px;
	border-radius: 10px;
	background: transparent;
	order: 1;
	white-space: nowrap;
	margin-right: 0;
}

.ai-chat-header-strip .workspace-name-display:empty {
	display: none;
}

/* Mobile drawer toggle buttons (hidden on desktop) */
.mobile-menu-btn,
.mobile-sources-btn {
	display: none;
	align-items: center;
	justify-content: center;
	position: relative;
	background: transparent;
	border: none;
	padding: 6px;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-sources-btn:hover {
	background: rgba(14, 133, 183, 0.1);
}

.mobile-btn-icon {
	width: 22px;
	height: 22px;
	display: block;
	object-fit: contain;
}

.mobile-sources-badge {
	position: absolute;
	top: 2px;
	left: 2px;
	background: #e53e3e;
	color: white;
	border-radius: 50%;
	width: 16px;
	height: 16px;
	font-size: 0.65rem;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.mobile-sources-badge.hideMe {
	display: none;
}

/* Mobile drawer backdrop */
.mobile-drawer-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 10000;
}

.mobile-drawer-backdrop.active {
	display: block;
}

/* Minimize Button */
.ai-minimize-btn {
	background: transparent;
	border: none;
	color: #666;
	font-size: 1rem;
	font-weight: bold;
	transition: background 0.2s ease;
	border-radius: 50%;
	margin-right: 8px;
}

.ai-minimize-btn:hover {
	background: #ddd;
}

/* New Chat Button in Side Menu */
.new-chat-btn {
	width: 100%;
	padding: 0.6rem 0.75rem;
	margin-bottom: 8px;
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.2s ease;
}

.new-chat-btn:hover {
	background: #0c7aa6;
}

/* Main Content Wrapper - Grid: side menu 30%, chat center, selected docs right */
.ai-chat-main-content {
	display: grid;
	overflow: hidden;
	box-sizing: border-box;
	flex-grow: 1;
}

/* Side Menu - 30% */
.ai-chat-side-menu {
	background: #f0f4f8;
	border-left: 1px solid #e0e0e0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	direction: rtl;
	transition: width 0.3s ease, min-width 0.3s ease;
}

/* Side Menu Toggle Button */
.side-menu-toggle-btn {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	padding: 12px;
	background: transparent;
	border: none;
	border-bottom: 1px solid #e0e0e0;
	cursor: pointer;
	transition: background 0.2s ease;
}

.side-menu-toggle-btn:hover {
	background: rgba(14, 133, 183, 0.1);
}

.side-menu-toggle-btn .hamburger-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

/* Side Menu Collapsed State */
.ai-chat-side-menu.collapsed {
	width: 60px;
	min-width: 60px;
	overflow: hidden;
}

.ai-chat-side-menu.collapsed .side-menu-section {
	padding: 0.25rem 0;
	border-bottom: none;
}

.ai-chat-side-menu.collapsed .side-menu-section-title {
	display: none;
}

.ai-chat-side-menu.collapsed .side-menu-title-icon {
	margin: 0;
}

.ai-chat-side-menu.collapsed .new-workspace-btn,
.ai-chat-side-menu.collapsed .new-chat-btn {
	display: none;
}

/* Show action rows in collapsed mode but icon only */
/*
.ai-chat-side-menu.collapsed .side-menu-new-chat-row,
.ai-chat-side-menu.collapsed .side-menu-new-workspace-row {
	display: grid;
	grid-template-columns: 1fr;
	justify-items: center;
	padding: 8px 0;
	border-bottom: none;
	margin-bottom: 0;
}
*/
.ai-chat-side-menu.collapsed .side-menu-new-workspace-row {
	padding:0.6rem 0.75rem;
}

.ai-chat-side-menu.collapsed .side-menu-new-chat-row span,
.ai-chat-side-menu.collapsed .side-menu-new-workspace-row span {
	display: none;
}

.ai-chat-side-menu.collapsed .workspaces-list,
.ai-chat-side-menu.collapsed .conversations-list {
	display: none;
}

.ai-chat-side-menu.collapsed .expand-row {
	display: none !important;
}

.side-menu-section {
	padding: 2rem 0.75rem;
	border-bottom: 1px solid #e0e0e0;
}

.side-menu-section:last-of-type {
	border-bottom: none;
}

.side-menu-section-title {
	margin: 0 0 0.5rem 0;
	font-size: 1rem;
	color: #666;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.side-menu-title-icon {
	background-color:#f85207;
	border-radius: 0.3rem;
	width: 24px;
	height: 24px;
	object-fit: contain;
	flex-shrink: 0;
}


.conversations-list,
.workspaces-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.side-menu-item {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	background: white;
	border-radius: 6px;
	border: 1px solid #e0e0e0;
	cursor: pointer;
	transition: background 0.2s ease;
	position: relative;
	text-align: right;
	min-height: 40px;
	box-sizing: border-box;
}

.side-menu-item:hover {
	background: #f5f5f5;
}

.side-menu-item .side-menu-item-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.9rem;
	color: #666;
}

.side-menu-item .three-dots-btn {
	width: 24px;
	height: 24px;
	background: url(../images/moreBtnVrt1.png) center/20px no-repeat;
	border: none;
	cursor: pointer;
	flex-shrink: 0;
	opacity: 0;
	transition: opacity 0.2s ease;
	border-radius: 4px;
}

.side-menu-item:hover .three-dots-btn {
	opacity: 1;
}

.side-menu-item-hidden {
	display: none !important;
}

.side-menu-item .three-dots-btn:hover {
	background-image: url(../images/moreBtnVrt2.png);
}

.side-menu-item-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 100;
	min-width: 120px;
	padding: 4px 0;
	display: none;
}

.side-menu-item-dropdown.show {
	display: block;
}

.side-menu-item-dropdown button {
	display: block;
	width: 100%;
	padding: 8px 12px;
	border: none;
	background: none;
	text-align: right;
	font-size: 0.9rem;
	cursor: pointer;
	color: #666;
}

.side-menu-item-dropdown button:hover {
	background: #f0f0f0;
}

.expand-row {
	display: flex;
	justify-content: center;
	padding: 6px 0;
	cursor: pointer;
	margin-top: 4px;
}

.expand-arrow,.collapse-arrow {
	display: inline-block;
}

.expand-arrow {
	font-size: 1.2rem;
	color: #666;
	transition: transform 0.2s ease;
}

.collapse-arrow {
	font-size: 1.2rem;
	color: #666;
	transition: transform 0.2s ease;
	transform: rotate(180deg);
}

.new-workspace-btn {
	width: 100%;
	padding: 0.6rem 0.75rem;
	margin-bottom: 8px;
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.2s ease;
}

.new-workspace-btn:hover {
	background: #0e85b7;
}

/* Plain action rows: שיחה חדשה (top) and סביבת עבודה חדשה (inside workspaces section) */
.side-menu-new-chat-row,
.side-menu-new-workspace-row {
	display: grid;
	grid-template-columns: auto auto 1fr;
	gap:1rem;
	align-items: center;
	cursor: pointer;
	color: #666;
	font-size: 0.95rem;
	border-bottom: 1px solid #e0e0e0;
	transition: background 0.2s ease;
}

.side-menu-new-chat-row:hover,
.side-menu-new-workspace-row:hover {
	background: rgba(14, 133, 183, 0.06);
}
.side-menu-new-chat-row{
	padding: 0.6rem 0.75rem;
}
.side-menu-new-workspace-row {
	border-bottom: none;
	margin-bottom: 8px;
	padding:10px 0;
}

.side-menu-action-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
	flex-shrink: 0;
}

/* Selected Documents List */
.ai-chat-selected-docs {
	background: #f8f9fa;
	border-left: 1px solid #e0e0e0;
	padding: 0.5rem;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	min-width: 0;
}

@media only screen and (max-width: 768px) {
	/* Full-screen panel */
	.ai-chat-panel {
		width: 100%;
		height: 100vh;
		height: 100dvh; /* iOS-safe: excludes dynamic browser toolbars */
		border-radius: 0;
	}

	/* Single-column chat layout */
	.ai-chat-main-content {
		grid-template-columns: 1fr;
	}

	/* Show mobile toggle buttons */
	.mobile-menu-btn,
	.mobile-sources-btn {
		display: flex;
	}

	/* Side menu → fixed off-canvas drawer from right (RTL start edge) */
	.ai-chat-side-menu {
		display: flex !important;
		position: fixed;
		top: 0;
		right: 0;
		width: 80%;
		max-width: 300px;
		height: 100vh;
		height: 100dvh; /* iOS-safe: excludes dynamic browser toolbars */
		z-index: 10001;
		transform: translateX(100%);
		transition: transform 0.3s ease;
		overflow-y: auto;
	}

	.ai-chat-side-menu.mobile-open {
		transform: translateX(0);
		box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
	}

	/* Override desktop collapsed state — drawer is always full width on mobile */
	.ai-chat-side-menu.collapsed {
		width: 80%;
		min-width: 0;
		overflow-y: auto;
	}

	.ai-chat-side-menu.collapsed .side-menu-section,
	.ai-chat-side-menu.collapsed .side-menu-section-title,
	.ai-chat-side-menu.collapsed .side-menu-new-chat-row span,
	.ai-chat-side-menu.collapsed .side-menu-new-workspace-row span,
	.ai-chat-side-menu.collapsed .workspaces-list,
	.ai-chat-side-menu.collapsed .conversations-list {
		display: revert;
	}

	.ai-chat-side-menu.collapsed .expand-row {
		display: flex !important;
	}

	/* Sources panel → fixed off-canvas drawer from left (RTL end edge) */
	.ai-chat-selected-docs {
		display: flex !important;
		position: fixed;
		top: 0;
		left: 0;
		width: 80%;
		max-width: 300px;
		height: 100vh;
		height: 100dvh; /* iOS-safe: excludes dynamic browser toolbars */
		z-index: 10001;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		overflow-y: auto;
	}

	.ai-chat-selected-docs.mobile-open {
		transform: translateX(0);
		box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
	}

	/* Stack document cards vertically in narrow sources drawer */
	.selected-doc-item {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	.selected-doc-item .doc-mador {
		align-self: flex-start;
	}

	.selected-doc-item .doc-detail-row {
		flex-wrap: wrap;
	}

	.selected-doc-item .doc-value {
		min-width: 0;
		word-break: break-word;
	}
	.pa-tour-help-btn {
		display: none;
	}
}

@media only screen and (max-width: 480px) {
	/* Wider drawers on small phones */
	.ai-chat-side-menu,
	.ai-chat-side-menu.collapsed {
		width: 90%;
		max-width: none;
	}
	.ai-chat-selected-docs {
		width: 90%;
		max-width: none;
	}
}
.ai-chat-selected-docs h3 {
	margin: 0 0 10px 0;
	font-size: 1rem;
	color: #666;
}

.sources-actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-bottom: 10px;
}

.sources-add-wrapper {
	position: relative;
}

.sources-add-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	left: auto;
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 100;
	min-width: 140px;
	padding: 4px 0;
	display: none;
	direction: rtl;
}

.sources-add-dropdown.show {
	display: block;
}

.sources-add-dropdown .sources-add-dropdown-item {
	display: block;
	width: 100%;
	padding: 8px 12px;
	border: none;
	background: none;
	text-align: right;
	font-size: 0.9rem;
	cursor: pointer;
	color: #666;
}

.sources-add-dropdown .sources-add-dropdown-item:hover {
	background: #f0f0f0;
}

.sources-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	direction: rtl;
	width: 100%;
	padding: 0.6rem 0.75rem;
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.2s ease;
	box-sizing: border-box;
}

.sources-action-btn:hover {
	background: #0e85b7;
}

.sources-action-btn .sources-btn-plus {
	margin-right: 1rem;
	font-size: 1.1rem;
	font-weight: bold;
}

.sources-action-btn .sources-btn-label {
	white-space: nowrap;
}

.selected-docs-list {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 8px;
}

.selected-doc-item {
	display: flex;
	align-items: flex-start;
	background: white;
	padding: 12px 15px;
	border-radius: 8px;
	border-left: 4px solid #0e85b7;
	border-right: 1px solid #e0e0e0;
	border-top: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	gap: 12px;
	margin-bottom: 8px;
	position: relative;
	flex-wrap: wrap;
	width: 100%;
	box-sizing: border-box;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.selected-doc-item[data-type="laws"],
.selected-doc-item[data-type="חוקים"] {
	border-left-color: #0e85b7;
}

.selected-doc-item[data-type="notes"],
.selected-doc-item[data-type="הערה"] {
	border-left-color: #0e85b7;
}

.selected-doc-item .doc-mador {
	color: #666;
	padding: 6px 12px;
	border-radius: 5px;
	border: 1px solid #666;
	font-size: 1rem;
	font-weight: bold;
	white-space: nowrap;
	flex-shrink: 0;
	margin-top: 2px;
}

.selected-doc-item .doc-mador[data-type="judgments"],
.selected-doc-item .doc-mador[data-type="פסקי דין"] {
	background: #0e85b7;
}

.selected-doc-item .doc-mador[data-type="laws"],
.selected-doc-item .doc-mador[data-type="חוקים"] {
	background: #0e85b7;
}

.selected-doc-item .doc-mador[data-type="notes"],
.selected-doc-item .doc-mador[data-type="הערה"] {
	background: #0e85b7;
}

.selected-doc-item .doc-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.selected-doc-item .doc-detail-row {
	display: flex;
	gap: 5px;
	font-size: 1rem;
	line-height: 1.4;
}

.selected-doc-item .doc-label {
	font-weight: bold;
	color: #666;
	white-space: nowrap;
	flex-shrink: 0;
}

.selected-doc-item .doc-value {
	color: #666;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.selected-doc-item .doc-nm {
	flex: 1;
	font-size: 1rem;
	color: #666;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.selected-doc-item .doc-remove {
	color: #0e85b7;
	text-decoration: none;
	font-size: 20px;
	font-weight: bold;
	width: 25px;
	height: 25px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
	flex-shrink: 0;
	margin-top: 2px;
}

.selected-doc-item .doc-remove:hover {
	background: rgba(248, 82, 7, 0.15);
}

.selected-doc-item .doc-remove img {
	width: 14px;
	height: 14px;
	display: block;
}

/* Chat Content Wrapper */
.ai-chat-content-wrapper {
	flex-grow: 1;
	overflow: hidden;
	padding: 20px 25px;
	box-sizing: border-box;
	background: #f5f5f5;
	display: flex;
	flex-direction: column;
}

/* Initial State - Welcome screen centered */
.ai-chat-content-wrapper:not(.chat-active) {
	justify-content: center;
	align-items: center;
	gap:1rem;
}

.ai-chat-content-wrapper:not(.chat-active) .ai-chat-messages {
	display: none;
}

/* Active State - Chat mode */
.ai-chat-content-wrapper.chat-active .ai-chat-welcome {
	display: none;
}

.ai-chat-content-wrapper.chat-active .ai-chat-initial-questions {
	display: none !important;
}

/* Reorder elements: messages first, then input, then footer */
.ai-chat-content-wrapper.chat-active .ai-chat-messages {
	order: 1;
	flex-grow: 1;
	overflow-y: auto;
	padding:1rem;
	scrollbar-width:thin;
	margin:0.4rem 0;
}

.ai-chat-content-wrapper.chat-active .ai-chat-input-wrapper {
	order: 2;
	max-width: none;
	border-radius: 0;
	border-left: none;
	border-right: none;
	border-bottom: none;
	margin: 0;
	width: 100%;
	flex-shrink: 0;
}

.ai-chat-content-wrapper.chat-active .ai-chat-footer {
	order: 3;
	display: block;
	flex-shrink: 0;
}

/* Welcome Message */
.ai-chat-welcome {
	padding: 20px 20px 10px;
	width: 100%;
	max-width: 600px;
}

.ai-chat-welcome h3 {
	color: #666;
	margin: 0;
	font-size: 24px;
	font-weight: bold;
}

.ai-chat-welcome p {
	color: #666;
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
}

/* Initial Questions Section */
.ai-chat-initial-questions {
	width: 100%;
	max-width: 600px;
	text-align: center;
	padding: 15px 0;
	display: none;
}

.example-questions-caption {
	display: block;
	color: #666;
	font-size: 1rem;
	margin-bottom: 10px;
	text-align: right;
}

.predefined-questions-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.predefined-q-btn {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	color: #555;
	font-size: 0.9rem;
	line-height: 1.5;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: right;
	padding: 12px 16px;
	text-decoration: none;
}

.predefined-q-btn:hover {
	border-color: #0e85b7;
	background: #f0f8fb;
	box-shadow: 0 2px 8px rgba(14, 133, 183, 0.15);
	transform: translateY(-2px);
	color: #333;
}

@media screen and (max-width: 600px) {
	.predefined-questions-list {
		grid-template-columns: 1fr;
	}
}

/* Chat Messages */
.ai-chat-messages {
	display: flex;
	flex-direction: column;
}
.ai-chat-messages-content {
	position:relative;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 15px;
	font-size:1rem;
}

.chat-message {
	display: flex;
	flex-direction: column;
	animation: messageSlideIn 0.3s ease;
}

.ai-chat-messages ul,
.ai-chat-messages ol {
	margin: 0 1rem 0 0 !important;
	padding: 0 !important;
}

@keyframes messageSlideIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.chat-message .message-content {
	padding: 15px 20px;
	border-radius: 15px;
	max-width: 80%;
	line-height: 1.6;
	word-wrap: break-word;
}

.user-message {
	align-items: flex-end;
}

.user-message .message-content {
	background: #0e85b7;
	color: white;
}

.ai-message {
	align-items: flex-start;
}

.ai-message .message-content {
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #666;
	border: 2px solid #0e85b7;
}

.ai-message .message-content > .ai-message-actions {
	margin-top: 8px;
}

.ai-message.typing .message-content {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
}

/* Per-AI-message copy/print actions - bottom left, 32x32 */
.ai-message-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	width:100%;
}

.ai-segment-copy-btn,
.ai-segment-print-btn {
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	border-radius: 4px;
	background-color: #0e85b7;
	background-position: center;
	background-repeat: no-repeat;
	background-size: 16px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ai-segment-copy-btn {
	background-image: url(../images/chatCopy.png);
}

.ai-segment-print-btn {
	background-image: url(../images/chatPrint.png);
}

.ai-segment-copy-btn:hover {
	background-color: rgba(59, 130, 246, 0.4);
	transform: scale(1.1);
}

.ai-segment-print-btn:hover {
	background-color: rgba(139, 92, 246, 0.4);
	transform: scale(1.1);
}

.typing-dots {
	display: inline-flex;
	gap: 4px;
}

.typing-dots span {
	width: 8px;
	height: 8px;
	background: #0e85b7;
	border-radius: 50%;
	animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(1) {
	animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
	animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typingBounce {
	0%, 60%, 100% {
		transform: translateY(0);
	}
	30% {
		transform: translateY(-10px);
	}
}

/* Chat Input Wrapper */
.ai-chat-input-wrapper {
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	padding: 10px 15px;
	display: flex;
	gap: 10px;
	align-items: center;
	flex-shrink: 0;
	width: 100%;
	max-width: 600px;
	box-sizing: border-box;
}

/* Vertical Three Dots Button */
.ai-more-questions-btn {
	display: none;
	width: 32px;
	height: 50px;
	background-image: url(../images/moreBtnVrt1.png);
	background-position: center;
	background-repeat: no-repeat;
	background-size: 32px;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.2s ease;
	align-self: center;
}

.ai-more-questions-btn:hover {
	background-image: url(../images/moreBtnVrt2.png);
}

.ai-chat-input {
	flex: 1;
	border: none;
	padding: 8px 10px;
	font-size: 1rem;
	resize: none;
	min-height: 40px;
	max-height: 160px;
	overflow-y: auto;
	transition: border-color 0.2s ease;
	font-family: inherit;
	line-height: 1.5;
	background: transparent;
}

.ai-chat-input:focus {
	outline: none;
}

.ai-chat-input-wrapper:focus-within {
	border-color: #0e85b7;
	box-shadow: 0 0 0 3px rgba(248, 82, 7, 0.1);
}

.ai-chat-send-btn {
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 10px;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
	align-self: center;
}

.ai-chat-send-btn:hover {
	background: #0e85b7;
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(248, 82, 7, 0.4);
}

.ai-chat-send-btn span {
	font-size: 24px;
	transform: rotate(180deg);
}

.ai-chat-send-btn img {
	width: 24px;
	height: 24px;
	display: block;
	filter: brightness(0) invert(1);
}

/* Chat Footer */
.ai-chat-footer {
	background: #f8f9fa;
	border-top: 1px solid #e0e0e0;
	padding: 10px 25px;
	text-align: center;
	color: #666;
	font-size: 13px;
	flex-shrink: 0;
	margin-top: 0;
}

/* Tablet Layout - Grid: side menu 25%, chat, selected docs 30% */
@media screen and (min-width: 769px) and (max-width: 1024px) {
	.ai-chat-main-content {
		grid-template-columns: 25% 1fr minmax(160px, 30%);
	}
	.ai-chat-main-content.sideMenuCollapsed {
		grid-template-columns: 60px 1fr minmax(160px, 30%);
	}
}

/* Large Screen Layout - Grid: side menu 30%, chat, selected docs */
@media screen and (min-width: 1025px) {
	.ai-chat-main-content {
		grid-template-columns: 20% 1fr minmax(200px, 40%);
	}
	.ai-chat-main-content.sideMenuCollapsed {
		grid-template-columns: 60px 1fr minmax(200px, 40%);
	}
/*	
	.ai-chat-selected-docs {
		border-left: 1px solid #e0e0e0;
		max-height: none;
		height: 100%;
		border-bottom: none;
	}
	
	.ai-chat-content-wrapper {
		min-width: 0;
	}
*/
}
@media screen and (min-width: 1281px) {
	.ai-chat-main-content {
		grid-template-columns: 20% 1fr minmax(200px, 30%);
	}
	.ai-chat-main-content.sideMenuCollapsed {
		grid-template-columns: 60px 1fr minmax(200px, 30%);
	}
}
/* Responsive Design */
@media screen and (max-width: 768px) {
	.ai-chat-fab {
		bottom: 20px;
		left: 20px;
		padding: 12px 20px;
	}
	
	.ai-chat-fab .fab-text {
		font-size: 1rem;
	}
	
	.ai-chat-panel {
		width: 100%;
		height: 100vh;
		height: 100dvh; /* iOS-safe: excludes dynamic browser toolbars */
		max-height: none;
		border-radius: 0;
	}
	
	.ai-chat-doc-count {
		font-size: 1rem;
		padding: 4px 10px;
	}
	
	.chat-message .message-content {
		max-width: 90%;
	}
}

/* AI Chat Actions - Icon Buttons */
.ai-chat-actions {
	display: flex;
	flex-direction: row;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
	order: 3;
	margin:0 auto 0 1rem;
}

.aiNewChatBtn,
.aiCopyBtn,
.aiPrintBtn,
.aiHistoryBtn,
.aiLoadWorkspaceBtn,
.aiSaveWorkspaceBtn,
.aiDeleteWorkspaceBtn {
	width: 32px;
	height: 32px;
	background-color: rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	background-position: center;
	background-repeat: no-repeat;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.aiNewChatBtn {
	background-color: rgba(16, 185, 129, 0.3);
}

.aiCopyBtn {
	background-color: rgba(59, 130, 246, 0.3);
}

.aiPrintBtn {
	background-color: rgba(139, 92, 246, 0.3);
}

.aiHistoryBtn {
	background-color: rgba(245, 158, 11, 0.3);
}

.aiLoadWorkspaceBtn {
	background-color: rgba(20, 184, 166, 0.3);
}

.aiSaveWorkspaceBtn {
	background-color: rgba(16, 185, 129, 0.3);
}

.aiDeleteWorkspaceBtn {
	background-color: rgba(239, 68, 68, 0.3);
}

.aiPrintBtn,
.aiHistoryBtn,
.aiLoadWorkspaceBtn,
.aiSaveWorkspaceBtn,
.aiDeleteWorkspaceBtn {
	background-size: 20px;
}

.aiNewChatBtn,
.aiCopyBtn {
	background-size: 18px;
}

.aiNewChatBtn {
	background-image: url(../images/chatNew.png);
	filter: brightness(0) invert(1);
}

.aiCopyBtn {
	background-image: url(../images/chatCopy.png);
	filter: brightness(0) invert(1);
}

.aiPrintBtn {
	background-image: url(../images/chatPrint.png);
	filter: brightness(0) invert(1);
}

.aiHistoryBtn {
	background-image: url(../images/chatHistory.png);
	filter: brightness(0) invert(1);
}

.aiLoadWorkspaceBtn {
	background-image: url(../images/loadDoc.png);
	filter: brightness(0) invert(1);
	margin-left: 1rem;
}

.aiSaveWorkspaceBtn {
	background-image: url(../images/saveDoc.png);
	filter: brightness(0) invert(1);
}

.aiDeleteWorkspaceBtn {
	background-image: url(../images/delDoc.png);
	filter: brightness(0) invert(1);
}

.aiNewChatBtn:hover {
	background-color: rgba(16, 185, 129, 0.5);
	transform: scale(1.1);
}

.aiCopyBtn:hover {
	background-color: rgba(59, 130, 246, 0.5);
	transform: scale(1.1);
}

.aiPrintBtn:hover {
	background-color: rgba(139, 92, 246, 0.5);
	transform: scale(1.1);
}

.aiHistoryBtn:hover {
	background-color: rgba(245, 158, 11, 0.5);
	transform: scale(1.1);
}

.aiLoadWorkspaceBtn:hover {
	background-color: rgba(20, 184, 166, 0.5);
	transform: scale(1.1);
}

.aiSaveWorkspaceBtn:hover {
	background-color: rgba(16, 185, 129, 0.5);
	transform: scale(1.1);
}

.aiDeleteWorkspaceBtn:hover {
	background-color: rgba(239, 68, 68, 0.5);
	transform: scale(1.1);
}

.aiAddNoteBtn {
	background-color: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 8px;
	color: white;
	padding: 6px 12px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
	margin-left: 1rem;
	white-space: nowrap;
}

.aiAddNoteBtn:hover {
	background-color: rgba(255, 255, 255, 0.3);
	transform: scale(1.05);
}

.aiAddDocBtn {
	background-color: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 8px;
	color: white;
	padding: 6px 12px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
	margin-left: 1rem;
	white-space: nowrap;
}

.aiAddDocBtn:hover {
	background-color: rgba(255, 255, 255, 0.3);
	transform: scale(1.05);
}

/* Note Editor */
.note-editor-label {
	font-size: 1rem;
	font-weight: bold;
	color: #333;
	margin-bottom: 5px;
}

.note-editor-input {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
	direction: rtl;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.note-editor-input:focus {
	outline: none;
	border-color: #0e85b7;
	box-shadow: 0 0 0 3px rgba(248, 82, 7, 0.1);
}

.note-editor-textarea {
	width: 100%;
	flex: 1;
	min-height: 200px;
	padding: 12px 15px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 1rem;
	font-family: inherit;
	direction: rtl;
	resize: vertical;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.note-editor-textarea:focus {
	outline: none;
	border-color: #0e85b7;
	box-shadow: 0 0 0 3px rgba(248, 82, 7, 0.1);
}

.note-editor-actions {
	display: flex;
	flex-direction: row;
	gap: 10px;
	justify-content: flex-start;
	margin-top: 10px;
}

.note-editor-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.note-editor-cancel {
	background-color: #e0e0e0;
	color: #333;
}

.note-editor-cancel:hover {
	background-color: #d0d0d0;
	transform: translateY(-2px);
}

.note-editor-side .note-editor-cancel {
	background-color: #0e85b7;
	color: white;
}

.note-editor-side .note-editor-cancel:hover {
	background-color: #0e85b7;
	transform: translateY(-2px);
	box-shadow: 0 2px 5px rgba(248, 82, 7, 0.3);
}

.note-editor-save {
	background: #0e85b7;
	color: white;
}

.note-editor-save:hover {
	background: #0e85b7;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(248, 82, 7, 0.3);
}

/* Chat History Dropdown */
.chat-history-dropdown {
	position: absolute;
	top: 70px;
	left: 50%;
	transform: translateX(-50%);
	background: white;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	padding: 15px;
	max-height: 400px;
	overflow-y: auto;
	z-index: 10001;
	min-width: 300px;
	max-width: 500px;
	animation: slideDown 0.3s ease;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

.chat-history-dropdown h3 {
	margin: 0 0 15px 0;
	font-size: 18px;
	color: #666;
	border-bottom: 2px solid #0e85b7;
	padding-bottom: 10px;
}

.chat-history-item {
	padding: 12px 15px;
	margin-bottom: 8px;
	background: #f5f5f5;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	border: 1px solid #e0e0e0;
}

.chat-history-item:hover {
	background: #0e85b7;
	color: white;
	transform: translateX(-3px);
}

.chat-history-item-date {
	font-size: 1rem;
	color: #666;
	margin-bottom: 5px;
}

.chat-history-item:hover .chat-history-item-date {
	color: rgba(255, 255, 255, 0.8);
}

.chat-history-item-preview {
	font-size: 1rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chat-history-empty {
	text-align: center;
	color: #999;
	padding: 20px;
	font-size: 1rem;
}

/* Research Agent Predefined Questions Popup */
.research-questions-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.research-questions-overlay.hideMe {
	display: none;
}

/* Workspace Management Popup */
.workspace-management-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.workspace-management-overlay.hideMe {
	display: none;
}

.workspace-management-popup {
	background: white;
	width: 90%;
	max-width: 600px;
	max-height: 80vh;
	border-radius: 15px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: slideUp 0.3s ease;
	direction: rtl;
}

.workspace-management-header {
	background: linear-gradient(135deg, #1e4f8f 0%, #0e85b7 100%);
	color: white;
	padding: 20px 25px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.workspace-management-header h3 {
	margin: 0;
	font-size: 20px;
}

.workspace-management-header .close-btn {
	color: white;
	text-decoration: none;
	font-size: 32px;
	font-weight: bold;
	width: 35px;
	height: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
	line-height: 1;
}

.workspace-management-header .close-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

.workspace-management-content {
	padding: 25px;
	overflow-y: auto;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.workspace-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 300px;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 3px;
}

.workspace-item {
	padding: 12px 15px;
	background: white;
	border: 2px solid #2a9793;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	position: relative;
}

.workspace-item:hover {
	transform: translateX(-3px);
	box-shadow: 0 4px 12px rgba(42, 151, 147, 0.2);
	border-color: #24918d;
	background: #f5f5f5;
}

.workspace-item.selected {
	background: #2a9793;
	color: white;
	border-color: #2a9793;
	box-shadow: 0 4px 12px rgba(42, 151, 147, 0.4);
}

.workspace-name-input {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 1rem;
	direction: rtl;
	box-sizing: border-box;
	background: white;
	transition: all 0.2s ease;
}

.workspace-name-input::placeholder {
	color: #999;
	font-style: italic;
}

.workspace-name-input:focus {
	outline: none;
	border-color: #2a9793;
	box-shadow: 0 0 0 3px rgba(42, 151, 147, 0.1);
	background: #FAFAFA;
}

.workspace-action-btn {
	padding: 12px 25px;
	background: #2a9793;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s ease;
	width: 100%;
}

.workspace-action-btn:hover {
	background: #24918d;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(42, 151, 147, 0.4);
}

.workspace-management-popup[data-mode="load"] .workspace-action-btn {
	background: linear-gradient(135deg, #ed7721 0%, #e67315 100%);
}

.workspace-management-popup[data-mode="load"] .workspace-action-btn:hover {
	background: linear-gradient(135deg, #e67315 0%, #ed7721 100%);
	box-shadow: 0 4px 12px rgba(237, 119, 33, 0.4);
}

.workspace-management-popup[data-mode="delete"] .workspace-action-btn {
	background: linear-gradient(135deg, #ea5b4b 0%, #d64535 100%);
}

.workspace-management-popup[data-mode="delete"] .workspace-action-btn:hover {
	background: linear-gradient(135deg, #d64535 0%, #ea5b4b 100%);
	box-shadow: 0 4px 12px rgba(234, 91, 75, 0.4);
}

.workspace-action-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
}

.research-questions-popup {
	background: white;
	width: 90%;
	max-width: 700px;
	max-height: 80vh;
	border-radius: 15px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: slideUp 0.3s ease;
	direction: rtl;
}

.research-questions-header {
	background-color: #0e85b7;
	color: white;
	padding: 20px 25px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.research-questions-header h3 {
	margin: 0;
	font-size: 20px;
}

.research-questions-header .close-btn {
	color: white;
	text-decoration: none;
	font-size: 32px;
	font-weight: bold;
	width: 35px;
	height: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
	line-height: 1;
}

.research-questions-header .close-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

.research-questions-content {
	padding: 25px;
	overflow-y: auto;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.research-question-btn {
	display: block;
	width: 100%;
	padding: 15px 20px;
	background: white;
	border: 1px solid #666;
	border-radius: 10px;
	color: #666;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: right;
	line-height: 1.5;
}

.research-question-btn:hover {
	background: #0e85b7;
	color: white;
	transform: translateX(-3px);
	box-shadow: 0 4px 10px rgba(42, 151, 147, 0.3);
}

/* Print-only header for segment print (hidden on screen) */
.print-segment-header {
	display: none;
}

/* Print Styles */
@media print {
	.ai-chat-fab,
	.docSelectCol,
	#eSvdItmsContainer .researchAgentBtn,
	.ai-chat-actions,
	.ai-message-actions,
	.ai-chat-close,
	.ai-more-questions-btn,
	.research-questions-overlay {
		display: none !important;
	}
	
	.ai-chat-panel {
		box-shadow: none;
		border-radius: 0;
	}
	
	/* Segment-only print: hide everything except the target message */
	body.print-segment-active * {
		visibility: hidden;
	}
	body.print-segment-active #print-segment-target,
	body.print-segment-active #print-segment-target * {
		visibility: visible;
	}
	body.print-segment-active #print-segment-target {
		position: fixed !important;
		left: 0 !important;
		top: 0 !important;
		width: 100% !important;
	}
	body.print-segment-active .print-segment-header {
		display: block !important;
		margin-bottom: 1em;
	}
	body.print-segment-active .print-segment-header h1 {
		color: #f85207;
		border-bottom: 3px solid #f85207;
		padding-bottom: 10px;
	}
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	.ai-chat-header {
		gap: 10px;
		padding: 15px 20px;
	}
	
	.ai-chat-actions {
		gap: 5px;
	}
	
	.aiNewChatBtn,
	.aiCopyBtn,
	.aiPrintBtn,
	.aiHistoryBtn {
		width: 28px;
		height: 28px;
	}
	
	.ai-chat-header h2 {
		font-size: 18px;
	}
}

@media screen and (max-width: 480px) {
	.ai-chat-header {
		gap: 8px;
		padding: 12px 15px;
	}
	
	.ai-chat-doc-count {
		display: none;
	}
	
	.ai-chat-header h2 {
		font-size: 1rem;
	}
	
	.aiNewChatBtn,
	.aiCopyBtn,
	.aiPrintBtn,
	.aiHistoryBtn {
		width: 24px;
		height: 24px;
	}
}

/* Document Open Button */
.doc-open-btn {
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 5px;
	padding: 6px 12px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-top: 8px;
	align-self: flex-start;
}

.doc-open-btn:hover {
	background: #0e85b7;
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(248, 82, 7, 0.3);
}

.doc-open-btn.closed {
	background: #0e85b7;
}

.doc-open-btn.closed:hover {
	background: #0e85b7;
	box-shadow: 0 2px 5px rgba(248, 82, 7, 0.3);
}

.doc-open-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Document Iframe Container */
.doc-iframe-container {
	margin-top: 10px;
	margin-bottom: 0;
	border-left: none;
	border-right: none;
	border-top: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	border-radius: 0;
	background: white;
	overflow: hidden;
	display: none;
	animation: slideDown 0.3s ease;
	width: calc(100% + 50px);
	position: relative;
	box-sizing: border-box;
}

.doc-iframe-container.show {
	display: block;
}

.doc-iframe-toolbar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 6px 8px 4px;
	min-height: 32px;
	box-sizing: border-box;
}

.doc-expand-fullsize-btn {
	width: 16px;
	height: 16px;
	padding: 0;
	border: none;
	background: transparent url(../images/openFullSizeBtn.png) center/contain no-repeat;
	cursor: pointer;
	flex-shrink: 0;
	box-sizing: border-box;
}

.doc-expand-fullsize-btn:hover {
	background-image: url(../images/openFullSizeBtnH.png);
}

.doc-iframe-container iframe {
	width: 100%;
	border: none;
	display: block;
	min-height: 400px;
	overflow: hidden;
}

.doc-iframe-close-btn {
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 5px;
	padding: 8px 15px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	margin: 10px;
	margin-right: auto;
	display: block;
}

.doc-iframe-close-btn:hover {
	background: #0e85b7;
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(248, 82, 7, 0.3);
}

/* Document full-size overlay (inside personal assistant panel) */
.doc-fullsize-view {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100;
	background: white;
	overflow: hidden;
	display: grid;
	grid-template-rows: auto 1fr;
	box-sizing: border-box;
}

.doc-fullsize-view.hideMe {
	display: none;
}

.doc-fullsize-header {
	display: grid;
	justify-content: flex-end;
	align-items: center;
	padding: 6px 12px;
	min-height: 44px;
	background: #f8f9fa;
	border-bottom: 1px solid #e0e0e0;
	box-sizing: border-box;
}

.doc-fullsize-content {
	position: relative;
	overflow: auto;
	min-height: 0;
}

.doc-fullsize-content iframe {
	width: 100%;
	height: 100%;
	display: block;
	border: none;
	min-height: 400px;
}

.doc-fullsize-view .doc-expand-fullsize-btn {
	margin-left: 8px;
}

/* Note Editor in Side Panel */
.note-editor-side {
	padding: 15px;
	background: white;
	border-left: none;
	border-right: none;
	border-top: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	border-radius: 0;
	margin-top: 10px;
	display: none;
	animation: slideDown 0.3s ease;
	width: 100%;
	position: relative;
	box-sizing: border-box;
}

.note-editor-side.show {
	display: flex;
	flex-direction: column;
	gap:0.5rem;
}

.note-editor-side .note-editor-actions {
	display: flex;
	flex-direction: row;
	gap: 10px;
	justify-content: flex-start;
	margin-top: 15px;
}

.note-editor-side .note-editor-save {
	background: #0e85b7;
	color: white;
}

.note-editor-side .note-editor-save:hover {
	background: #0e85b7;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(248, 82, 7, 0.3);
}

.note-editor-side .doc-iframe-close-btn {
	margin-right: auto;
}

/* Selected Doc Item - Position relative for button positioning */
.selected-doc-item {
	position: relative;
}

.selected-doc-item .doc-details {
	position: relative;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
		max-height: 0;
	}
	to {
		opacity: 1;
		transform: translateY(0);
		max-height: 1000px;
	}
}

@keyframes slideUp {
	from {
		opacity: 1;
		transform: translateY(0);
		max-height: 1000px;
	}
	to {
		opacity: 0;
		transform: translateY(-10px);
		max-height: 0;
	}
}

/* Document Upload Popup */
.document-upload-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.document-upload-overlay.hideMe {
	display: none;
}

.document-upload-popup {
	background: white;
	width: 90%;
	max-width: 700px;
	max-height: 80vh;
	border-radius: 15px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: slideUp 0.3s ease;
	direction: rtl;
}

.document-upload-header {
	background: linear-gradient(135deg, #1e4f8f 0%, #0e85b7 100%);
	color: white;
	padding: 20px 25px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.document-upload-header h3 {
	margin: 0;
	font-size: 20px;
}

.document-upload-header .close-btn {
	color: white;
	text-decoration: none;
	font-size: 32px;
	font-weight: bold;
	width: 35px;
	height: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
	line-height: 1;
}

.document-upload-header .close-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

.document-upload-content {
	padding: 25px;
	overflow-y: auto;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.document-upload-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.upload-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.upload-form-col {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.upload-label {
	font-size: 1rem;
	font-weight: bold;
	color: #333;
}

.document-name-input {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 1rem;
	direction: rtl;
	box-sizing: border-box;
	background: white;
	transition: all 0.2s ease;
}

.document-name-input::placeholder {
	color: #999;
	font-style: italic;
}

.document-name-input:focus {
	outline: none;
	border-color: #2a9793;
	box-shadow: 0 0 0 3px rgba(42, 151, 147, 0.1);
	background: #FAFAFA;
}

.document-file-input {
	display: none;
}

.file-input-label {
	display: inline-block;
	padding: 12px 24px;
	background: #2a9793;
	color: white;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	font-size: 1rem;
}

.file-input-label:hover {
	background: #24918d;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(42, 151, 147, 0.4);
}

.selected-file-name {
	margin-top: 8px;
	color: #666;
	font-size: 0.9rem;
	font-style: italic;
}

.document-upload-actions {
	display: flex;
	flex-direction: row;
	gap: 10px;
	justify-content: flex-start;
	margin-top: 10px;
}

.document-upload-action-btn {
	padding: 12px 25px;
	background: #2a9793;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s ease;
}

.document-upload-action-btn:hover {
	background: #24918d;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(42, 151, 147, 0.4);
}

.document-upload-action-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
}

.document-upload-cancel-btn {
	padding: 12px 25px;
	background: #e0e0e0;
	color: #333;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s ease;
}

.document-upload-cancel-btn:hover {
	background: #d0d0d0;
	transform: translateY(-2px);
}

@media screen and (max-width: 768px) {
	.upload-form-row {
		grid-template-columns: 1fr;
	}
	
	.document-upload-popup {
		width: 95%;
		max-width: none;
	}
}

/* Uploaded Document Viewer */
.uploaded-doc-viewer {
	margin-top: 10px;
	margin-bottom: 0;
	border-left: none;
	border-right: none;
	border-top: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	border-radius: 0;
	background: white;
	overflow: hidden;
	display: none;
	animation: slideDown 0.3s ease;
	width: 100%;
	position: relative;
	box-sizing: border-box;
}

.uploaded-doc-viewer.show {
	display: block;
}

.uploaded-doc-viewer .doc-iframe-toolbar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 6px 8px 4px;
	min-height: 32px;
	box-sizing: border-box;
}

.uploaded-doc-content {
	padding: 15px;
	direction: rtl;
	text-align: right;
	overflow: visible;
}

.uploaded-doc-content img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto 20px auto;
}

.uploaded-doc-content .docx {
	direction: rtl;
	text-align: right;
}

/* Selected workspace highlight in sidebar */
.side-menu-item.workspace-selected {
	background: #bdd2ef;
}

/* Selected chat highlight in sidebar */
.side-menu-item.chat-selected {
	background: #bdd2ef;
}

/* Hide welcome paragraph text */
.ai-chat-welcome p {
	display: none;
}

/* New Project Popup */
.new-project-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10002;
	display: grid;
	place-items: center;
	animation: fadeIn 0.3s ease;
}

.new-project-overlay.hideMe {
	display: none;
}

.new-project-popup {
	background: white;
	width: 90%;
	max-width: 480px;
	border-radius: 16px;
	box-shadow: 0 16px 70px rgba(0, 0, 0, 0.25);
	display: grid;
	grid-template-rows: auto 1fr auto;
	overflow: hidden;
	animation: newProjectPopupIn 0.3s ease;
	direction: rtl;
}

@keyframes newProjectPopupIn {
	from {
		transform: translateY(30px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.new-project-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
}

.new-project-header h3 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: #1a1a1a;
}

.new-project-header .close-btn {
	color: #999;
	text-decoration: none;
	font-size: 24px;
	font-weight: 400;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	transition: background 0.2s ease, color 0.2s ease;
	line-height: 1;
}

.new-project-header .close-btn:hover {
	background: #f0f0f0;
	color: #333;
}

.new-project-body {
	padding: 24px;
	display: grid;
	gap: 10px;
}

.new-project-label {
	font-size: 0.9rem;
	font-weight: 600;
	color: #555;
}

.new-project-input {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	font-size: 1rem;
	font-family: inherit;
	direction: rtl;
	box-sizing: border-box;
	background: #fafafa;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	color: #1a1a1a;
}

.new-project-input::placeholder {
	color: #aaa;
}

.new-project-input:focus {
	outline: none;
	border-color: #0e85b7;
	background: white;
	box-shadow: 0 0 0 3px rgba(14, 133, 183, 0.12);
}

.new-project-footer {
	display: grid;
	grid-template-columns: auto auto;
	gap: 10px;
	justify-content: end;
	padding: 16px 24px 20px;
	border-top: 1px solid #e8e8e8;
}

.new-project-cancel-btn {
	padding: 10px 24px;
	background: transparent;
	color: #666;
	border: 1px solid #ddd;
	border-radius: 10px;
	font-size: 0.95rem;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
}

.new-project-cancel-btn:hover {
	background: #f5f5f5;
	border-color: #ccc;
	color: #333;
}

.new-project-create-btn {
	padding: 10px 28px;
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
}

.new-project-create-btn:hover {
	background: #0c7aa6;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(14, 133, 183, 0.35);
}

.new-project-create-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

@media screen and (max-width: 480px) {
	.new-project-popup {
		width: 95%;
		max-width: none;
	}
}

/* Attach to Workspace Choice Popup */
.attach-to-workspace-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10002;
	display: grid;
	place-items: center;
	animation: fadeIn 0.3s ease;
}

.attach-to-workspace-overlay.hideMe {
	display: none;
}

.attach-to-workspace-popup {
	background: white;
	width: 90%;
	max-width: 620px;
	border-radius: 16px;
	box-shadow: 0 16px 70px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	animation: newProjectPopupIn 0.3s ease;
	direction: rtl;
}

.attach-to-workspace-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
}

.attach-to-workspace-header h3 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: #1a1a1a;
}

.attach-to-workspace-header .close-btn {
	color: #999;
	text-decoration: none;
	font-size: 24px;
	font-weight: 400;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	transition: background 0.2s ease, color 0.2s ease;
	line-height: 1;
}

.attach-to-workspace-header .close-btn:hover {
	background: #f0f0f0;
	color: #333;
}

.attach-to-workspace-body {
	padding: 24px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.attach-to-workspace-prompt {
	margin: 0;
	font-size: 1rem;
	color: #555;
}

.attach-to-workspace-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

#attachToActiveWsBtn {
	grid-column: 1 / -1;
}

.attach-to-workspace-btn {
	padding: 14px 20px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
	background: white;
	color: #333;
}

.attach-to-workspace-btn:hover {
	border-color: #0e85b7;
	background: #f0f8fb;
	color: #0e85b7;
}

.attach-create-btn {
	border-color: #0e85b7;
	background: #0e85b7;
	color: white;
}

.attach-active-btn {
	border-color: #10B981;
	background: #10B981;
	color: white;
	box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.attach-active-btn:hover {
	background: #059669;
	border-color: #059669;
	color: white;
}

.attach-create-btn:hover {
	background: #0c7aa6;
	border-color: #0c7aa6;
	color: white;
}

.attach-existing-btn:hover {
	background: #e8f4f8;
}


@media screen and (max-width: 480px) {
	.attach-to-workspace-popup {
		width: 95%;
		max-width: none;
	}
	.attach-to-workspace-actions {
		grid-template-columns: 1fr;
	}
}

.unsaved-workspace-save-link {
	font-size: 0.7em;
	font-weight: normal;
	margin-right: 6px;
	text-decoration: none;
	opacity: 0.75;
	cursor: pointer;
}
.unsaved-workspace-save-link:hover {
	opacity: 1;
	text-decoration: underline;
}

/* Document-generated questions animation */
#aiPredefinedQuestions {
	transition: opacity 0.3s ease, transform 0.3s ease;
}
#aiPredefinedQuestions.questions-fade-out {
	opacity: 0;
	transform: scale(0.95);
}
#aiPredefinedQuestions.questions-fade-in .predefined-q-btn {
	opacity: 0;
	animation: questionItemFadeIn 0.4s ease forwards;
}
#aiPredefinedQuestions.questions-fade-in .predefined-q-btn:nth-child(1) { animation-delay: 0s; }
#aiPredefinedQuestions.questions-fade-in .predefined-q-btn:nth-child(2) { animation-delay: 0.08s; }
#aiPredefinedQuestions.questions-fade-in .predefined-q-btn:nth-child(3) { animation-delay: 0.16s; }
#aiPredefinedQuestions.questions-fade-in .predefined-q-btn:nth-child(4) { animation-delay: 0.24s; }
@keyframes questionItemFadeIn {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ai-more-questions-btn.more-questions-updated {
	animation: moreQuestionsAttention 0.7s ease 5;
	border-radius: 6px;
}
@keyframes moreQuestionsAttention {
	0%   { background-color: transparent; box-shadow: none; transform: scale(1); }
	40%  { background-color: rgba(14, 133, 183, 0.25); box-shadow: 0 0 8px rgba(14, 133, 183, 0.5); transform: scale(1.15); }
	100% { background-color: transparent; box-shadow: none; transform: scale(1); }
}

/* Guest Mode Popup */
.guest-mode-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10003;
	display: grid;
	place-items: center;
	animation: fadeIn 0.3s ease;
}
.guest-mode-overlay.hideMe {
	display: none;
}
.guest-mode-popup {
	background: white;
	width: 90%;
	max-width: 480px;
	border-radius: 16px;
	box-shadow: 0 16px 70px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	animation: newProjectPopupIn 0.3s ease;
	direction: rtl;
}
.guest-mode-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
}
.guest-mode-header h3 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: #1a1a1a;
}
.guest-mode-header .close-btn {
	color: #999;
	text-decoration: none;
	font-size: 24px;
	font-weight: 400;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	transition: background 0.2s ease, color 0.2s ease;
	line-height: 1;
}
.guest-mode-header .close-btn:hover {
	background: #f0f0f0;
	color: #333;
}
.guest-mode-body {
	padding: 24px;
}
.guest-mode-body p {
	margin: 0;
	font-size: 1rem;
	color: #444;
	line-height: 1.7;
}
.guest-mode-body a {
	color: #0e85b7;
	text-decoration: underline;
}
.guest-mode-body a:hover {
	color: #0c7aa6;
}

/* Unsaved Workspace Prompt */
.unsaved-workspace-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10004;
	display: grid;
	place-items: center;
	animation: fadeIn 0.3s ease;
}
.unsaved-workspace-overlay.hideMe {
	display: none;
}
.unsaved-workspace-popup {
	background: white;
	width: 90%;
	max-width: 480px;
	border-radius: 16px;
	box-shadow: 0 16px 70px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	animation: newProjectPopupIn 0.3s ease;
	direction: rtl;
}
.unsaved-workspace-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
}
.unsaved-workspace-header h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: #1a1a1a;
}
.unsaved-workspace-header .close-btn {
	color: #999;
	text-decoration: none;
	font-size: 24px;
	font-weight: 400;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	transition: background 0.2s ease, color 0.2s ease;
	line-height: 1;
}
.unsaved-workspace-header .close-btn:hover {
	background: #f0f0f0;
	color: #333;
}
.unsaved-workspace-body {
	padding: 24px;
	display: grid;
	gap: 16px;
}
.unsaved-ws-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.unsaved-ws-btn {
	padding: 12px 20px;
	border: none;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
}
.unsaved-ws-save-btn {
	background: #10B981;
	color: white;
}
.unsaved-ws-save-btn:hover {
	background: #059669;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.unsaved-ws-abandon-btn {
	background: #f5f5f5;
	color: #555;
	border: 1px solid #ddd;
}
.unsaved-ws-abandon-btn:hover {
	background: #fee2e2;
	color: #dc2626;
	border-color: #fca5a5;
}
.unsaved-ws-save-section {
	display: grid;
	gap: 10px;
}
.unsaved-ws-save-section.hideMe {
	display: none;
}
.unsaved-ws-label {
	font-size: 0.9rem;
	font-weight: 600;
	color: #555;
}
.unsaved-ws-name-input {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	font-size: 1rem;
	font-family: inherit;
	direction: rtl;
	box-sizing: border-box;
	background: #fafafa;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	color: #1a1a1a;
}
.unsaved-ws-name-input::placeholder {
	color: #aaa;
}
.unsaved-ws-name-input:focus {
	outline: none;
	border-color: #0e85b7;
	background: white;
	box-shadow: 0 0 0 3px rgba(14, 133, 183, 0.12);
}
.unsaved-ws-confirm-btn {
	padding: 12px 28px;
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
	justify-self: end;
}
.unsaved-ws-confirm-btn:hover:not(:disabled) {
	background: #0c7aa6;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(14, 133, 183, 0.35);
}
.unsaved-ws-confirm-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
@media screen and (max-width: 480px) {
	.unsaved-workspace-popup {
		width: 95%;
	}
	.unsaved-ws-actions {
		grid-template-columns: 1fr;
	}
}

/* ========== PA Onboarding Tour ========== */

/* Dimmed column */
.pa-tour-dimmed {
	opacity: 0.12;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

/* Highlighted column */
.pa-tour-highlighted {
	position: relative;
	z-index: 2;
	transition: opacity 0.3s ease;
	background-color: rgba(14, 133, 183, 0.04);
}

/* Pulse animation for key buttons during tour */
.pa-tour-pulse {
	animation: paTourPulse 1.5s ease-in-out infinite;
	border-radius: 8px;
}

@keyframes paTourPulse {
	0%   { box-shadow: 0 0 0 0 rgba(14, 133, 183, 0.5); }
	70%  { box-shadow: 0 0 0 12px rgba(14, 133, 183, 0); }
	100% { box-shadow: 0 0 0 0 rgba(14, 133, 183, 0); }
}

/* Outline on a specific element within a highlighted column */
.pa-tour-outline {
	outline: 3px solid #0e85b7 !important;
	outline-offset: 4px;
	border-radius: 4px;
	position: relative;
	z-index: 3;
}

/* Tour caption wrapper */
.pa-tour-caption-wrapper {
	position: absolute;
	z-index: 10;
	max-width: 400px;
	padding: 1.5rem 2rem;
	background-color: #0e85b7;
	color: white;
	border-radius: 0.75rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
	font-size: 1.1rem;
	line-height: 1.6;
	text-align: right;
	direction: rtl;
	box-sizing: border-box;
	z-index: 10001;
	max-height: 90%;
	overflow-y: auto;
}

.pa-tour-caption-wrapper.pa-tour-centered {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.pa-tour-close-btn {
	position: absolute;
	top: 0.5rem;
	left: 0.75rem;
	width: 22px;
	height: 22px;
	cursor: pointer;
	font-size: 1.2rem;
	color: rgba(255, 255, 255, 0.7);
	line-height: 22px;
	text-align: center;
}

.pa-tour-close-btn:hover {
	color: white;
}

.pa-tour-step-indicator {
	font-size: 0.82rem;
	opacity: 0.7;
	margin-bottom: 0.4rem;
}

.pa-tour-caption {
	margin-bottom: 0;
}

.pa-tour-caption img {
	max-width: 100%;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	display: block;
	margin-top: 0.75rem;
}

.pa-tour-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 1.25rem;
	justify-content: flex-end;
}

.pa-tour-btn {
	font-family: inherit;
	background-color: rgba(255, 255, 255, 0.2);
	padding: 0.45rem 1rem;
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: white;
	cursor: pointer;
	border-radius: 6px;
	font-size: 1rem;
	transition: background 0.2s ease;
	white-space: nowrap;
}

.pa-tour-btn:hover {
	background-color: rgba(255, 255, 255, 0.35);
}

.pa-tour-btn.pa-tour-btn-primary {
	background-color: rgba(255, 255, 255, 0.3);
	border-color: white;
	font-weight: bold;
}

.pa-tour-btn.pa-tour-btn-primary:hover {
	background-color: rgba(255, 255, 255, 0.5);
}

/* Tour arrow */
.pa-tour-arrow {
	position: absolute;
	width: 14px;
	height: 14px;
	background-image: url(../images/arrow3.png);
	background-size: contain;
	background-repeat: no-repeat;
}

.pa-tour-arrow.arrow-top {
	top: -14px;
}

.pa-tour-arrow.arrow-bottom {
	bottom: -14px;
	transform: rotate(180deg);
}

/* Help button in PA header */
@media only screen and (min-width: 769px) {
	.pa-tour-help-btn {
		cursor: pointer;
		padding: 0;
		font-size: 0.9rem;
		font-weight: bold;
		color: #666;
		background: transparent;
		border: 1px solid #bbb;
		border-radius: 50%;
		width: 24px;
		height: 24px;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		transition: background 0.2s ease, color 0.2s ease;
		margin-right: auto;
	}
	.pa-tour-help-btn:hover {
		background: #e8f4f8;
		color: #0e85b7;
		border-color: #0e85b7;
	}
}

/* Mobile empty-sources CTA - hidden on desktop */
.mobile-empty-sources-cta {
	display: none;
}

@media only screen and (max-width: 768px) {
	.mobile-empty-sources-cta.visible {
		display: flex;
		align-items: center;
		gap: 10px;
		background: #e8f4f8;
		border: 2px dashed #0e85b7;
		border-radius: 12px;
		padding: 14px 18px;
		cursor: pointer;
		width: 100%;
		max-width: 400px;
		box-sizing: border-box;
		transition: background 0.2s ease;
	}
	.mobile-empty-sources-cta.visible:active {
		background: #d0eaf2;
	}
	.mobile-empty-sources-cta .empty-cta-icon {
		width: 28px;
		height: 28px;
		flex-shrink: 0;
	}
	.mobile-empty-sources-cta .empty-cta-text {
		color: #0e85b7;
		font-size: 0.95rem;
		font-weight: 600;
		line-height: 1.4;
	}
	.mobile-sources-btn.no-sources::after {
		content: '';
		position: absolute;
		top: 2px;
		left: 2px;
		width: 10px;
		height: 10px;
		background: #e53e3e;
		border-radius: 50%;
		animation: pulse-dot 1.5s ease-in-out infinite;
	}
	@keyframes pulse-dot {
		0%, 100% { opacity: 1; transform: scale(1); }
		50% { opacity: 0.5; transform: scale(1.4); }
	}
}

/* Redirect Confirmation Popup */
.redirect-confirm-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10002;
	display: grid;
	place-items: center;
	animation: fadeIn 0.3s ease;
}

.redirect-confirm-overlay.hideMe {
	display: none;
}

.redirect-confirm-popup {
	background: white;
	width: 90%;
	max-width: 520px;
	border-radius: 16px;
	box-shadow: 0 16px 70px rgba(0, 0, 0, 0.25);
	display: grid;
	grid-template-rows: auto 1fr auto;
	overflow: hidden;
	animation: newProjectPopupIn 0.3s ease;
	direction: rtl;
}

.redirect-confirm-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e8e8e8;
}

.redirect-confirm-header h3 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: #1a1a1a;
}

.redirect-confirm-header .close-btn {
	color: #999;
	text-decoration: none;
	font-size: 24px;
	font-weight: 400;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	transition: background 0.2s ease, color 0.2s ease;
	line-height: 1;
}

.redirect-confirm-header .close-btn:hover {
	background: #f0f0f0;
	color: #333;
}

.redirect-confirm-body {
	padding: 24px;
	display: grid;
	gap: 14px;
}

.redirect-confirm-image {
	display: block;
	max-width: 100%;
	margin: 0 auto;
	border-radius: 8px;
}

.redirect-confirm-body p {
	margin: 0;
	font-size: 0.95rem;
	color: #444;
	line-height: 1.6;
}

.redirect-confirm-dontshow {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.88rem;
	color: #666;
}

.redirect-confirm-dontshow input[type="checkbox"] {
	cursor: pointer;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.redirect-confirm-footer {
	display: grid;
	grid-template-columns: auto auto;
	gap: 10px;
	justify-content: end;
	padding: 16px 24px 20px;
	border-top: 1px solid #e8e8e8;
}

.redirect-confirm-cancel-btn {
	padding: 10px 24px;
	background: transparent;
	color: #666;
	border: 1px solid #ddd;
	border-radius: 10px;
	font-size: 0.95rem;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
}

.redirect-confirm-cancel-btn:hover {
	background: #f5f5f5;
	border-color: #ccc;
	color: #333;
}

.redirect-confirm-accept-btn {
	padding: 10px 28px;
	background: #0e85b7;
	color: white;
	border: none;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
}

.redirect-confirm-accept-btn:hover {
	background: #0c7aa6;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(14, 133, 183, 0.35);
}
