.js-container h1,
.js-container h2,
.js-container h3,
.js-container h4,
.js-container h5,
.js-container h6 {
	margin: 0;
}

.js-container h2 {
	/* padding: 0.25rem; */
	background: #386fb6;
	color: #fff;
	position: relative;
	margin-bottom: 1rem;
	font-weight: 500;
	background: hsl(var(--hue_0), var(--sat_0), var(--lum_0_high));
	color: var(--contrast_0_high);
}

.js-container h2:before {
	content: '';
	display: block;
	position: absolute;
	z-index: -1;
	background: #386fb6;
	top: 0;
	bottom: 0;
	left: calc(calc(100vw - 100%) / -2);
	width: 100%;
	background: hsl(var(--hue_0), var(--sat_0), var(--lum_0_high));
	color: var(--contrast_0_high);
}

.js-container *+h2 {
	margin-top: 4rem;
}

.js-container h3 {
	padding: 0.25rem;
	background: hsl(212.7, 67.8%, 29.2%);
	color: #fff;
	background: hsl(var(--hue_0), var(--sat_0), var(--lum_0_low));
	color: var(--contrast_0_low);
}

.js-container h4 {
	padding: 0.5rem;
	background: hsl(25, 85%, 55%);
	color: #000;
	background: hsl(var(--hue_1), var(--sat_1), var(--lum_1_high));
	color: var(--contrast_0_high);
}

table {
	border-collapse: collapse;
	min-width: 100%;
	border: solid 1px #d1d3d4;
}

@media (prefers-color-scheme: dark) {
	table {
		border-color: #4c4c4c;
	}
}

/* th {
	white-space: nowrap;
} */

th, td {
	padding: 0.25em;
	text-align: center;
	border-top: solid 1px #d1d3d4;
	vertical-align: top;
}

th:first-child, td:first-child {
    text-align: left;
}

@media (prefers-color-scheme: dark) {
	th, td {
		border-color: #4c4c4c;
	}
}

button.no-style {
	border: none;
	padding: 3px;
	color: black;
	font-size: inherit;
	min-height: 0;
	display: block;
	background: #cdcdcd; /* #b5b5b5 #d1d3d4; */
	text-align: inherit;
	font-weight: 500;
	width: 100%;
	border-radius: 2px;
}

.panel {
	margin: 0;
	padding: 0;
}

.panel-header {
	padding: 0 0 1rem;
}

.collapsing .panel-header {
	cursor: pointer;
}

.panel-header h2 {
	margin-bottom: 0;
}

.panel-content {
	padding: 1em 0 1em;
}

.panel-header + .panel-content {
	padding-top: 0;
}

.panel-content.full-width {
	padding: 0 1em 1em;
	margin: 0 calc(50% - 50vw);
}

.panel-content > h3 {
	margin: 1rem 0;
}

.inline-control {
	margin: 0.5rem 0;
}

.table-wrap {
	overflow-x: auto;
}

.race-results {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -0.25rem;
	justify-content: center;
}

.leaderboard .pilot {
	text-align: left;
}

.node {
	box-sizing: border-box;
	min-width: 7em;
	max-width: 24em;
	margin: 0.5rem 0;
	padding: 0 0.25rem;
	flex: 1 0 7em;
	align-self: flex-start;
}

@media (max-width: 42em) {
	.compact-field input {
		width: 100%;
	}
}

@media (max-width: 137em) {
	.node:first-child:nth-last-child(16),
	.node:first-child:nth-last-child(16) ~ .node {
		flex: 0 auto;
		width: 12.5%;
	}
}

@media (max-width: 129em) {
	.node:first-child:nth-last-child(15),
	.node:first-child:nth-last-child(15) ~ .node {
		flex: 0 auto;
		width: 12.5%;
	}
}

@media (max-width: 120em) {
	.node:first-child:nth-last-child(14),
	.node:first-child:nth-last-child(14) ~ .node {
		flex: 0 auto;
		width: 14.2857%;
	}
}

@media (max-width: 112em) {
	.node:first-child:nth-last-child(13),
	.node:first-child:nth-last-child(13) ~ .node {
		flex: 0 auto;
		width: 14.2857%;
	}
}

@media (max-width: 103em) {
	.node:first-child:nth-last-child(12),
	.node:first-child:nth-last-child(12) ~ .node {
		flex: 0 auto;
		width: 16.6667%;
	}
}

@media (max-width: 95em) {
	.node:first-child:nth-last-child(11),
	.node:first-child:nth-last-child(11) ~ .node {
		flex: 0 auto;
		width: 16.6667%;
	}
}

@media (max-width: 86em) {
	.node:first-child:nth-last-child(10),
	.node:first-child:nth-last-child(10) ~ .node {
		flex: 0 auto;
		width: 20%;
	}
}

@media (max-width: 78em) {
	.node:first-child:nth-last-child(9),
	.node:first-child:nth-last-child(9) ~ .node {
		flex: 0 auto;
		width: 20%;
	}
}

