.site-page--atlas {
	min-height: 100vh;
}

.site-page--atlas .site-controls {
	display: none;
}

/* Match Systems document chrome widths */
.site-page--atlas .site-header .site-header__rail,
.site-page--atlas .site-footer > .container {
	width: min(100%, 96rem);
	margin-inline: auto;
	padding-inline: clamp(1rem, 2.5vw, 2rem);
}

.site-page--atlas .site-header__series {
	padding-left: 0.05rem;
}

.atlas-page {
	padding: 0.75rem 0 2rem;
}

.atlas-page__container {
	width: min(100%, 96rem);
	margin: 0 auto;
	padding: 0 clamp(1rem, 2.5vw, 2rem);
	display: grid;
	gap: 1rem;
}

.atlas-page__header {
	display: grid;
	gap: 0.35rem;
}

.atlas-page__kicker {
	margin: 0;
	font-family: var(--font-display);
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--highlight);
}

.atlas-page__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.4rem, 3vw, 2rem);
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--text);
}

.atlas-page__subtitle {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--muted);
	max-width: 42rem;
}

.atlas-workspace {
	display: grid;
	gap: 1rem;
	align-items: start;
}

@media (min-width: 900px) {
	.atlas-workspace {
		grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
	}
}

.atlas-panel {
	display: grid;
	gap: 0.85rem;
	padding: 0.95rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: color-mix(in srgb, var(--bg-secondary) 55%, transparent);
}

.atlas-panel__section {
	display: grid;
	gap: 0.55rem;
}

.atlas-panel__label {
	margin: 0;
	font-family: var(--font-display);
	font-size: 0.58rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--highlight);
}

.atlas-panel__name {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text);
}

.atlas-meta {
	display: grid;
	gap: 0.45rem;
	margin: 0;
}

.atlas-meta__row {
	display: grid;
	grid-template-columns: 6.5rem 1fr;
	gap: 0.5rem;
	font-size: 0.78rem;
	line-height: 1.4;
}

.atlas-meta__row dt {
	margin: 0;
	color: var(--muted);
}

.atlas-meta__row dd {
	margin: 0;
	color: var(--text);
	word-break: break-word;
}

.atlas-gear {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.4rem;
}

.atlas-gear__item {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.78rem;
	background: color-mix(in srgb, var(--bg-deep) 35%, transparent);
}

.atlas-gear__item strong {
	font-weight: 600;
	color: var(--text);
}

.atlas-gear__item span {
	color: var(--highlight);
	font-family: var(--font-display);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.atlas-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.atlas-btn {
	appearance: none;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font-family: var(--font-display);
	font-size: 0.56rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 0.42rem 0.7rem;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.atlas-btn:hover,
.atlas-btn:focus-visible {
	color: var(--text);
	border-color: var(--border-strong);
}

.atlas-btn.is-active {
	color: var(--bg-deep);
	background: var(--highlight);
	border-color: var(--highlight);
}

[data-theme="light"] .atlas-btn.is-active {
	color: #fff;
}

.atlas-btn--ghost {
	border-style: dashed;
}

.atlas-editor-hint {
	margin: 0;
	font-size: 0.72rem;
	line-height: 1.45;
	color: var(--muted);
}

.atlas-stage {
	min-width: 0;
	padding: 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: color-mix(in srgb, var(--bg-secondary) 40%, transparent);
}

.atlas-zoombar {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
	margin-bottom: 0.35rem;
}

.atlas-zoombar__readout {
	min-width: 3.2rem;
	text-align: center;
	font-family: var(--font-display);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	color: var(--muted);
}

.atlas-zoom-hint,
.atlas-detail-hint {
	margin: 0 0 0.55rem;
	font-size: 0.68rem;
	color: var(--muted);
	line-height: 1.35;
}

.atlas-detail-hint {
	margin: 0.55rem 0 0;
	padding-top: 0.35rem;
	border-top: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
}

.atlas-stage__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1.15;
	max-height: min(78vh, 42rem);
	margin-inline: auto;
	overflow: hidden;
	border-radius: 6px;
}

.atlas-svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	touch-action: none;
	cursor: crosshair;
	user-select: none;
}

.atlas-svg.is-view {
	cursor: default;
}

.atlas-svg.is-view.is-zoomed {
	cursor: grab;
}

.atlas-svg.is-panning {
	cursor: grabbing;
}

