/* Course guide pages (generated by tool/build_race_pages.py — edit the
   RACES_CSS string there, not this file). Tokens, .wrap, .btn, .brand,
   .section-label, .section-title and the header/footer come from styles.css. */
.guide .crumbs { font-size: 13px; color: var(--text-lo); margin: 18px 0 0; }
.guide .crumbs ol { margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; list-style: none; }
.guide .crumbs a { color: var(--text-lo); }
.guide .crumbs a:hover { color: var(--pine); }
.guide .crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--divider); }

.ghero { padding: 28px 0 10px; }
.ghero h1 { font-size: clamp(34px, 5.4vw, 54px); line-height: 1.04; letter-spacing: -1.4px; font-weight: 800; margin: 12px 0 12px; color: var(--text-hi); text-wrap: balance; }
.ghero .lede { font-size: 19px; color: var(--text-lo); max-width: 40em; margin: 0 0 10px; }
.ghero .indep { font-size: 13.5px; color: var(--text-lo); max-width: 52em; margin: 0 0 22px; padding-left: 12px; border-left: 3px solid var(--sage); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 10px; margin: 0 0 22px; }
@media (max-width: 520px) { .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.stat { background: var(--surface); border: 1px solid var(--divider); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1; color: var(--text-hi); }
.stat span { display: block; font-size: 12px; font-weight: 600; color: var(--text-lo); margin-top: 3px; }
.stat b small { font-size: 14px; font-weight: 700; letter-spacing: 0; margin-left: 2px; color: var(--text-lo); }
.ctas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 8px; }
.ctas .hint { font-size: 13px; color: var(--text-lo); }

.profile-card { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 10px; margin: 18px 0 0; }
.profile-card h2 { margin: 0 0 2px; font-size: 18px; letter-spacing: -0.3px; }
.profile-card .sub { margin: 0 0 10px; font-size: 13.5px; color: var(--text-lo); }
.profile-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-hint { display: none; font-size: 12px; color: var(--text-lo); margin: 4px 0 0; }
@media (max-width: 760px) { .scroll-hint { display: block; } }
.course-svg { display: block; width: 100%; min-width: 720px; height: auto; }
.course-svg .grid { stroke: var(--divider); stroke-width: 1; }
.course-svg .legtick { stroke: var(--divider); stroke-width: 1; stroke-dasharray: 2 4; }
.course-svg .ylab { font: 600 11px/1 'Manrope', sans-serif; fill: var(--text-lo); }
.course-svg .legnum { font: 700 11px/1 'Manrope', sans-serif; fill: var(--text-lo); }
.course-svg a:hover .legnum { fill: var(--coral); }
.course-svg .area { fill: var(--pine); fill-opacity: 0.14; }
.course-svg .line { fill: none; stroke: var(--pine); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.course-svg .van circle { fill: var(--coral); fill-opacity: 0.25; }
.course-svg .van .van-core { fill: var(--coral); fill-opacity: 1; }
.course-svg .end { fill: var(--surface); stroke: var(--pine); stroke-width: 2; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-lo); margin: 8px 0 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.legend .l-van { background: var(--coral); }
.legend .l-line { background: var(--pine); }

.jump { position: sticky; top: 66px; z-index: 5; background: color-mix(in srgb, var(--fog) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--divider); margin: 20px 0 0; }
.jump .row { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.jump .row::-webkit-scrollbar { display: none; }
.jump .lbl { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-lo); align-self: center; margin-right: 6px; white-space: nowrap; }
.jump a { flex: none; min-width: 34px; text-align: center; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--divider); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text-hi); text-decoration: none; }
.jump a:hover { border-color: var(--pine); color: var(--pine); }
.jump a.van2 { border-style: dashed; }

.gsec { padding: 34px 0 6px; }

.hl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .hl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hl .v { font-size: 19px; } }
@media (max-width: 340px) { .hl { grid-template-columns: 1fr; } }
.hl a { display: block; background: var(--surface); border: 1px solid var(--divider); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: inherit; }
.hl a:hover { border-color: var(--pine); text-decoration: none; }
.hl .k { font-size: 12px; font-weight: 700; color: var(--text-lo); }
.hl .v { font-size: 22px; font-weight: 800; letter-spacing: -0.6px; margin: 2px 0 0; }
.hl .w { font-size: 13px; color: var(--text-lo); }
.vans { margin: 14px 0 0; font-size: 14px; color: var(--text-lo); }

