/*
 * Optional screen header. Disable $use_screen_report_header in main.tpl.php
 * to remove this stylesheet and its script, restoring the original layout.
 * The original intro logo remains in its original DOM position for print.
 */
.report-screen-header {
	display: none;
}

@media screen {
	html.has-report-screen-header {
		--rsh-expanded-height: 120px;
		--rsh-compact-height: 60px;
		--rsh-height: var(--rsh-expanded-height);
		--rsh-logo-width: 260px;
	}

	html.has-report-screen-header #li_report {
		padding-top: var(--rsh-expanded-height);
	}

	html.has-report-screen-header #toc_report_start {
		padding-top: 14px;
		scroll-margin-top: var(--rsh-expanded-height);
	}

	html.has-report-screen-header #toc_report_start > .intro-brand-link {
		display: none;
	}

	html.has-report-screen-header #li_report > section.sheet[id]:not(#toc_report_start) {
		scroll-margin-top: calc(var(--rsh-compact-height) + 16px);
	}

	.report-screen-header {
		position: fixed;
		inset: 0 0 auto;
		z-index: 1900;
		display: block;
		box-sizing: border-box;
		width: 100%;
		max-width: none;
		height: var(--rsh-height);
		border-bottom: 1px solid transparent;
		background: #fff;
		color: var(--li-color-menu, #6f7683);
		font-family: var(--li-font-family, "Poppins", sans-serif);
		transition: border-color 160ms ease, box-shadow 160ms ease;
	}

	.has-report-header-scrolled .report-screen-header {
		border-bottom-color: #e8edf4;
		box-shadow: 0 3px 14px rgba(36, 59, 96, 0.06);
	}

	.report-screen-header__inner {
		position: relative;
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		align-items: center;
		gap: 24px;
		box-sizing: border-box;
		width: 100%;
		max-width: 280mm;
		height: 100%;
		margin: 0 auto;
		padding: 0 10mm;
	}

	.report-screen-header__brand {
		grid-column: 2;
		justify-self: center;
		display: block;
		width: var(--rsh-logo-width);
		max-width: 100%;
		min-width: 0;
		border-radius: 4px;
		line-height: 0;
	}

	.report-screen-header__logo {
		display: block;
		width: 100%;
		height: auto;
		max-height: calc(var(--rsh-height) - 20px);
		object-fit: contain;
	}

	.report-screen-header__actions {
		position: absolute;
		top: 50%;
		right: 10mm;
		transform: translateY(-50%);
		justify-self: end;
		display: flex;
		align-items: center;
		gap: 22px;
	}

	.report-screen-header__action {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-height: 44px;
		padding: 6px 0;
		border: 0;
		border-radius: 4px;
		background: transparent;
		color: inherit;
		font: inherit;
		font-size: 13px;
		font-weight: 500;
		line-height: 1.3;
		text-decoration: none;
		white-space: nowrap;
		cursor: pointer;
	}

	.report-screen-header__action > i {
		width: 17px;
		font-size: 16px;
		text-align: center;
	}

	.report-screen-header__action:hover {
		color: #4f596a;
	}

	.report-screen-header__action:focus-visible,
	.report-screen-header__brand:focus-visible {
		outline: 2px solid #617fb5;
		outline-offset: 5px;
	}

	.report-screen-header__status {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	html.has-report-screen-header .toc-menu {
		top: calc(var(--rsh-height) + 20px);
	}

	html.has-report-screen-header .toc-menu .nav-menu {
		max-height: calc(100dvh - var(--rsh-height) - 90px);
	}

	@media (max-width: 1200px) {
		.report-screen-header__inner {
			max-width: none;
			padding-right: 15px;
			padding-left: 15px;
		}

		.report-screen-header__actions {
			right: 15px;
		}
	}

	@media (max-width: 900px) {
		.report-screen-header__inner {
			grid-template-columns: 112px minmax(0, 1fr) auto;
			gap: 16px;
			padding: 0 15px;
		}

		.report-screen-header__brand {
			justify-self: center;
			width: min(var(--rsh-logo-width), 210px);
		}

		.report-screen-header__actions {
			position: static;
			grid-column: 3;
			transform: none;
			gap: 16px;
		}
	}

	@media (max-width: 700px) {
		.report-screen-header__inner {
			grid-template-columns: 44px minmax(0, 1fr) auto;
			gap: 10px;
			padding: 0 15px;
		}

		.report-screen-header__brand {
			width: clamp(100px, calc(var(--rsh-logo-width) * 0.52), 140px);
		}

		.report-screen-header__actions {
			gap: 6px;
		}

		.report-screen-header__action {
			flex-direction: column;
			gap: 3px;
			min-width: 48px;
			min-height: 52px;
			padding: 3px 4px;
			font-size: 11.5px;
		}

		.report-screen-header__action-label {
			max-width: 44px;
			line-height: 1.15;
			text-align: center;
			white-space: normal;
		}

		html.has-report-screen-header .toc-menu {
			left: max(12px, env(safe-area-inset-left));
		}

		html.has-report-screen-header .toc-menu summary {
			width: 44px;
			gap: 0;
			justify-content: center;
			padding: 0;
		}

		html.has-report-screen-header .toc-menu-label {
			display: none;
		}

		html.has-report-screen-header .toc-menu .nav-menu {
			box-sizing: border-box;
			top: var(--rsh-height);
			height: calc(100dvh - var(--rsh-height));
			max-height: none;
		}

		html.has-report-screen-header .toc-menu::details-content {
			transform: none;
			transition: none;
		}

		html.has-report-screen-header .toc-menu-backdrop {
			/* The drawer moves below the header; its dimming mask stays viewport-wide. */
			inset: 0;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		.report-screen-header {
			transition: none;
		}
	}
}

@media print {
	.report-screen-header {
		display: none !important;
	}
}
