.site-menu {
	position: relative;
}

.site-menu > summary {
	list-style: none;
	cursor: pointer;
	color: #fff;
	background-color: #212529;
}

.site-menu > summary::-webkit-details-marker {
	display: none;
}

.site-menu > summary:hover {
	background-color: #6c757d;
}

.site-menu[open] > .dropdown-menu {
	display: block;
	right: 0;
}

.btn-join {
	color: #fff;
	background-color: #212529;
}

.btn-join:hover {
	color: #fff;
	background-color: #6c757d;
}

.site-menu > .dropdown-menu {
	--bs-dropdown-link-active-bg: #212529;
}

.site-menu > summary,
.btn-join {
	padding: 0.5rem 1rem;
	border-radius: 0.375rem;
}

.stat-value {
	line-height: 1.2;
}

.stat-cards .card-body {
	padding: 0.5rem 0.75rem;
}

.stat-cards .stat-value span {
	font-size: 0.7rem;
}

.stat-cards > .col {
	min-width: 0;
}

.stat-cards .stat-value {
	overflow-wrap: anywhere;
}

.breadcrumb {
	--bs-breadcrumb-divider: ">";
	flex-wrap: nowrap;
}

.breadcrumb-item {
	display: flex;
	align-items: center;
	min-width: 0;
}

header nav[aria-label="breadcrumb"] {
	min-width: 0;
}