@media (max-width: 69em) {
	.node:first-child:nth-last-child(1) {
		flex: 0 auto;
		width: 100%;
	}

	.node:first-child:nth-last-child(2),
	.node:first-child:nth-last-child(2) ~ .node {
		flex: 0 auto;
		width: 50%;
	}

	.node:first-child:nth-last-child(4),
	.node:first-child:nth-last-child(4) ~ .node,
	.node:first-child:nth-last-child(7),
	.node:first-child:nth-last-child(7) ~ .node,
	.node:first-child:nth-last-child(8),
	.node:first-child:nth-last-child(8) ~ .node,
	.node:first-child:nth-last-child(10),
	.node:first-child:nth-last-child(10) ~ .node,
	.node:first-child:nth-last-child(11),
	.node:first-child:nth-last-child(11) ~ .node,
	.node:first-child:nth-last-child(12),
	.node:first-child:nth-last-child(12) ~ .node,
	.node:first-child:nth-last-child(16),
	.node:first-child:nth-last-child(16) ~ .node {
		flex: 0 auto;
		width: 25%;
	}

	.node:first-child:nth-last-child(13),
	.node:first-child:nth-last-child(13) ~ .node,
	.node:first-child:nth-last-child(14),
	.node:first-child:nth-last-child(14) ~ .node,
	.node:first-child:nth-last-child(15),
	.node:first-child:nth-last-child(15) ~ .node {
		width: 20%;
	}
}

@media (max-width: 53em) {
	.node:first-child:nth-last-child(3),
	.node:first-child:nth-last-child(3) ~ .node,
	.node:first-child:nth-last-child(5),
	.node:first-child:nth-last-child(5) ~ .node,
	.node:first-child:nth-last-child(6),
	.node:first-child:nth-last-child(6) ~ .node,
	.node:first-child:nth-last-child(9),
	.node:first-child:nth-last-child(9) ~ .node,
	.node:first-child:nth-last-child(11),
	.node:first-child:nth-last-child(11) ~ .node,
	.node:first-child:nth-last-child(12),
	.node:first-child:nth-last-child(12) ~ .node {
		flex: 0 auto;
		width: 33.3333%;
	}
}

@media (max-width: 45em) {
	.node:first-child:nth-last-child(13),
	.node:first-child:nth-last-child(13) ~ .node,
	.node:first-child:nth-last-child(14),
	.node:first-child:nth-last-child(14) ~ .node,
	.node:first-child:nth-last-child(15),
	.node:first-child:nth-last-child(15) ~ .node {
		width: 33.3333%;
	}
}

@media (max-width: 36em) {
	.node:first-child:nth-last-child(7),
	.node:first-child:nth-last-child(7) ~ .node,
	.node:first-child:nth-last-child(8),
	.node:first-child:nth-last-child(8) ~ .node,
	.node:first-child:nth-last-child(10),
	.node:first-child:nth-last-child(10) ~ .node,
	.node:first-child:nth-last-child(16),
	.node:first-child:nth-last-child(16) ~ .node {
		width: 33.3333%;
	}

	.node:first-child:nth-last-child(4),
	.node:first-child:nth-last-child(4) ~ .node{
		width: 50%;
	}
}

@media (max-width: 27em) {
	.node:first-child:nth-last-child(3),
	.node:first-child:nth-last-child(3) ~ .node,
	.node:first-child:nth-last-child(5),
	.node:first-child:nth-last-child(5) ~ .node,
	.node:first-child:nth-last-child(6),
	.node:first-child:nth-last-child(6) ~ .node,
	.node:first-child:nth-last-child(7),
	.node:first-child:nth-last-child(7) ~ .node,
	.node:first-child:nth-last-child(8),
	.node:first-child:nth-last-child(8) ~ .node,
	.node:first-child:nth-last-child(9),
	.node:first-child:nth-last-child(9) ~ .node,
	.node:first-child:nth-last-child(10),
	.node:first-child:nth-last-child(10) ~ .node,
	.node:first-child:nth-last-child(11),
	.node:first-child:nth-last-child(11) ~ .node,
	.node:first-child:nth-last-child(12),
	.node:first-child:nth-last-child(12) ~ .node,
	.node:first-child:nth-last-child(13),
	.node:first-child:nth-last-child(13) ~ .node,
	.node:first-child:nth-last-child(14),
	.node:first-child:nth-last-child(14) ~ .node,
	.node:first-child:nth-last-child(15),
	.node:first-child:nth-last-child(15) ~ .node,
	.node:first-child:nth-last-child(16),
	.node:first-child:nth-last-child(16) ~ .node {
		width: 50%;
	}
}

