.dge {
	--dge-icon-size: 40px;
	--dge-pdf: #d93025;
	--dge-ppt: #c4441c;
	--dge-doc: #2b579a;
	--dge-xls: #1e7145;
	--dge-image: #7247c4;
	--dge-zip: #8a6d3b;
	--dge-video: #b8195a;
	--dge-audio: #00796b;
	--dge-other: #5f6b7a;
}

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

/* Toolbar */
.dge-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 20px;
}

.dge-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dge .dge-filter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 14px;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	background: #fff;
	color: #344054;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}

.dge .dge-filter:hover {
	border-color: #98a2b3;
	background: #f9fafb;
	color: #1d2939;
}

.dge .dge-filter.is-active {
	border-color: #1d2939;
	background: #1d2939;
	color: #fff;
}

.dge-filter__count {
	font-size: .85em;
	opacity: .7;
}

.dge-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
}

.dge-sort select {
	width: auto;
	min-height: 0;
	padding: 6px 10px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	background-color: #fff;
	font: inherit;
}

.dge .dge-filter:focus-visible,
.dge-sort select:focus-visible,
.dge-item a:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

/* List */
.dge-items {
	display: grid;
	grid-template-columns: repeat(var(--dge-columns, 1), minmax(0, 1fr));
	gap: 12px;
}

.dge-group-heading {
	grid-column: 1 / -1;
	margin: 20px 0 0;
	font-size: 1.15em;
}

.dge-items > .dge-group-heading:first-child {
	margin-top: 0;
}

.dge-item {
	--dge-type: var(--dge-other);
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.dge-item:hover {
	border-color: #c4c9d2;
	box-shadow: 0 2px 8px rgba(16, 24, 40, .06);
}

.dge-type--pdf   { --dge-type: var(--dge-pdf); }
.dge-type--ppt   { --dge-type: var(--dge-ppt); }
.dge-type--doc   { --dge-type: var(--dge-doc); }
.dge-type--xls   { --dge-type: var(--dge-xls); }
.dge-type--image { --dge-type: var(--dge-image); }
.dge-type--zip   { --dge-type: var(--dge-zip); }
.dge-type--video { --dge-type: var(--dge-video); }
.dge-type--audio { --dge-type: var(--dge-audio); }

.dge-item__icon {
	flex: 0 0 auto;
	width: var(--dge-icon-size);
	color: var(--dge-type);
	line-height: 0;
}

.dge-icon {
	display: block;
	width: 100%;
	height: auto;
}

.dge-thumb {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 6px;
}

.dge-item__body {
	flex: 1 1 auto;
	min-width: 0;
}

.dge .dge-item__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.dge-item__title a {
	color: inherit;
	text-decoration: none;
}

.dge-item__title a:hover {
	text-decoration: underline;
}

.dge .dge-item__desc {
	margin: 4px 0 0;
	color: #475467;
	font-size: 14px;
	line-height: 1.45;
}

.dge .dge-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 0;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	color: #667085;
	font-size: 13px;
}

.dge .dge-item__meta li {
	margin: 0;
	padding: 0;
}

.dge .dge-item__meta li + li::before {
	content: "\00b7";
	margin: 0 8px;
	opacity: .6;
}

.dge-item__type {
	color: var(--dge-type);
	font-weight: 700;
	letter-spacing: .02em;
}

.dge-badge {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	background: #f2f4f7;
	color: #344054;
	font-size: 12px;
}

.dge .dge-item__button {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 6px;
	background: #1d2939;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s, color .15s;
}

.dge .dge-item__button:hover,
.dge .dge-item__button:focus-visible {
	background: #344054;
	color: #fff;
}

.dge-item__button svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.dge-empty {
	margin: 0;
	padding: 24px;
	border: 1px dashed #d0d5dd;
	border-radius: 10px;
	color: #667085;
	text-align: center;
}

.dge-editor-notice {
	padding: 16px;
	border: 1px dashed #c4c9d2;
	color: #667085;
	text-align: center;
}

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

	.dge-item {
		flex-wrap: wrap;
	}

	.dge-item__body {
		flex-basis: calc(100% - var(--dge-icon-size) - 16px);
	}

	.dge .dge-item__button {
		width: 100%;
	}
}
