/* =============================================================================
   SP Program Management v4
   All selectors are namespaced under .sp-pm to avoid collisions.
   ============================================================================= */

/* ── Custom properties ──────────────────────────────────────────────────────── */
:root {
	--sp-accent:          gray; /* Default; overridable per embed via ?accent= (see General.php + template.tpl.php) */
	--sp-accent-light:    oklch(from var(--sp-accent) 93% 0.05 h);
	--sp-accent-dark:     oklch(from var(--sp-accent) 43% calc(c * 0.85) h);
	--sp-text:            #1a1a2e;
	--sp-text-muted:      #6b7280;
	--sp-border:          #e5e7eb;
	--sp-surface:         #ffffff;
	--sp-surface-alt:     #f9fafb;
	--sp-error:           #dc2626;
	--sp-radius:          8px;
	--sp-radius-lg:       14px;
	--sp-shadow-sm:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
	--sp-shadow-md:       0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
	--sp-transition:      180ms ease;
	--sp-max-width:       1100px;
}

/* ── Base reset (scoped) ────────────────────────────────────────────────────── */
#sp-pm *,
#sp-pm *::before,
#sp-pm *::after {
	box-sizing: border-box;
}

#sp-pm {
	max-width: var(--sp-max-width);
	/*width: 100%;*/
	margin: 0 auto;
	padding: 32px 20px;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	color: var(--sp-text);
	font-size: 15px;
	line-height: 1.5;

	@media (max-width: 768px) {
		padding: 16px 12px;
	}

	p,
	ul,
	h3,
	h4 {
		margin: 0;
		padding: 0;
	}

	ul {
		list-style: none;
	}
}


/* ── Filter bar ─────────────────────────────────────────────────────── */
.sp-pm__filters {
	margin-bottom: 24px;
}

.sp-pm__filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-start;
	padding: 16px 20px;
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-lg);
	box-shadow: var(--sp-shadow-sm);

	@media (max-width: 768px) {
		padding: 12px;
	}

	&.sp-pm__filter-bar--loading {
		/*border-color: var(--sp-accent);*/
		animation: sp-filter-pulse 2.1s ease-in-out infinite;
	}

	/* ── Choices.js overrides ─────────────────────────────────────────── */
	.choices {
		margin-bottom: 0;
		font-family: inherit;
		font-size: 14px;
	}

	.choices__inner {
		min-height: 40px;
		padding: 5px 36px 5px 12px;
		padding-bottom: 0 !important;
		background: var(--sp-surface-alt);
		border: 1px solid var(--sp-border);
		border-radius: var(--sp-radius) !important;
		font-family: inherit;
		font-size: 14px;
		color: var(--sp-text);
		transition: border-color var(--sp-transition), box-shadow var(--sp-transition);
		cursor: pointer;
	}

	.choices.is-open .choices__inner,
	.choices.is-focused .choices__inner {
		border-color: var(--sp-accent);
		box-shadow: 0 0 0 3px rgba(124, 77, 255, .15);
	}

	.choices__list--single {
		padding: 0;
		.choices__item {
			padding: 0;
			line-height: 28px;
		}
	}

	.choices[data-type*="select-one"] {
		&:after {
			border-color: var(--sp-text-muted) transparent transparent;
			right: 12px;
			margin-top: -3px;
		}
		&.is-open:after {
			border-color: transparent transparent var(--sp-text-muted);
			margin-top: -7px;
		}
	}

	.choices__list--dropdown,
	.choices__list[aria-expanded] {
		border: 1px solid var(--sp-border) !important;
		border-radius: var(--sp-radius) !important;
		box-shadow: var(--sp-shadow-md);
		background: var(--sp-surface);
		margin-top: 4px;
		font-family: inherit;
		font-size: 14px;
		z-index: 200;

		.choices__item {
			padding: 8px 12px;
			color: var(--sp-text);
			font-size: 14px;
		}

		.choices__item--selectable.is-highlighted {
			background: var(--sp-accent-light);
			color: var(--sp-accent-dark);
		}

		.choices__input {
			padding: 8px 12px;
			font-family: inherit;
			font-size: 14px;
			border-bottom: 1px solid var(--sp-border);
			background: var(--sp-surface-alt);
			color: var(--sp-text);
			width: 100%;
			box-sizing: border-box;
		}
	}
}

