/* Applies to the <iframe> in the parent window. */
.modal-frame {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	border-width: 0px;
	border-style: none;
}

/* Could be applied to <body> inside <iframe>. */
.modal-bg {
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.4);
	overflow: auto;
}

/* In case it is used on a div in the parent window. */
div.modal-bg {
	position: fixed;
	top: 0;
	left: 0;
}

.modal {
	margin: 5vh auto auto auto;
	width: 90vw;
	height: 90vh;
	min-width: 300px;
	min-height: 400px;
	background: #fff;
	border: 1px solid #888;
	box-shadow: 1px 2px 2px #666;
	display: grid;
	grid-template-rows: auto 1fr auto;
}

@media (min-width: 1200px) {
	.modal {
		width: 40vw;
		height: 60vh;
	}
	.modal.tall {
		height: 90vh;
	}
	.modal.wide {
		width: 75vw;
	}
}

.modal-header,
.modal > header {
	background: steelblue;
	color: white;
	font-weight: bold;
	padding: 6px 20px;
	text-align: center;
}

.modal-body,
.modal > main {
	overflow: auto;
	padding: 20px 20px 100px 20px;
}

.modal-footer,
.modal > footer {
	background: #f6f6f6;
	border-top: 1px solid #ddd;
	text-align: right;
	padding: 12px 20px;
}

.modal-footer button,
.modal-footer .button,
.modal > footer button,
.modal > footer .button {
	margin-left: 10px;
}
