.page-projects {
	background: var(--color-bg);
	color: var(--color-text);
	height: 100vh;
	min-height: 0;
	overflow: hidden !important;
}

.page-projects #main-content {
	overflow: hidden;
}

.page-projects #projects-page-root {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	min-width: 0;
}

.projects-layout {
	display: flex;
	flex: 1;
	min-height: 0;
	min-width: 0;
}

.gallery-sidebar {
	flex: 0 0 240px;
	display: flex;
	flex-direction: column;
	background: transparent;
	border-right: 1px solid var(--color-border);
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.75rem 0;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: var(--gray-700) transparent;
}

.gallery-sidebar::-webkit-scrollbar {
	width: 4px;
}

.gallery-sidebar::-webkit-scrollbar-track {
	background: transparent;
}

.gallery-sidebar::-webkit-scrollbar-thumb {
	background: var(--gray-700);
	border-radius: 2px;
}

.gallery-sidebar::-webkit-scrollbar-thumb:hover {
	background: var(--gray-600);
}

.projects-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.sidebar-section {
	margin-bottom: 1rem;
}

.sidebar-section:last-child {
	margin-bottom: 0;
}

.section-header {
	padding: 0.375rem 1rem;
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--gray-400);
	margin-bottom: 0.25rem;
}

.collapsible .section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	border-radius: 4px;
}

.collapsible .section-header:hover {
	background: var(--color-card-bg-hover);
	color: var(--color-text);
}

.collapse-arrow {
	font-size: 0.75rem;
	color: var(--gray-500);
}

.collapse-arrow::after {
	content: '▾';
}

.collapsible.collapsed .collapse-arrow::after {
	content: '▸';
}

.collapsible .section-header:hover .collapse-arrow {
	color: var(--text-primary);
}

.collapsible.collapsed .section-items {
	display: none;
}

.gallery-item-create {
	background: none;
	border: none;
	width: 100%;
	text-align: left;
	justify-content: flex-start;
	gap: 0.25rem;
	padding-left: 1rem;
	transition: color 120ms ease;
}

.gallery-item-create:hover {
	background: none;
}

.gallery-item-create .item-icon {
	width: 14px;
	height: 14px;
	color: var(--gray-500);
	transition: color 120ms ease;
}

.gallery-item-create .item-label {
	font-size: 0.75rem;
	color: var(--gray-500);
	transition: color 120ms ease;
}

.gallery-item-create:hover .item-icon,
.gallery-item-create:hover .item-label {
	color: var(--color-text);
}

.gallery-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	cursor: pointer;
	color: var(--color-text-muted);
}

.gallery-item:hover:not(.gallery-item-create) {
	background: var(--color-card-bg-hover);
	color: var(--color-text);
}

.gallery-item.active:not(.gallery-item-create) {
	background: var(--color-card-bg-hover);
	color: var(--color-text);
}

.item-label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.item-count {
	font-size: 0.6875rem;
	color: var(--gray-500);
	flex-shrink: 0;
}

.item-icon {
	font-size: 1rem;
	flex-shrink: 0;
}

.item-label {
	font-size: 0.8125rem;
	font-weight: 500;
}

.profile-indicator {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 1rem 0.25rem;
	font-size: 0.8125rem;
	color: var(--color-text-muted);
}

.profile-indicator .icon-user {
	width: 14px;
	height: 14px;
}

.profile-indicator-sep {
	opacity: 0.5;
}

.profile-indicator-link {
	color: var(--color-text-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.profile-indicator-link:hover {
	color: var(--color-text);
}

.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	border-bottom: none;
	background: transparent;
	gap: 1rem;
	flex-wrap: wrap;
}

.toolbar-left {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	flex: 1;
	min-width: 0;
}

.gallery-title {
	font-size: 1.125rem;
	font-weight: 500;
	margin: 0;
	color: var(--color-text);
}

.project-count {
	font-size: 0.8125rem;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.toolbar-right {
	display: flex;
	align-items: center;
}

.btn-create-project {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--color-button-primary);
	color: var(--color-on-button-primary);
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	white-space: nowrap;
}

.btn-create-project:hover {
	background: var(--color-button-primary-hover);
}

.btn-create-project .icon-mask {
	width: 18px;
	height: 18px;
}

.search-bar {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 0.875rem 1rem;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-overlay-soft);
}

