:root {
	--page-max-width: 1600px;
	--gap: 0.35rem;
	--radius: 0.35rem;
	--border-dark: #1f2937;
	--text-muted: #4b5563;
	--head-bg: #76448A;
	--day-bg: #512E5F;
	--head-fg: #F5EEF8;
	--wp-color: #A493BF;
	--time-bg: rgb(199, 217, 249);
}

* {
	box-sizing: border-box;
}

html {
	font-size: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 0.75rem;
	font-family: Calibri, Arial, Helvetica, sans-serif;
	font-size: clamp(16px, 1.05vw, 21px);
	line-height: 1.35;
	color: #111827;
	background: #f3f4f6;
}

h1,
.stand,
.ahoi,
.filter-panel,
.tag,
.footer,
.legende {
	width: min(100%, var(--page-max-width));
	margin-left: auto;
	margin-right: auto;
}

h1 {
	margin-top: 0;
	margin-bottom: 0.5rem;
	font-size: clamp(1.7rem, 3.2vw, 3.0rem);
	background-color: var(--head-bg);
	color: var(--head-fg);
	padding: 0.45em 0.6em;
	text-align: center;
	border-radius: var(--radius);
}

.stand {
	font-size: clamp(1rem, 1.2vw, 1.25rem);
	text-align: center;
	border: 3px solid navy;
	background-color: yellow;
	padding: 0.55em;
	border-radius: var(--radius);
}

.ahoi {
	font-size: clamp(1.1rem, 1.8vw, 1.7rem);
	text-align: center;
	border: 3px solid black;
	background-color: #ccc;
	color: #555;
	font-weight: bold;
	padding: 0.65em;
	margin-top: 0.75rem;
	margin-bottom: 0.75rem;
	border-radius: var(--radius);
}


