:root {
  --ink: #17202a;
  --muted: #66717c;
  --paper: #f7f4ee;
  --panel: #ffffff;
  --line: #ddd7cd;
  --summit: #16836d;
  --ski: #16a6c9;
  --marathon: #e45d32;
  --relay: #7d4bb3;
  --nordic: #1779a8;
  --focus: #0b5fff;
  --shadow: 0 16px 50px rgba(28, 35, 42, 0.12);
}
* { box-sizing: border-box; }
html { scroll-behavior:smooth; }
html, body { min-height: 100%; margin: 0; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
a { color: inherit; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(350px, 440px) 1fr; }
.sidebar { position: relative; z-index: 500; background: var(--paper); padding: 30px 26px 22px; overflow-y: auto; border-right: 1px solid var(--line); }
.brand-block { margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.18em; color: var(--summit); }
h1 { margin: 0; font-size: clamp(2.15rem, 4vw, 3.4rem); line-height: 0.98; letter-spacing: -0.045em; }
.lede { margin: 14px 0 0; max-width: 38ch; color: var(--muted); line-height: 1.5; }
.section-nav { display:flex; flex-wrap:wrap; gap:6px; margin-top:18px; }
.section-nav a { text-decoration:none; color:var(--muted); border:1px solid var(--line); background:var(--panel); border-radius:999px; padding:7px 10px; font-size:.74rem; font-weight:700; white-space:nowrap; }
.section-nav a:hover, .section-nav a.is-active { color:#fff; background:var(--ink); border-color:var(--ink); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 20px; }
.stat { min-width:0; padding: 12px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.stat-value { display: block; font-size: 1.4rem; line-height: 1; font-weight: 800; }
.stat-label { display: block; margin-top: 5px; color: var(--muted); font-size: 0.68rem; line-height:1.2; }
.controls { margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.filter-button, .secondary-button, .year-reset { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 8px 11px; cursor: pointer; transition: transform 120ms ease, border-color 120ms ease, background 120ms ease; }
.filter-button:hover, .secondary-button:hover, .year-reset:hover { transform: translateY(-1px); }
.filter-button.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.filter-button:focus-visible, .secondary-button:focus-visible, .year-reset:focus-visible, input:focus-visible, select:focus-visible, .adventure-item:focus-visible, .section-nav a:focus-visible { outline: 3px solid rgba(11, 95, 255, 0.25); outline-offset: 2px; }
.year-controls { display:grid; grid-template-columns:1fr auto 1fr auto; gap:7px; align-items:end; margin:0 0 12px; padding:10px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.5); }
.year-controls label { display:grid; gap:4px; color:var(--muted); font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.year-controls select { width:100%; min-width:0; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--ink); padding:7px 8px; font-size:.76rem; }
.year-arrow { align-self:center; color:var(--muted); font-size:.8rem; }
.year-reset { padding:7px 9px; align-self:end; font-size:.72rem; }
.search-label { display: block; margin: 0 0 6px; font-size: 0.78rem; font-weight: 700; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#searchInput { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 9px 13px; }
.secondary-button { white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 20px; color: var(--muted); font-size: 0.75rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.summit-dot { background: var(--summit); }.marathon-dot { background: var(--marathon); }.relay-dot { background: var(--relay); }.nordic-dot { background: var(--nordic); }
.results-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.results-heading h2 { margin: 0; font-size: 1rem; }.result-count { color: var(--muted); font-size: 0.75rem; }
.adventure-list { display: grid; gap: 8px; }
.adventure-item { width: 100%; display: grid; grid-template-columns: 11px 1fr auto; gap: 10px; align-items: start; border: 1px solid transparent; background: transparent; padding: 10px 8px; border-radius: 12px; color: inherit; text-align: left; cursor: pointer; }
.adventure-item:hover, .adventure-item.is-hovered { background: rgba(255, 255, 255, 0.8); border-color: var(--line); }.adventure-item.is-unmapped { cursor: default; opacity: 0.72; }
.item-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }.item-title { display: block; font-weight: 750; line-height: 1.2; }.item-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }.item-value { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.sidebar-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; line-height: 1.45; }.sidebar-footer p { margin: 5px 0; }
.map-panel { position: sticky; top: 0; height: 100vh; height: 100dvh; min-height: 620px; background: #d9e4df; }
#map { width: 100%; height: 100%; min-height: 1px; }
.map-note { position: absolute; z-index: 600; left: 18px; bottom: 24px; max-width: min(520px, calc(100% - 36px)); padding: 10px 13px; border: 1px solid rgba(255,255,255,0.7); border-radius: 12px; background: rgba(23,32,42,0.88); color: #fff; box-shadow: var(--shadow); backdrop-filter: blur(8px); font-size: 0.8rem; line-height: 1.4; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }.leaflet-popup-content { margin: 14px 16px; min-width: 210px; }.popup-card + .popup-card { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }.popup-kicker { margin: 0 0 3px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.64rem; font-weight: 800; color: var(--muted); }.popup-title { margin: 0; font-size: 1rem; }.popup-meta { margin: 5px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }.popup-alias { margin: 4px 0 0; font-size: 0.75rem; font-style: italic; }.popup-status { display: inline-block; margin-top: 8px; border-radius: 999px; padding: 3px 7px; background: #f0ede7; color: var(--muted); font-size: 0.65rem; font-weight: 700; }.popup-detail{margin:9px 0 0;font-size:.72rem;font-weight:750}.popup-detail a{text-underline-offset:2px}
@media (max-width: 820px) {
  .app-shell { display: block; min-height: auto; }
  .sidebar { overflow: visible; border-right: 0; padding-bottom: 20px; }
  .section-nav { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding-bottom:3px; }
  .section-nav::-webkit-scrollbar { display:none; }
  .section-nav a { flex:0 0 auto; }
  .map-panel { position: relative; top: auto; width: 100%; height: 56vh; height: 56dvh; min-height: 390px; max-height: 560px; margin: 8px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .results-section { max-height: 380px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .leaflet-control-zoom { margin-top: 12px !important; margin-left: 12px !important; }
}
@media (max-width: 520px) {
  .sidebar { padding: 22px 15px 18px; }
  .stats { grid-template-columns:repeat(2,1fr); gap: 6px; }
  .stat { padding: 10px 8px; }
  .year-controls { grid-template-columns:1fr auto 1fr; }
  .year-reset { grid-column:1/-1; justify-self:start; }
  .search-row { grid-template-columns: 1fr; }
  .secondary-button { justify-self: start; }
  .map-panel { height: 52vh; height: 52dvh; min-height: 360px; max-height: 500px; margin-left: -15px; margin-right: -15px; width: calc(100% + 30px); }
  .map-note { display:none; }
}
@media (prefers-reduced-motion: reduce) { html{scroll-behavior:auto}.filter-button,.secondary-button,.year-reset{transition:none}.filter-button:hover,.secondary-button:hover,.year-reset:hover{transform:none} }
