.window:not([show-window]) {
	display: none;
}

.window[show-window] {
	position: absolute;
	inset: 0 0 0 0;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 3;
}

.window > section:not([show-window]) {
	display: none;
}

.window > section[show-window] {
	position: absolute;
	width: clamp(640px, 65%, 775px);
	max-height: 90%;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	overflow: auto;
	display: flex;
	background-color: var(--background-color);
	color: var(--text-color);
}

.window > section[show-window].wide-window {
	width: clamp(720px, 85%, 1100px);
}

.window > section:not(.loading-window) {
	flex-direction: column;
}

.window > section.loading-window {
	min-height: 50%;
	justify-content: center;
	align-items: center;
}

.window > section > * {
	padding: clamp(.5rem, 3vw, 1.2rem) clamp(.5rem, 4.5vw, 1.4rem);
}

.window-header,
.window-footer {
	min-height: 4.5rem;
	display: flex;
	align-items: center;
	font-size: .8rem;
	gap: 1rem;
}

/* Header */
.window-header {
	justify-content: space-between;
	border-bottom: 2px solid var(--border-color);
}

.window-header > button:last-of-type {
	height: 1rem;
	aspect-ratio: 1/1;
	padding: 0;
	background-color: transparent;
}

.window-header > button:last-of-type > img {
	height: 100%;
}

/* Main window */
.window-content {
	min-height: 15rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	justify-content: center;
	overflow: auto;
}

.window-content form {
	align-self: center;
}

.window-content table {
	width: 100%;
}

.window-content tr > * {
	padding: .5rem;
}

.window-content th {
	font-size: .8rem;
}

.window-content table th :where(input) {
	width: min-content;
}

.window-content table :where(select, input) {
	width: 90%;
	padding: .5rem;
	border: 2px solid var(--border-color);
	border-radius: 2px;
	background-color: var(--background-color);
	color: var(--text-color);
}

.window-content td > p {
	margin-top: .2rem;
	margin-left: .1rem;
	font-size: .8rem;
}

/* Footer */
.window-footer {
	justify-content: flex-end;
	border-top: 2px solid var(--border-color);
}

.window-footer button {
	padding: .5rem 1rem;
	border-radius: 2px;
	color: var(--light-color);
}

.cancel-window {
	background-color: var(--error-color);
}

.window-footer button[type="submit"] {
	background-color: var(--success-color);
}

@media (max-width: 850px) {
	.window > section[show-window].wide-window {
		width: 90%;
		height: 90%;
		max-height: unset;
	}
	.window > section[show-window].wide-window .window-content {
		flex-grow: 1;
	}
}

@media (max-width: 720px) {
	.window > section[show-window] {
		width: 90%;
		height: 90%;
		max-height: unset;
	}
	.window > section[show-window] .window-content {
		flex-grow: 1;
	}
	.window > section[show-window].wide-window {
		width: 100%;
		height: 100%;
	}
}

@media (max-width: 600px) {
	.window > section[show-window] {
		width: 100%;
		height: 100%;
	}
}