.sp-pm__filter-item {
	flex: 1 1 auto;
	min-width: 0;

	&.sp-pm__filter-item--search {
		flex: 1 1 160px;
	}

	@media (max-width: 768px) {
		flex: 1 1 calc(50% - 5px);

		&.sp-pm__filter-item--search {
			flex: 1 1 100%;
		}
	}
}

.sp-pm__filter-input {
	display: block;
	width: 100%;
	height: 40px;
	padding: 0 12px;
	font-family: inherit;
	font-size: 14px;
	color: var(--sp-text);
	background: var(--sp-surface-alt);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	outline: none;
	transition: border-color var(--sp-transition), box-shadow var(--sp-transition);

	&:focus {
		border-color: var(--sp-accent);
		box-shadow: 0 0 0 3px rgba(124, 77, 255, .15);
	}
}

.sp-pm__filter-reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--sp-text-muted);
	background: transparent;
	border: 1px solid var(--sp-border);
	border-radius: 100px;
	cursor: pointer;
	white-space: nowrap;
	transition: color var(--sp-transition), border-color var(--sp-transition), background var(--sp-transition);

	&:hover {
		color: var(--sp-text);
		border-color: var(--sp-text-muted);
		background: var(--sp-surface-alt);
	}

	&[hidden] { display: none !important; }
}

/* ── Filter info bar (shown when days are hidden or filter results are active) */
.sp-pm__filter-info {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	padding: 10px 16px;
	margin-bottom: 12px;
	background: color-mix(in srgb, var(--sp-accent) 8%, white);
	border: 1px solid color-mix(in srgb, var(--sp-accent) 20%, white);
	border-radius: var(--sp-radius);
	font-size: 13px;
	color: var(--sp-accent-dark);

	&[hidden] { display: none !important; }

	@media (max-width: 480px) {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.sp-pm__filter-results {
		font-weight: 600;
	}

	.sp-pm__filter-results--none {
		font-weight: 400;
		font-style: italic;
		color: var(--sp-text-muted);
	}

	.sp-pm__filter-info-sep {
		color: var(--sp-text-muted);
		opacity: .5;
		flex-shrink: 0;

		@media (max-width: 480px) {
			display: none;
		}
	}

	.sp-pm__filter-info-text {
		flex: 1;

		@media (max-width: 480px) {
			flex: none;
		}
	}

	.sp-pm__filter-info-reset {
		background: none;
		border: none;
		padding: 0;
		font-family: inherit;
		font-size: 13px;
		font-weight: 600;
		color: var(--sp-accent-dark);
		cursor: pointer;
		text-decoration: underline;
		text-underline-offset: 2px;
		white-space: nowrap;

		&:hover { opacity: .7; }
	}
}

/* ── Print button ────────────────────────────────────────────────────── */
.sp-pm__print-bar {
	display: flex;
	justify-content: flex-end;
	padding: 16px 0 0;
}

.sp-pm__print-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 20px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--sp-text-muted);
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	border-radius: 100px;
	cursor: pointer;
	transition: color var(--sp-transition), border-color var(--sp-transition);

	&::before {
		content: '';
		display: inline-block;
		width: 14px;
		height: 14px;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 6 2 18 2 18 9'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-size: contain;
	}

	&:hover {
		color: var(--sp-text);
		border-color: var(--sp-text-muted);
	}

	&:disabled {
		opacity: .5;
		cursor: not-allowed;
	}
}

