.lean-document-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	flex-wrap: wrap;
}

.lean-document-header > h1 {
	flex: 1 1 15rem;
	margin: 0;
}

.lean-document-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-block-start: 0.4rem;
}

.lean-document-export .lean-document-actions :is(a, button).lean-document-action {
	display: inline-flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0.4rem;
	box-sizing: border-box;
	max-inline-size: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
	min-block-size: 2.5rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.8125rem;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
}

.lean-document-action::before {
	content: "";
	flex-shrink: 0;
	inline-size: 1rem;
	block-size: 1rem;
	margin-block-start: max(0px, calc((1lh - 1rem) / 2));
	background: currentColor;
	mask: var(--lean-document-action-icon) center / contain no-repeat;
}

.lean-document-action--download {
	--lean-document-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5'/%3E%3C/svg%3E");
}

.lean-document-action--print {
	--lean-document-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8V3h12v5M6 17H3V8h18v9h-3M6 13h12v8H6z'/%3E%3C/svg%3E");
}

.lean-document-actions .lean-document-action:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.lean-document-export > .document-masthead {
	display: none;
}

@media print {
	body:has(.lean-document-export) *:not(:has(.lean-document-export)):not(.lean-document-export):not(.lean-document-export *) {
		display: none !important;
	}

	body:has(.lean-document-export) *:has(.lean-document-export) {
		display: block !important;
		position: static !important;
		width: auto !important;
		max-width: none !important;
		min-height: 0 !important;
		height: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: visible !important;
		transform: none !important;
	}

	body .lean-document-export {
		position: static;
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 0;
		color: #000;
		background: #fff;
	}

	body .lean-document-export > .document-masthead {
		display: block;
	}

	body .lean-document-export .lean-document-header {
		display: block;
		margin-bottom: 18pt;
	}

	body .lean-document-export .lean-document-actions {
		display: none;
	}

	.lean-document-export :is(h1, h2, h3) {
		break-after: avoid;
	}

	.lean-document-export tr {
		break-inside: avoid;
	}
}