.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); }
table.legs { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
table.legs th, table.legs td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--divider); white-space: nowrap; }
table.legs th { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-lo); position: sticky; top: 0; background: var(--surface); }
table.legs th:first-child, table.legs td:first-child, table.legs th.l, table.legs td.l { text-align: left; }
table.legs tr:last-child td { border-bottom: 0; }
table.legs td.num a { font-weight: 800; color: var(--text-hi); text-decoration: none; }
table.legs td.num a:hover { color: var(--coral); }
table.legs td.pos { color: var(--amber); }
table.legs td.neg { color: var(--slate); }
table.legs td.sp { width: 130px; padding-top: 4px; padding-bottom: 4px; }
.spark { width: 120px; height: 28px; display: block; }
.spark .area { fill: var(--pine); fill-opacity: 0.16; }
.spark .line { fill: none; stroke: var(--pine); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); color: var(--text-hi); }
.tag.Downhill { background: color-mix(in srgb, var(--slate) 18%, transparent); }
.tag.Hilly, .tag.Steep { background: color-mix(in srgb, var(--coral) 18%, transparent); }
.tag.Flat { background: color-mix(in srgb, var(--sage) 60%, transparent); }
.van-row td:first-child { border-left: 3px solid var(--coral); }

.legcards { display: grid; gap: 16px; }
.legcard { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius); padding: 18px 20px 16px; scroll-margin-top: 130px; }
.legcard .top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.legcard h2 { margin: 0; font-size: 26px; letter-spacing: -0.8px; font-weight: 800; }
.legcard h2 .mi { font-size: 18px; color: var(--text-lo); font-weight: 700; letter-spacing: -0.3px; margin-left: 6px; }
.legcard .meta { font-size: 13.5px; color: var(--text-lo); margin: 4px 0 12px; }
.legcard .meta b { color: var(--text-hi); font-weight: 700; }
.legcard .body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.legcard .body.nomap { grid-template-columns: 1fr; }
@media (max-width: 760px) { .legcard .body { grid-template-columns: 1fr; } }
.leg-svg { display: block; width: 100%; height: 96px; }
.leg-svg .area { fill: var(--pine); fill-opacity: 0.14; }
.leg-svg .line { fill: none; stroke: var(--pine); stroke-width: 2; vector-effect: non-scaling-stroke; }
.leg-svg .end { fill: var(--surface); stroke: var(--pine); stroke-width: 2; }
.leg-svg .end.fin { fill: var(--coral); stroke: var(--coral); }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-lo); margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 0; }
.facts div { background: var(--surface-alt); border-radius: 12px; padding: 8px 10px; }
.facts b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.4px; }
.facts span { font-size: 11.5px; color: var(--text-lo); font-weight: 600; }
.facts .pos b { color: var(--amber); }
.facts .neg b { color: var(--slate); }
.legmap { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--divider); background: var(--surface-alt); aspect-ratio: 1280 / 768; }
.legmap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exch { font-size: 13px; color: var(--text-lo); margin-top: 8px; }
.exch a { color: var(--coral); font-weight: 700; text-decoration: none; }
.exch a:hover { text-decoration: underline; }

.gcta { margin: 40px 0 0; background: var(--pine); color: var(--ink-on-accent); border-radius: var(--radius-lg); padding: 34px 28px; text-align: center; }
.gcta h2 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.8px; color: inherit; }
.gcta p { margin: 0 auto 18px; max-width: 38em; color: color-mix(in srgb, var(--ink-on-accent) 84%, transparent); }
.gcta .btn-ghost2 { background: transparent; color: var(--ink-on-accent); border: 1.5px solid color-mix(in srgb, var(--ink-on-accent) 50%, transparent); }
.gcta .btn-ghost2:hover { border-color: var(--ink-on-accent); text-decoration: none; }

.more { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.more a, .gcards a { display: block; background: var(--surface); border: 1px solid var(--divider); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: inherit; }
.more a:hover, .gcards a:hover { border-color: var(--pine); text-decoration: none; }
.more b, .gcards b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.more span, .gcards span { font-size: 13px; color: var(--text-lo); }
.foot-notes { font-size: 13px; color: var(--text-lo); max-width: 66em; margin: 28px 0 0; }
.foot-notes p { margin: 0 0 8px; }

/* /races/ index */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 8px; }
.gcards a { padding: 18px 18px 14px; }
.gcards b { font-size: 20px; letter-spacing: -0.5px; }
.gcards .loc { display: block; margin: 2px 0 10px; }
.gcards .mini { display: block; width: 100%; height: 64px; }
.gcards .mini .area { fill: var(--pine); fill-opacity: 0.14; }
.gcards .mini .line { fill: none; stroke: var(--pine); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.gcards .nums { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--text-lo); }
.gcards .nums b { display: inline; font-size: 14px; color: var(--text-hi); letter-spacing: 0; }
.gcards .go { display: block; margin-top: 12px; font-weight: 800; color: var(--coral); font-size: 14px; }