/* ── Filter footer reset button ──────────────────────────────────────── */
.sp-pm__filter-footer {
	display: flex;
	justify-content: center;
	padding: 24px 0 8px;

	&[hidden] { display: none !important; }

	.sp-pm__filter-footer-btn {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		height: 38px;
		padding: 0 20px;
		font-family: inherit;
		font-size: 13px;
		font-weight: 500;
		color: var(--sp-text-muted);
		background: var(--sp-surface);
		border: 1px solid var(--sp-border);
		border-radius: 100px;
		cursor: pointer;
		transition: color var(--sp-transition), border-color var(--sp-transition), background var(--sp-transition);

		&:hover {
			color: var(--sp-text);
			border-color: var(--sp-text-muted);
			background: var(--sp-surface-alt);
		}
	}
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Days
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__days {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ── Day card ─────────────────────────────────────────────────────────────── */
.sp-pm__day {
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-lg);
	box-shadow: var(--sp-shadow-sm);
	overflow: clip;

	.sp-pm__day-sentinel {
		height: 1px;
		margin-bottom: -1px;
		visibility: hidden;
		pointer-events: none;
	}

	.sp-pm__day-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20px 24px;
		cursor: pointer;
		gap: 12px;
		user-select: none;
		position: sticky;
		top: 0;
		z-index: 10;
		background: var(--sp-surface);
		border-radius: var(--sp-radius-lg);
		transition: background var(--sp-transition), border-color var(--sp-transition);

		&:hover {
			background: var(--sp-surface-alt);
		}

		&:has(+ .sp-pm__sessions:not([hidden])) {
			border-radius: var(--sp-radius-lg) var(--sp-radius-lg) 0 0;
			border-bottom: 1px solid var(--sp-border);

			&.is-stuck {
				border-top-left-radius: 0;
				border-top-right-radius: 0;
				box-shadow: var(--sp-shadow-md);
				background: var(--sp-surface-alt);
			}
		}

		@media (max-width: 768px) {
			padding: 16px;
		}

		.sp-pm__day-meta {
			display: flex;
			flex-direction: column;
			gap: 2px;

			.sp-pm__day-name {
				font-size: 17px;
				font-weight: 600;
				color: var(--sp-text);
			}

			.sp-pm__day-date {
				font-size: 13px;
				color: var(--sp-text-muted);
			}
		}

		/* Day toggle button */
		.sp-pm__toggle.sp-pm__day-toggle {
			background: transparent;
			color: var(--sp-text-muted);
			border: 1.5px solid var(--sp-border);
			border-radius: var(--sp-radius);
			width: 34px;
			height: 34px;
			flex-shrink: 0;
			cursor: pointer;
			display: flex;
			align-items: center;
			justify-content: center;
			transition: color var(--sp-transition), border-color var(--sp-transition), background var(--sp-transition);

			.sp-pm__chevron {
				transition: transform 220ms ease;
			}

			&:hover,
			&[aria-expanded="true"] {
				color: var(--sp-accent-dark);
				border-color: var(--sp-accent-light);
				background: var(--sp-accent-light);
			}

			&[aria-expanded="true"] .sp-pm__chevron {
				transform: rotate(180deg);
			}

			@media (max-width: 480px) {
				width: 30px;
				height: 30px;
			}
		}
	}
}


.sp-pm__day--filtered-out {
	display: none !important;
}

