ml-sidenav {
	--sidenav-width: 400px;
	--middle-translateX: translateX(0);
	--step-back-opacity: 0;
	--step-back-pointer-events: auto;

	position: absolute;
	display: flex;
	flex-direction: column;
	top: 0;
	right: 0;
	width: var(--sidenav-width);
	height: 100vh;
	max-height: 100dvh;
	background-color: var(--ml-background-color);
	transition: all 0.3s cubic-bezier(0.47, 0.17, 0.36, 1.15);
	filter: blur(10px);
	transform: translateX(110%);
	border-left: 1px solid var(--ml-border-color);
	z-index: 100;
	overflow: hidden;

}
ml-sidenav[hidden] { display: none }
ml-sidenav[open] {
	transform: translateX(0);
	filter: blur(0);
}

ml-sidenav[can-go-back] {	--step-back-pointer-events: none; }
ml-sidenav[step="1"] {	--middle-translateX: translateX(-100%); --step-back-opacity: 1; }
ml-sidenav[step="2"] {	--middle-translateX: translateX(-200%); --step-back-opacity: 1; }
ml-sidenav[step="3"] {	--middle-translateX: translateX(-300%); --step-back-opacity: 1; }

ml-sidenav[menu="dashboard"] { --dashboard-menu-display: flex; }
ml-sidenav[menu="premium"] { --premium-menu-display: flex; }

ml-sidenav section {
	display: flex;
	width: 100%;
}

ml-sidenav section.top {
	height: calc(2 * var(--topnav-height));
	display: flex;
	flex-direction: column;
}

ml-sidenav section.top .first-row {
	display: flex;
	justify-content: space-between;
	width: 100%;
	height: var(--topnav-height);
	border-bottom: 1px solid var(--ml-border-color);
}

ml-sidenav section.top .second-row {
	display: flex;
	justify-content: center;
	height: var(--topnav-height);
}

ml-sidenav section.top .second-row .state-title {
	text-align: center;
	font-family: var(--header-font-family);
	font-size: var(--font-size-h3);
	margin: auto;
}

ml-sidenav section.middle {
	height: calc(100% - (3 * var(--topnav-height)) );
	max-height: calc(100% - (3 * var(--topnav-height)) );
	flex-direction: row;
	transform: var(--middle-translateX);
	transition: transform 0.3s ease-in-out;
}

ml-sidenav section.footer {
	height: var(--topnav-height);
	margin-top: auto;
	border-top: 1px solid var(--ml-border-color);
	background-color: var(--ml-background-color);
	z-index: 2;
}

ml-sidenav ml-icon-text.menu-button {
	cursor: pointer;
	margin: var(--scale8-2);
	gap:16px;
}

ml-sidenav ml-icon-text.menu-button:hover {
	filter:brightness(1.5);
}

ml-sidenav ml-icon-text.menu-button::part(icon) {
	background-color: var(--ml-primary-color);
	color: var(--ml-secondary-color);
	height: var(--scale8-3);
	width: var(--scale8-3);
	padding: var(--scale8-1);
	border-radius: 50%;
	margin: auto var(--scale8-1);
	margin-right: 0;
}

ml-sidenav ml-icon-text.menu-button::part(text) {
	font-size: var(--rem-l);
	margin-top: 7px;
	color: var(--ml-primary-color);
	user-select: none;
}

ml-sidenav ml-icon.close-btn {
	margin-left: auto;
	margin-right: var(--scale8-3);
	width: var(--scale8-3);
	cursor: pointer;
}

ml-sidenav ml-icon.close-btn:hover {
	color: var(--ml-error-color);
}

ml-sidenav ml-icon-text.menu-button:active,
ml-sidenav ml-icon.close-btn:active {
	transform: scale(0.98);
}

ml-sidenav step-track step {
	display: flex;
	flex-direction: column;
	height: 100%;
	gap: var(--gutter-margin-2xs);
	transition: transform 0.3s ease-in-out;
	overflow: auto;
}

ml-sidenav .button-sidenav {
	width: calc(100% - var(--scale8-6));
	margin: 0 auto;
	padding: 0 var(--scale8-2);
	height: 60px;
	min-height: 60px;
	border: 1px solid transparent;
	font-size: var(--rem-l);
	font-family: var(--text-font-family);
	font-weight: 500;
	color: var(--ml-text-color);
	cursor: pointer;
	text-align: left;
	display: flex;
	flex-direction: row;
	align-items: center;
	text-decoration: none;
	box-sizing: border-box;
}

