.bg_foundation{padding:18px}.bg_foundation_grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}.bg_foundation_card{padding:14px;border:1px solid rgba(127,127,127,.25);border-radius:8px}.bg_foundation_card p{margin-bottom:0}.bg_health_summary{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:14px}.bg_health_summary>div{min-width:110px;padding:12px;text-align:center;border:1px solid rgba(127,127,127,.25);border-radius:8px}.bg_health_summary strong,.bg_health_summary span{display:block}.bg_health_summary strong{font-size:1.6em}.bg_status{display:inline-block;min-width:52px;padding:3px 7px;border-radius:999px;font-weight:700;text-align:center}.bg_status_pass{background:#26734d;color:#fff}.bg_status_warn{background:#a66b00;color:#fff}.bg_status_fail{background:#9b2c2c;color:#fff}.bg_health_table{width:100%}.bg_health_table th,.bg_health_table td{padding:8px;vertical-align:top}


.bg_gallery_toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.bg_album_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}

.bg_album_card {
	display: block;
	overflow: hidden;
	border: 1px solid rgba(127,127,127,.25);
	border-radius: 10px;
	text-decoration: none;
}

.bg_album_cover {
	aspect-ratio: 16 / 9;
}

.bg_album_cover_placeholder {
	background: linear-gradient(135deg, rgba(127,127,127,.15), rgba(127,127,127,.3));
}

.bg_album_card_body {
	padding: 14px;
}

.bg_album_card_body h3 {
	margin: 0 0 6px;
}

.bg_album_card_body p {
	min-height: 2.8em;
}

.bg_album_form,
.bg_category_form {
	display: grid;
	gap: 12px;
}

.bg_album_form label,
.bg_category_form label {
	display: grid;
	gap: 4px;
}

.bg_album_form input[type="text"],
.bg_album_form input[type="password"],
.bg_album_form textarea,
.bg_album_form select,
.bg_category_form input[type="text"],
.bg_category_form input[type="number"],
.bg_category_form textarea,
.bg_category_form select {
	width: 100%;
	box-sizing: border-box;
}

.bg_inline_form {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 8px;
}

.bg_inline_form label {
	flex: 1 1 240px;
}

.bg_inline_form input[type="password"],
.bg_inline_form textarea {
	width: 100%;
	box-sizing: border-box;
}

.bg_category_row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	align-items: end;
	margin-bottom: 10px;
}

.bg_check {
	display: flex !important;
	grid-template-columns: auto 1fr;
	align-items: center;
	justify-content: start;
}

.bg_admin_panel{padding:18px}
.bg_panel_intro{display:flex;flex-direction:column;gap:3px;margin-bottom:16px}
.bg_category_card{padding:0;overflow:hidden;margin-bottom:14px;border:1px solid rgba(127,127,127,.22);border-radius:10px}
.bg_category_card_header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px 10px;border-bottom:1px solid rgba(127,127,127,.16)}
.bg_category_title_row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:1.08em}
.bg_status_pill,.bg_count_badge{display:inline-flex;align-items:center;justify-content:center;min-height:20px;padding:2px 8px;border-radius:999px;font-size:.78em;font-weight:700;line-height:1}
.bg_status_enabled{background:rgba(38,115,77,.9);color:#fff}
.bg_status_disabled{background:rgba(127,127,127,.35)}
.bg_count_badge{margin-left:6px;background:rgba(255,255,255,.15)}
.bg_category_card_form{display:block;padding:16px}
.bg_category_grid{display:grid;grid-template-columns:minmax(220px,1fr) minmax(180px,.7fr);gap:16px;align-items:start}
.bg_field{display:flex;flex-direction:column;gap:6px;font-weight:600}
.bg_field>span{line-height:1.2}
.bg_field input,.bg_field textarea,.bg_field select{width:100%;box-sizing:border-box;font-weight:400}
.bg_field textarea{resize:vertical;min-height:96px}
.bg_field_description{grid-column:1/2}
.bg_category_compact{display:grid;grid-template-columns:minmax(90px,130px) 1fr;gap:16px;align-items:end}
.bg_toggle_field{display:flex;align-items:center;gap:7px;min-height:38px;font-weight:600}
.bg_card_actions{display:flex;justify-content:flex-end;margin-top:16px;padding-top:12px;border-top:1px solid rgba(127,127,127,.14)}
.bg_destructive_row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 16px;border-top:1px solid rgba(127,127,127,.14);background:rgba(127,127,127,.04)}
.bg_danger_button{font-weight:700}
@media(max-width:720px){.bg_category_grid{grid-template-columns:1fr}.bg_field_description{grid-column:auto}.bg_category_compact{grid-template-columns:1fr 1fr}.bg_destructive_row{align-items:flex-start;flex-direction:column}}


