.afp-library {
	--afp-border: #d8dee4;
	--afp-text: #1f2328;
	--afp-muted: #59636e;
	--afp-surface: #ffffff;
	--afp-action: #f97316;
	--afp-action-hover: #ea580c;
	color: var(--afp-text);
}

.afp-filters {
	background: #f6f8fa;
	border: 1px solid var(--afp-border);
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0 0 24px;
	padding: 16px;
}

.afp-filter-primary,
.afp-filter-secondary {
	align-items: end;
	display: grid;
	gap: 12px;
}

.afp-filter-primary {
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.afp-filter-secondary {
	border-top: 1px solid var(--afp-border);
	grid-template-columns: minmax(180px, 240px) minmax(190px, 240px) minmax(210px, 260px) auto;
	justify-content: start;
	padding-top: 14px;
}

.afp-filters label {
	display: grid;
	gap: 5px;
	min-width: 0;
}

.afp-filters span {
	color: var(--afp-muted);
	font-size: 13px;
	font-weight: 600;
}

.afp-filters input,
.afp-filters select {
	background: #fff;
	border: 1px solid var(--afp-border);
	border-radius: 4px;
	box-sizing: border-box;
	min-height: 40px;
	padding: 8px 10px;
	width: 100%;
}

.afp-date-input {
	cursor: pointer;
}

.afp-filters button,
.afp-button {
	align-items: center;
	background: var(--afp-action) !important;
	border: 0 !important;
	border-radius: 4px;
	color: #fff !important;
	cursor: pointer;
	display: inline-flex;
	font-weight: 700;
	justify-content: center;
	min-height: 40px;
	padding: 8px 14px;
	text-decoration: none;
}

.afp-filters button:hover,
.afp-filters button:focus,
.afp-button:hover,
.afp-button:focus {
	background: var(--afp-action-hover) !important;
	color: #fff !important;
	text-decoration: none;
}

.afp-button:visited {
	background: var(--afp-action) !important;
	color: #fff !important;
}

.afp-login-required .afp-login-button,
.afp-login-required .afp-login-button:visited {
	background: var(--afp-action) !important;
	color: #fff !important;
	min-width: 120px;
	width: auto;
}

.afp-login-required .afp-login-button:hover,
.afp-login-required .afp-login-button:focus {
	background: var(--afp-action-hover) !important;
	color: #fff !important;
}

.afp-document-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.afp-card {
	background: var(--afp-surface);
	border: 1px solid var(--afp-border);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	overflow: hidden;
	overflow-wrap: anywhere;
	padding: 18px;
}

.afp-card h3 {
	font-size: 20px;
	line-height: 1.25;
	margin: 0 0 6px;
}

.afp-card h3 a {
	color: inherit;
	display: block;
	overflow: hidden;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-card h3 a:hover {
	color: var(--afp-action);
}

.afp-card-summary {
	justify-content: space-between;
	min-height: 150px;
}

.afp-card-footer {
	align-items: center;
	border-top: 1px solid var(--afp-border);
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-top: auto;
	min-width: 0;
	padding-top: 12px;
}

.afp-card-footer span {
	color: var(--afp-muted);
	font-size: 13px;
	font-weight: 600;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-card-open {
	flex: 0 0 auto;
	min-height: 34px;
	padding: 7px 14px;
}

.afp-meta,
.afp-tags,
.afp-file-list span {
	color: var(--afp-muted);
	font-size: 13px;
}

.afp-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	min-width: 0;
}

.afp-meta span,
.afp-tags {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-card .afp-content {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.afp-card .afp-content > :first-child {
	margin-top: 0;
}

.afp-card .afp-content > :last-child {
	margin-bottom: 0;
}

.afp-file-list {
	display: grid;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.afp-file-list li {
	align-items: center;
	border-top: 1px solid var(--afp-border);
	display: grid;
	grid-template-columns: minmax(180px, 1fr) max-content;
	gap: 12px;
	padding-top: 10px;
}

.afp-file-list li > div {
	min-width: 0;
}

.afp-file-list strong,
.afp-file-list span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-file-actions-front {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	flex-wrap: nowrap;
	gap: 8px;
	justify-content: flex-end;
}

.afp-library .afp-preview-button {
	align-items: center;
	background: #fff !important;
	border: 1px solid var(--afp-border) !important;
	border-radius: 4px !important;
	color: var(--afp-text) !important;
	cursor: pointer;
	display: inline-flex;
	font-size: 13px;
	font-weight: 700;
	justify-content: center;
	line-height: 1.15;
	min-height: 34px !important;
	min-width: 86px;
	padding: 7px 10px !important;
	width: auto !important;
}

.afp-library .afp-preview-button:hover,
.afp-library .afp-preview-button:focus {
	background: #f6f8fa !important;
	border-color: var(--afp-action) !important;
	color: var(--afp-action) !important;
}

.afp-library .afp-download-button {
	border-radius: 4px !important;
	font-size: 13px;
	line-height: 1.15;
	min-height: 34px !important;
	min-width: 76px;
	padding: 7px 10px !important;
	width: auto !important;
}

.afp-preview-modal {
	align-items: center;
	background: rgba(15, 23, 42, 0.72);
	bottom: 0;
	display: none;
	justify-content: center;
	left: 0;
	padding: 24px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 99999;
}

.afp-preview-modal.is-open {
	display: flex;
}

.afp-preview-open body {
	overflow: hidden;
}

.afp-preview-dialog {
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	max-height: min(820px, 90vh);
	max-width: min(980px, 94vw);
	overflow: hidden;
	width: 100%;
}

.afp-preview-header {
	align-items: center;
	border-bottom: 1px solid var(--afp-border);
	display: flex;
	gap: 16px;
	justify-content: space-between;
	padding: 12px 16px;
}

.afp-preview-title {
	font-weight: 800;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-preview-close {
	background: transparent;
	border: 0;
	color: var(--afp-text);
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	min-height: 36px;
	min-width: 36px;
	padding: 0;
}

.afp-preview-body {
	background: #f6f8fa;
	display: grid;
	min-height: 280px;
	place-items: center;
}

.afp-preview-body img,
.afp-preview-body iframe {
	border: 0;
	display: block;
	max-height: 78vh;
	max-width: 100%;
	width: 100%;
}

.afp-preview-body img {
	height: auto;
	object-fit: contain;
}

.afp-preview-body iframe {
	height: min(760px, 78vh);
}

.afp-single-files {
	margin-top: 28px;
}

.afp-file-sort-form {
	align-items: end;
	background: #f6f8fa;
	border: 1px solid var(--afp-border);
	border-radius: 4px;
	display: grid;
	gap: 10px;
	grid-template-columns: minmax(210px, 260px) auto;
	justify-content: start;
	margin: 0 0 14px;
	padding: 12px;
}

.afp-file-controls-form {
	grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) minmax(210px, 260px) auto;
}

.afp-file-sort-form label {
	display: grid;
	gap: 5px;
}

.afp-file-sort-form span {
	color: var(--afp-muted);
	font-size: 13px;
	font-weight: 600;
}

.afp-file-sort-form input,
.afp-file-sort-form select {
	background: #fff;
	border: 1px solid var(--afp-border);
	border-radius: 4px;
	box-sizing: border-box;
	min-height: 40px;
	padding: 8px 10px;
	width: 100%;
}

.afp-file-sort-form button {
	align-items: center;
	background: var(--afp-action);
	border: 0;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font-weight: 700;
	justify-content: center;
	min-height: 40px;
	padding: 8px 14px;
}

.afp-file-sort-form button:hover,
.afp-file-sort-form button:focus {
	background: var(--afp-action-hover);
	color: #fff;
}

.afp-file-result-summary {
	color: var(--afp-muted);
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 10px;
}

.afp-file-pagination {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 18px;
}

.afp-file-page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.afp-file-page-link {
	align-items: center;
	background: #fff;
	border: 1px solid var(--afp-border);
	border-radius: 4px;
	color: var(--afp-text);
	display: inline-flex;
	font-size: 13px;
	font-weight: 800;
	justify-content: center;
	min-height: 34px;
	min-width: 34px;
	padding: 7px 10px;
	text-decoration: none;
}

.afp-file-page-link:hover,
.afp-file-page-link:focus,
.afp-file-page-link.is-current {
	background: var(--afp-action);
	border-color: var(--afp-action);
	color: #fff;
	text-decoration: none;
}

.afp-single-page {
	margin: 0 auto;
	max-width: 1120px;
	padding: 32px 20px;
}

.afp-single-template {
	background: #fff;
	border: 1px solid var(--afp-border);
	border-radius: 6px;
	padding: 28px;
}

.afp-single-document {
	display: grid;
	gap: 20px;
}

.afp-breadcrumb {
	align-items: center;
	color: var(--afp-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	font-weight: 600;
	gap: 8px;
	min-width: 0;
}

.afp-breadcrumb a {
	color: var(--afp-action);
	text-decoration: none;
}

.afp-breadcrumb a:hover,
.afp-breadcrumb a:focus {
	color: var(--afp-action-hover);
	text-decoration: underline;
}

.afp-breadcrumb span:last-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-single-actions-top {
	display: flex;
	justify-content: flex-start;
}

.afp-back-link {
	align-items: center;
	background: #fff;
	border: 1px solid var(--afp-border);
	border-radius: 4px;
	color: var(--afp-text);
	display: inline-flex;
	font-size: 13px;
	font-weight: 800;
	min-height: 36px;
	padding: 8px 12px;
	text-decoration: none;
}

.afp-back-link::before {
	content: "<";
	font-size: 14px;
	font-weight: 900;
	margin-right: 8px;
}

.afp-back-link:hover,
.afp-back-link:focus {
	background: #f6f8fa;
	border-color: var(--afp-action);
	color: var(--afp-action);
	text-decoration: none;
}

.afp-single-header {
	border-bottom: 1px solid var(--afp-border);
	padding-bottom: 22px;
}

.afp-single-kicker {
	color: var(--afp-action);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.afp-single-header h1 {
	font-size: clamp(30px, 5vw, 48px);
	line-height: 1.1;
	margin: 0;
	overflow-wrap: anywhere;
}

.afp-single-meta {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	margin-top: 22px;
}

.afp-single-meta div {
	background: #f6f8fa;
	border: 1px solid var(--afp-border);
	border-radius: 4px;
	min-width: 0;
	padding: 12px;
}

.afp-single-meta span,
.afp-single-meta strong {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-single-meta span {
	color: var(--afp-muted);
	font-size: 12px;
	font-weight: 800;
	margin-bottom: 4px;
	text-transform: uppercase;
}

.afp-single-content {
	font-size: 17px;
	line-height: 1.65;
	overflow-wrap: anywhere;
}

.afp-single-content > :first-child {
	margin-top: 0;
}

.afp-single-content > :last-child {
	margin-bottom: 0;
}

.afp-single-file-list li {
	grid-template-columns: minmax(220px, 1fr) max-content;
}

.afp-group {
	margin: 0 0 28px;
}

.afp-group h2 {
	border-bottom: 1px solid var(--afp-border);
	font-size: 22px;
	margin: 0 0 14px;
	padding-bottom: 8px;
}

.afp-empty,
.afp-login-required {
	background: #f6f8fa;
	border: 1px solid var(--afp-border);
	border-radius: 6px;
	padding: 16px;
}

@media (max-width: 640px) {
	.afp-filter-secondary {
		grid-template-columns: 1fr;
	}

	.afp-file-sort-form {
		grid-template-columns: 1fr;
	}

	.afp-file-controls-form {
		grid-template-columns: 1fr;
	}

	.afp-single-page {
		padding: 20px 12px;
	}

	.afp-single-template {
		padding: 18px;
	}

	.afp-file-list li {
		align-items: stretch;
		grid-template-columns: 1fr;
	}

	.afp-button {
		width: 100%;
	}

	.afp-card-footer {
		align-items: stretch;
		flex-direction: column;
	}

	.afp-file-actions-front {
		justify-content: stretch;
	}

	.afp-library .afp-preview-button,
	.afp-library .afp-download-button {
		width: 100% !important;
	}

	.afp-preview-modal {
		padding: 12px;
	}
}