.breadcrumb-item a,
.breadcrumb-item h1 {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

header .nav {
	flex-shrink: 0;
}

img {
	max-width: 100%;
	height: auto;
}

pre {
	overflow-x: auto;
}

.table-year td:has(> .bar-cell) {
	width: 100%;
}

.table-route td:has(> .bar-cell) {
	width: 50%;
}

.table-hz th:nth-child(2),
.table-hz td:nth-child(2) {
	white-space: nowrap;
}

.table-hz th:first-child,
.table-hz td:first-child {
	width: 1%;
}

.table-celebrity tr:not(.register-description) th:first-child,
.table-celebrity tr:not(.register-description) td:first-child {
	white-space: nowrap;
	overflow-wrap: normal;
}

.table-grade th:nth-child(2),
.table-grade td:nth-child(2) {
	width: 22%;
}

.table-grade th:first-child,
.table-grade td:first-child,
.table-year th:nth-child(-n+2),
.table-year td:nth-child(-n+2) {
	width: 1%;
	white-space: nowrap;
}

@media (max-width: 575.98px) {
	.table-hz {
		font-size: 0.8125rem;
	}

	.table-hz td {
		overflow-wrap: anywhere;
	}

	.table-hz > :not(caption) > * > * {
		padding: 0.3rem 0.25rem;
	}
}

.table-route .bar-cell {
	min-width: 6rem;
}

@media (max-width: 575.98px) {
	.table-route .bar-cell {
		min-width: 4rem;
	}
}

@media (min-width: 1200px) {
	.table-route tr:not(.route-desc) td:nth-child(1) {
		white-space: nowrap;
	}
}

.route-desc td {
	padding-top: 0;
}

.table-route tbody:nth-of-type(odd) > tr > *,
.table-hz tbody:nth-of-type(odd) > tr > * {
	--bs-table-bg-type: var(--bs-table-striped-bg);
}

.register-description td {
	padding-top: 0;
}

.bar-cell {
	min-width: 10rem;
}

.bar-cell .progress {
	position: relative;
	height: 1.25rem;
}

.bar-cell .progress-bar {
	position: relative;
	z-index: 1;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	background-color: var(--bs-gray-700);
}

.bar-label {
	padding-left: 0.5rem;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	flex-shrink: 0;
}

.bar-label-track {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	display: flex;
	align-items: center;
	color: var(--bs-gray-700);
}

.bar-label-fill {
	color: #fff;
}

.bar-label-flags {
	font-size: 1.1rem;
	line-height: 1;
	letter-spacing: 0.08em;
	flex-shrink: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bar-label-track.bar-label-flags {
	right: 0;
	max-width: 100%;
	z-index: 2;
	display: block;
	line-height: 1.25rem;
	padding-right: 0.35rem;
}

@media (max-width: 575.98px) {
	.table-discovery .bar-cell {
		min-width: 5rem;
	}

	.table-discovery th:first-child,
	.table-discovery td:first-child {
		white-space: normal;
	}

	.table-discovery .bar-label-flags {
		font-size: 0.95rem;
		letter-spacing: 0;
	}
}

.progress.stacked .progress-bar + .progress-bar {
	border-left: 2px solid var(--bs-body-bg);
}

.progress.stacked .progress-bar {
	container-type: inline-size;
}

.progress.stacked .bar-label {
	padding-left: 0.3rem;
	font-weight: 600;
}

@container (max-width: 26px) {
	.bar-label {
		visibility: hidden;
	}
}

/* one colour per route, by ascent rank within the tower. Hue walks the wheel in
   111 degree steps and lightness alternates dark/light, so touching segments in a
   stack differ in both. 30 slots covers the biggest guide (Fellerova vez, 24 routes).
   Checked, not eyeballed: worst adjacent pair dE 9.3 protanopia, 21.0 normal vision;
   all inside the L 0.43-0.77 band, all chroma >= 0.1. The count label inside each
   segment is what carries the light band, which sits under 3:1 on white. */
.progress-bar.seg-1 { background-color: #2a68b7; }
.progress-bar.seg-2 { background-color: #dd7d91; }
.progress-bar.seg-3 { background-color: #637100; }
.progress-bar.seg-4 { background-color: #39acda; }
.progress-bar.seg-5 { background-color: #9b4382; }
.progress-bar.seg-6 { background-color: #ba9b39; }
.progress-bar.seg-7 { background-color: #0080a4; }
.progress-bar.seg-8 { background-color: #b887d3; }
.progress-bar.seg-9 { background-color: #975700; }
.progress-bar.seg-10 { background-color: #30b69a; }
.progress-bar.seg-11 { background-color: #6459b5; }
.progress-bar.seg-12 { background-color: #de8268; }
.progress-bar.seg-13 { background-color: #187e36; }
.progress-bar.seg-14 { background-color: #709fe9; }
.progress-bar.seg-15 { background-color: #a93f56; }
.progress-bar.seg-16 { background-color: #93aa4f; }
.progress-bar.seg-17 { background-color: #00729b; }
.progress-bar.seg-18 { background-color: #d27fb2; }
.progress-bar.seg-19 { background-color: #7d6700; }
.progress-bar.seg-20 { background-color: #00b3c2; }
.progress-bar.seg-21 { background-color: #884b9e; }
.progress-bar.seg-22 { background-color: #d08f44; }
.progress-bar.seg-23 { background-color: #008870; }
.progress-bar.seg-24 { background-color: #9c91e4; }
.progress-bar.seg-25 { background-color: #a94620; }
.progress-bar.seg-26 { background-color: #61b377; }
.progress-bar.seg-27 { background-color: #3a65b8; }
.progress-bar.seg-28 { background-color: #de7d89; }
.progress-bar.seg-29 { background-color: #5a7400; }
.progress-bar.seg-30 { background-color: #45aade; }

.seg-2 .bar-label,
.seg-4 .bar-label,
.seg-6 .bar-label,
.seg-8 .bar-label,
.seg-10 .bar-label,
.seg-12 .bar-label,
.seg-14 .bar-label,
.seg-16 .bar-label,
.seg-18 .bar-label,
.seg-20 .bar-label,
.seg-22 .bar-label,
.seg-23 .bar-label,
.seg-24 .bar-label,
.seg-26 .bar-label,
.seg-28 .bar-label,
.seg-30 .bar-label {
	color: var(--bs-gray-900);
}

/* one fixed colour per Saxon grade (I..XIIc) plus unclassified.
   Hues walk the wheel by the golden angle so neighbours stay apart;
   the slot comes from report.sql, never from row order. */
.progress-bar.grade-1 { background-color: #983e3e; } /* I */
.progress-bar.grade-2 { background-color: #3e9858; } /* II */
.progress-bar.grade-3 { background-color: #733e98; } /* III */
.progress-bar.grade-4 { background-color: #988d3e; } /* IV */
.progress-bar.grade-5 { background-color: #3e8998; } /* V */
.progress-bar.grade-6 { background-color: #983e6f; } /* VI */
.progress-bar.grade-7 { background-color: #55983e; } /* VIIa */
.progress-bar.grade-8 { background-color: #423e98; } /* VIIb */
.progress-bar.grade-9 { background-color: #985c3e; } /* VIIc */
.progress-bar.grade-10 { background-color: #3e9876; } /* VIIIa */
.progress-bar.grade-11 { background-color: #913e98; } /* VIIIb */
.progress-bar.grade-12 { background-color: #85983e; } /* VIIIc */
.progress-bar.grade-13 { background-color: #3e6b98; } /* IXa */
.progress-bar.grade-14 { background-color: #983e51; } /* IXb */
.progress-bar.grade-15 { background-color: #3e9846; } /* IXc */
.progress-bar.grade-16 { background-color: #603e98; } /* Xa */
.progress-bar.grade-17 { background-color: #987a3e; } /* Xb */
.progress-bar.grade-18 { background-color: #3e9895; } /* Xc */
.progress-bar.grade-19 { background-color: #983e81; } /* XIa */
.progress-bar.grade-20 { background-color: #67983e; } /* XIb */
.progress-bar.grade-21 { background-color: #3e4d98; } /* XIc */
.progress-bar.grade-22 { background-color: #984a3e; } /* XIIa */
.progress-bar.grade-23 { background-color: #3e9864; } /* XIIb */
.progress-bar.grade-24 { background-color: #7e3e98; } /* XIIc */
.progress-bar.grade-25 { background-color: #9e9e9e; } /* ? */

.grade-12 .bar-label,
.grade-25 .bar-label {
	color: var(--bs-gray-900);
}

@media (max-width: 575.98px) {
	/* keep the tail of the breadcrumb: parent and current page, ellipsis for the rest */
	.breadcrumb-item:not(:nth-last-child(-n+2)) {
		display: none;
	}

	.breadcrumb-item:nth-last-child(2)::before {
		content: "…";
	}

	.table-grade th:nth-child(2),
	.table-grade td:nth-child(2) {
		width: auto;
	}

	.stat-cards {
		--bs-gutter-x: 0.5rem;
	}

	.stat-cards .card-body {
		padding: 0.5rem 0.4rem;
	}

	.bar-cell {
		min-width: 5rem;
	}

	.table > :not(caption) > * > * {
		padding: 0.4rem;
	}
}

.tower-row {
	padding: 0.25rem 0.5rem;
}

.tower-row:nth-child(odd) {
	background-color: rgba(var(--bs-emphasis-color-rgb), 0.05);
}

.tower-row > a {
	flex-shrink: 0;
}

.tower-row > span {
	min-width: 0;
}

article img {
	display: block;
	width: 22rem;
	max-width: 100%;
	height: auto;
	border-radius: 0.5rem;
	margin: 0 auto 0.35rem;
}

article p:has(img) {
	text-align: center;
}