/* dev12: album discovery + search */
.bg_gallery_search_form { display:grid; grid-template-columns:minmax(240px,1.4fr) minmax(180px,.8fr) auto auto; gap:12px; align-items:end; }
.bg_gallery_search_form > label { display:flex; flex-direction:column; gap:5px; }
.bg_gallery_search_form input[type="search"], .bg_gallery_search_form select { width:100%; box-sizing:border-box; }
.bg_gallery_search_check { flex-direction:row !important; align-items:center; padding-bottom:8px; white-space:nowrap; }
.bg_gallery_search_actions { display:flex; gap:6px; align-items:center; padding-bottom:1px; }
.bg_gallery_result_summary { margin:0 0 10px; }
.bg_locked_note { margin-top:10px; font-size:.9em; font-weight:700; opacity:.8; }
@media (max-width:900px) { .bg_gallery_search_form { grid-template-columns:1fr 1fr; } }
@media (max-width:600px) { .bg_gallery_search_form { grid-template-columns:1fr; } .bg_gallery_search_check { padding-bottom:0; white-space:normal; } }


.bg_media_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
}

.bg_media_card {
	display: block;
	overflow: hidden;
	border: 1px solid rgba(127,127,127,.24);
	border-radius: 8px;
	text-decoration: none;
}

.bg_media_card img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.bg_media_card_body {
	padding: 10px;
}


.bg_media_card video {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #000;
}


/* dev17: media management + album covers */
.bg_album_cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bg_media_description {
	margin: 8px 0 0;
}

.bg_media_manage {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
}

.bg_media_manage form {
	display: inline;
	margin: 0;
}

.bg_cover_badge {
	display: inline-block;
	padding: 5px 9px;
	border: 1px solid rgba(127,127,127,.28);
	border-radius: 999px;
	font-size: .85em;
	font-weight: 700;
}


/* dev18: automatic cover fallbacks + restricted album lock treatment */
.bg_album_cover_placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
	text-align: center;
}

.bg_album_placeholder_icon {
	display: block;
	font-size: 3rem;
	line-height: 1;
}

.bg_album_placeholder_label {
	display: block;
	font-size: .9em;
	font-weight: 700;
	opacity: .82;
}

.bg_album_cover_locked .bg_album_placeholder_icon {
	font-size: 3.35rem;
}

.bg_album_card_locked .bg_album_cover {
	position: relative;
}

.bg_album_card_locked .bg_locked_note {
	display: flex;
	align-items: center;
	gap: 5px;
}


/* dev20: compact media action icons */
.bg_media_manage {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin-top: 10px;
}

.bg_media_manage form {
	display: inline-flex;
	margin: 0;
	padding: 0;
}

.bg_media_action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	box-sizing: border-box;
	padding: 0;
	border: 1px solid rgba(127,127,127,.28);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	vertical-align: middle;
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.bg_media_action:hover,
.bg_media_action:focus {
	text-decoration: none;
	background: rgba(127,127,127,.12);
	transform: translateY(-1px);
}

.bg_media_action_cover_active {
	cursor: default;
	font-weight: 700;
	background: rgba(127,127,127,.12);
}

.bg_media_action_cover_active:hover {
	transform: none;
}

.bg_media_action_delete {
	color: #c62828;
	border-color: rgba(198,40,40,.35);
}

.bg_media_action_delete:hover,
.bg_media_action_delete:focus {
	background: rgba(198,40,40,.10);
	border-color: rgba(198,40,40,.55);
}


/* dev21: uniform inline SVG media action icons */
.bg_media_action {
	-webkit-appearance: none;
	appearance: none;
}

.bg_media_action_icon {
	display: block;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	pointer-events: none;
	overflow: visible;
}

.bg_media_action_edit .bg_media_action_icon,
.bg_media_action_cover .bg_media_action_icon,
.bg_media_action_delete .bg_media_action_icon {
	color: currentColor;
}

