/* Racetrack Wiki: a map-first atlas with a shared reference shell. */
:root { --sidebar-width: 0px; --atlas-header-height: 68px; --atlas-ink: var(--rw-black); --atlas-muted: var(--rw-muted); --atlas-line: var(--rw-rule); --atlas-paper: var(--rw-white); --atlas-accent: var(--rw-red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-frame { margin-left: 0; }
#topbar { z-index: 60; background: var(--atlas-paper); border-bottom: 1px solid var(--atlas-line); backdrop-filter: none; }
.atlas-header { display: flex; align-items: center; gap: 28px; height: var(--atlas-header-height); padding: 0 28px; }
.atlas-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--atlas-ink); font-size: 19px; letter-spacing: -.6px; }
.atlas-brand strong { font-weight: 700; }
.atlas-header .global-search-button { width: min(390px, 35vw); min-width: 220px; height: 42px; margin: 0 auto; padding: 0 13px; border: 1px solid var(--rw-rule); border-radius: 4px; background: var(--rw-surface); font-size: 13px; color: var(--rw-muted); }
.atlas-header .global-search-button kbd { background: transparent; border-color: var(--rw-rule); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-action, .menu-toggle { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; padding: 8px 10px; border-radius: 4px; color: var(--rw-black); font-size: 13px; }
.header-action:hover, .menu-toggle:hover { background: var(--rw-surface); }
.header-action small { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; background: var(--rw-surface); border-radius: 4px; font-size: 12px; }
.atlas-header .unit-toggle { min-height: 36px; min-width: 68px; padding: 5px 9px; font-size: 12px; }
.app-menu { position: fixed; z-index: 70; top: calc(var(--atlas-header-height) + 8px); right: 20px; width: 264px; display: grid; gap: 3px; padding: 10px; border: 1px solid var(--atlas-line); border-radius: 8px; box-shadow: 0 14px 50px #11131526; background: var(--atlas-paper); }
.app-menu .nav-item { font-size: 14px; color: var(--atlas-ink); min-height: 44px; }
.app-menu .nav-item:hover { background: var(--rw-surface); }
.app-menu .nav-item.active { background: var(--rw-surface); color: var(--rw-black); }
.app-menu .nav-item.active > .icon { color: var(--rw-black); }
.app-menu .nav-count { background: var(--rw-surface); color: var(--rw-black); }
.app-menu-rule { height: 1px; background: var(--atlas-line); margin: 8px; }
body.is-explorer { overflow: hidden; background: var(--rw-black); }
body.is-explorer .site-frame { height: 100svh; min-height: 0; padding-bottom: 0; }
body.is-explorer:has(.compare-tray-inner) #toast { bottom: 24px; }
body.is-explorer #main { height: calc(100svh - var(--atlas-header-height)); flex: none; }
body.is-explorer #footer, body.is-explorer #compare-tray { display: none; }
.atlas-page { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--atlas-ink); }
.atlas-toolbar { position: absolute; z-index: 12; top: 22px; left: 24px; right: 95px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.atlas-toolbar > * { pointer-events: auto; }
.atlas-view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #ffffff26; border-radius: 4px; background: #111315e8; box-shadow: 0 2px 16px #1113150f; }
.atlas-view-switch button { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 13px; border-radius: 4px; color: var(--rw-muted-on-dark); font-size: 13px; }
.atlas-view-switch button[aria-pressed="true"] { background: var(--rw-surface); color: var(--rw-black); }
.atlas-filter-toggle { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 13px; border: 1px solid #ffffff26; border-radius: 4px; background: #111315e8; color: var(--rw-white); font-size: 13px; }
.atlas-toolbar .active-filters { gap: 6px; margin: 0; flex-wrap: nowrap; max-width: 40vw; overflow-x: auto; }
.atlas-toolbar .active-filter { flex-shrink: 0; background: #111315e8; border-color: var(--rw-control-boundary); color: var(--rw-white); font-size: 12px; }
.atlas-toolbar .text-button { flex-shrink: 0; color: var(--rw-white); font-size: 12px; }
.atlas-result-count { font-size: 12px; color: var(--rw-muted-on-dark); white-space: nowrap; }
.atlas-filters { position: absolute; z-index: 30; top: 78px; left: 24px; width: 340px; max-height: calc(100% - 96px); overflow-y: auto; padding: 22px; display: grid; gap: 16px; border: 1px solid var(--atlas-line); border-radius: 8px; box-shadow: 0 12px 40px #11131529; background: var(--atlas-paper); }
.atlas-filter-heading { display: flex; align-items: center; justify-content: space-between; }
.atlas-filter-heading h2 { font-size: 18px; }
.atlas-filters .select-field { width: 100%; }
.atlas-filters .select-field > span { margin-bottom: 6px; font-size: 12px; color: var(--atlas-muted); }
.atlas-filters .select-field select { width: 100%; font-size: 14px; }
.atlas-workspace { position: relative; min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0,1fr); overflow: hidden; }
.earth-stage { position: relative; min-height: 0; min-width: 0; height: 100%; background: radial-gradient(ellipse at 50% 45%, var(--rw-black), var(--rw-black) 75%); isolation: isolate; }
.earth-map { position: absolute; inset: 0; }
.earth-status { position: absolute; z-index: 2; left: 28px; bottom: 154px; max-width: 410px; font-size: 13px; line-height: 1.6; color: var(--rw-muted-on-dark); }
.earth-status[data-state="ready"] { display: none; }
.earth-status[data-state="unavailable"] { bottom: auto; top: 165px; max-width: 360px; }
.earth-stage .maplibregl-ctrl-top-right { top: 12px; right: 16px; }
.earth-stage .maplibregl-ctrl-group { border-radius: 4px; box-shadow: 0 2px 12px #11131533; overflow: hidden; }
.earth-stage .maplibregl-ctrl-group button { width: 38px; height: 38px; }
.earth-stage .maplibregl-ctrl-attrib { font-size: 12px; }
.earth-reset, .earth-retry { position: absolute; right: 26px; bottom: 150px; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; border: 1px solid #1113154f; border-radius: 4px; background: #111315dc; color: var(--rw-white); font-size: 12px; }
.earth-retry { left: 28px; right: auto; bottom: 160px; }
.atlas-fallback { position: absolute; left: 28px; top: 245px; max-width: 360px; color: var(--rw-white); }
.atlas-fallback h2 { font-size: 23px; color: var(--rw-white); }
.atlas-fallback p { margin-top: 12px; font-size: 14px; color: var(--rw-muted-on-dark); }
.atlas-fallback .button.primary { background: var(--rw-surface); color: var(--rw-black); font-size: 14px; }
.atlas-discovery { position: absolute; bottom: 70px; left: 28px; right: 28px; }
.atlas-discovery > span { display: block; color: var(--rw-muted-on-dark); font-size: 12px; letter-spacing: .04em; margin-bottom: 9px; }
.pilot-list { display: flex; gap: 7px; overflow-x: auto; padding: 1px 2px 5px; scrollbar-width: thin; scrollbar-color: var(--rw-control-boundary) transparent; }
.pilot-button { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; min-height: 39px; padding: 8px 13px; border: 1px solid #11131547; border-radius: 4px; background: #111315dd; color: var(--rw-white); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pilot-button:hover { border-color: var(--atlas-accent); background: var(--rw-surface-on-dark); color: var(--rw-black); }
.atlas-map-meta { position: absolute; bottom: 39px; left: 28px; right: 28px; display: flex; gap: 18px; color: var(--rw-muted-on-dark); font-size: 12px; }
.atlas-map-info summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.atlas-map-info > div { position: absolute; z-index: 15; bottom: 27px; left: 0; width: min(380px,100%); padding: 20px; border: 1px solid #1113154f; border-radius: 4px; background: var(--rw-black); box-shadow: 0 12px 35px #11131544; font-size: 13px; line-height: 1.7; color: var(--rw-white); }
.atlas-map-info a { text-decoration: underline; }
.earth-credit { position: absolute; bottom: 12px; left: 28px; margin: 0; max-width: 80%; color: var(--rw-muted); font-size: 12px; }
.earth-pin { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; background: transparent; border: 0; border-radius: 50%; }
.earth-pin-dot { width: 13px; height: 13px; border: 2px solid var(--rw-rule); border-radius: 50%; background: var(--rw-surface-on-dark); box-shadow: 0 0 0 5px #1113151a, 0 1px 8px #111315aa; }
.earth-pin:hover .earth-pin-dot, .earth-pin[aria-pressed="true"] .earth-pin-dot { width: 17px; height: 17px; box-shadow: 0 0 0 7px #1113152e,0 1px 8px #111315aa; }
.earth-pin-label { display: none; position: absolute; top: 44px; padding: 5px 9px; border: 1px solid #11131570; border-radius: 4px; background: #111315ee; color: var(--rw-white); white-space: nowrap; font-size: 12px; }
.earth-pin:hover .earth-pin-label, .earth-pin:focus-visible .earth-pin-label, .earth-pin[aria-pressed="true"] .earth-pin-label { display: block; }
.earth-pin:focus-visible { outline: 2px solid var(--rw-rule); outline-offset: 0; }
.map-outline { min-height: 230px; display: flex; flex-direction: column; justify-content: center; }
.map-outline svg { width: 100%; height: auto; max-height: 290px; }
.route-lines { fill: none; stroke: var(--rw-black); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.route-lines .bridge-underlay { stroke: var(--rw-surface); stroke-width: 9; }
.route-lines .bridge { stroke: var(--rw-black); stroke-width: 3; }
.route-lines .estimated-underlay { stroke: var(--rw-surface); stroke-width: 8; }
.route-lines .estimated-segment { stroke: var(--rw-black); stroke-width: 3; stroke-dasharray: 4 3; }
.route-endpoints { fill: var(--rw-black); stroke: white; stroke-width: 1; }
.map-outline.is-unavailable { min-height: 220px; padding: 28px; }
.map-outline.is-unavailable strong { color: var(--rw-muted); font-size: 17px; font-weight: 500; }
.map-outline.is-unavailable p { font-size: 14px; line-height: 1.7; color: var(--rw-muted); margin-top: 9px; }
.atlas-list { min-width: 0; height: 100%; overflow-y: auto; padding: 92px 32px 45px; margin: 0; background: var(--rw-surface); overscroll-behavior: contain; }
.atlas-list-heading { display: flex; align-items: center; gap: 26px; justify-content: space-between; margin-bottom: 24px; }
.atlas-list-heading h2 { font-size: 27px; letter-spacing: -.6px; }
.atlas-list-heading p { color: var(--rw-muted); font-size: 13px; margin: 7px 0 0; }
.atlas-list-heading .directory-search { max-width: 360px; flex: 1; background: var(--rw-white); }
.atlas-list-options { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--rw-rule); }
.atlas-list-options .collection-chips { margin: 0; gap: 5px; flex-wrap: wrap; }
.atlas-list-options .chip { font-size: 12px; min-height: 35px; padding: 6px 10px; }
.atlas-list-options .select-field { min-width: 160px; }
.atlas-list .results-meta { padding: 15px 0; margin: 0; }
.atlas-result.track-card { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px 8px 0; margin: 0; min-height: 91px; border: 0; border-bottom: 1px solid var(--rw-rule); border-radius: 0; box-shadow: none; background: transparent; }
.atlas-result-select { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex: 1; min-width: 0; min-height: 70px; padding: 12px 14px; text-align: left; border-radius: 4px; }
.atlas-result-select:hover { background: var(--rw-surface); }
.atlas-result-select[aria-pressed="true"] { background: var(--rw-surface); box-shadow: inset 3px 0 var(--rw-black); }
.atlas-result-select > div:first-child { min-width: 0; }
.atlas-result-select strong { display: block; font-size: 16px; color: var(--rw-black); }
.atlas-result-select > div > span { display: block; margin-top: 6px; font-size: 12px; color: var(--rw-muted); }
.atlas-result-measure { text-align: right; flex-shrink: 0; }
.atlas-result-measure .measure { font-size: 15px; font-variant-numeric: tabular-nums; }
.atlas-result-measure > small { display: block; font-size: 12px; color: var(--rw-muted); margin-top: 7px; }
.atlas-result-profile { display: grid; place-items: center; min-height: 44px; padding-inline: .55rem; font-weight: 600; color: var(--rw-black); text-decoration: underline; text-underline-offset: .15em; }
.is-list-view .atlas-toolbar { top: 20px; }
.is-list-view .atlas-view-switch, .is-list-view .atlas-filter-toggle { background: var(--rw-white); border-color: var(--rw-rule); color: var(--rw-black); }
.is-list-view .atlas-view-switch button { color: var(--rw-muted); }
.is-list-view .atlas-view-switch button[aria-pressed="true"] { background: var(--rw-surface); color: var(--rw-black); }
.is-list-view .atlas-result-count { display: none; }
.is-list-view .atlas-toolbar .active-filter { background: var(--rw-surface); border-color: var(--rw-rule); color: var(--rw-black); }
.is-list-view .atlas-toolbar .text-button { color: var(--rw-black); }
@media (max-width: 1050px) {
 .atlas-header { gap: 16px; padding: 0 20px; }
 .header-action > span, .menu-toggle > span:last-child { display: none; }
 .header-action, .menu-toggle { width: 40px; padding: 8px; }
 .atlas-header .global-search-button { min-width: 180px; flex: 1; width: auto; }
 .atlas-list-heading, .atlas-list-options { align-items: start; flex-direction: column; }
 .atlas-list-heading .directory-search { width: 100%; max-width: none; flex: auto; }
 .atlas-toolbar .active-filters { max-width: 23vw; }
}
@media (max-width: 760px) {
 :root { --atlas-header-height: 60px; }
 .atlas-header { padding: 0 16px; gap: 12px; }
 .atlas-brand { font-size: 17px; gap: 8px; }
 .atlas-brand img { width: 25px; height: 25px; }
 .header-actions { gap: 2px; }
 .header-action { display: none; }
 .atlas-header .global-search-button { flex: none; min-width: 0; width: 42px; margin-left: auto; margin-right: 0; padding: 10px; background: transparent; border: 0; }
 .atlas-header .global-search-button > span:not(.icon), .atlas-header .global-search-button kbd { display: none; }
 .atlas-header .unit-toggle { min-width: 59px; font-size: 12px; padding: 5px; }
 .atlas-toolbar { top: 15px; left: 16px; right: 70px; gap: 7px; flex-wrap: wrap; }
 .atlas-view-switch button { padding: 7px 11px; min-height: 34px; font-size: 12px; }
 .atlas-filter-toggle { min-height: 42px; padding: 7px 10px; font-size: 12px; }
 .atlas-result-count { display: none; }
 .atlas-toolbar .active-filters { max-width: calc(100vw - 100px); order: 5; flex-basis: 100%; }
 .earth-stage .maplibregl-ctrl-top-right { top: 7px; right: 8px; }
 .earth-stage .maplibregl-ctrl-group button { width: 35px; height: 35px; }
 .earth-status { left: 20px; bottom: 145px; right: 20px; font-size: 12px; }
 .earth-status[data-state="unavailable"] { top: 153px; max-width: 290px; }
 .atlas-fallback { top: 238px; left: 20px; right: 20px; max-width: 300px; }
 .atlas-fallback h2 { font-size: 21px; }
 .atlas-fallback p { font-size: 13px; }
 .earth-retry { bottom: 143px; left: 20px; }
 .earth-reset { bottom: 143px; right: 20px; }
 .atlas-discovery { left: 20px; right: 20px; bottom: 70px; }
 .atlas-map-meta { left: 20px; right: 20px; gap: 13px; font-size: 12px; }
 .earth-credit { left: 20px; font-size: 12px; }
 .app-menu { right: 12px; top: calc(var(--atlas-header-height) + 6px); }
 .atlas-filters { top: 66px; left: 16px; width: min(340px,calc(100% - 32px)); }
 .map-outline { min-height: 185px; }
 .map-outline svg { max-height: 230px; }
 .atlas-list { padding: 84px 20px 40px; }
 .atlas-list-heading h2 { font-size: 25px; }
 .atlas-list-options .collection-chips { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
 .atlas-list-options .chip { white-space: nowrap; flex-shrink: 0; }
 .atlas-result-select { padding-left: 8px; gap: 14px; }
 .atlas-result-select strong { font-size: 15px; }
 .atlas-result-select > div > span { font-size: 12px; }
 .atlas-result-measure > small { display: none; }
 .atlas-result.track-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .375rem; padding-right: 0; }
 .atlas-result-profile { justify-self: start; grid-column: 1; }
 .is-list-view .atlas-toolbar { top: 15px; }
}
@media (max-height: 700px) and (max-width: 760px) {
 .earth-status[data-state="unavailable"] { top: 88px; }
 .atlas-fallback { top: 175px; }
 .atlas-fallback p { display: none; }
 .atlas-fallback .button { margin-top: 14px; }
}
@media (max-width: 380px) {
 .atlas-header { gap: 6px; padding: 0 12px; }
 .atlas-brand { font-size: 15px; gap: 6px; }
 .atlas-brand img { width: 23px; height: 23px; }
}
@media (max-height: 500px) and (max-width: 760px) {
 .atlas-discovery { display: none; }
 .earth-status[data-state="unavailable"] { top: 76px; }
 .atlas-fallback { top: 150px; }
 .earth-retry { left: auto; right: 20px; bottom: 65px; }
}
@media (prefers-reduced-motion: reduce) { .earth-pin { transition: none; } }
@media print {
 .atlas-header, .app-menu, .atlas-toolbar, .earth-stage { display: none !important; }
 body.is-explorer { overflow: visible; background: white; }
 body.is-explorer .site-frame, body.is-explorer #main, .atlas-page, .atlas-workspace { display: block; height: auto; overflow: visible; }
}
