.fbgl-app {
	display: flex;
	gap: 20px;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	overflow: hidden;
	min-height: 360px;
	font-size: 14px;
}

.fbgl-sidebar {
	flex: 0 0 280px;
	max-width: 40%;
	background: #f6f7f7;
	border-right: 1px solid #e2e4e7;
	padding: 12px;
	overflow: auto;
}

.fbgl-main {
	flex: 1 1 auto;
	padding: 16px;
	overflow: auto;
}

/* Tree */
.fbgl-tree,
.fbgl-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fbgl-children {
	margin-left: 18px;
	display: none;
}

.fbgl-node.open > .fbgl-children {
	display: block;
}

.fbgl-folder {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 6px;
	border-radius: 4px;
	cursor: pointer;
	user-select: none;
}

.fbgl-folder:hover {
	background: #eaecee;
}

.fbgl-folder.active {
	background: #2271b1;
	color: #fff;
}

.fbgl-toggle {
	width: 14px;
	text-align: center;
	font-size: 11px;
	color: inherit;
	flex: 0 0 14px;
}

.fbgl-folder-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Access badge next to tagged folders */
.fbgl-badge {
	flex: 0 0 auto;
	margin-left: auto;
	font-size: 12px;
	line-height: 1;
	padding: 2px 5px;
	border-radius: 10px;
	cursor: default;
}

.fbgl-badge--board {
	background: #fcf3d6;
}

.fbgl-badge--guild {
	background: #e1ecf7;
}

/* Keep badges readable when the row is selected. */
.fbgl-folder.active .fbgl-badge {
	background: rgba( 255, 255, 255, 0.25 );
}

/* Files */
.fbgl-placeholder {
	color: #888;
	margin: 8px 0;
}

.fbgl-file-table {
	width: 100%;
	border-collapse: collapse;
}

.fbgl-file-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.fbgl-file-name {
	font-weight: 500;
}

.fbgl-file-size,
.fbgl-file-date {
	color: #777;
	white-space: nowrap;
	width: 1%;
}

.fbgl-dl-btn {
	display: inline-block;
	padding: 4px 12px;
	background: #2271b1;
	color: #fff !important;
	text-decoration: none;
	border-radius: 4px;
	font-size: 13px;
	white-space: nowrap;
}

.fbgl-dl-btn:hover {
	background: #135e96;
}

.fbgl-upload-form {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #eee;
	flex-wrap: wrap;
}

.fbgl-upload-form .fbgl-dl-btn {
	border: 0;
	cursor: pointer;
}

.fbgl-upload-form .fbgl-dl-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.fbgl-upload-status {
	color: #777;
	font-size: 13px;
}

.fbgl-notice {
	padding: 16px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	color: #555;
}

/* ---------- Document library (block / shortcode / Elementor) ---------- */
.fbgl-doclib {
	font-size: 14px;
}

.fbgl-doclib-title {
	margin: 0 0 12px;
}

.fbgl-breadcrumb {
	margin-bottom: 12px;
	color: #555;
}

.fbgl-breadcrumb .fbgl-crumb {
	color: #2271b1;
	text-decoration: none;
}

.fbgl-breadcrumb .fbgl-crumb--current {
	color: #555;
	font-weight: 600;
}

.fbgl-breadcrumb .fbgl-sep {
	margin: 0 6px;
	color: #aaa;
}

.fbgl-subfolders {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 8px;
}

.fbgl-subfolder {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	text-decoration: none;
	color: #1d2327;
	background: #fff;
}

.fbgl-subfolder:hover {
	background: #f6f7f7;
}

.fbgl-sf-name {
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fbgl-sf-count {
	flex: 0 0 auto;
	font-size: 12px;
	color: #777;
	background: #f0f0f1;
	border-radius: 10px;
	padding: 1px 7px;
}

/* Files — grid */
.fbgl-files-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( var( --fbgl-columns, 4 ), 1fr );
	gap: 12px;
}

