/* The trail pages (tools/build_trails.py writes them): the app's colours, light and dark */
:root{--bg:#eef2f3;--card:#fff;--ink:#14262e;--mute:#4f6168;--line:#cdd8db;--link:#0b6e8f;--warn:#b35c00;--fill:#cdd8db;color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#0e1a1f;--card:#16262d;--ink:#e6eef0;--mute:#94a8ae;--line:#2a3f47;--link:#6cc5e3;--warn:#ffa94d;--fill:#2a3f47;color-scheme:dark}}
:root[data-theme="dark"]{--bg:#0e1a1f;--card:#16262d;--ink:#e6eef0;--mute:#94a8ae;--line:#2a3f47;--link:#6cc5e3;--warn:#ffa94d;--fill:#2a3f47;color-scheme:dark}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
a{color:var(--link);text-underline-offset:2px}
.bar{display:flex;align-items:center;gap:10px;padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));background:var(--card);border-bottom:1px solid var(--line)}
.bar .home{display:flex;align-items:center;gap:8px;color:var(--ink);text-decoration:none;font-size:20px}
.bar img{border-radius:7px;display:block}
.bar span{margin-left:auto;color:var(--mute);font-size:14px}
main{max-width:760px;margin:0 auto;padding:16px max(16px,env(safe-area-inset-right)) 32px max(16px,env(safe-area-inset-left))}
.crumb{font-size:14px;color:var(--mute)}
h1{font-size:30px;line-height:1.15;margin:4px 0 6px}
h2{font-size:21px;margin:26px 0 8px}
.also{margin:-2px 0 6px;color:var(--mute)}
.lead{margin:0 0 14px;font-size:17px;max-width:65ch}
.small{font-size:14px}.mute{color:var(--mute)}
.facts{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:0 0 16px}
.facts div{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.facts b{display:block;font-size:19px;white-space:nowrap}.facts small{color:var(--mute);font-size:13px}
.go{display:flex;gap:8px 16px;flex-wrap:wrap;align-items:center;margin:0 0 6px}
.go a:not(.btn){font-weight:600}
.btn{display:inline-block;background:var(--ink);color:var(--bg)!important;text-decoration:none;font-weight:700;padding:12px 18px;border-radius:10px;font-size:17px}
.map{height:380px;border-radius:12px;border:1px solid var(--line);margin:14px 0 0;background:var(--card);z-index:0}
.map .stop{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#14262e;color:#fff;border:2px solid #fff;font:700 11px/1 system-ui,sans-serif;box-shadow:0 1px 3px #0006}
.prof{display:block;width:100%;height:auto;margin:4px 0 0}
.prof .fill{fill:var(--fill)}.prof .ln{fill:none;stroke:var(--ink);stroke-width:1.6}
.prof .end{stroke:var(--mute);stroke-width:1;stroke-dasharray:3 3}
.prof text{fill:var(--mute);font:12px system-ui,sans-serif}.prof .dn{text-anchor:middle;font-weight:700;fill:var(--ink)}
ol.stages{list-style:none;padding:0;margin:0;background:var(--card);border:1px solid var(--line);border-radius:12px}
ol.stages li{padding:9px 12px;border-top:1px solid var(--line);display:grid;grid-template-columns:62px minmax(0,1fr) auto;gap:2px 8px;align-items:baseline}
ol.stages li:first-child{border-top:0}
ol.stages .d{font-weight:700;color:var(--mute);font-size:14px}
ol.stages .d .n{white-space:nowrap}   /* "Days 15–18", a stretch with no bed on the trail, on two lines */
ol.stages .t{font-weight:700;white-space:nowrap}
ol.stages .s{grid-column:2/4;color:var(--mute);font-size:14px}
/* the kind goes to the next line whole, and wraps itself only where it is wider than the column; a long name breaks
   anywhere: "Refugio de montaña PNRC" and "Steinbu,markvatnet,krystad" ran off a 320 px phone (IMPROVEMENTS.md 218) */
ol.stages .nm{overflow-wrap:anywhere}
ol.stages .k{display:inline-block;max-width:100%;color:var(--mute);font-size:13px;margin-left:4px}
/* who runs the hut, as the app's tag under its marker (DNT, AV, SAC…) */
ol.stages .club{display:inline-block;margin-left:5px;padding:0 4px;border-radius:3px;background:#c8202f;color:#fff;font:700 11px/16px system-ui,sans-serif;text-decoration:none;vertical-align:1px;cursor:help}
.long{display:block;color:var(--warn);font-weight:600}.gap{display:block}
main ul{padding-left:20px}main li{margin:4px 0}
.more{display:flex;flex-wrap:wrap;gap:8px}
.more a{background:var(--card);border:1px solid var(--line);border-radius:999px;padding:5px 12px;text-decoration:none;font-weight:600;font-size:14px}
.tlist{list-style:none;padding:0}.tlist li{margin:6px 0}.tlist a{font-weight:600}.tlist .mute{font-size:14px;white-space:nowrap}
/* a list page with a map (the ski treks, the owner's choice from pictures, 1 Dec 2026): the country's official site under
   its heading, and a map icon at the end of each row that shows the trek on the map at the top */
.official{margin:-4px 0 4px}.map.over{margin:14px 0 10px}
.tlist.ml li{display:flex;align-items:flex-start;gap:10px}.tlist.ml li>div{flex:1;min-width:0}
.tlist .mi{flex:none;display:grid;place-items:center;width:40px;height:40px;margin:-8px -8px -8px 0;border-radius:8px;color:var(--link)}
.tlist .mi:focus-visible{outline:2px solid var(--link)}.tlist .mi svg{width:22px;height:22px}
/* on a laptop the map beside the list, in view while the list scrolls (the owner's choice from pictures, 1 Dec 2026:
   the list 560 px wide, the map the rest of the screen; each half was tried first) */
@media (min-width:1000px){main.withmap{max-width:none;display:grid;grid-template-columns:minmax(0,560px) minmax(0,1fr);column-gap:32px;align-items:start}
main.withmap>*{grid-column:1}main.withmap>.map.over{grid-column:2;grid-row:1/span 200;position:sticky;top:16px;height:calc(100vh - 100px);min-height:360px;margin:16px 0 0}
main.withmap>.tlist{margin:0}main.withmap>h2{margin-top:22px}}
footer{max-width:760px;margin:0 auto;padding:16px max(16px,env(safe-area-inset-right)) 32px max(16px,env(safe-area-inset-left));border-top:1px solid var(--line);font-size:13px;color:var(--mute)}
footer .src{font-size:12px}   /* the heights' sources, as they ask to be named (IMPROVEMENTS.md 125) */
@media (max-width:560px){.facts{grid-template-columns:repeat(2,1fr)}h1{font-size:26px}.btn{width:100%;text-align:center}.map{height:300px}.bar span{display:none}}