.search-input-wrapper {
	position: relative;
	flex: 1;
	max-width: 400px;
}

.search-icon {
	position: absolute;
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--gray-500);
	pointer-events: none;
	width: 18px;
	height: 18px;
}

.search-input {
	width: 100%;
	padding: 0.5rem 0.75rem 0.5rem 2.5rem;
	background: var(--color-field-bg);
	border: 1px solid var(--color-field-border);
	border-radius: 6px;
	color: var(--color-text);
	font-size: 0.875rem;
}

.search-input:focus {
	outline: none;
}

.search-input::placeholder {
	color: var(--color-text-subtle);
}

.filters-section {
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.filter-group {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.filter-label {
	font-size: 0.875rem;
	color: var(--color-text-muted);
	font-weight: 500;
}

/* Custom radio buttons (shared by filter and privacy radios) */
.filter-radio,
.privacy-option {
	display: flex;
	align-items: center;
	font-size: 0.875rem;
	color: var(--color-text);
	cursor: pointer;
	position: relative;
}

.filter-radio { gap: 0.375rem; }
.privacy-option { gap: 0.5rem; }

.filter-radio input[type="radio"],
.privacy-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	cursor: pointer;
}

.filter-radio span,
.privacy-option span {
	position: relative;
	padding-left: 1.25rem;
}

.filter-radio span::before,
.privacy-option span::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 14px;
	height: 14px;
	border: 2px solid var(--color-field-border);
	border-radius: 50%;
	background: var(--color-field-bg);
}

.filter-radio input[type="radio"]:checked + span::before,
.privacy-option input[type="radio"]:checked + span::before {
	border-color: var(--color-accent);
}

.filter-radio input[type="radio"]:checked + span::after,
.privacy-option input[type="radio"]:checked + span::after {
	content: '';
	position: absolute;
	left: 4px;
	top: 50%;
	transform: translateY(-50%);
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--color-accent);
}

.filter-radio:hover span::before,
.privacy-option:hover span::before {
	border-color: var(--color-border-strong);
}

.filter-radio input[type="radio"]:checked:hover + span::before,
.privacy-option input[type="radio"]:checked:hover + span::before {
	border-color: var(--color-accent);
}

.projects-content {
	flex: 1;
	padding: 0;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--gray-600) transparent;
}

.projects-content::-webkit-scrollbar {
	width: 6px;
}

.projects-content::-webkit-scrollbar-track {
	background: transparent;
}

.projects-content::-webkit-scrollbar-thumb {
	background: var(--gray-600);
	border-radius: 3px;
}

.projects-content::-webkit-scrollbar-thumb:hover {
	background: var(--gray-500);
}

.projects-grid {
	display: flex;
	flex-direction: column;
}

.projects-header {
	display: grid;
	grid-template-columns: 28px 1fr 140px 160px 160px 100px;
	align-items: center;
	gap: 0.5rem;
	padding: 0.625rem 1rem;
	border-bottom: 1px solid var(--color-border);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--color-bg);
}

.header-expand {
	width: 28px;
}

