.course-map{--route:#e6f396;--route-ink:#142d28;margin:8px 0 40px}
.course-map[data-base=trails],.course-map[data-base=clean]{--route:#1d5846;--route-ink:#fff}
.cm-stats{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 14px}
.cm-stats div{background:#f5f6f3;border:1px solid var(--line);padding:10px 16px;min-width:120px}
.cm-stats dt{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.cm-stats dd{margin:2px 0 0;font-size:22px;font-weight:bold;color:var(--ink)}
.cm-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;background:var(--ink);border-radius:10px 10px 0 0}
.cm-bar [role=group]{display:flex;gap:4px;flex-wrap:wrap}
.cm-bar button{border:1px solid #ffffff33;background:transparent;color:#fff;padding:7px 12px;font-size:12px;border-radius:6px;cursor:pointer;font-family:inherit}
.cm-bar button[aria-pressed=true]{background:var(--accent);color:var(--ink);border-color:var(--accent);font-weight:bold}
.cm-bar [data-play]{background:var(--accent);color:var(--ink);border-color:var(--accent);font-weight:bold}
.cm-map{height:min(620px,70vh);min-height:380px;background:#1b2a26;border-left:1px solid var(--line);border-right:1px solid var(--line)}
.cm-panel{border:1px solid var(--line);border-top:0;border-radius:0 0 10px 10px;padding:14px 16px 8px;background:#fff}
.cm-panel-head{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted)}
.cm-panel-head strong{color:var(--ink);font-size:13px}
.cm-readout{font-variant-numeric:tabular-nums;color:var(--ink);font-weight:bold}
.cm-profile{display:block;width:100%;height:auto;color:var(--green);touch-action:none;cursor:crosshair}
.cm-grid line{stroke:#e4e9e5}.cm-grid text,.cm-ticks text{font-size:12px;fill:var(--muted)}
.cm-line{fill:none;stroke:var(--green);stroke-width:2.5}
.cm-hill line{stroke:#9aa9a2;stroke-dasharray:3 3}.cm-hill text{font-size:12px;font-weight:bold;fill:var(--ink)}
.cm-cursor line{stroke:var(--ink);stroke-width:1}.cm-cursor circle{fill:var(--accent);stroke:var(--ink);stroke-width:2}
.cm-note{font-size:12px;color:var(--muted);margin:10px 0 0;line-height:1.5}
.cm-failed .cm-map::after{content:'The course map could not be loaded.';display:block;padding:40px;color:#fff}
/* Route layers */
.cm-casing{stroke:var(--route-ink);stroke-opacity:.55;fill:none;stroke-linecap:round;stroke-linejoin:round}
.cm-route{stroke:var(--route);fill:none;stroke-linecap:round;stroke-linejoin:round}
.cm-flow{stroke:var(--route-ink);fill:none;stroke-linecap:round;animation:cm-flow 1.4s linear infinite}
@keyframes cm-flow{to{stroke-dashoffset:-16}}
@media (prefers-reduced-motion:reduce){.cm-flow{animation:none}}
.cm-runner{fill:#ff6a3d;fill-opacity:1;stroke:#fff;stroke-width:3}
/* Pins: Leaflet positions .cm-pin (0x0 at the point); the visible pin is the span inside it. */
.cm-pin{position:relative}
.cm-pin>span{position:absolute;left:0;top:0;white-space:nowrap;font:bold 11px/1 Arial,Helvetica,sans-serif;transform:translate(-50%,-50%)}
.cm-start,.cm-finish{padding:6px 9px;border-radius:999px;border:2px solid #fff;box-shadow:0 2px 6px #0006;color:#fff}
.cm-start{background:#1d5846}
.cm-finish{color:#142d28;background:#fff;border-color:#142d28!important}
.cm-pin>.cm-mile{width:22px;height:22px;border-radius:50%;background:#142d28;color:var(--accent);display:grid;place-items:center;border:2px solid var(--accent);box-shadow:0 2px 6px #0006}
.cm-pin>.cm-landmark{padding:5px 8px;border-radius:6px;background:#fffffff0;color:#142d28;box-shadow:0 2px 6px #0005;transform:translate(-50%,calc(-100% - 16px))}
.cm-landmark::after{content:'';position:absolute;left:50%;bottom:-5px;margin-left:-5px;border:5px solid transparent;border-bottom:0;border-top-color:#fffffff0}
.leaflet-container{font-family:inherit}
@media(max-width:700px){.cm-stats dd{font-size:18px}.cm-stats div{min-width:0;flex:1}.cm-map{height:460px}.cm-bar button{padding:7px 9px}}
.cm-laps{background:#f5f6f3;border-left:4px solid var(--green);padding:14px 18px;margin:0 0 24px}.cm-laps h2{font-size:17px;margin:0 0 6px}.cm-laps p{margin:0;font-size:14px}
/* Course sheet viewer */
.sheet{margin:0 0 28px}
.sheet-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;background:var(--ink);border-radius:10px 10px 0 0}
.sheet-bar [role=group],.sheet-bar>div{display:flex;gap:4px;align-items:center}
.sheet-bar button,.sheet-bar a{border:1px solid #ffffff33;background:transparent;color:#fff;padding:7px 12px;font-size:12px;border-radius:6px;cursor:pointer;font-family:inherit;text-decoration:none}
.sheet-bar button[aria-pressed=true]{background:var(--accent);color:var(--ink);border-color:var(--accent);font-weight:bold}
.sheet-viewport{border:1px solid var(--line);border-top:0;border-radius:0 0 10px 10px;overflow:auto;max-height:min(760px,80vh);background:#f4f4ef}
.sheet-viewport img{display:block;width:100%;height:auto;margin:0 auto;user-select:none;-webkit-user-drag:none}
.sheet-viewport.zoomed{cursor:grab}.sheet-viewport.zoomed:active{cursor:grabbing}
.sheet figcaption{font-size:12px;color:var(--muted);margin-top:8px;line-height:1.5}
.sheet h3{font-size:16px;margin:0 0 10px}
.card.has-thumb{padding-top:0;overflow:hidden}.card .card-thumb{display:block;width:calc(100% + 48px);max-width:none;aspect-ratio:16/10;object-fit:cover;margin:0 -24px 16px;border-bottom:1px solid var(--line);background:#f4f4ef}
/* Course insights: facts, mile by mile, climbs, meets, method */
.ci{margin:8px 0 40px}
.ci-section{margin:0 0 36px}
.ci-section h2,.ci-method h2{font-size:22px;margin:0 0 14px}
.ci-lead{font-size:15px;line-height:1.55;margin:0 0 14px;max-width:70ch}
.ci-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;margin:0;background:#fff}
.ci-facts div{padding:14px 16px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.ci-facts div:nth-child(3n){border-right:0}
.ci-facts div:nth-last-child(-n+3){border-bottom:0}
.ci-facts dt{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.ci-facts dd{margin:4px 0 0;font-size:15px;font-weight:bold;color:var(--ink)}
.ci-facts dd a{color:inherit}
.ci-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px}
.ci-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:#fff}
.ci-table{width:100%;border-collapse:collapse;font-size:14px}
.ci-table th,.ci-table td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
.ci-table tbody tr:last-child th,.ci-table tbody tr:last-child td{border-bottom:0}
.ci-table thead th{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);background:#f5f6f3;font-weight:bold}
.ci-table tbody th{font-weight:bold;color:var(--ink);white-space:nowrap}
.ci-table tbody th small{display:block;font-weight:normal;color:var(--muted);font-size:11px;margin-top:2px}
.ci-feel{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:bold;background:#eef2ee;color:var(--green)}
.ci-hilly{background:#1d5846;color:#fff}.ci-rolling{background:#e6f396;color:#142d28}
.ci-note{font-size:12px;color:var(--muted);margin:8px 0 0}
.ci-meets{list-style:none;padding:0;margin:0 0 10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
.ci-meets li a{display:flex;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:14px}
.ci-meets li a span{color:var(--muted);font-variant-numeric:tabular-nums;min-width:38px}
.ci-meets li a:hover{color:var(--green)}
.ci-section details summary{cursor:pointer;font-size:13px;color:var(--green);margin:6px 0 10px;font-weight:bold}
.ci-method{background:#f5f6f3;border-left:4px solid var(--green);padding:18px 22px;border-radius:0 10px 10px 0}
.ci-method ul{margin:0;padding-left:18px;font-size:13px;line-height:1.6;color:#33463f}
.ci-method li{margin:0 0 6px}
@media(max-width:900px){.ci-grid{grid-template-columns:1fr}.ci-facts{grid-template-columns:1fr 1fr}.ci-facts div:nth-child(3n){border-right:1px solid var(--line)}.ci-facts div:nth-child(2n){border-right:0}.ci-facts div:nth-last-child(-n+3){border-bottom:1px solid var(--line)}.ci-facts div:nth-last-child(-n+2){border-bottom:0}}
@media(max-width:560px){.ci-facts{grid-template-columns:1fr}.ci-facts div{border-right:0!important;border-bottom:1px solid var(--line)!important}.ci-facts div:last-child{border-bottom:0!important}.ci-meets{grid-template-columns:1fr}}
.ci-table tbody th{text-transform:none;letter-spacing:0;font-size:14px}
.ci-table td{white-space:nowrap}.ci-table td:last-child{white-space:normal}
/* Course index */
.cx-intro{font-size:16px;line-height:1.6;max-width:72ch;margin:0 0 20px}
.cx-stats{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 22px}
.cx-stats div{background:#f5f6f3;border:1px solid var(--line);padding:10px 16px;border-radius:8px}
.cx-stats b{display:block;font-size:22px;color:var(--ink)}.cx-stats span{font-size:12px;color:var(--muted)}
.cx-map{height:min(440px,60vh);border:1px solid var(--line);border-radius:10px;margin:0 0 36px;background:#e9ece6}
.cx-venue{margin:0 0 40px}
.cx-venue-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;border-bottom:2px solid var(--ink);padding-bottom:8px;margin-bottom:16px}
.cx-venue-head h2{margin:0;font-size:24px}.cx-venue-head p{margin:0;color:var(--muted);font-size:13px}
.cx-pop a{display:block;color:var(--green);font-weight:bold;margin-top:4px}.cx-pop strong{font-size:14px}
.ci-uphill{background:#1d5846;color:#fff}.ci-downhill{background:#dfe9f1;color:#1f4a66}
.ci-grid{grid-template-columns:1fr}
.ci-seq{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 0}
.ci-seq li{display:inline-flex;align-items:baseline;gap:6px;white-space:nowrap}
.ci-seq li+li::before{content:'→';color:var(--muted);margin:0 10px 0 10px}
.ci-seq li span{color:var(--muted);font-size:12px}
.ci-table td:last-child{width:55%}
/* Course explorer */
.cx-explorer{display:grid;grid-template-columns:330px minmax(0,1fr);height:min(640px,78vh);border:1px solid var(--line);border-radius:12px;overflow:hidden;margin:0 0 44px;background:#fff;box-shadow:0 6px 24px #142d2814}
.cx-side{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line);background:#fbfbf8}
.cx-search{padding:12px;border-bottom:1px solid var(--line)}
.cx-search input{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font:inherit;font-size:14px;background:#fff}
.cx-list{overflow-y:auto;flex:1;padding:6px 0}
.cx-group{padding:4px 0 8px}
.cx-venue-btn{display:block;width:100%;text-align:left;background:none;border:0;padding:10px 16px 4px;cursor:pointer;font:inherit}
.cx-venue-btn span{display:block;font-weight:bold;font-size:14px;color:var(--ink)}
.cx-venue-btn small{color:var(--muted);font-size:11px}
.cx-venue-btn.is-active span{color:var(--green)}
.cx-group ul{list-style:none;margin:0;padding:0}
.cx-course{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;text-align:left;background:none;border:0;padding:7px 16px;cursor:pointer;font:inherit;font-size:13px;color:var(--ink)}
.cx-course:hover{background:#eef2ec}
.cx-course.is-active{background:var(--ink);color:#fff}.cx-course.is-active .cx-dist{color:#cfe0c8}
.cx-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cx-dist{font-size:11px;color:var(--muted);white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis}
.cx-dot{width:8px;height:8px;border-radius:50%;border:1.5px solid #9aa9a2}
.cx-dot.is-live{background:var(--accent);border-color:var(--green)}
.cx-stage{position:relative;min-height:0}
.cx-stage .cx-map{height:100%;border:0;border-radius:0;margin:0}
.cx-pin{display:grid;place-items:center;min-width:28px;height:28px;padding:0 6px;border-radius:999px;background:var(--ink);color:var(--accent);font:bold 12px/1 Arial,sans-serif;border:2px solid var(--accent);box-shadow:0 2px 8px #0007;transform:translate(-50%,-50%);transition:transform .15s}
.cm-pin.is-hover .cx-pin{transform:translate(-50%,-50%) scale(1.25);background:var(--accent);color:var(--ink)}
.cx-card{position:absolute;left:14px;bottom:14px;z-index:500;width:min(300px,calc(100% - 28px));background:#fff;border-radius:10px;box-shadow:0 8px 28px #0005;padding:16px 18px}
.cx-card h3{margin:0 0 10px;font-size:18px}
.cx-kicker{margin:0 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.cx-card dl{display:flex;gap:18px;margin:0 0 12px}.cx-card dt{font-size:11px;color:var(--muted)}.cx-card dd{margin:2px 0 0;font-weight:bold;font-size:16px}
.cx-card ul{list-style:none;margin:0 0 4px;padding:0;max-height:220px;overflow:auto}
.cx-card li{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-bottom:1px solid var(--line);font-size:13px}.cx-card li span{color:var(--muted);font-size:11px;white-space:nowrap}
.cx-card img{width:100%;border-radius:6px;margin:0 0 8px;border:1px solid var(--line)}
.cx-muted{color:var(--muted);font-size:13px;margin:0 0 10px}
.cx-open{display:inline-block;background:var(--ink);color:var(--accent);padding:9px 14px;border-radius:8px;font-weight:bold;font-size:13px;text-decoration:none}
.cx-close{position:absolute;top:8px;right:10px;border:0;background:none;font-size:22px;line-height:1;cursor:pointer;color:var(--muted)}
@media(max-width:820px){.cx-explorer{grid-template-columns:1fr;grid-template-rows:380px auto;height:auto}.cx-stage{grid-row:1}.cx-side{grid-row:2;border-right:0;border-top:1px solid var(--line);max-height:420px}}
/* Mobile fit for the course pages */
.ci-grid,.course-layout{grid-template-columns:minmax(0,1fr)}
@media(min-width:851px){.course-layout{grid-template-columns:minmax(0,3fr) minmax(230px,1fr)}}
.ci-table-wrap:has(table.stacked){border:0;background:none;overflow:visible}
@media(max-width:700px){.ci-table td,.ci-seq li{white-space:normal}.ci-seq li+li::before{margin:0 6px}.cm-panel{padding:12px 10px 6px}}
/* #thumb: the map alone, filling the window, for card thumbnails */
html.cm-thumb,html.cm-thumb body{background:#fff;overflow:hidden}html.cm-thumb body{visibility:hidden}
html.cm-thumb .cm-map{visibility:visible;position:fixed!important;top:0;left:0;width:960px!important;height:600px!important;margin:0;border:0;border-radius:0;z-index:9999}
html.cm-thumb .leaflet-control-container{display:none}
.cm-address a{color:var(--green);font-weight:600;text-decoration:none}.cm-address a:hover{text-decoration:underline}
.cm-address small{display:block;margin-top:3px;color:var(--muted);font-size:12.5px;line-height:1.4}
.page-top .cm-address-line{margin:10px 0 0;font-size:16px;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.page-top .cm-address-line::before{content:'';width:14px;height:14px;align-self:center;background:var(--green);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat}
.page-top .cm-address-line small{display:inline;margin:0;font-size:13px}
/* Course header: title, course line and address read as one block */
.page-top:has(.cm-address-line) h1{margin-bottom:8px}
.page-top:has(.cm-address-line) h1+p{margin:0}
.page-top .cm-address-line{margin-top:6px}
.page-top .cm-address-line{margin-bottom:14px}
.page-top:has(.cm-address-line) h1{margin-bottom:6px}
.page-top .cm-address-line{margin-top:0}