.bg_media_action_cover_active .bg_media_action_icon {
	width: 19px;
	height: 19px;
}

.bg_media_action_delete .bg_media_action_icon {
	width: 18px;
	height: 18px;
}


/* dev22: drag-and-drop progress uploader */
.bg_uploader {
	display: block;
}

.bg_upload_dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 180px;
	padding: 24px;
	border: 2px dashed rgba(127,127,127,.42);
	border-radius: 10px;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.bg_upload_dropzone:hover,
.bg_upload_dropzone:focus,
.bg_upload_dropzone.is-dragover {
	border-color: currentColor;
	background: rgba(127,127,127,.08);
	outline: none;
}

.bg_upload_dropzone.is-dragover {
	transform: translateY(-1px);
}

.bg_upload_icon {
	width: 42px;
	height: 42px;
	opacity: .86;
}

.bg_upload_browse_button {
	pointer-events: none;
	margin-top: 3px;
}

.bg_upload_native_input {
	display: block;
	margin-top: 10px;
}

.bg_uploader.is-enhanced .bg_upload_native_input {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.bg_upload_limits {
	margin-top: 10px;
	opacity: .85;
}

.bg_upload_notice {
	margin-top: 10px;
}

.bg_upload_notice:empty {
	display: none;
}

.bg_upload_queue {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}

.bg_upload_item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 6px 12px;
	align-items: center;
	padding: 10px 12px;
	border: 1px solid rgba(127,127,127,.24);
	border-radius: 8px;
}

.bg_upload_item_name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 700;
}

.bg_upload_item_meta {
	font-size: .86em;
	opacity: .78;
	white-space: nowrap;
}

.bg_upload_progress {
	grid-column: 1 / -1;
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(127,127,127,.18);
}

.bg_upload_progress_bar {
	width: 0;
	height: 100%;
	background: currentColor;
	opacity: .72;
	transition: width .1s linear;
}

.bg_upload_item_status {
	grid-column: 1 / -1;
	font-size: .86em;
}

.bg_upload_item.is-complete .bg_upload_progress_bar {
	opacity: 1;
}

.bg_upload_item.is-error {
	border-color: rgba(198,40,40,.45);
}

.bg_upload_item.is-error .bg_upload_item_status {
	color: #c62828;
}

.bg_upload_actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.bg_upload_actions button:disabled {
	opacity: .55;
	cursor: not-allowed;
}


/* dev24: lightbox viewer + media interactions */
.bg_media_preview {
	position: relative;
	display: block;
	text-decoration: none;
	background: rgba(0,0,0,.08);
}

.bg_media_video_fallback {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: rgba(0,0,0,.25);
}

.bg_media_play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(0,0,0,.72);
	color: #fff;
}

.bg_media_play svg {
	width: 25px;
	height: 25px;
	margin-left: 3px;
}

.bg_media_social_counts {
	display: flex;
	gap: 10px;
	margin-top: 6px;
}

.bg_lightbox[hidden] {
	display: none !important;
}

.bg_lightbox {
	position: fixed;
	z-index: 99999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.bg_lightbox_backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.84);
}

.bg_lightbox_dialog {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
	width: min(1400px, 96vw);
	height: min(900px, 92vh);
	overflow: hidden;
	border-radius: 12px;
	background: #111;
	color: #f5f5f5;
	box-shadow: 0 18px 60px rgba(0,0,0,.55);
}

.bg_lightbox_stage {
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #050505;
}

.bg_lightbox_stage img,
.bg_lightbox_stage video {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bg_lightbox_stage video {
	width: 100%;
	height: 100%;
}

.bg_lightbox_info {
	overflow: auto;
	padding: 22px;
	background: rgba(28,28,28,.98);
}

.bg_lightbox_info h3 {
	margin-top: 0;
	color: inherit;
}

.bg_lightbox_close,
.bg_lightbox_nav {
	position: absolute;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,0,.6);
	color: #fff;
	cursor: pointer;
}

.bg_lightbox_close {
	top: 12px;
	right: 372px;
}

.bg_lightbox_nav {
	top: 50%;
	transform: translateY(-50%);
}

.bg_lightbox_prev {
	left: 12px;
}

.bg_lightbox_next {
	right: 372px;
}