.atlas-rock-dot {
	fill: color-mix(in srgb, var(--muted) 55%, #c4a574);
}

[data-theme="light"] .atlas-rock-dot {
	fill: color-mix(in srgb, #8a7350 45%, #b08960);
}

.atlas-svg[data-detail="medium"] .atlas-silhouette {
	stroke-width: 1.75;
}

.atlas-svg[data-detail="fine"] .atlas-silhouette {
	stroke-width: 2;
}

.atlas-svg:not(.is-view) .atlas-marker {
	pointer-events: none;
}

.atlas-tip {
	position: absolute;
	z-index: 4;
	min-width: 7.5rem;
	max-width: 12rem;
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	background: color-mix(in srgb, var(--bg-deep) 88%, #101820);
	color: var(--text);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
	font-size: 0.72rem;
	line-height: 1.35;
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 6px));
	flex-direction: column;
	gap: 0.12rem;
}

/* `display:flex` must not override the HTML `hidden` attribute */
.atlas-tip[hidden] {
	display: none !important;
}

.atlas-tip:not([hidden]) {
	display: flex;
}

.atlas-tip strong {
	font-family: var(--font-display);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
}

.atlas-tip__kind {
	color: var(--muted);
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.atlas-tip em {
	font-style: normal;
	color: var(--muted);
	font-size: 0.66rem;
}

.atlas-conditions-note {
	margin: 0.55rem 0 0;
	padding: 0.45rem 0.55rem;
	border-left: 2px solid color-mix(in srgb, #e0a84a 70%, var(--border));
	color: var(--muted);
	font-size: 0.72rem;
	line-height: 1.4;
}

.atlas-marker {
	cursor: pointer;
	outline: none;
}

.atlas-marker__hit {
	fill: transparent;
	stroke: none;
}

.atlas-marker:hover .atlas-bolt,
.atlas-marker:focus .atlas-bolt,
.atlas-marker:hover .atlas-pro,
.atlas-marker:focus .atlas-pro {
	transform-box: fill-box;
	transform-origin: center;
}

.atlas-marker:hover .atlas-bolt,
.atlas-marker:focus-visible .atlas-bolt {
	stroke: #dff0ff;
	stroke-width: 1.8;
}

.atlas-marker:hover .atlas-pro,
.atlas-marker:focus-visible .atlas-pro {
	stroke: #ffe9b0;
	stroke-width: 1.6;
}

.atlas-marker:hover .atlas-station,
.atlas-marker:focus-visible .atlas-station {
	stroke: #fff;
	stroke-width: 1.6;
}

.atlas-pitch-layer.is-hot .atlas-route {
	stroke-width: 3.2;
	filter: brightness(1.15);
}

.atlas-pitch-layer:not(.is-hot) .atlas-route {
	transition: stroke-width 120ms ease, opacity 120ms ease;
}

.atlas-world:has(.atlas-pitch-layer.is-hot) .atlas-pitch-layer:not(.is-hot) {
	opacity: 0.38;
}

.atlas-pitch.is-hot {
	border-color: color-mix(in srgb, #3d8bfd 55%, var(--border));
	background: color-mix(in srgb, #3d8bfd 12%, transparent);
}

.atlas-axis {
	fill: none;
	stroke: color-mix(in srgb, var(--border-strong) 80%, transparent);
	stroke-width: 1.25;
}

.atlas-grid {
	fill: none;
	stroke: color-mix(in srgb, var(--border) 70%, transparent);
	stroke-width: 0.75;
	stroke-dasharray: 2 3;
}

.atlas-tick-label {
	fill: var(--muted);
	font-family: var(--font-display);
	font-size: 8px;
	letter-spacing: 0.06em;
}

.atlas-axis-title {
	fill: var(--muted);
	font-family: var(--font-display);
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.atlas-silhouette {
	fill: color-mix(in srgb, var(--bg-secondary) 55%, transparent);
	stroke: color-mix(in srgb, var(--muted) 75%, var(--border-strong));
	stroke-width: 1.5;
	stroke-linejoin: round;
}

.atlas-route {
	fill: none;
	stroke: #3d8bfd;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.atlas-route--sport {
	stroke: #3d8bfd;
	stroke-width: 2.4;
}

.atlas-route--trad {
	stroke: #e0a84a;
	stroke-width: 2.4;
}

.atlas-route--mixed {
	stroke: #c07cff;
	stroke-width: 2.4;
	stroke-dasharray: 7 4;
}

.atlas-route--third_class {
	stroke: color-mix(in srgb, var(--muted) 85%, #9aa7b8);
	stroke-width: 2;
	stroke-dasharray: 3 5;
	opacity: 0.9;
}

.atlas-route--alternate {
	stroke: #7eb6ff;
	stroke-width: 1.8;
	stroke-dasharray: 5 4;
	opacity: 0.85;
}

[data-theme="light"] .atlas-route,
[data-theme="light"] .atlas-route--sport {
	stroke: #1a5fd0;
}

[data-theme="light"] .atlas-route--trad {
	stroke: #b7791f;
}

[data-theme="light"] .atlas-route--mixed {
	stroke: #8b4fd1;
}

[data-theme="light"] .atlas-route--alternate {
	stroke: #3d7fd4;
}

.atlas-bolt {
	fill: color-mix(in srgb, var(--bg-deep) 30%, #3d8bfd);
	stroke: #9ec5ff;
	stroke-width: 1.2;
}

.atlas-pro {
	fill: color-mix(in srgb, var(--bg-deep) 25%, #e0a84a);
	stroke: #f0d08a;
	stroke-width: 1.1;
}

[data-theme="light"] .atlas-bolt {
	fill: #d6e6ff;
	stroke: #1a5fd0;
}

[data-theme="light"] .atlas-pro {
	fill: #f7e6c2;
	stroke: #b7791f;
}

.atlas-station {
	fill: color-mix(in srgb, var(--highlight) 35%, transparent);
	stroke: var(--highlight);
	stroke-width: 1.6;
}

.atlas-pitch-label {
	fill: var(--muted);
	font-family: var(--font-display);
	font-size: 8px;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.atlas-pitches {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.4rem;
}

.atlas-pitch {
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: color-mix(in srgb, var(--bg-deep) 35%, transparent);
	display: grid;
	gap: 0.2rem;
	transition: border-color 120ms ease, background 120ms ease;
}

.atlas-pitch__top {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	align-items: baseline;
}

.atlas-pitch__id {
	font-family: var(--font-display);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--highlight);
}

.atlas-pitch__grade {
	font-family: var(--font-display);
	font-size: 0.68rem;
	color: var(--text);
}

.atlas-pitch__meta {
	font-size: 0.72rem;
	color: var(--muted);
	line-height: 1.35;
}

.atlas-key {
	margin-top: 0.85rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--border);
}

.atlas-key__title {
	margin: 0 0 0.55rem;
	font-family: var(--font-display);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.atlas-key__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.74rem;
	line-height: 1.35;
}

.atlas-key__table th,
.atlas-key__table td {
	padding: 0.42rem 0.35rem;
	border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
	vertical-align: middle;
	text-align: left;
}

.atlas-key__table th {
	font-family: var(--font-display);
	font-size: 0.64rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.atlas-key__table td:first-child {
	width: 3.4rem;
	padding-right: 0.55rem;
}

.atlas-key__table td:last-child {
	color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.atlas-key__icon {
	display: block;
	width: 2.6rem;
	height: 1.05rem;
	overflow: visible;
}

.atlas-key__line {
	fill: none;
	stroke-width: 2.4;
	stroke-linecap: round;
}

.atlas-key__line--sport { stroke: #3d8bfd; }
.atlas-key__line--trad { stroke: #e0a84a; }
.atlas-key__line--mixed {
	stroke: #c07cff;
	stroke-dasharray: 5 3;
}
.atlas-key__line--third {
	stroke: #9aa7b8;
	stroke-width: 2;
	stroke-dasharray: 2.5 3.5;
}
.atlas-key__line--alt {
	stroke: #7eb6ff;
	stroke-width: 1.8;
	stroke-dasharray: 4 3;
}

.atlas-key__bolt {
	fill: color-mix(in srgb, var(--bg-deep) 30%, #3d8bfd);
	stroke: #9ec5ff;
	stroke-width: 1.2;
}

.atlas-key__pro {
	fill: color-mix(in srgb, var(--bg-deep) 25%, #e0a84a);
	stroke: #f0d08a;
	stroke-width: 1.1;
}

.atlas-key__station {
	fill: color-mix(in srgb, var(--highlight) 35%, transparent);
	stroke: var(--highlight);
	stroke-width: 1.4;
}

.atlas-key__wall {
	fill: color-mix(in srgb, var(--bg-secondary) 55%, transparent);
	stroke: color-mix(in srgb, var(--muted) 75%, var(--border-strong));
	stroke-width: 1.2;
	stroke-linejoin: round;
}

[data-theme="light"] .atlas-key__line--sport { stroke: #1a5fd0; }
[data-theme="light"] .atlas-key__line--trad { stroke: #b7791f; }
[data-theme="light"] .atlas-key__line--mixed { stroke: #8b4fd1; }
[data-theme="light"] .atlas-key__line--alt { stroke: #3d7fd4; }
[data-theme="light"] .atlas-key__bolt {
	fill: #d6e6ff;
	stroke: #1a5fd0;
}
[data-theme="light"] .atlas-key__pro {
	fill: #f7e6c2;
	stroke: #b7791f;
}

.atlas-edit-point {
	fill: var(--highlight);
	stroke: var(--text);
	stroke-width: 0.8;
	opacity: 0.85;
}

.atlas-export {
	width: 100%;
	min-height: 7rem;
	margin: 0;
	padding: 0.55rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: color-mix(in srgb, var(--bg-deep) 55%, transparent);
	color: var(--muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.65rem;
	line-height: 1.4;
	resize: vertical;
}

@media (max-width: 899px) {
	.atlas-stage__frame {
		aspect-ratio: 1 / 1.05;
		max-height: min(70vh, 34rem);
	}
}
