body{
	padding-top:40px;
}
::-webkit-scrollbar {
  width: 10px;
  padding-left: -10px;
}

/* Track */
::-webkit-scrollbar-track {
  background: transparent;
  border-radius:5px;
}
/* Handle */
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius:5px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
#menu{
	width:100%;
	height:40px;
	border-bottom:1px solid #888;
	background-color:#f5f5f5;
	padding:0;
	font-size:0;
	margin:0;
	list-style-type: disc;
	z-index:99;
	position:fixed;
	top:0;
	max-height:100vh;
	white-space: nowrap;
	/* 
	overflow-x: scroll;
	overflow-y: visible;
	 */
}
#menu::-webkit-scrollbar {
    display: none; /* for Chrome, Safari, and Opera */
}
#menu > * {
	white-space: normal;
	white-space: nowrap;
}
#menu .icon{
	height:100%;
	vertical-align:top;
}
#menu li{
	display:inline-block;
	vertical-align:top;
	height:100%;
	border-right:1px solid #888;
	padding: 8px 10px;
	font-size:20px;
	position:relative;
	background-color:#f5f5f5;
	cursor:pointer;
}
#menu > li > ul{
	margin-top:-1px;
}
#menu li ul, #menu li ul li ul{
	display:none;
	z-index:99;
	min-width:calc(100% + 42px);
	border-top:1px solid #888;
}
#menu li ul li{
	border:1px solid #888;
	border-top:none;
	display:block;
	white-space: nowrap;
}
#menu li ul li ul li{
	border:1px solid #888;
	border-top:none;
	display:block;
}
#menu a{
	color: inherit;
	text-decoration:none;
}
#menu li.active{
	background-color: #ccc;
	cursor:default;
}
#menu .label{
	padding:0;
	margin:0;
	margin-left:20px;
	display:none;
}
#menu li > span.menu::after{
	content: " ";
	margin-left:3px;
	transform: rotateY(0deg) rotate(-135deg) translate(1px,1px);
	width:5px;
	height:5px;
	border-bottom:2px solid #888;
	border-left:2px solid #888;
	display: inline-block;
	transition: transform 0.1s linear;
}


html.dark #menu{
 	background-color: #000;
}
html.dark #menu li{
 	background-color: #000;
}
html.dark #menu li:active{
 	background: #333;
}
html.dark #menu a, html.dark #menu li span{
	color: #fff;
}
html.dark #menu .active{
	background: #666;
	color:white;
}
html.dark #menu .icon{
	filter: invert(1);
}
/* Handle */
html.dark ::-webkit-scrollbar-thumb {
  background: #806600;
}
/* Handle on hover */
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #ffcc00;
}
@media(hover: hover) and (min-width: 800px) {
	#menu li:hover > ul{
		display:block;
		position:absolute;
		top:40px;
		left:-41px;
	}
	#menu li ul li:hover > ul{
		display:block;
		position:absolute;
		top:-1px;
		left:calc(100% - 40px);
		border-top:1px solid #888;
	}
	#menu li:hover > span.menu::after{
		transform: rotateY(0deg) rotate(-45deg) translate(3px,-1px);
	}
	#menu li:hover{
		background-color:#d9d9d9;
	}
	#menu li.active:hover{
		background-color:#ccc;
	}
	
	html.dark #menu li:hover{
		background-color:#444;
	}
	html.dark #menu li.active:hover{
		background-color:#666;
	}
}
@media (hover: none) OR (max-width: 800px) {
	#menu{
		height:0;
		overflow:hidden;
		position:fixed;
		top:0;
		width:100%;
		max-height:100%;
		/* max-height:calc(100vh - 56px); /* seems 100vh includes phone's nav menu */
		overflow-X:auto;
		border-bottom:none;
		white-space: normal;
	}
	#menu::before{
		position:fixed;
		top:0;
		left:0;
		width:100%;
		height:40px;
		display:block;
		content:" ";
		border-bottom:1px solid #888;
		background-image: url("/css/hamburger.png"),linear-gradient(124deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #dd00f3);
		background-position: center; /* Center the image */
		background-repeat: no-repeat; /* Do not repeat the image */
		background-size: contain; /* Resize the background image to cover the entire container */
	}
	html.dark #menu::before{
		background-image: url("/css/hamburger.png"), linear-gradient(124deg, #4d0a00, #5d0909, #666600, #5b5d09, #095d17, #09595d, #0f095d, #46004d, #46004d);
		border-bottom:1px solid #333;
	}
	#menu.hover{
		height:auto;
		overflow:scroll;
	}
	#menu.hover::before{
		position: static;
	}
	#menu .label{
		display:inline-block;
	}
	#menu li{
		width:100%;
		border-bottom:1px solid #888;
		max-width:100%;
		overflow:hidden;
	}
	#menu .icon{
		height:23px;
		vertical-align:middle;
	}
	#menu li.hover{
		width:100%;
		border-bottom:none;
		background-color:#d9d9d9;
	}
	#menu li.hover > ul, #menu li.hover ul li.hover > ul{
		display:block;
		padding:0;
		margin-top:8px;
		margin-left:-10px;
		margin-bottom:-8px;
	}
	#menu li.hover ul li{
		border-left:4px solid blue;
	}
	#menu li.hover > span.menu::after{
		transform: rotateY(0deg) rotate(-45deg) translate(3px,-1px);
	}
}