:root {
	--javo-bottom-nav-height: 56px;
	--javo-bottom-nav-edge: max(3px, env(safe-area-inset-bottom));
}

/*
 * Persistent footer stack clearance.
 * Specificity intentionally exceeds the player stylesheet's root rules so
 * this shell can sit below the player without changing player-owned CSS.
 */
html body {
	padding-bottom: calc(
		var(--javo-mini-player-height, 72px) +
		var(--javo-bottom-nav-height) +
		16px +
		env(safe-area-inset-bottom) +
		env(safe-area-inset-bottom)
	);
}

html body.javo-player-mini-hidden {
	padding-bottom: calc(
		var(--javo-bottom-nav-height) +
		var(--javo-bottom-nav-edge) +
		16px
	);
}

body #javo_master_player {
	bottom: calc(
		var(--javo-bottom-nav-height) +
		var(--javo-bottom-nav-edge)
	);
}

.javo-bottom-nav {
	position: fixed;
	right: 50%;
	bottom: var(--javo-bottom-nav-edge);
	z-index: 1000;

	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: stretch;

	width: min(calc(100% - 32px), 480px);
	height: var(--javo-bottom-nav-height);
	padding: 4px;

	direction: rtl;
	box-sizing: border-box;

	background: rgba(20, 31, 44, 0.97);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 20px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);

	transform: translateX(50%);
	-webkit-tap-highlight-color: transparent;
}

.javo-bottom-nav *,
.javo-bottom-nav *::before,
.javo-bottom-nav *::after {
	box-sizing: border-box;
}

.javo-bottom-nav__item,
.javo-bottom-nav__item:visited {
	position: relative;

	display: grid;
	min-width: 0;
	min-height: 44px;
	padding: 0;
	margin: 0;
	place-items: center;

	color: #B3E7FF;
	text-decoration: none;

	background: transparent;
	border: 0;
	border-radius: 14px;

	font: inherit;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	touch-action: manipulation;

	transition:
		color 160ms ease,
		opacity 160ms ease,
		background-color 160ms ease;
}

.javo-bottom-nav__item svg {
	display: block;
	width: 22px;
	height: 22px;
}
/* =========================================================
   PLAYER ICON
========================================================= */

.javo-bottom-nav__player-icon {
	display: block;
	width: 22px;
	height: 22px;
	overflow: visible;
}



.javo-bottom-nav__player-icon {
    display: block;
    width: 22px;
    height: 22px;

    transform-origin: center;
}

.javo-bottom-nav__player.is-playing
.javo-bottom-nav__player-icon {
    will-change: transform;
    animation: javo-bottom-nav-player-pulse 1s ease-in-out infinite;
}

@keyframes javo-bottom-nav-player-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.16);
    }
}
.javo-bottom-nav__item.is-active,
body.javo-saved-hub-active
.javo-bottom-nav__item[data-javo-bottom-nav="saved"] {
	color: #b3e7ff;
}

.javo-bottom-nav__item.is-active::after,
body.javo-saved-hub-active
.javo-bottom-nav__item[data-javo-bottom-nav="saved"]::after {
	position: absolute;
	right: 50%;
	bottom: 4px;

	width: 14px;
	height: 2px;

	background: currentColor;
	border-radius: 999px;
	content: "";
	transform: translateX(50%);
}

.javo-bottom-nav__item:focus-visible {
	outline: 2px solid #b3e7ff;
	outline-offset: -2px;
}

.javo-bottom-nav__item:active {
	opacity: 0.72;
}

body.javo-player-mini-hidden #javo_player_mini {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(calc(100% + 16px));
}

/* The player's existing state hook suppresses the persistent dock. */
#javo_master_player.is-expanded ~ .javo-bottom-nav {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

@media (min-width: 768px) {
	body #javo_master_player {
		/* The desktop mini player already contributes its own 8px gap. */
		bottom: calc(
			var(--javo-bottom-nav-height) +
			var(--javo-bottom-nav-edge)
		);
	}
}

@media (max-width: 767px) {
	body #javo_master_player {
		bottom: calc(
			var(--javo-bottom-nav-height) +
			var(--javo-bottom-nav-edge) +
			8px
		);
	}

	.javo-bottom-nav {
		width: calc(100% - 20px);
	}
}

@media (hover: hover) and (pointer: fine) {
	.javo-bottom-nav__item:hover {
		color: rgba(255, 255, 255, 0.78);
		background: rgba(255, 255, 255, 0.035);
	}

	.javo-bottom-nav__item.is-active:hover,
	body.javo-saved-hub-active
	.javo-bottom-nav__item[data-javo-bottom-nav="saved"]:hover {
		color: #b3e7ff;
	}
}

@media (max-width: 380px) {
	:root {
		--javo-bottom-nav-height: 52px;
	}

	.javo-bottom-nav {
		width: calc(100% - 12px);
		padding: 3px;
		border-radius: 18px;
	}

	.javo-bottom-nav__item svg {
		width: 20px;
		height: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {

    .javo-bottom-nav__item {
        transition-duration: 1ms;
    }

    .javo-bottom-nav__player.is-playing
    .javo-bottom-nav__player-icon {
        animation: none;
        transform: none;
    }

}