.sap-player {
	--sap-bg: #111;
	--sap-text: #fff;
	--sap-accent: #4f8cff;
	--sap-button: #4f8cff;
	--sap-mini-button: #4f8cff;
	--sap-player-bg: #111111;
	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	background: var(--sap-player-bg);
	color: var(--sap-text);
	font-family: inherit;
	box-shadow: 0 4px 24px rgba(0,0,0,.22);
	border: 1px solid rgba(255,255,255,.10);
	-webkit-font-smoothing: antialiased;
}

.sap-player *,
.sap-player *::before,
.sap-player *::after {
	box-sizing: border-box;
}

.sap-position-top {
	top: 0;
	left: 0;
	right: 0;
}

.sap-position-bottom {
	left: 0;
	right: 0;
	bottom: 0;
}

.sap-position-left {
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	border-radius: 0 12px 12px 0;
	max-width: min(380px, 92vw);
}

.sap-position-right {
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	border-radius: 12px 0 0 12px;
	max-width: min(380px, 92vw);
}


.sap-mini-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sap-mini-button);
	color: #fff;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	box-shadow: none;
}

.sap-mini-toggle:hover,
.sap-mini-toggle:focus-visible {
	background: var(--sap-mini-button);
	color: var(--sap-accent);
	filter: brightness(1.12);
	outline: none;
}

.sap-mini-icon {
	font-size: 15px;
	line-height: 1;
}

.sap-close {
	position: absolute;
	top: 7px;
	right: 9px;
	z-index: 2;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sap-button);
	cursor: pointer;
	font: 22px/26px Arial, sans-serif;
	opacity: .72;
}

.sap-close:hover,
.sap-close:focus-visible {
	background: rgba(255,255,255,.10);
	opacity: 1;
	outline: none;
}

.sap-expanded {
	display: none;
}

.sap-player.sap-expanded-state .sap-mini-toggle {
	display: none;
}

.sap-player.sap-expanded-state .sap-expanded {
	display: block;
	position: relative;
}

.sap-player.sap-expanded-state .sap-inner {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 0;
	padding: 8px 10px;
	width: max-content;
	max-width: min(96vw, 760px);
}

.sap-player.sap-collapsed {
	width: auto;
	height: auto;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.sap-position-top.sap-collapsed,
.sap-position-bottom.sap-collapsed {
	left: auto;
	right: 14px;
}

.sap-position-top.sap-collapsed {
	top: 14px;
}

.sap-position-bottom.sap-collapsed {
	bottom: 14px;
}

.sap-position-left.sap-collapsed,
.sap-position-right.sap-collapsed {
	transform: translateY(-50%);
}

.sap-position-left.sap-collapsed {
	left: 14px;
}

.sap-position-right.sap-collapsed {
	right: 14px;
}

.sap-position-left.sap-expanded-state .sap-inner,
.sap-position-right.sap-expanded-state .sap-inner {
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	width: max-content;
	max-width: min(320px, 92vw);
}

.sap-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 58px;
	padding: 10px 16px;
}

.sap-position-left .sap-inner,
.sap-position-right .sap-inner {
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	width: max-content;
	max-width: min(320px, 92vw);
}

.sap-title {
	min-width: 0;
	max-width: 220px;
	display: flex;
	align-items: center;
	gap: 7px;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
}

.sap-title-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sap-status {
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-radius: 50%;
	background: var(--sap-accent);
	opacity: .55;
}

.sap-player.sap-playing .sap-status {
	opacity: 1;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--sap-accent) 18%, transparent);
}

.sap-controls {
	display: flex;
	gap: 5px;
	align-items: center;
}