.header-sortable {
	background: none;
	border: none;
	padding: 0;
	color: var(--gray-400);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.header-sortable:hover {
	color: var(--text-primary);
}

.header-sortable.sorted-asc,
.header-sortable.sorted-desc {
	color: var(--text-primary);
}

.sort-arrow::before {
	content: '▼';
	font-size: 0.625rem;
	opacity: 0.3;
}

.header-sortable.sorted-asc .sort-arrow::before {
	content: '▲';
	opacity: 1;
}

.header-sortable.sorted-desc .sort-arrow::before {
	opacity: 1;
}

.header-privacy {
	justify-content: flex-end;
	padding-right: 1rem;
}

.project-card {
	display: grid;
	grid-template-columns: 28px 1fr 140px 160px 160px 100px;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: transparent;
	border-bottom: 1px solid var(--color-border);
	position: relative;
	cursor: pointer;
}

.project-card:hover {
	background: var(--color-card-bg-hover);
}

.project-card:last-child {
	border-bottom: none;
}

.project-expand {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--gray-500);
}

.project-expand.has-children {
	color: var(--gray-400);
}

.project-expand.has-children:hover {
	color: var(--text-primary);
}

.project-expand-icon {
	width: 16px;
	height: 16px;
	display: block;
	background-color: currentColor;
	-webkit-mask-image: url('../../../weblogo/bin-debug/images/icons/icon-chevron-down.svg');
	mask-image: url('../../../weblogo/bin-debug/images/icons/icon-chevron-down.svg');
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	transform: rotate(-90deg);
}

.project-card.expanded .project-expand-icon {
	transform: rotate(0deg);
}

.project-card.is-remix-parent .project-owner {
	visibility: hidden;
}

.project-card.is-remix-parent.expanded {
	background: rgba(128,128,128,0.04);
	border-left: 2px solid rgba(128,128,128,0.15);
}

.project-card.is-child {
	background: rgba(128,128,128,0.04);
	border-left: 2px solid rgba(128,128,128,0.15);
}

.project-card.is-child .project-name {
	margin-left: 1rem;
}

.project-card.is-child:hover {
	background: rgba(128,128,128,0.08);
}

.project-link {
	display: grid;
	grid-template-columns: subgrid;
	grid-column: 2 / 7;
	align-items: center;
	gap: 0.5rem;
	color: var(--color-text);
	text-decoration: none;
	cursor: pointer;
}

.project-name {
	font-size: 0.875rem;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.project-name-group {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	min-width: 0;
	overflow: hidden;
}

.project-description-cell {
	font-size: 0.75rem;
	color: var(--gray-500);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex-shrink: 1;
	min-width: 0;
}

.project-owner {
	font-size: 0.8125rem;
	color: var(--gray-400);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.project-created,
.project-modified {
	font-size: 0.8125rem;
	color: var(--gray-400);
	white-space: nowrap;
}

.project-privacy {
	font-size: 0.8125rem;
	color: var(--gray-400);
	white-space: nowrap;
	text-align: right;
	padding-right: 1rem;
}

.modal-body {
	padding: 1.5rem;
}

.settings-section {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.25rem 0;
}

.settings-section:first-child {
	padding-top: 0;
}

.settings-section:not(:last-child) {
	border-bottom: 1px solid var(--gray-700);
}

.project-created-by {
	display: block;
	font-size: 0.85rem;
	color: var(--text-secondary);
	margin-top: 0.2rem;
}

.project-created-by a {
	color: var(--green-primary);
	text-decoration: none;
}

.project-created-by a:hover {
	text-decoration: underline;
}

.btn-full {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 1.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
}

.btn-full .icon-mask {
	width: 18px;
	height: 18px;
}

.section-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--gray-300);
}

.description-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.btn-edit-description {
	background: none;
	border: none;
	color: var(--gray-400);
	font-size: 0.875rem;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: flex-end;
	gap: 0.375rem;
	line-height: 1;
}

.btn-edit-description .icon-mask {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

.btn-edit-description:hover {
	color: var(--text-primary);
}

.project-description {
	margin: 0;
	font-size: 0.875rem;
	color: var(--gray-400);
	line-height: 1.5;
	min-height: 20px;
}

.project-description:empty::before {
	content: attr(data-empty-text);
	color: var(--gray-500);
	font-style: italic;
}

.add-gallery-link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--text-primary);
	cursor: pointer;
}