.bg_lightbox_close svg,
.bg_lightbox_nav svg {
	width: 23px;
	height: 23px;
}

.bg_like_button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.bg_like_button svg {
	width: 20px;
	height: 20px;
}

.bg_like_button.is-liked svg path {
	fill: currentColor;
}

.bg_comments_panel {
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid rgba(255,255,255,.14);
}

.bg_comments_list {
	display: grid;
	gap: 10px;
	max-height: 320px;
	overflow: auto;
}

.bg_comment {
	padding: 9px 10px;
	border-radius: 7px;
	background: rgba(255,255,255,.07);
}

.bg_comment_head {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 4px;
	font-size: .88em;
}

.bg_comment_delete {
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: .7;
}

.bg_comment_form {
	display: grid;
	gap: 8px;
	margin-top: 12px;
}

.bg_comment_form textarea {
	width: 100%;
	box-sizing: border-box;
}

.bg_lightbox_message {
	margin-top: 10px;
	font-size: .9em;
}

.bg_lightbox_message:empty {
	display: none;
}

.bg_lightbox_message.errorbox,
.bg_lightbox_message.information {
	display: block;
	padding: 10px 12px;
	border-radius: 0;
	box-sizing: border-box;
	text-shadow: none;
}

.bg_lightbox_message.errorbox {
	border: 1px solid #c53939;
	background: #fff1f1;
	color: #6f1717 !important;
}

.bg_lightbox_message.information {
	border: 1px solid #7b98af;
	background: #eef6fb;
	color: #203744 !important;
}

.bg_lightbox_message.errorbox *,
.bg_lightbox_message.information * {
	color: inherit !important;
}

body.bg_lightbox_open {
	overflow: hidden;
}

@media (max-width: 850px) {
	.bg_lightbox {
		padding: 8px;
	}

	.bg_lightbox_dialog {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(0, 60vh) minmax(0, 1fr);
		width: 98vw;
		height: 96vh;
	}

	.bg_lightbox_close {
		right: 10px;
	}

	.bg_lightbox_next {
		right: 10px;
	}

	.bg_lightbox_info {
		padding: 15px;
	}
}


/* dev25: full-size and download viewer actions */
.bg_lightbox_actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0;
}

.bg_lightbox_action {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.bg_lightbox_action svg {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
}


/* dev26: chunked album downloads */
.bg_album_download_summary {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	margin-top: 12px;
}

.bg_album_download_parts {
	display: grid;
	gap: 8px;
}

.bg_album_download_part {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 12px;
	border: 1px solid rgba(127,127,127,.24);
	border-radius: 8px;
}

@media (max-width: 600px) {
	.bg_album_download_part {
		align-items: stretch;
		flex-direction: column;
	}
}


/* dev28: bulk media deletion */
.bg_bulk_delete_form {
	margin-bottom: 12px;
}

.bg_bulk_toolbar {
	position: sticky;
	top: 6px;
	z-index: 25;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid rgba(127,127,127,.24);
	border-radius: 8px;
	background: inherit;
	box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.bg_bulk_toolbar_left {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 7px;
}

.bg_bulk_toolbar_actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
}

.bg_bulk_delete_button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.bg_bulk_delete_button:not(:disabled) {
	color: #c62828;
}

.bg_bulk_delete_button svg {
	width: 18px;
	height: 18px;
}

.bg_media_card_selectable {
	position: relative;
}

.bg_media_bulk_select {
	position: absolute;
	z-index: 12;
	top: 8px;
	left: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	background: rgba(0,0,0,.68);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 1px 5px rgba(0,0,0,.28);
}

.bg_media_bulk_select input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.bg_media_bulk_select span {
	position: relative;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-radius: 4px;
	box-sizing: border-box;
}

.bg_media_bulk_select input:checked + span::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 0;
	width: 5px;
	height: 9px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.bg_media_bulk_select:focus-within {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bg_media_card.is-selected {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

@media (max-width: 700px) {
	.bg_bulk_toolbar {
		position: static;
		align-items: stretch;
		flex-direction: column;
	}

	.bg_bulk_toolbar_actions {
		align-items: stretch;
	}

	.bg_bulk_toolbar_actions .button {
		flex: 1 1 auto;
	}
}


/* dev29: media pagination + sorting */
.bg_media_toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.bg_media_sort_form label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bg_media_sort_form select {
	max-width: 220px;
}

.bg_media_pages_top,
.bg_media_pages_bottom {
	margin: 10px 0 14px;
}

.bg_media_pages_bottom {
	margin-top: 16px;
	margin-bottom: 0;
}

@media (max-width: 650px) {
	.bg_media_toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.bg_media_sort_form label {
		align-items: stretch;
		flex-direction: column;
	}

	.bg_media_sort_form select {
		max-width: none;
		width: 100%;
	}
}


/* dev30: favorites + reporting */
.bg_lightbox_member_actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0;
}

.bg_favorite_button,
.bg_report_button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.bg_favorite_button svg,
.bg_report_button svg {
	width: 19px;
	height: 19px;
}

.bg_favorite_button.is-favorited svg path {
	fill: currentColor;
}

.bg_report_panel {
	margin: 12px 0;
	padding: 12px;
	border: 1px solid rgba(127,127,127,.28);
	border-radius: 8px;
}

.bg_report_panel form,
.bg_report_panel label {
	display: grid;
	gap: 7px;
}

.bg_report_panel form {
	gap: 10px;
}

.bg_report_panel textarea,
.bg_report_panel select {
	width: 100%;
	box-sizing: border-box;
}

.bg_report_actions,
.bg_comment_actions {
	display: flex;
	gap: 6px;
	align-items: center;
}

.bg_comment_report,
.bg_comment_delete {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: .72;
}

.bg_comment_report svg {
	width: 17px;
	height: 17px;
}

.bg_favorite_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 14px;
}

.bg_favorite_card {
	overflow: hidden;
	border: 1px solid rgba(127,127,127,.25);
	border-radius: 9px;
}

.bg_favorite_preview {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: rgba(0,0,0,.08);
}

.bg_favorite_preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bg_favorite_placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-weight: 700;
	opacity: .65;
}