ml-sidenav .button-sidenav > ml-icon {
	margin-left: auto;
}

ml-sidenav .button-sidenav:hover {
	background-color: var(--ml-background-moodlight-color);
	color: var(--ml-primary-color);
	border-color: var(--ml-border-color);
}

ml-sidenav .button-sidenav:active {
	transform: scale(0.99);
}

ml-sidenav .button-sidenav.ml-collapsible-trigger.opened ml-icon.icon-expand {
	transform: rotate(180deg);
}

ml-sidenav .ml-collapsible .button-sidenav {
	max-height: 45px;
	min-height: 45px;
	margin-top: var(--gutter-margin-2xs);
}

.ml-user-type-student ml-sidenav .ml-collapsible #educators.button-sidenav {
	opacity: 0.3;
	pointer-events: none;
}

ml-sidenav .menu-fragment {
	overflow: auto;
	height: 100%;
}

ml-sidenav[premium-active] #menu-side-premium {
	display: none;
}

ml-sidenav .dashboard-button {
	display: none;
	flex-direction: column;
}

ml-sidenav[signed-in] .dashboard-button {
	display: flex;
}

ml-sidenav .submenu {
	display: none;
	flex-direction: column;
	min-width: var(--sidenav-width);
}

ml-sidenav .submenu .submenu-item {
	display: flex;
	flex-direction: column;
	gap: var(--scale8-1);
	margin-bottom: 5px;
}

ml-sidenav .submenu .submenu-item.selected {
	border-left: var(--scale8-2) solid;
	color: var(--ml-button-text-color);
	filter: brightness(0.95);
	transform: scale(0.98);
}

ml-sidenav .submenu.dashboard {
	display: var(--dashboard-menu-display);
}

ml-sidenav .submenu.premium {
	display: var(--premium-menu-display);
}

ml-sidenav bottom-links {
	display: flex;
	justify-content: space-around;
	width: 100%;
	height: 100%;
	text-decoration: underline;
	border-top: 1px solid var(--ml-border-color);
}

ml-sidenav[signed-in] bottom-links.signed-out {
	display: none;
}

ml-sidenav[signed-out] bottom-links.signed-in {
	display: none;
}

ml-sidenav .bottom-link {
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-size: var(--rem-xl);
	cursor: pointer;
}

ml-sidenav .bottom-link:hover {
	color: var(--ml-link-highlight-color);
}

ml-sidenav[mode-dashboard] .bottom-link.dashboard {
	display: none;
}

ml-sidenav #settings.button-sidenav,
ml-sidenav #download-app.button-sidenav,
ml-sidenav #support.button-sidenav {
	font-size: var(--rem-base);
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 16px;
}

ml-sidenav #settings.button-sidenav ml-icon,
ml-sidenav #download-app.button-sidenav ml-icon,
ml-sidenav #support.button-sidenav ml-icon {
	margin: 0;
}


ml-sidenav #settings.button-sidenav {
	border-top: 1px solid var(--ml-border-highlight-color);
	margin-top: auto;
}


ml-sidenav ::-webkit-scrollbar {
	width: 4px;
}

ml-sidenav ::-webkit-scrollbar-track {
	background: #f1f1f1;
}

ml-sidenav ::-webkit-scrollbar-thumb {
	background: #888;
}

ml-sidenav ::-webkit-scrollbar-thumb:hover {
	background: #555;
}

@media all and (max-width: 904px) {
	ml-sidenav  {
		width: 100%;
	}
}

@media all and (max-width: 599px) {
	ml-sidenav section.top {
		height: calc(var(--topnav-height) * 1.5);
	}

	ml-sidenav section.top .second-row {
		height: calc(var(--topnav-height) / 2);
	}

	ml-sidenav h3.my-account {
		margin-top: var(--scale8-2);
	}

	ml-sidenav section.middle {
		height: calc(100% - (2.5 * var(--topnav-height)) );
		max-height: calc(100% - (2.5 * var(--topnav-height)) );
	}

	ml-sidenav section.top .second-row .state-title {
		font-size: var(--rem-xl);
	}
}