@media (max-width: 19em) {
	.node:first-child:nth-last-child(1),
	.node:first-child:nth-last-child(1) ~ .node,
	.node:first-child:nth-last-child(2),
	.node:first-child:nth-last-child(2) ~ .node,
	.node:first-child:nth-last-child(3),
	.node:first-child:nth-last-child(3) ~ .node,
	.node:first-child:nth-last-child(4),
	.node:first-child:nth-last-child(4) ~ .node,
	.node:first-child:nth-last-child(5),
	.node:first-child:nth-last-child(5) ~ .node,
	.node:first-child:nth-last-child(6),
	.node:first-child:nth-last-child(6) ~ .node,
	.node:first-child:nth-last-child(7),
	.node:first-child:nth-last-child(7) ~ .node,
	.node:first-child:nth-last-child(8),
	.node:first-child:nth-last-child(8) ~ .node,
	.node:first-child:nth-last-child(8),
	.node:first-child:nth-last-child(8) ~ .node,
	.node:first-child:nth-last-child(9),
	.node:first-child:nth-last-child(9) ~ .node,
	.node:first-child:nth-last-child(10),
	.node:first-child:nth-last-child(10) ~ .node,
	.node:first-child:nth-last-child(11),
	.node:first-child:nth-last-child(11) ~ .node,
	.node:first-child:nth-last-child(12),
	.node:first-child:nth-last-child(12) ~ .node,
	.node:first-child:nth-last-child(13),
	.node:first-child:nth-last-child(13) ~ .node,
	.node:first-child:nth-last-child(14),
	.node:first-child:nth-last-child(14) ~ .node,
	.node:first-child:nth-last-child(15),
	.node:first-child:nth-last-child(15) ~ .node,
	.node:first-child:nth-last-child(16),
	.node:first-child:nth-last-child(16) ~ .node {
		width: 100%;
	}
}

.node h3,
.node h4,
.node h5 {
	padding: 0.25rem;
	background: hsl(25, 85%, 55%);
	color: #000;
	white-space: nowrap;
	overflow: clip;
	font-size: 1rem;
	background: hsl(var(--hue_1), var(--sat_1), var(--lum_1_high));
	color: var(--contrast_1_high);
}

@media (prefers-color-scheme: dark) {
	.node h3,
	.node h4,
	.node h5 {
		background: hsl(var(--hue_1), var(--sat_1), var(--lum_1_low));
		color: var(--contrast_1_low);
	}
}

.node h5 {
	background: #9e3d22;
	color: #fff;
	background: hsl(var(--hue_1), var(--sat_1), var(--lum_1_low));
	color: var(--contrast_1_low);
}

@media (prefers-color-scheme: dark) {
	.node h5 {
		background: hsl(var(--hue_1), var(--sat_1), var(--lum_1_high));
		color: var(--contrast_1_high);
	}
}

.race-results h4 {
	overflow: clip;
}

.race-header {
	margin: 0.25rem -0.125rem 0;
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
}

.race-header>* {
	margin: 0 0.125rem 0.25rem;
}

.custom_attr {
	margin:0.25rem 0;
	display: flex;
	flex-basis: 100%;
	flex-wrap: wrap;
}

.custom_attr .desc {
	margin: 0;
	font-size: 0.75em;
	font-style: italic;
}

.custom_attr input:not([type="checkbox"]),
.custom_attr select {
	flex-basis: 100%;
}

.custom_attr [type="checkbox"] {
	order: -1;
	flex: 0 1 auto;
	margin-right: 0.5rem;
}

@media (max-width: 45em) {
	.responsive-wrap th {
		font-size: 0.75em;
	}
}

@media (max-width: 38em) {
	.responsive-wrap {
		font-size: 1rem;
		overflow: auto;
	}
	.responsive-wrap th {
		font-size: 0.75em;
	}
	.responsive-wrap .behind {
		display: none;
	}
}





.actions {
	position: absolute;
	top: 0.25rem;
	right: 0.25em;
	font-size: 0.9rem;
	z-index: 90;
}

.actions button {
	margin-left:0.5em;
	font-weight: bold;
}

.event-leaderboard {
	margin-bottom: 1em;
}

.node-list {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -0.25rem;
	justify-content: center;
}

.simulate_lap {
	font-size: 1rem;
}

.lap_0 {
	background: #eee;
}

@media (prefers-color-scheme: dark) {
	.lap_0 {
		background: #666;
	}
}

.from_start {
	display: block;
	font-size: 0.75em;
}

.after-time-expired {
	background: #eee;
}

@media (prefers-color-scheme: dark) {
	.after-time-expired {
		background: #666;
	}
}

.late-lap {
	text-decoration: line-through;
}

.lap-deleted {
	background: #d1d3d4;
}

@media (prefers-color-scheme: dark) {
	.lap-deleted {
		background: #4c4c4c;
	}
}

@media (prefers-color-scheme: dark) {
	.lap_split {
		color: #999;
	}
}

.restore_deleted_lap {
	float: left;
}

.invalid {
	opacity: 0.2;
	pointer-events: none;
}

.pilot-team {
	display: flex;
	justify-content: center;
	align-items: center;
	flex: 1;
}

.pilot-team label {
	margin-right: 0.5em;
}

/* ************* */
/* Print Styling */
/* ************* */

@media print {

	thead {
		display: table-header-group;
	}

	tr {
		break-inside: avoid;
	}

	p, h2, h3 {
		orphans: 3;
		widows: 3;
	}

	h2, h3 {
		break-after: avoid;
	}

	.panel-content {
		display: block !important;
	}
	
}