.fbgl-file-link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 14px;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	text-decoration: none;
	color: #1d2327;
	background: #fff;
	transition: box-shadow 0.15s ease;
}

.fbgl-file-link:hover {
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.08 );
}

.fbgl-file-icon {
	font-size: 28px;
	line-height: 1;
}

.fbgl-file-title {
	font-weight: 500;
	word-break: break-word;
}

.fbgl-file-meta {
	font-size: 12px;
	color: #777;
	margin-top: auto;
}

/* Files — list layout */
.fbgl-layout-list .fbgl-files-grid {
	grid-template-columns: 1fr;
}

.fbgl-layout-list .fbgl-file-link {
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.fbgl-layout-list .fbgl-file-icon {
	font-size: 20px;
}

.fbgl-layout-list .fbgl-file-meta {
	margin-top: 0;
	margin-left: auto;
	white-space: nowrap;
}

@media ( max-width: 600px ) {
	.fbgl-files-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* File card: preview button + separate download button */
.fbgl-file {
	position: relative;
}

.fbgl-file-open {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	height: 100%;
	padding: 14px;
	text-align: left;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	background: #fff;
	color: #1d2327;
	cursor: pointer;
	transition: box-shadow 0.15s ease;
}

.fbgl-file-open:hover {
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.08 );
}

.fbgl-file-dl {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 6px;
	background: #2271b1;
	color: #fff !important;
	text-decoration: none;
	font-size: 15px;
	line-height: 1;
}

.fbgl-file-dl:hover {
	background: #135e96;
}

.fbgl-layout-list .fbgl-file-open {
	flex-direction: row;
	align-items: center;
	gap: 12px;
	padding-right: 50px;
}

.fbgl-layout-list .fbgl-file-meta {
	margin-left: auto;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 1px, 1px, 1px, 1px );
	white-space: nowrap;
}

/* Generic button (upload, lightbox) */
.fbgl-btn {
	display: inline-block;
	padding: 7px 14px;
	background: #2271b1;
	color: #fff !important;
	border: 0;
	border-radius: 5px;
	font-size: 13px;
	text-decoration: none;
	cursor: pointer;
}

.fbgl-btn:hover {
	background: #135e96;
}

/* Upload form */
.fbgl-upload-form {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid #eee;
}

.fbgl-upload-status {
	font-size: 13px;
	color: #777;
}

.fbgl-upload-hint {
	flex-basis: 100%;
	font-size: 12px;
	color: #888;
}

/* Lightbox */
.fbgl-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
}

.fbgl-lightbox.is-open {
	display: flex;
}

.fbgl-lb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.8 );
}

.fbgl-lb-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	max-width: 90vw;
	max-height: 90vh;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.fbgl-lb-close {
	position: absolute;
	top: 6px;
	right: 8px;
	z-index: 2;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.fbgl-lb-content {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #111;
	min-width: 320px;
	min-height: 200px;
	max-height: 80vh;
	overflow: auto;
}

.fbgl-lb-img {
	max-width: 90vw;
	max-height: 80vh;
	display: block;
}

.fbgl-lb-frame {
	width: 80vw;
	height: 80vh;
	border: 0;
	background: #fff;
}

.fbgl-lb-media {
	max-width: 90vw;
}

.fbgl-lb-noprev {
	color: #ddd;
	padding: 48px 32px;
	text-align: center;
}

.fbgl-lb-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: #fff;
}

.fbgl-lb-caption {
	flex: 1 1 auto;
	font-weight: 500;
	word-break: break-word;
}

body.fbgl-lb-lock {
	overflow: hidden;
}

@media ( max-width: 600px ) {
	.fbgl-app {
		flex-direction: column;
	}
	.fbgl-sidebar {
		flex-basis: auto;
		max-width: none;
		border-right: none;
		border-bottom: 1px solid #e2e4e7;
	}
}