.filter-panel {
	display: grid;
	grid-template-columns: minmax(18rem, 1fr) auto;
	gap: 0.5rem;
	align-items: end;
	margin-top: 0.75rem;
	margin-bottom: 0.75rem;
	padding: 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: var(--radius);
	background: white;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.filter-panel label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.filter-panel input {
	width: 100%;
	padding: 0.55rem 0.65rem;
	border: 1px solid #9ca3af;
	border-radius: 0.25rem;
	font: inherit;
	background: #fff;
}

.filter-panel button {
	padding: 0.55rem 0.8rem;
	border: 1px solid #6b7280;
	border-radius: 0.25rem;
	font: inherit;
	cursor: pointer;
	background: #f9fafb;
}

.filter-panel button:hover,
.filter-panel button:focus {
	background: #e5e7eb;
}

.filter-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.filter-options {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
}

.filter-options label {
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
	margin: 0;
	font-weight: 400;
}

.filter-hide-past {
	grid-column: 1 / -1;
	display: inline-flex !important;
	align-items: center;
	gap: 0.35rem;
	justify-self: start;
	white-space: nowrap;
	align-self: center;
	margin-bottom: 0.1rem !important;
	font-weight: 400 !important;
}

.filter-hide-past input {
	width: auto;
	margin: 0;
	padding: 0;
}

.filter-link-status {
	min-height: 1.2em;
}

.filter-hint {
	grid-column: 1 / -1;
	font-size: 0.9em;
	color: var(--text-muted);
}

.filter-no-results {
	display: none;
	width: min(100%, var(--page-max-width));
	margin: 0.75rem auto;
	padding: 0.75rem;
	border: 1px solid #9ca3af;
	border-radius: var(--radius);
	background: white;
	text-align: center;
	font-weight: 700;
}

.is-hidden-by-filter,
.is-hidden-by-date {
	display: none !important;
}

.tag {
	margin-top: 0.75rem;
}

.wochentag {
	position: sticky;
	top: 0;
	z-index: 2;
	margin-top: 0.5em;
	padding: 0.5em 0.6em;
	background-color: var(--day-bg);
	color: var(--head-fg);
	font-weight: bold;
	border: 1px solid black;
	font-size: clamp(1.25rem, 2vw, 1.85rem);
	border-radius: var(--radius) var(--radius) 0 0;
}

/* .wochentag::before { background-color: #E51400; font-weight: normal; padding-left: 0.5em; padding-right: 0.5em; margin-right: 1em; content: "⚠ VORLÄUFIG"; border: 2px solid white;} */

.prfg {
	display: grid;
	grid-template-columns: minmax(10rem, 0.75fr) minmax(18rem, 2fr) minmax(9rem, 0.75fr) minmax(12rem, 1.25fr);
	align-items: stretch;
	gap: 0;
	margin-top: var(--gap);
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.prfg > div {
	min-width: 0;
	padding: 0.5em 0.8em;
	overflow-wrap: anywhere;
}

.prfg > div + div {
	border-left: 1px solid rgba(0, 0, 0, 0.16);
}

.wp {
	border-left: 4px solid var(--wp-color);
}

.prfg.wp {
	position: relative;
	border-left: 1px solid rgba(0, 0, 0, 0.18);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.prfg.wp::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	background: var(--wp-color);
	z-index: 1;
	pointer-events: none;
}

.prfg.wp > div:first-child {
	padding-left: calc(0.8em + 4px);
}

.wp_legende {
	border-left: 4px solid var(--wp-color);
	background-color: #EEE;
}

.b1, .b1 > div { background-color: #ABEBC6; }
.b2, .b2 > div { background-color: #AED6F1; }
.b3, .b3 > div { background-color: #82E0AA; }
.b4, .b4 > div { background-color: #85C1E9; }
.b5, .b5 > div { background-color: #58D68D; }
.b6, .b6 > div { background-color: #5DADE2; }
.m1, .m1 > div { background-color: #FAD7A0; }
.m2, .m2 > div { background-color: #F8C471; }
.m3, .m3 > div { background-color: #F5B041; }
.b15, .b15 > div { background-color: #ffadd9; }
.m17, .m17 > div { background-color: #ffadd9; }
.basics > div { background-color: gainsboro; }

.uhrzeit {
	background-color: var(--time-bg) !important;
	font-weight: 700;
	white-space: normal;
}

.lehrveranstaltung {
	font-weight: bold;
}

.lvnr {
	margin-top: 0.25rem;
	font-weight: normal;
	font-style: italic;
	color: var(--text-muted);
}

.lehrende {
	margin-top: 0.2rem;
	font-weight: normal;
}

.lehrende::before { content: "Lehrende/r: "; }
.raum::before { content: "Raum: "; font-weight: 700; }
.teilnehmer { margin-top: 0.2rem; font-style: italic; color: var(--text-muted); }
.teilnehmer::before { content: "max. "; }
.teilnehmer::after { content: " TN"; }
.aufsicht::before { content: "Aufsicht: "; font-weight: 700; }
.aufsichtname { font-weight: bold; }

.footer {
	font-size: clamp(1rem, 1.25vw, 1.25rem);
	text-align: center;
	border: 3px solid navy;
	background-color: yellow;
	margin-top: 1rem;
	margin-bottom: 1rem;
	padding: 0.75em;
	border-radius: var(--radius);
}

.legende {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
	font-size: clamp(0.95rem, 1.1vw, 1.15rem);
	text-align: center;
	border: 3px solid navy;
	background-color: white;
	margin-top: 1rem;
	margin-bottom: 1rem;
	padding: 0.65em;
	border-radius: var(--radius);
}

.legende > span {
	display: inline-flex;
	align-items: center;
	min-height: 1.9rem;
	border: 1px solid black;
	padding: 0.2rem 0.5rem;
}

@media (min-width: 1800px) {
	:root { --page-max-width: 1800px; }
	body { padding: 1.25rem; }
	.prfg {
		grid-template-columns: minmax(12rem, 0.7fr) minmax(24rem, 2.3fr) minmax(12rem, 0.85fr) minmax(16rem, 1.25fr);
	}
}

@media (max-width: 900px) {
	body {
		padding: 0.5rem;
		font-size: 17px;
	}

	.wochentag {
		position: static;
	}

	.prfg {
		grid-template-columns: 9.5rem 1fr;
		grid-template-areas:
			"time title"
			"room room"
			"supervision supervision";
	}

	.uhrzeit { grid-area: time; }
	.lehrveranstaltung { grid-area: title; }
	.raum { grid-area: room; }
	.aufsicht { grid-area: supervision; }

	.prfg > div + div {
		border-left: 0;
	}

	.raum,
	.aufsicht {
		border-top: 1px solid rgba(0, 0, 0, 0.16);
	}

	.filter-panel {
		grid-template-columns: 1fr;
		align-items: stretch;
	}

	.filter-panel button {
		width: 100%;
	}

}

@media (max-width: 560px) {
	body {
		padding: 0.35rem;
		font-size: 16px;
		background: #fff;
	}

	h1,
	.stand,
	.ahoi,
	.wochentag,
	.footer,
	.legende,
	.prfg {
		border-radius: 0.25rem;
	}

	.ahoi {
		font-size: 1rem;
		text-align: left;
	}

	.prfg {
		display: block;
	}

	.prfg.wp {
		border-left-width: 1px;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	}

	.prfg > div {
		padding: 0.45rem 0.55rem;
		border-left: 0 !important;
	}

	.prfg.wp > div:first-child {
		padding-left: calc(0.55rem + 4px);
	}

	.prfg > div + div {
		border-top: 1px solid rgba(0, 0, 0, 0.16);
	}

	.uhrzeit {
		font-size: 1.05rem;
	}

	.lehrveranstaltung {
		font-size: 1.05rem;
	}

	.legende {
		justify-content: flex-start;
		text-align: left;
	}
}

@media print {
	@page {
		size: A4 portrait;
		margin: 12mm 10mm;
	}

	* {
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}

	html,
	body {
		margin: 0;
		padding: 0;
		background: white;
		color: black;
		font-size: 10.5pt;
		line-height: 1.22;
	}

	h1,
	.stand,
	.ahoi,
	.filter-panel,
	.tag,
	.footer,
	.legende {
		width: 100%;
		max-width: none;
	}

	h1 {
		margin: 0 0 4mm 0;
		padding: 0;
		background: white;
		color: black;
		font-size: 18pt;
		border: 0;
	}

	.filter-panel,
	.filter-no-results {
		display: none !important;
	}

	.tag.is-hidden-by-filter,
	.tag.is-hidden-by-date,
	.prfg.is-hidden-by-filter,
	.prfg.is-hidden-by-date {
		display: none !important;
	}

	body.print-filtered .tag,
	body.print-filtered [style*="page-break-before"] {
		page-break-before: auto !important;
		break-before: auto !important;
	}

	.stand,
	.ahoi,
	.footer {
		background: white;
		color: black;
		border: 1px solid black;
		padding: 2mm;
		margin: 0 0 3mm 0;
		font-size: 10pt;
	}

	.ahoi {
		font-size: 11pt;
	}

	.wochentag {
		position: static;
		background: white;
		color: black;
		border: 1px solid black;
		margin-top: 3mm;
		padding: 1.5mm 2mm;
		font-size: 12pt;
		break-after: avoid;
		page-break-after: avoid;
	}

	.tag,
	.prfg {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.prfg {
		display: grid !important;
		grid-template-columns: 26mm 1fr 30mm 38mm !important;
		grid-template-areas: none !important;
		margin-top: 1.2mm;
		border-top: 1px solid #444 !important;
		border-right: 2px solid #444 !important;
		border-bottom: 1px solid #444 !important;
		border-left: 2px solid #444 !important;
		border-radius: 0;
		box-shadow: none;
		overflow: hidden;
		background: white !important;
		background-color: white !important;
	}

	.prfg *,
	.prfg > div {
		background: white !important;
		background-color: white !important;
	}

	.prfg > div {
		grid-area: auto !important;
		padding: 1.3mm 1.6mm;
	}


	.b1, .b1 > div,
	.b2, .b2 > div,
	.b3, .b3 > div,
	.b4, .b4 > div,
	.b5, .b5 > div,
	.b6, .b6 > div,
	.m1, .m1 > div,
	.m2, .m2 > div,
	.m3, .m3 > div,
	.b15, .b15 > div,
	.m17, .m17 > div,
	.basics, .basics > div {
		background: white !important;
		background-color: white !important;
	}

	.uhrzeit,
	.lehrveranstaltung,
	.raum,
	.aufsicht {
		grid-area: auto !important;
	}

	.prfg > div + div {
		border-left: 1px solid #999;
	}

	.prfg.wp {
		border-left: 4px solid #444 !important;
		border-right: 2px solid #444 !important;
		box-shadow: none;
	}

	.prfg.wp::before {
		content: none;
		display: none;
	}

	.prfg.wp > div:first-child {
		padding-left: 1.6mm;
	}

	.uhrzeit {
		background: white !important;
		font-weight: bold;
	}

	.lvnr,
	.lehrende,
	.teilnehmer {
		color: black;
	}

	.legende {
		display: none;
	}

	.footer {
		margin-top: 5mm;
		break-inside: avoid;
		page-break-inside: avoid;
	}


	.tag.is-hidden-by-filter,
	.tag.is-hidden-by-date,
	.prfg.is-hidden-by-filter,
	.prfg.is-hidden-by-date {
		display: none !important;
	}

	a {
		color: black;
		text-decoration: none;
	}
}