.add-gallery-link:hover {
	text-decoration: underline;
}

.add-gallery-link .icon-mask {
	width: 14px;
	height: 14px;
}

.current-galleries {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.no-galleries-message {
	font-size: 0.8125rem;
	color: var(--gray-500);
	margin: 0;
	opacity: 0.7;
	font-style: italic;
}

.gallery-item-current {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0;
	font-size: 0.875rem;
	color: var(--text-primary);
}

.gallery-item-name {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.gallery-item-type {
	font-size: 0.75rem;
	color: var(--gray-500);
}

.gallery-picker {
	flex-direction: column;
	max-height: calc(90vh - 2px);
}

.gallery-picker-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--gray-700);
}

.gallery-picker-header h3 {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
}

.gallery-picker-list {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.5rem 0;
	scrollbar-width: thin;
	scrollbar-color: rgba(128,128,128,0.35) transparent;
}

.gallery-picker-list::-webkit-scrollbar {
	width: 6px;
}

.gallery-picker-list::-webkit-scrollbar-track {
	background: rgba(128,128,128,0.08);
	border-radius: 3px;
	margin: 0.5rem 0;
}

.gallery-picker-list::-webkit-scrollbar-thumb {
	background: rgba(128,128,128,0.35);
	border-radius: 3px;
}

.gallery-picker-list::-webkit-scrollbar-thumb:hover {
	background: rgba(128,128,128,0.5);
}

.gallery-picker-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.625rem 1.5rem;
	cursor: pointer;
	font-size: 0.875rem;
	color: var(--text-primary);
}

.gallery-picker-item:hover {
	background: var(--gray-800);
}

.gallery-picker-item input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	accent-color: var(--green-primary);
}

.gallery-picker-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gallery-picker-type {
	font-size: 0.75rem;
	color: var(--gray-500);
	flex-shrink: 0;
}

.gallery-picker-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--gray-700);
}

.gallery-picker-footer-right {
	display: flex;
	gap: 0.5rem;
}

.description-edit {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.description-actions {
	display: flex;
	gap: 0.5rem;
	justify-content: flex-end;
}

.btn-edit-gallery {
	background: none;
	border: none;
	color: var(--gray-400);
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
}

.btn-edit-gallery:hover {
	color: var(--text-primary);
}

.btn-edit-gallery .icon-mask {
	width: 16px;
	height: 16px;
}

.modal .modal-actions-spread {
	justify-content: space-between;
	align-items: center;
}

.modal-actions-right {
	display: flex;
	gap: 0.75rem;
}

.settings-delete-link {
	background: none;
	border: none;
	color: #dc2626;
	font-size: 0.875rem;
	cursor: pointer;
	padding: 0;
	text-align: left;
}

.settings-delete-link:hover {
	text-decoration: underline;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 2rem;
	text-align: center;
	color: var(--gray-500);
}

.empty-icon {
	font-size: 4rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

.empty-state p {
	margin: 0;
	font-size: 1rem;
}

@media (max-width: 768px) {
	.projects-layout {
		flex-direction: column;
	}

	.gallery-sidebar {
		flex: 0 0 auto;
		border-right: none;
		border-bottom: 1px solid var(--gray-700);
		max-height: 300px;
	}

	.toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.toolbar-left {
		flex-direction: column;
		gap: 0.5rem;
	}

	.toolbar-right {
		width: 100%;
	}

	.btn-create-project {
		width: 100%;
		justify-content: center;
	}

	.search-bar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.search-input-wrapper {
		max-width: none;
	}

	.filters-section {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.filter-group {
		flex-wrap: wrap;
	}

	.projects-header {
		display: none;
	}

	.project-card {
		grid-template-columns: 28px auto 1fr;
		gap: 0.75rem;
	}

	.project-owner,
	.project-created,
	.project-modified,
	.project-privacy {
		display: none;
	}
}