.bg_favorite_body {
	display: grid;
	gap: 6px;
	padding: 10px;
}

.bg_report_queue_toolbar {
	display: flex;
	justify-content: flex-end;
}

.bg_report_table td {
	vertical-align: top;
}

.bg_report_note {
	margin-top: 7px;
	padding: 7px;
	border-radius: 6px;
	background: rgba(127,127,127,.08);
}

.bg_report_decide_form {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}


/* dev30a: icon-only lightbox actions */
.bg_lightbox_actions,
.bg_lightbox_member_actions,
.bg_lightbox_like_wrap {
	align-items: center;
}

.bg_icon_button,
a.bg_icon_button,
button.bg_icon_button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 38px;
	width: 38px;
	min-width: 38px;
	max-width: 38px;
	height: 38px;
	min-height: 38px;
	padding: 0;
	margin: 0;
	line-height: 1;
	vertical-align: middle;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
}

.bg_icon_button svg,
.bg_lightbox_action.bg_icon_button svg,
.bg_favorite_button.bg_icon_button svg,
.bg_report_button.bg_icon_button svg,
.bg_like_button.bg_icon_button svg {
	display: block;
	width: 20px;
	height: 20px;
	margin: 0;
	flex: 0 0 20px;
}

.bg_icon_button_with_badge {
	overflow: visible;
}

.bg_icon_badge {
	position: absolute;
	top: -6px;
	right: -7px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 9px;
	background: rgba(0,0,0,.78);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	box-sizing: border-box;
	pointer-events: none;
}

.bg_lightbox_like_wrap {
	display: inline-flex;
	margin-top: 0;
}

.bg_lightbox_member_actions,
.bg_lightbox_actions {
	margin: 8px 0;
}


/* dev30b: one-row lightbox action toolbar */
.bg_lightbox_info > .bg_lightbox_actions,
.bg_lightbox_info > .bg_lightbox_member_actions,
.bg_lightbox_info > .bg_lightbox_like_wrap {
	display: inline-flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 8px;
	margin: 8px 4px 8px 0;
	vertical-align: middle;
}

.bg_lightbox_info > .bg_lightbox_like_wrap {
	margin-right: 0;
}

/* Five 38px controls plus gaps fit the normal viewer sidebar.
   Keep the toolbar from breaking into the old 2 + 2 + 1 pattern. */
.bg_lightbox_info > .bg_lightbox_actions,
.bg_lightbox_info > .bg_lightbox_member_actions {
	width: auto;
	max-width: none;
}