.sp-pm__days--updated .sp-pm__day:not(.sp-pm__day--filtered-out) {
	animation: sp-results-flash 650ms ease-out both;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Sessions
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__sessions {
	border-top: 1px solid var(--sp-border);
	display: flex;
	flex-direction: column;
	gap: 0;

	&[hidden] { display: none !important; }

	.sp-pm__session {
		border-top: 1px solid var(--sp-border);
		padding: 20px 24px 16px;
		border-left: 4px solid var(--sp-accent-dark);
		animation: sp-fade-in 220ms ease both;
		display: grid;
		grid-template-columns: 1fr auto;
		column-gap: 16px;
		align-items: start;
		/*border-top-right-radius: var(--sp-radius-lg);*/
		/*border-bottom-right-radius: var(--sp-radius-lg);*/

		&:first-child {
			border-top: none;
		}

		@media (max-width: 768px) {
			padding: 16px;
			column-gap: 12px;
		}

		.sp-pm__session-inner {
			display: flex;
			flex-direction: column;
			gap: 8px;

			.sp-pm__session-meta {
				display: flex;
				align-items: center;
				flex-wrap: wrap;
				gap: 12px;
				font-size: 13px;
				color: var(--sp-text-muted);
			}

			.sp-pm__session-title {
				font-size: 15px;
				font-weight: 600;
				color: var(--sp-text);
				line-height: 1.4;

				@media (max-width: 480px) {
					font-size: 14px;
				}
			}
		}

		/* Session action buttons (info / expand) */
		.sp-pm__session-actions {
			display: flex;
			flex-direction: row;
			align-items: center;
			gap: 8px;
		}

		/* Presentations panel spans both grid columns */
		.sp-pm__presentations {
			grid-column: 1 / -1;
		}
	}
}

.sp-pm__location {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.sp-pm__time {
	font-variant-numeric: tabular-nums;
	font-size: 13px;
	color: var(--sp-text-muted);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Presentations
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__presentations {
	margin-top: 16px;
	margin-left: 24px;
	border-left: 3px solid var(--sp-accent-light);
	display: flex;
	flex-direction: column;

	&[hidden] { display: none !important; }

	@media (max-width: 768px) {
		margin-left: 8px;
	}

	.sp-pm__presentation {
		padding: 14px 16px;
		padding-right: 0;
		border-bottom: 1px solid var(--sp-border);
		display: grid;
		animation: sp-fade-in 180ms ease both;
		grid-template-columns: auto 1fr auto;
		gap: 12px;
		align-items: start;

		&:last-child {
			border-bottom: none;
		}

		@media (max-width: 768px) {
			grid-template-columns: 1fr;
			gap: 6px;
		}

		.sp-pm__presentation-meta {
			margin-top: -2px;
			width: 72px;
			flex-shrink: 0;
		}

		.sp-pm__presentation-title {
			font-size: 14px;
			font-weight: 500;
			color: var(--sp-text);
			line-height: 1.4;
		}

		.sp-pm__presentation-actions {
			align-self: start;
			display: flex;
			flex-wrap: wrap;
			gap: 6px;
		}

		/* Adjust grid when there is no meta (no time) */
		&:not(:has(> .sp-pm__presentation-meta)) {
			grid-template-columns: 1fr auto;

			&:not(:has(> .sp-pm__presentation-actions)) {
				grid-template-columns: 1fr;
			}
		}
	}
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Persons
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__persons {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;

	.sp-pm__person-role {
		font-size: 13px;
		color: var(--sp-text-muted);

		.sp-pm__person-role-label {
			font-weight: 500;
			margin-right: 3px;
		}

		.sp-pm__person-role-names {
			color: var(--sp-text);
		}
	}
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Classifiers
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__classifiers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;

	.sp-pm__classifier {
		--c-color: var(--sp-accent);
		display: inline-block;
		padding: 3px 10px;
		border-radius: 100px;
		font-size: 11px;
		font-weight: 600;
		letter-spacing: .02em;
		text-transform: uppercase;
		background-color: color-mix(in srgb, var(--c-color, var(--sp-accent)) 15%, white);
		color:            var(--c-color, var(--sp-accent));
		border: 1px solid color-mix(in srgb, var(--c-color, var(--sp-accent)) 25%, white);
	}
	.sp-pm__classifier--hide {
		display: none;
	}
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	border: none;
	border-radius: var(--sp-radius-lg);
	cursor: pointer;
	font-family: inherit;
	font-weight: 500;
	transition: opacity var(--sp-transition), background var(--sp-transition);
	white-space: nowrap;

	&:hover  { opacity: .85; }
	&:active { opacity: .70; }

	/* Info / description, poster and video buttons share the same base style */
	&.sp-pm__btn--info,
	&.sp-pm__btn--poster,
	&.sp-pm__btn--video {
		background: var(--sp-accent-light);
		color: var(--sp-accent-dark);
		font-size: 13px;
		padding: 6px 16px;
		height: 34px;

		@media (max-width: 480px) {
			font-size: 12px;
			padding: 5px 12px;
		}
	}

	&.sp-pm__btn--poster,
	&.sp-pm__btn--video {
		text-decoration: none;
	}

	/* Expand / collapse toggle button */
	&.sp-pm__btn--expand {
		background: var(--sp-surface-alt);
		color: var(--sp-text);
		border: 1.5px solid color-mix(in srgb, var(--sp-border) 40%, var(--sp-text-muted));
		border-radius: var(--sp-radius);
		width: 30px;
		height: 30px;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: color var(--sp-transition), border-color var(--sp-transition), background var(--sp-transition);

		.sp-pm__chevron {
			transition: transform 220ms ease;
		}

		&:hover,
		&[aria-expanded="true"] {
			color: var(--sp-accent-dark);
			border-color: var(--sp-accent-light);
			background: oklch(from var(--sp-accent) 88% 0.07 h);
		}

		&[aria-expanded="true"] .sp-pm__chevron {
			transform: rotate(180deg);
		}

		@media (max-width: 480px) {
			width: 26px;
			height: 26px;
		}
	}

	/* Small variant */
	&.sp-pm__btn--sm {
		font-size: 12px;
		padding: 4px 12px;
		height: 28px;
	}
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Popup / modal
   ═══════════════════════════════════════════════════════════════════════════ */

.sp-pm__popup {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;

	&[hidden] {
		display: none !important;
	}

	.sp-pm__popup-backdrop {
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, .55);
		cursor: pointer;
	}

	.sp-pm__popup-panel {
		position: relative;
		background: var(--sp-surface);
		border-radius: var(--sp-radius-lg);
		box-shadow: var(--sp-shadow-md);
		max-width: 600px;
		width: 100%;
		max-height: 80vh;
		overflow-y: auto;
		padding: 40px;
		z-index: 1;

		@media (max-width: 768px) {
			padding: 28px 20px;
			max-height: 90vh;
		}
	}

	.sp-pm__popup-close {
		position: absolute;
		top: 12px;
		right: 12px;
		background: none;
		border: none;
		cursor: pointer;
		color: var(--sp-text-muted);
		padding: 6px;
		border-radius: 6px;
		display: flex;
		align-items: center;
		transition: color var(--sp-transition), background var(--sp-transition);

		&:hover {
			color: var(--sp-text);
			background: var(--sp-surface-alt);
		}
	}

	.sp-pm__popup-title {
		font-size: 18px;
		font-weight: 700;
		margin-bottom: 16px;
		padding-right: 32px;
		color: var(--sp-text);
	}

	.sp-pm__popup-content {
		font-size: 14px;
		line-height: 1.7;
		color: var(--sp-text);

		p {
			margin-bottom: 12px;
		}
	}

	/* Popup loading */
	.sp-pm__popup-loading {
		display: flex;
		flex-direction: column;
		gap: 12px;
		padding: 8px 0;
	}

	/* Wide variant for media content (poster / video) */
	.sp-pm__popup-panel--media {
		max-width: 860px;
		padding: 24px;

		@media (max-width: 768px) {
			padding: 16px;
		}
	}
}

/* Video embed — 16:9 aspect-ratio container */
.sp-pm__popup-video {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: var(--sp-radius);

	.sp-pm__popup-video-iframe {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		border: 0;
	}
}

/* Poster image */
.sp-pm__popup-poster {
	text-align: center;

	.sp-pm__popup-poster-img {
		max-width: 100%;
		height: auto;
		display: block;
		margin: 0 auto;
		border-radius: var(--sp-radius);
	}
}



/* ═══════════════════════════════════════════════════════════════════════════════
   Loading skeletons
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes sp-filter-pulse {
	0%, 100% { box-shadow: 0 0 0 2px rgba(124, 77, 255, .12), var(--sp-shadow-sm); }
	50%       { box-shadow: 0 0 0 5px rgba(124, 77, 255, .20), var(--sp-shadow-sm); }
}

@keyframes sp-shimmer {
	0%   { background-position: -400px 0; }
	100% { background-position:  400px 0; }
}

@keyframes sp-fade-in {
	from { opacity: 0; transform: translateY(5px); }
	to   { opacity: 1; transform: translateY(0);   }
}

@keyframes sp-results-flash {
	0%   { background-color: rgba(124, 77, 255, .07); }
	100% { background-color: var(--sp-surface);        }
}

.sp-pm__skeleton {
	border-radius: 4px;
	background: linear-gradient(90deg, #ececec 25%, #f5f5f5 50%, #ececec 75%);
	background-size: 800px 100%;
	animation: sp-shimmer 1.4s infinite linear;

	&.sp-pm__skeleton--short  { height: 13px; width: 90px;  }
	&.sp-pm__skeleton--long   { height: 15px; width: 100%; max-width: 340px; }
}

/* Skeleton wrapper rows */
.sp-pm__skeleton-row {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--sp-border);

	&.sp-pm__skeleton-row--day {
		border: 1px solid var(--sp-border);
		border-radius: var(--sp-radius-lg);
		margin-bottom: 16px;
	}

	&.sp-pm__skeleton-row--session {
		padding-left: 24px;
	}

	&.sp-pm__skeleton-row--presentation {
		padding-left: 40px;
	}
}


/* ═══════════════════════════════════════════════════════════════════════════════
   Misc states
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
	.sp-pm__session,
	.sp-pm__presentation,
	.sp-pm__filter-bar--loading,
	.sp-pm__days--updated .sp-pm__day {
		animation: none;
	}
}


.sp-pm__empty {
	padding: 20px 24px;
	font-size: 14px;
	color: var(--sp-text-muted);
	font-style: italic;
}

.sp-pm__error {
	padding: 12px 16px;
	font-size: 14px;
	color: var(--sp-error);
	background: #fef2f2;
	border-radius: var(--sp-radius);
	border: 1px solid #fecaca;
}

/* ── Embedded in an iframe (class set by embed.js) ─────────────────────────── */
html.sp-pm--embedded,
html.sp-pm--embedded body {
	margin: 0;
	/* The parent resizes the iframe to the content height, so the document
	   itself must never scroll (wheel events then scroll the parent page). */
	overflow: hidden;
}

	/* embed.js sets top/height of .sp-pm__popup to the visible part of the
	   iframe; make the panel height relative to that instead of to the full
	   iframe height (80vh). */
	html.sp-pm--embedded .sp-pm__popup-panel {
		max-height: 80%;
	}

/* ═══════════════════════════════════════════════════════════════════════════════
   Print
   Triggered by the print button (app.js printAll() expands every visible day
   and session first) or by the browser's own print command.
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {

	@page {
		margin: 1.5cm 2cm;
	}

	/* ── Hide interactive / screen-only elements ────────────────────────────── */
	.sp-pm__filters,
	.sp-pm__filter-bar,
	.sp-pm__filter-info,
	.sp-pm__filter-footer,
	.sp-pm__print-bar,
	.sp-pm__popup,
	.sp-pm__day-sentinel,
	.sp-pm__day-toggle,
	.sp-pm__session-actions,
	.sp-pm__presentation-actions,
	.sp-pm__btn--info,
	.sp-pm__btn--poster,
	.sp-pm__btn--video,
	.sp-pm__btn--expand,
	.sp-pm__skeleton-row,
	.sp-pm__skeleton {
		display: none !important;
	}

	/* ── Embedded in an iframe ──────────────────────────────────────────────── */
	/* embed.js makes the document non-scrollable (overflow: hidden on html and
	   body). When printing from inside the iframe that would clip everything
	   after the first page, so allow overflow again. */
	html.sp-pm--embedded,
	html.sp-pm--embedded body {
		overflow: visible !important;
		height: auto !important;
	}

	/* ── Reset container ────────────────────────────────────────────────────── */
	#sp-pm {
		max-width: none;
		padding: 0;
		font-size: 10pt;
		line-height: 1.4;
		color: #000;
	}

	#sp-pm-title {
		margin: 0 0 12pt;
		font-size: 16pt;
	}

	.sp-pm__days {
		gap: 14pt;
	}

	/* ── Day card ───────────────────────────────────────────────────────────── */
	.sp-pm__day {
		border: 1pt solid #ccc;
		border-radius: 0;
		box-shadow: none;
		overflow: visible;               /* overflow: clip would cut off pages 2+ */
		animation: none;                 /* results flash */
		break-inside: auto;
	}

	.sp-pm__day .sp-pm__day-header {
		position: static;                /* no sticky header on paper */
		padding: 10pt 14pt;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
		cursor: default;
		break-after: avoid;              /* keep the day title with its first session */
		break-inside: avoid;
	}

	.sp-pm__day .sp-pm__day-header .sp-pm__day-meta .sp-pm__day-name { font-size: 13pt; }
	.sp-pm__day .sp-pm__day-header .sp-pm__day-meta .sp-pm__day-date { font-size: 10pt; }

	/* ── Force all sessions and presentations open ──────────────────────────── */
	.sp-pm__sessions,
	.sp-pm__sessions[hidden] {
		display: flex !important;
	}

	.sp-pm__presentations,
	.sp-pm__presentations[hidden] {
		display: flex !important;
	}

	/* ── Sessions ───────────────────────────────────────────────────────────── */
	.sp-pm__sessions .sp-pm__session {
		padding: 8pt 14pt;
		grid-template-columns: 1fr;      /* actions column is hidden */
		column-gap: 0;
		animation: none;
		break-inside: auto;              /* long sessions may span pages... */
		print-color-adjust: exact;       /* keep accent left border */
		-webkit-print-color-adjust: exact;
	}

	.sp-pm__sessions .sp-pm__session .sp-pm__session-inner {
		padding-right: 0 !important;
		break-inside: avoid;             /* ...but never split the session header itself */
		break-after: avoid;              /* and keep it with its first presentation */
	}

	.sp-pm__sessions .sp-pm__session .sp-pm__session-inner .sp-pm__session-meta {
		font-size: 9pt;
	}

	.sp-pm__sessions .sp-pm__session .sp-pm__session-inner .sp-pm__session-title {
		font-size: 11pt;
	}

	.sp-pm__time {
		font-size: 9pt;
	}

	/* ── Presentations ──────────────────────────────────────────────────────── */
	.sp-pm__presentations {
		margin-top: 8pt;
		margin-left: 14pt;
		print-color-adjust: exact;       /* keep the light accent left border */
		-webkit-print-color-adjust: exact;
	}

	.sp-pm__presentations .sp-pm__presentation {
		grid-template-columns: auto 1fr; /* time + body; actions column is hidden */
		gap: 8pt;
		padding: 5pt 10pt;
		animation: none;
		break-inside: avoid;
	}

	/* No time column: body takes the full width */
	.sp-pm__presentations .sp-pm__presentation:not(:has(> .sp-pm__presentation-meta)) {
		grid-template-columns: 1fr;
	}

	.sp-pm__presentations .sp-pm__presentation .sp-pm__presentation-meta {
		width: 64pt;                     /* fits "09:00 - 09:15" on one line at 9pt */
		margin-top: 0;
	}

	.sp-pm__presentations .sp-pm__presentation .sp-pm__presentation-title {
		font-size: 10pt;
	}

	/* ── Persons ────────────────────────────────────────────────────────────── */
	.sp-pm__persons .sp-pm__person-role {
		font-size: 9pt;
	}

	/* ── Classifiers ────────────────────────────────────────────────────────── */
	.sp-pm__classifiers .sp-pm__classifier {
		font-size: 8pt;
		padding: 1pt 7pt;
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}

	/* ── Empty / error states ───────────────────────────────────────────────── */
	.sp-pm__empty {
		padding: 6pt 14pt;
		font-size: 9pt;
	}
}
