/* The 2021 original positioned both panels with `position:absolute; left:500px`, which
   pinned the layout to one window size. Same look on a desktop, but it now reflows. */

body {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
	padding: 8px;
	font-family: sans-serif;
}

.gate {
	flex: 0 1 500px;
	min-width: 280px;
	max-width: 500px;
}

.gate svg {
	display: block;
	width: 100%;
	height: auto;
}

.panel {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-top: 17px;
}

.svgButton {
	width: 25px;
	height: 25px;
}

.addressImg {
	width: 40px;
	height: 40px;
}

.imgWork {
	background-color: #BF3030;
}

.imgLock {
	background-color: #BF8230;
}

.imgContainer {
	display: grid;
	grid-template-columns: repeat(8, 50px);
}

.FButton {
	width: 47px;
	height: 36px;
	font-weight: 700;
	font-size: 14px;
	font-family: fantasy;
	text-align: left;
}

.addressTable {
	display: table;
	width: auto;
	border: 1px solid #1B1BB3;
}

.divTable {
	display: table;
	width: auto;
}

.divTableRow {
	display: table-row;
}

.divTableCell,
.divTableHead {
	border: 1px solid #999999;
	display: table-cell;
	width: 25px;
	height: 25px;
}

.divTableHeading {
	background-color: #EEE;
	display: table-header-group;
	font-weight: bold;
}

.divTableFoot {
	background-color: #EEE;
	display: table-footer-group;
	font-weight: bold;
}

.divTableBody {
	display: table-row-group;
}

.SelectedButton {
	background-color: #FF9200;
}

.ErrorButton {
	background-color: #BF3030;
}

/* Narrow screens: stack the gate above the keypad rather than push the page sideways.
   `flex` is reset because in a column container flex-basis sizes the height, not the width. */
@media (max-width: 900px) {
	body {
		flex-direction: column;
		align-items: center;
	}

	.gate {
		flex: none;
		width: 100%;
		max-width: 500px;
	}

	.panel {
		flex: none;
		padding-top: 0;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
	}

	/* the eight dialled-glyph slots track the width instead of forcing 8 x 50px */
	.imgContainer {
		grid-template-columns: repeat(8, minmax(0, 50px));
	}

	.addressImg {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
	}
}