/* dev30d: album favorites + unique-view polish */
.bg_album_favorite_form {
	display: inline-block;
	margin: 0;
}

.bg_album_favorite_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	min-width: 30px;
	height: 30px;
	min-height: 30px;
	padding: 0;
	margin: 0;
	line-height: 1;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	vertical-align: middle;
}

.bg_album_favorite_button svg {
	display: block;
	width: 16px;
	height: 16px;
	margin: 0;
}

.bg_album_favorite_button.is-favorited svg path {
	fill: currentColor;
}

.bg_favorites_tabs {
	margin-bottom: 0;
}


/* dev31: permanent album deletion */
.bg_album_delete_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	min-width: 30px;
	height: 30px;
	min-height: 30px;
	padding: 0;
	margin: 0;
	vertical-align: middle;
	box-sizing: border-box;
}

.bg_album_delete_button svg {
	display: block;
	width: 16px;
	height: 16px;
}

.bg_album_delete_confirm {
	display: grid;
	gap: 16px;
}

.bg_permanent_delete_warning p {
	margin-bottom: 0;
}

.bg_delete_album_summary {
	padding: 12px;
	border: 1px solid rgba(127,127,127,.28);
	border-radius: 8px;
}

.bg_delete_album_form {
	display: grid;
	gap: 14px;
}

.bg_delete_album_form label {
	display: grid;
	gap: 6px;
}

.bg_delete_confirm_check {
	grid-template-columns: auto 1fr !important;
	align-items: start;
}

.bg_delete_album_form input[type="text"] {
	max-width: 520px;
}

.bg_delete_album_danger {
	font-weight: 700;
}


/* dev31a: complete admin toolbar surfaces */
.bg_admin_toolbar_surface {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 42px;
	padding: 8px 10px;
	box-sizing: border-box;
}

.bg_admin_toolbar_buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px;
	margin: 0;
}

.bg_admin_toolbar_buttons::after {
	display: none;
}

.bg_admin_toolbar_buttons .button {
	margin: 0;
}


/* dev32: member gallery dashboard */
.bg_member_stats_grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
	gap: 10px;
}

.bg_member_stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 92px;
	text-align: center;
}

.bg_member_stat strong {
	font-size: 1.65em;
	line-height: 1.1;
}

.bg_member_stat span {
	margin-top: 5px;
	font-size: .9em;
	opacity: .78;
}

.bg_dashboard_columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.bg_dashboard_media_grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.bg_dashboard_media_card {
	display: block;
	overflow: hidden;
	text-decoration: none;
	border: 1px solid rgba(127,127,127,.22);
	border-radius: 8px;
}

.bg_dashboard_media_card img,
.bg_dashboard_media_placeholder {
	display: flex;
	width: 100%;
	aspect-ratio: 4 / 3;
	align-items: center;
	justify-content: center;
	object-fit: cover;
	background: rgba(127,127,127,.08);
}

.bg_dashboard_media_card > span:last-child {
	display: grid;
	gap: 2px;
	padding: 7px;
}

.bg_dashboard_media_card small {
	opacity: .72;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bg_dashboard_activity {
	display: grid;
	gap: 8px;
}

.bg_dashboard_activity_item {
	padding: 9px 10px;
	border: 1px solid rgba(127,127,127,.18);
	border-radius: 7px;
}

.bg_dashboard_ranked {
	display: grid;
	gap: 5px;
}

.bg_dashboard_ranked > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 10px;
	text-decoration: none;
	border-bottom: 1px solid rgba(127,127,127,.16);
}

.bg_dashboard_ranked > a:last-child {
	border-bottom: 0;
}

.bg_dashboard_ranked > a span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 800px) {
	.bg_dashboard_columns {
		grid-template-columns: 1fr;
	}

	.bg_dashboard_media_grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}


/* dev32a: member storage quota meter */
.bg_storage_quota_panel {
	display: grid;
	gap: 10px;
}

.bg_storage_quota_summary {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 16px;
}

.bg_storage_quota_summary > div:first-child {
	display: flex;
	align-items: baseline;
	gap: 7px;
	flex-wrap: wrap;
}

.bg_storage_quota_summary strong {
	font-size: 1.35em;
}

