:root[data-theme=dark]{color-scheme:dark;--paper:#17231f;--field:#1c2b26;--ink:#eee9da;--quiet:#b4c0b6;--rule:#465b50;--route:#e8a18b;--overpass:#d9afcb;--river:#536d62;--river-ink:#b3c9bd}
html{background:var(--paper)}
[data-theme=dark] .route-brand{background:var(--paper)}
[data-theme=dark] .route-brand>.route-wordmark{filter:brightness(1.1) grayscale(1) invert(1) sepia(.25);mix-blend-mode:lighten}
[data-theme=dark] .node.active .disc{fill:#e8a18b0a}
[data-theme=dark] .node.current .disc{fill:var(--route)}
[data-theme=dark] .node.current text{fill:var(--paper)}
[data-theme=dark] button.primary{background:#29483b;border-color:#76997e;color:var(--ink)}
[data-theme=dark] button:hover{background:#ffffff0a}
[data-theme=dark] button.primary:hover{background:#355746}
[data-theme=dark] .multiplier-node .disc{fill:#33453b}
[data-theme=dark] .multiplier-node.current .disc{fill:var(--route)}
[data-theme=dark] .connection-return{background:#29483b;color:var(--ink);border:1px solid #76997e}
.header-actions{display:flex;align-items:center;gap:4px;flex:none}
.web-header-actions{text-align:right;min-width:0}.web-header-actions #page-label{font-size:14px}.web-header-actions #day-label{max-width:23ch;font-size:12px;line-height:1.4}
button.theme-toggle,button.theme-toggle[aria-pressed=true]{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:10px;border:0;background:transparent;color:var(--ink)}
.theme-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.theme-sun{display:none}[data-theme=dark] .theme-moon{display:none}[data-theme=dark] .theme-sun{display:block}
dialog.completion-card{color:var(--ink);background:var(--paper);border:1px solid var(--rule);border-top:3px solid var(--route);border-radius:3px;padding:22px;width:calc(100% - 32px);max-width:380px;max-height:calc(100% - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 32px);overflow:auto;box-shadow:0 18px 60px #0003}
.completion-card::backdrop{background:#101b17ad}
.completion-card[open]{animation:record-arrives 180ms ease-out}
.completion-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.completion-reference{color:var(--quiet);font-size:13px;font-variant-numeric:tabular-nums}
.completion-card .completion-close{border:0;width:44px;height:44px;padding:0;margin:-8px -10px -8px 0;font-size:28px}
.completion-card .completion-eyebrow{color:var(--route);font:600 12px var(--sans);letter-spacing:.08em;text-transform:uppercase;margin:25px 0 10px}
.completion-card h2{font:400 30px/1.1 var(--serif);margin:0;max-width:12ch}
.completion-card .completion-distance{font:400 48px/1.1 var(--serif);font-variant-numeric:tabular-nums;margin:22px 0 12px}
#completion-note{color:var(--quiet);font-size:15px;line-height:1.45;min-height:3em;margin:0 0 16px}
.completion-rule{color:var(--quiet);font-size:13px;line-height:1.45;margin:0 0 24px}
.completion-card>.primary,.completion-card>.completion-retry{display:block;width:100%;min-height:46px;margin:10px 0 0}
@keyframes record-arrives{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.completion-card[open]{animation:none}}

/* Optional post-completion tools keep the board itself clear. */
.completion-card .completion-reveal{display:block;min-height:44px;border:0;padding:8px 0;text-align:left;font-size:14px;color:var(--route)}
.completion-card .completion-share{display:block;width:100%;margin-top:6px;min-height:44px}
.completion-maximum{line-height:1.45;border-left:2px solid var(--route);padding-left:12px}
.score-bands{list-style:none;margin:12px 0;padding:0}.score-bands li{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;border-bottom:1px solid var(--rule);padding:12px 0;font-size:14px}.score-bands strong{text-align:right}.score-bands li>span:last-child{color:var(--quiet);font-size:12px}.your-standing{color:var(--route);font-weight:600}.recent-form{margin-top:28px;border-top:1px solid var(--rule);padding-top:12px}.recent-form h2{font:400 28px var(--serif)}.recent-average{font:400 38px var(--serif)}
.leaderboard-switch{display:flex;border:1px solid var(--rule);border-radius:3px;overflow:hidden;flex:none}.leaderboard-switch button{min-height:44px;min-width:62px;border:0;border-radius:0;padding:9px 12px;font-size:14px;color:var(--quiet);background:transparent}.leaderboard-switch button+button{border-left:1px solid var(--rule)}.leaderboard-switch button[aria-pressed=true]{color:var(--paper);background:var(--ink);font-weight:600}.form-ranking{list-style:none;padding:0;margin:12px 0}.form-ranking li{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid var(--rule);font-size:15px}.form-ranking small{display:block;color:var(--quiet);font-size:12px;margin-top:3px}.form-ranking li>span:nth-child(2){overflow-wrap:anywhere}.form-policy{margin:20px 0;font-size:14px}.form-policy p{line-height:1.5}


@media(max-height:740px){
 dialog.completion-card{padding:16px}.completion-card .completion-eyebrow{margin:10px 0 5px}.completion-card h2{font-size:27px}.completion-card .completion-distance{font-size:40px;margin:12px 0 8px}.completion-card #completion-note{font-size:14px;min-height:0;margin-bottom:8px}.completion-card .completion-rule{font-size:12px;margin-bottom:8px}.completion-card>.primary,.completion-card>.completion-retry{min-height:44px;margin-top:6px}
}

.wordmark .brand-home{display:flex;align-items:center;min-height:44px;padding:0;border:0;background:transparent}

/* Keep website list rules from overriding the shared leaderboard layouts. */
#leaderboard .score-bands li,#leaderboard .form-ranking li{display:grid}.social-panel .leaderboard-switch{width:max-content;margin-bottom:12px}.social-panel .leaderboard-switch button{margin:0}

.completion-share-message:empty{display:none}
.completion-share-message{font-size:13px;line-height:1.4;color:var(--quiet);margin:8px 0}
.studio-credit{display:flex;align-items:center;justify-content:center;gap:6px;border-top:1px solid var(--rule);margin-top:18px;padding-top:10px;color:var(--quiet);font-size:12px}
.studio-credit a{display:flex;align-items:center;min-height:44px;padding:0 4px}
.studio-credit img{display:block;width:96px;height:auto}
[data-theme=dark] .studio-credit img{filter:grayscale(1) invert(1);opacity:.85}

/* One complete route preview, one share action. The image is the attachment. */
dialog.share-card{color:var(--ink);background:var(--paper);border:1px solid var(--rule);border-top:3px solid var(--route);border-radius:3px;padding:18px;width:calc(100% - 28px);max-width:420px;max-height:calc(100% - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 28px);overflow:auto}
.share-card::backdrop{background:#101b17ad}.share-card h2{font:400 28px/1.1 var(--serif);margin:0}.share-card .share-close{border:0;width:44px;height:44px;padding:0;margin:-8px -8px -8px 0;font-size:28px}
.share-caption{font-size:13px;line-height:1.4;color:var(--quiet);margin:12px 0}.share-preview{display:block;width:100%;height:auto;border:1px solid var(--rule)}
.share-card .share-send{display:block;width:100%;min-height:44px;margin-top:14px}.share-card .share-reveal{display:block;border:0;padding:8px 0;min-height:44px;font-size:14px;color:var(--route);text-align:left;margin-top:6px}
.share-maximum,.share-message{font-size:13px;line-height:1.45;color:var(--quiet);margin:8px 0 0}.share-message:empty{display:none}
@media(max-height:740px){dialog.share-card{padding:14px}.share-preview{width:auto;max-width:100%;height:auto;max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 224px);margin:auto}.share-card .share-send{margin-top:10px}}
