#main {
	margin-bottom: 0;
}

#menu:has(#main[mode="questions"]) #modes {
	max-height: 0;
	padding: 0;
	overflow: hidden;
	margin-bottom: 30px;
}

#modes {
	display: flex;
	justify-content: center;

	position: relative;
	top: -5px;

	width: 100%;
	font-size: 1.1em;
	margin-bottom: 30px;

	background-color: var(--grey5);
	padding: 5px 0 5px 0;
	cursor: pointer;
	
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
}

#modes:hover {
	background-color: #333;
}

#head {
	display: flex;
	align-items: center;
	height: var(--button-height);
	padding-bottom: 20px;
}

#head > div {
	flex-grow: 1;
	display: flex;
	justify-content: center;
}

#head > div:first-child {
	justify-content: start;
}
#head > div:last-child {
	justify-content: end;
}

#head > div > .button {
	display: flex;
}
#head > div:last-child > .button::before {
	right: 0;
}
#head > div > .button::after {
	display: flex;
	align-items: center;
	position: relative;
	white-space: nowrap;
	pointer-events: none;
	left: 0;
	opacity: 0;
	content: attr(action);
	transition: all ease .3s;
}
#head > div > .button:hover::after {
	opacity: 1;
}
.button[shift="-2"]::after { left: -160px !important; }
.button[shift="-2"]:hover::after { left: -250px !important; }
.button[shift="-1"]::after { left: -360px !important; }
.button[shift="-1"]:hover::after { left: -400px !important; }
.button[shift= "0"]:hover::after { left: 5px !important; }
.button[shift= "1"]:hover::after { left: 55px !important; }
.button[shift= "2"]:hover::after { left: 105px !important; }
.button[shift= "3"]:hover::after { left: 155px !important; }

#head input[type=file] {
	max-height: 0;
	max-width: 0;
	padding: 0;
	margin: 0;
	border: none;
	pointer-events: none;
	overflow: hidden;
}

div:has(> #modules) {
	flex-grow: 0;
}

#modules-list {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin-bottom: 20px;
	max-height: 0;
	overflow: hidden;
	transition: all ease .3s;
}
#modules-list.expand {
	max-height: 300px;
}
#modules-list input {
	margin-top: 5px;
}

#modules-list ul {
	margin: 0;
	padding-left: 0
}

ul#valid {
	margin-top: 5px;
	list-style-type: '\2713  ';
}

ul#invalid {
	list-style-type: '\2717  ';
	color: var(--orange2);
}

#commands {
	display: flex;
	margin-bottom: 100px;
}

#file {
	margin-right: 60px;
}

#file > textarea {
	width: 45%;
	min-width: 200px;
	max-width: 70%;
}

#console {
	position: relative;
}

#console > textarea {
	resize: horizontal;
	height: 1.1em;
	width: 100%;
}

#historic {
	padding-bottom: 10px;
	margin-bottom: 10px;
	max-height: 500px;
	overflow: scroll;
}

.command, .response {
	font-family: monospace;
	font-size: 1.1em;
}

.command::before {
	content: '>>> ';
	color: var(--orange1);
}

.response {
	margin-bottom: 10px;
	white-space: pre-wrap;
	color: var(--grey1);
}

.response.error {
	color: var(--orange2);
}

.pyplot-canvas {
	position: fixed;
}
.ui-dialog-title {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.ui-widget-header {
	display: flex;
}
.ui-widget-header .button {
	height: 30px;
	margin-right: 3px;
	margin-top: 3px;
}
.ui-widget-header .button > img {
	height: 30px;
}

.keyword { color: var(--orange1); font-weight: bold; }
.str { color: #ffafaf; }
.number { color: #83dcff; }
.description { color: #687491; }
.comment { color: #61836b; }

#id_intitule { height: 100px; }

@media (max-width: 720px) {
	#head .button {
		width: 30px;
		height: 30px;
	}
	#head .button::after {
		top: 30px;
		left: -40px;
	}
	#head .button img {
		width: 30px;
	}
	.button[shift="-2"]::after { left: -100px !important; }
	.button[shift="-2"]:hover::after { left: -130px !important; }
	.button[shift="-1"]::after { left: -260px !important; }
	.button[shift="-1"]:hover::after { left: -280px !important; }
	.button[shift= "0"]:hover::after { left: -30px !important; }
	.button[shift= "1"]:hover::after { left: -30px !important; }
	.button[shift= "2"]:hover::after { left: -30px !important; }
	.button[shift= "3"]:hover::after { left: -30px !important; }

	#commands {
		flex-direction: column;
	}

	#commands > div {
		margin-right: 0;
	}

	#file {
		margin-bottom: 50px;
	}

	#file > textarea {
		min-width: 100%;
		max-width: 100%;
	}

	#console > textarea {
		resize: none;
	}

	#historic {
		max-height: 300px;
	}
}