.bg_storage_meter {
	position: relative;
	height: 16px;
	overflow: hidden;
	border: 1px solid rgba(127,127,127,.28);
	border-radius: 8px;
	background: rgba(127,127,127,.12);
}

.bg_storage_meter_fill {
	height: 100%;
	width: 0;
	background: currentColor;
	opacity: .42;
	transition: width .2s ease;
}

.bg_storage_meter.is-warning .bg_storage_meter_fill {
	opacity: .68;
}

.bg_storage_meter.is-critical .bg_storage_meter_fill {
	opacity: .92;
}

.bg_storage_percent {
	text-align: right;
}

@media (max-width: 600px) {
	.bg_storage_quota_summary {
		align-items: start;
		flex-direction: column;
		gap: 5px;
	}
}


/* dev32b: dashboard empty states belong directly to their parent surface */
.bg_dashboard_empty_state {
	margin: 0;
	padding: 6px 8px;
	opacity: .82;
}


/* dev33: portfolio mode */
.bg_gallery_toolbar .smalltext br + br {
	display: none;
}

.bg_gallery_toolbar > div:first-child {
	min-width: 0;
}

.bg_gallery_toolbar > div:first-child .smalltext {
	max-width: 760px;
	line-height: 1.5;
}


/* dev33b: complete admin save/result message surfaces */
.bg_admin_notice_surface {
	padding: 12px 14px;
	box-sizing: border-box;
}

.bg_admin_notice_success,
.bg_admin_notice_error {
	margin: 0;
}


/* dev34: Better Media identity + generic file cards */
#main_menu .bg_menu_icon,
.bg_menu_icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
	margin-right: 5px;
	vertical-align: -3px;
}

#main_menu .bg_menu_icon svg,
.bg_menu_icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.bg_media_file_preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 9px;
	text-decoration: none;
	background: rgba(127,127,127,.08);
}

.bg_media_file_preview_disabled {
	cursor: default;
}

.bg_media_file_icon {
	display: inline-flex;
	width: 54px;
	height: 54px;
	align-items: center;
	justify-content: center;
	opacity: .78;
}

.bg_media_file_icon svg {
	width: 48px;
	height: 48px;
}

.bg_media_file_type {
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .78;
}


/* dev34c: compact media-card stat icons */
.bg_media_meta,
.bg_media_social_counts,
.bg_card_stats {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px 8px;
}

.bg_card_stat {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
	line-height: 1;
}

.bg_card_stat svg {
	display: block;
	width: 13px;
	height: 13px;
	flex: 0 0 13px;
}

.bg_card_stat span {
	line-height: 1;
}


/* dev34d: Better Media owns its menu icon; collapse SMF's native icon slot */
#main_menu .main_icons.bg_media_no_native_icon {
	display: none !important;
	width: 0 !important;
	min-width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
}

#main_menu #button_gallery > a,
#main_menu li#button_gallery > a {
	width: auto !important;
	min-width: 0 !important;
}

#main_menu #button_gallery > a.active,
#main_menu li#button_gallery > a.active {
	padding-left: 10px;
	padding-right: 10px;
}


/* dev34e: album cards stay fully clickable without link underlines */
.bg_album_card,
.bg_album_card:link,
.bg_album_card:visited,
.bg_album_card:hover,
.bg_album_card:focus,
.bg_album_card:active {
	text-decoration: none !important;
	text-decoration-line: none !important;
}

.bg_album_card *,
.bg_album_card:hover *,
.bg_album_card:focus * {
	text-decoration: none !important;
	text-decoration-line: none !important;
}


/* dev34f: card metadata in two clean rows */
.bg_media_meta_primary {
	display: block;
	margin-top: 2px;
	line-height: 1.35;
}

.bg_media_stats_row {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 8px;
	margin-top: 4px;
	line-height: 1;
}

.bg_media_stats_row .bg_card_stat {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	flex: 0 0 auto;
	white-space: nowrap;
}


/* dev34h: aligned album capability rows + ON/OFF switches */
.bg_album_toggle {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between;
	gap: 18px;
	width: 100%;
	padding: 8px 0;
	box-sizing: border-box;
	cursor: pointer;
}

.bg_album_toggle_copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1 1 auto;
}

.bg_album_toggle_copy strong,
.bg_album_toggle_copy .smalltext {
	display: block;
}

