.ps-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	margin-top: 24px;
}

.ps-grid {
	flex: 1 1 65%;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	align-content: start;
}

.ps-cell {
	position: relative;
	border-radius: 6px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	border: 2px solid transparent;
	transition: border-color 0.15s ease;
}

.ps-cell img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	cursor: zoom-in;
}

.ps-cell .ps-check {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #ccc;
	color: #ccc;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	cursor: pointer;
	z-index: 2;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ps-cell .ps-check:hover {
	color: #2ecc71;
	border-color: #2ecc71;
}

.ps-cell.ps-selected {
	border-color: #2ecc71;
}

.ps-cell.ps-selected .ps-check {
	color: #fff;
	background: #2ecc71;
	border-color: #2ecc71;
}

.ps-load-more {
	display: block;
	margin: 20px auto 0;
	padding: 10px 20px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
}

.ps-sidebar {
	flex: 1 1 30%;
	min-width: 260px;
	position: sticky;
	top: 20px;
	align-self: start;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	background: #fafafa;
	max-height: 90vh;
	overflow-y: auto;
}

.ps-sidebar h3 {
	margin-top: 0;
}

.ps-hint {
	font-size: 12px;
	color: #888;
	margin: 4px 0 16px;
}

.ps-account-note {
	font-size: 12px;
	color: #2ecc71;
	background: #eafaf1;
	border-radius: 4px;
	padding: 6px 10px;
	margin: 0 0 10px;
}

#ps-selected-list {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ps-selected-item {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 4px 8px;
	cursor: grab;
}

.ps-selected-item img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 3px;
}

.ps-remove {
	margin-left: auto;
	cursor: pointer;
	color: #c0392b;
	font-size: 18px;
	line-height: 1;
}

#ps-form input,
#ps-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px;
	margin-bottom: 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
}

#ps-form textarea {
	min-height: 60px;
	resize: vertical;
}

#ps-submit-btn {
	width: 100%;
	padding: 10px;
	background: #2ecc71;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 15px;
	cursor: pointer;
}

#ps-submit-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

#ps-message {
	margin-top: 10px;
	font-size: 14px;
}

.ps-success { color: #2ecc71; }
.ps-error { color: #c0392b; }

@media (max-width: 700px) {
	.ps-sidebar {
		position: static;
		max-height: none;
	}
}

/* ---------- Lightbox ---------- */
#ps-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 9999;
	align-items: center;
	justify-content: center;
}

#ps-lightbox.ps-lb-open {
	display: flex;
}

.ps-lb-image {
	max-width: 85vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 4px;
}

.ps-lb-close {
	position: absolute;
	top: 20px;
	right: 30px;
	font-size: 36px;
	line-height: 1;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
}

.ps-lb-prev,
.ps-lb-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	font-size: 22px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
}

.ps-lb-prev:hover,
.ps-lb-next:hover {
	background: rgba(255, 255, 255, 0.3);
}

.ps-lb-prev { left: 20px; }
.ps-lb-next { right: 20px; }

.ps-lb-select {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	padding: 12px 28px;
	background: #2ecc71;
	color: #fff;
	border: none;
	border-radius: 30px;
	font-size: 15px;
	cursor: pointer;
}

.ps-lb-select.ps-lb-selected {
	background: #c0392b;
}

@media (max-width: 700px) {
	.ps-lb-prev, .ps-lb-next {
		width: 38px;
		height: 38px;
		font-size: 16px;
	}
	.ps-lb-select {
		padding: 10px 20px;
		font-size: 14px;
	}
}


/* ---------- Album directory (archive) ---------- */
.ps-album-subtitle {
	color: #888;
	font-size: 15px;
	margin: -8px 0 24px;
}

.ps-album-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-end;
	margin: 0 0 20px;
	padding: 20px;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 8px;
}

.ps-filter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ps-filter-field label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #666;
}

.ps-album-filter select {
	padding: 10px 14px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
	min-width: 190px;
	background: #fff;
	cursor: pointer;
}

.ps-album-filter select:focus {
	outline: none;
	border-color: #2ecc71;
}

.ps-filter-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
}

.ps-filter-btn {
	padding: 10px 26px;
	background: #2ecc71;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.ps-filter-btn:hover {
	background: #27ae60;
}

.ps-filter-clear {
	font-size: 13px;
	color: #888;
	text-decoration: underline;
	white-space: nowrap;
}

.ps-result-count {
	font-size: 14px;
	color: #666;
	margin: 0 0 16px;
}

.ps-album-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 24px;
}

.ps-album-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #eee;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ps-album-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.ps-album-cover {
	aspect-ratio: 4 / 3;
	background: #f2f2f2;
	overflow: hidden;
}

.ps-album-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.ps-album-card:hover .ps-album-cover img {
	transform: scale(1.04);
}

.ps-album-cover-placeholder {
	width: 100%;
	height: 100%;
	background: #eee;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #bbb;
	font-size: 32px;
}

.ps-album-card-body {
	padding: 14px 16px 16px;
}

.ps-album-card-title {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.3;
}

.ps-album-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ps-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 12px;
	white-space: nowrap;
}

.ps-tag-uni {
	background: #eafaf1;
	color: #1e8449;
}

.ps-tag-fac {
	background: #eaf2fb;
	color: #1a5fa8;
}

.ps-tag-year {
	background: #fdf2e3;
	color: #b9770e;
}

.ps-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: #888;
}

.ps-no-results p {
	margin: 0 0 10px;
	font-size: 15px;
}

@media (max-width: 700px) {
	.ps-album-filter {
		flex-direction: column;
		align-items: stretch;
	}
	.ps-filter-field,
	.ps-album-filter select {
		min-width: 0;
		width: 100%;
	}
	.ps-filter-actions {
		margin-left: 0;
		justify-content: space-between;
	}
}