.sap-button {
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid rgba(255,255,255,.16);
	border-radius: 50%;
	background: transparent;
	color: var(--sap-text);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.sap-button:hover,
.sap-button:focus-visible {
	background: var(--sap-button);
	border-color: var(--sap-button);
	outline: none;
}

.sap-loop[aria-pressed="true"] {
	background: var(--sap-button);
	border-color: var(--sap-button);
}

.sap-time {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 1 260px;
	width: min(260px, 34vw);
	min-width: 120px;
	font-size: 11px;
	opacity: .9;
}

.sap-progress {
	width: 100%;
	accent-color: var(--sap-accent);
	cursor: pointer;
}

.sap-current,
.sap-duration {
	min-width: 32px;
	text-align: center;
}

.sap-player audio {
	display: none;
}

@media (max-width: 680px) {
	.sap-inner {
		gap: 8px;
		padding: 9px 10px;
		min-height: 54px;
	}

	.sap-title {
		min-width: 0;
		max-width: 35vw;
	}

	.sap-time {
		min-width: 90px;
		gap: 4px;
	}

	.sap-current,
	.sap-duration {
		display: none;
	}

	.sap-position-left,
	.sap-position-right {
		max-width: 88vw;
	}

	.sap-position-left .sap-inner,
	.sap-position-right .sap-inner {
		min-width: 190px;
	}
}

@media (max-width: 680px) {
	.sap-mini-toggle {
		width: 42px;
		height: 42px;
		margin: 5px;
	}
}

.sap-player.sap-expanded-state {
	width: auto;
	height: auto;
}


.sap-meta {
	display: flex;
	align-items: center;
	gap: 7px;
	min-width: 0;
	max-width: 240px;
}

.sap-meta-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sap-meta .sap-title {
	display: block;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
}

.sap-artist {
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	opacity: .75;
}


/* Separate Desktop/Mobile player positions */
@media (min-width: 768px) {
	.sap-position-desktop-top { top: 0; bottom: auto; left: 0; right: 0; transform: none; }
	.sap-position-desktop-bottom { top: auto; bottom: 0; left: 0; right: 0; transform: none; }
	.sap-position-desktop-left { top: 50%; bottom: auto; left: 0; right: auto; transform: translateY(-50%); border-radius: 0 12px 12px 0; max-width: min(380px, 92vw); }
	.sap-position-desktop-right { top: 50%; bottom: auto; left: auto; right: 0; transform: translateY(-50%); border-radius: 12px 0 0 12px; max-width: min(380px, 92vw); }

	.sap-position-desktop-top.sap-collapsed { top: 14px; left: auto; right: 14px; }
	.sap-position-desktop-bottom.sap-collapsed { bottom: 14px; left: auto; right: 14px; }
	.sap-position-desktop-left.sap-collapsed { left: 14px; }
	.sap-position-desktop-right.sap-collapsed { right: 14px; }

	.sap-position-desktop-left.sap-expanded-state .sap-inner,
	.sap-position-desktop-right.sap-expanded-state .sap-inner,
	.sap-position-desktop-left .sap-inner,
	.sap-position-desktop-right .sap-inner {
		flex-direction: column;
		align-items: stretch;
		min-width: 0;
		width: max-content;
		max-width: min(320px, 92vw);
	}
}

@media (max-width: 767px) {
	.sap-position-mobile-top { top: 0; bottom: auto; left: 0; right: 0; transform: none; }
	.sap-position-mobile-bottom { top: auto; bottom: 0; left: 0; right: 0; transform: none; }
	.sap-position-mobile-left { top: 50%; bottom: auto; left: 0; right: auto; transform: translateY(-50%); border-radius: 0 12px 12px 0; max-width: 88vw; }
	.sap-position-mobile-right { top: 50%; bottom: auto; left: auto; right: 0; transform: translateY(-50%); border-radius: 12px 0 0 12px; max-width: 88vw; }

	.sap-position-mobile-top.sap-collapsed { top: 14px; left: auto; right: 14px; }
	.sap-position-mobile-bottom.sap-collapsed { bottom: 14px; left: auto; right: 14px; }
	.sap-position-mobile-left.sap-collapsed { left: 14px; }
	.sap-position-mobile-right.sap-collapsed { right: 14px; }

	.sap-position-mobile-left.sap-expanded-state .sap-inner,
	.sap-position-mobile-right.sap-expanded-state .sap-inner,
	.sap-position-mobile-left .sap-inner,
	.sap-position-mobile-right .sap-inner {
		flex-direction: column;
		align-items: stretch;
		min-width: 0;
		width: max-content;
		max-width: min(320px, 92vw);
	}
}
