.chavdar-document-card.has-files-popover {
	position: relative;
}

.chavdar-document-card__files-summary {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 14px;
}

.chavdar-document-card__files-summary > span {
	color: #667085;
	font-size: .88rem;
}

.chavdar-document-card__files-button {
	padding: 5px;
	border: 0;
	background: transparent;
	color: var(--chavdar-doc-accent);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
}

.chavdar-document-files-popover {
	box-sizing: border-box;
	position: absolute;
	z-index: 20;
	top: 50%;
	right: 18px;
	left: 18px;
	max-height: calc(100% - 36px);
	padding: 18px;
	overflow: hidden;
	border: 1px solid var(--chavdar-doc-border);
	border-radius: 9px;
	background: #fff;
	box-shadow: 0 14px 38px rgba(20, 35, 55, .22);
	opacity: 0;
	pointer-events: none;
	transform: translateY(-46%) scale(.98);
	transition: opacity .16s ease, transform .16s ease;
}

.has-files-popover.is-files-open {
	z-index: 21;
}

.has-files-popover.is-files-open .chavdar-document-files-popover {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(-50%) scale(1);
}

.chavdar-document-files-popover__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

.chavdar-document-files-popover__header h5 {
	margin: 0;
	color: #1e2d59;
	font-size: 1rem;
	line-height: 1.35;
}

.chavdar-document-files-popover__close {
	display: inline-grid;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	place-items: center;
	margin: -7px -7px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #526071;
	cursor: pointer;
	font-size: 1.55rem;
	line-height: 1;
}

.chavdar-document-files-popover__close:hover,
.chavdar-document-files-popover__close:focus-visible {
	background: #f0f3f7;
}

.chavdar-document-files-popover__scroll {
	max-height: 300px;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 5px;
	overscroll-behavior: contain;
}

.chavdar-document-files-popover .chavdar-document-files {
	width: auto;
	margin: 0;
}

.chavdar-document-files-popover .chavdar-document-files a {
	min-width: 0;
	padding: 10px 12px;
}

.chavdar-document-files-popover .chavdar-document-files a span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.chavdar-document-popover-backdrop {
	position: fixed;
	z-index: 9997;
	inset: 0;
	background: rgba(15, 23, 42, .42);
}

@media (min-width: 768px) {
	.chavdar-document-popover-backdrop {
		display: none;
	}
}

@media (max-width: 767px) {
	html.chavdar-files-sheet-open {
		overflow: hidden;
	}

	.chavdar-document-files-popover {
		position: fixed;
		z-index: 9998;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 80vh;
		padding: 20px 18px max(20px, env(safe-area-inset-bottom));
		border-width: 1px 0 0;
		border-radius: 16px 16px 0 0;
		opacity: 0;
		transform: translateY(104%);
	}

	.chavdar-document-card.has-files-popover.is-files-open {
		z-index: 9998;
		transform: none;
	}

	.has-files-popover.is-files-open .chavdar-document-files-popover {
		opacity: 1;
		transform: translateY(0);
	}

	.chavdar-document-files-popover__scroll {
		max-height: calc(80vh - 82px);
		padding-right: 4px;
	}
}
