.library-card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	/*background: linear-gradient(155deg, #ffffff 0%, #fff9ef 100%);*/
}

.library-heading {
	justify-content: flex-start;
	flex-wrap: wrap;
	margin-bottom: 0;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(201, 107, 29, 0.18);
}

.library-heading > i {
	color: var(--color-orange);
	font-size: 20px;
}

.library-badge {
	padding: 5px 9px;
	border-radius: 30px;
	background: var(--color-orange);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	box-shadow: 0 3px 9px rgba(201, 107, 29, 0.15);
}

.library-description {
	margin: 0;
	color: var(--color-green-dark);
	font-size: 14px;
}

.library-date-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px;
	border: 1px solid rgba(31, 95, 80, 0.13);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.75);
}

.library-date-row label {
	color: var(--color-green);
	font-size: 12px;
	font-weight: 700;
}

.library-date-row input {
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding: 9px 12px;
	border: 1px solid rgba(201, 107, 29, 0.3);
	border-radius: 12px;
	background: #fffaf1;
	color: var(--color-green-dark);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.library-date-row input:focus-visible {
	outline: 2px solid var(--color-orange);
	outline-offset: 2px;
}

.library-list {
	flex: 1;
	min-width: 0;
	min-height: 0;
	max-height: none;
	padding-right: 4px;
	overflow: visible;
}

.library-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 8px;
	padding: 12px;
	border: 1px solid rgba(201, 107, 29, 0.20);
	border-radius: 13px;
	background: #fffaf2;
	color: var(--color-green-dark);
	text-decoration: none;
	cursor: default;
	transition: border-color .2s ease, background .2s ease;
}

.library-item:last-child {
	border-bottom: 1px solid rgba(201, 107, 29, 0.20);
}

.library-item:hover {
	border-color: var(--color-orange);
	background: #fff4e4;
}

.library-item-details {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 5px;
}

.library-item-details strong {
	color: var(--color-green);
	font-size: 14px;
	font-weight: 800;
	overflow-wrap: anywhere;
}

.library-item-details small {
	color: var(--color-muted);
	font-size: 12px;
}

.library-play-icon {
	flex-shrink: 0;
	color: var(--color-orange);
	font-size: 28px;
}

.library-play-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--color-orange);
	text-decoration: none;
	transition: background .2s ease, transform .2s ease;
}

.library-play-link:hover {
	background: rgba(201, 107, 29, 0.10);
	transform: scale(1.06);
}

.library-play-link:focus-visible {
	outline: 2px solid var(--color-orange);
	outline-offset: 2px;
}

.library-state {
	margin: 14px 0;
	color: var(--color-muted);
	font-size: 14px;
}


/* Tablet */
@media (min-width: 641px) and (max-width: 980px) {
	.library-list {
		max-height: 400px;
	}
}

/* Mobile */
@media (max-width: 640px) {
	.library-card {
		min-height: 0;
	}

	.library-date-row {
		align-items: stretch;
		flex-direction: column;
	}

	.library-date-row input {
		width: 100%;
	}

	.library-list {
		max-height: none;
	}
}
/* Pagination controls */
.library-heading-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 10px;
	margin-left: auto;
}

.library-navigation {
	display: flex;
	align-items: center;
	gap: 5px;
}

.library-navigation-button {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid rgba(198, 98, 25, 0.2);
	border-radius: 50%;
	background: #fff;
	color: var(--color-orange);
	font: inherit;
	cursor: pointer;
}

.library-navigation-button:disabled {
	opacity: 0.42;
	cursor: default;
}

.library-navigation-button:focus-visible {
	outline: 2px solid var(--color-green);
	outline-offset: 2px;
}

.library-page-indicator {
	margin: 0;
	padding-top: 4px;
	color: var(--color-muted);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

.library-page-indicator[hidden] {
	display: none;
}

@media (max-width: 640px) {
	.library-heading-actions {
		gap: 6px;
	}

	.library-navigation-button {
		width: 28px;
		height: 28px;
	}
}

/* Desktop: fixed card height with an independently scrolling recording list */
@media (min-width: 981px) {
	.library-sponsors-grid > .library-card {
		height: 550px;
		min-height: 550px;
		max-height: 550px;
	}

	.library-sponsors-grid .library-list {
		flex: 1 1 auto;
		min-height: 0;
		max-height: none;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior-y: auto;
		scrollbar-width: thin;
		scrollbar-color: rgba(198, 98, 25, 0.45) transparent;
	}

	.library-sponsors-grid .library-heading,
	.library-sponsors-grid .library-description,
	.library-sponsors-grid .library-date-row,
	.library-sponsors-grid .library-page-indicator {
		flex-shrink: 0;
	}
}