.bg_switch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	min-width: 82px;
	justify-content: flex-end;
}

.bg_switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.bg_switch_track {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: 0 0 44px;
	border: 1px solid rgba(127,127,127,.40);
	border-radius: 999px;
	background: rgba(127,127,127,.20);
	box-sizing: border-box;
	transition: background-color .15s ease, border-color .15s ease;
}

.bg_switch_thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: currentColor;
	opacity: .72;
	transition: transform .15s ease, opacity .15s ease;
}

.bg_switch input:checked + .bg_switch_track {
	background: rgba(50,145,255,.22);
	border-color: currentColor;
}

.bg_switch input:checked + .bg_switch_track .bg_switch_thumb {
	transform: translateX(20px);
	opacity: 1;
}

.bg_switch input:focus-visible + .bg_switch_track {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bg_switch_state {
	min-width: 22px;
	font-size: .88em;
	font-weight: 700;
	text-align: left;
	opacity: .78;
}

@media (max-width: 600px) {
	.bg_album_toggle {
		align-items: flex-start !important;
	}

	.bg_switch {
		margin-top: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bg_switch_track,
	.bg_switch_thumb {
		transition: none;
	}
}


/* dev34i: preserve lightbox control appearance while keyboard-focused */
.bg_lightbox_close,
.bg_lightbox_close:hover,
.bg_lightbox_close:focus,
.bg_lightbox_close:focus-visible,
.bg_lightbox_close:active,
.bg_lightbox_nav,
.bg_lightbox_nav:hover,
.bg_lightbox_nav:focus,
.bg_lightbox_nav:focus-visible,
.bg_lightbox_nav:active {
	background: rgba(0,0,0,.6) !important;
	color: #fff !important;
	border: 0 !important;
	box-shadow: none !important;
}

.bg_lightbox_close:focus-visible,
.bg_lightbox_nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}


/* dev35: Maintenance & Cleanup */
.bg_maintenance_summary,
.bg_maintenance_grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.bg_maintenance_metric,
.bg_maintenance_card {
	padding: 14px;
	border: 1px solid rgba(127,127,127,.25);
	border-radius: 8px;
	box-sizing: border-box;
}

.bg_maintenance_metric {
	text-align: center;
}

.bg_maintenance_metric strong,
.bg_maintenance_metric span,
.bg_maintenance_card strong,
.bg_maintenance_value {
	display: block;
}

.bg_maintenance_metric strong,
.bg_maintenance_value {
	font-size: 1.55em;
	line-height: 1.15;
}

.bg_maintenance_card p,
.bg_maintenance_action p {
	margin: 5px 0 0;
}

.bg_maintenance_card_attention {
	border-color: rgba(155,44,44,.55);
}

.bg_maintenance_attention_list {
	margin-top: 14px;
	padding: 12px 14px;
	border: 1px solid rgba(155,44,44,.45);
	border-radius: 8px;
}

.bg_maintenance_attention_list ul {
	margin-bottom: 0;
}

.bg_maintenance_table td:nth-child(2) {
	width: 90px;
	text-align: center;
	font-weight: 700;
}

.bg_maintenance_table td:nth-child(3) {
	width: 130px;
	text-align: center;
}

.bg_maintenance_actions {
	display: grid;
	gap: 0;
	padding: 0;
}

.bg_maintenance_action {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 14px;
	border-bottom: 1px solid rgba(127,127,127,.20);
}

.bg_maintenance_action:last-child {
	border-bottom: 0;
}

.bg_maintenance_action > div {
	min-width: 0;
}

.bg_maintenance_action form {
	flex: 0 0 auto;
	margin: 0;
}

@media (max-width: 650px) {
	.bg_maintenance_action {
		align-items: stretch;
		flex-direction: column;
	}

	.bg_maintenance_action .button {
		width: 100%;
	}
}


/* dev36: bulk move between albums */
.bg_bulk_move_picker {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.bg_bulk_move_picker select {
	max-width: 220px;
	min-width: 150px;
}

.bg_bulk_move_button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.bg_bulk_move_button svg {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
}

@media (max-width: 700px) {
	.bg_bulk_move_picker {
		align-items: stretch;
		flex-direction: column;
		width: 100%;
	}

	.bg_bulk_move_picker select {
		width: 100%;
		max-width: none;
	}
}
