/* ============ Cairn — 3D viewer design system ============ */
:root {
  --pine-950: #0b231766;
  --pine-900: #0e2a1d;
  --pine-800: #143626;
  --pine-700: #1c4631;
  --pine-500: #2f6b4f;
  --pine-300: #74c69d;
  --pine-100: #d9efe2;
  --cream: #f4f1ea;
  --paper: #fdfcf9;
  --ink: #16241d;
  --muted: #62756b;
  --line: #e6e3da;
  --amber: #b97a06;
  --amber-bg: #fcf1d9;
  --red: #b13a2a;
  --red-bg: #fbe5e0;
  --ok: #1e7e46;
  --ok-bg: #e1f3e7;
  --radius: 18px;
  --shadow-lg: 0 24px 60px -18px rgba(10, 30, 20, 0.45);
  --shadow-md: 0 10px 30px -10px rgba(10, 30, 20, 0.25);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
::selection { background: var(--pine-300); color: var(--pine-900); }

/* ---------- header ---------- */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 64px; padding: 0 clamp(14px, 3vw, 28px);
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(180deg, rgba(10, 26, 18, 0.92), rgba(10, 26, 18, 0.75));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
header.site .logo { font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: #fff; text-decoration: none; display: flex; gap: 9px; align-items: center;
  letter-spacing: 0.2px; }
header.site .logo svg { width: 26px; height: 26px; }
header.site .logo span { color: var(--pine-300); font-style: italic; }
header.site nav { display: flex; gap: 16px; flex: 1; }
header.site nav a { color: #c5dccb; text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s; }
header.site nav a:hover { color: #fff; }
#profileBtn {
  background: var(--pine-300); color: var(--pine-900); border: 0; border-radius: 999px;
  padding: 9px 18px; font-weight: 700; font-size: 13px; cursor: pointer;
  font-family: var(--font-ui); transition: transform .15s, background .15s;
  box-shadow: 0 4px 14px -4px rgba(116, 198, 157, 0.55);
}
#profileBtn:hover { background: #8fd7b1; transform: translateY(-1px); }

/* ---------- index: hero ---------- */
.hero {
  position: relative; min-height: clamp(420px, 62vh, 640px);
  display: flex; align-items: flex-end;
  background: var(--pine-900); color: #f1f7f2; overflow: hidden;
}
.hero .bg { position: absolute; inset: 0; background-size: cover;
  background-position: center 35%; transform: scale(1.02); }
.hero .shade { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,26,18,.55) 0%, rgba(10,26,18,.08) 38%,
              rgba(10,26,18,.30) 58%, rgba(13,30,21,.94) 100%); }
.hero .inner { position: relative; z-index: 2; padding: 0 clamp(18px, 4vw, 48px) 56px;
  max-width: 1240px; margin: 0 auto; width: 100%; }
.hero .kicker { font-size: 12px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--pine-300); margin-bottom: 12px; }
.hero h1 { font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 5.6vw, 62px); line-height: 1.04; margin: 0 0 16px;
  max-width: 13ch; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--pine-300); }
.hero p { margin: 0 0 22px; color: #cfe0d3; max-width: 56ch; line-height: 1.65;
  font-size: clamp(14px, 1.6vw, 16.5px); }
.hero .stats { display: flex; gap: clamp(14px, 3vw, 34px); flex-wrap: wrap; }
.hero .stat { font-size: 13px; color: #a9c4af; }
.hero .stat b { display: block; font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 28px);
  color: #fff; font-weight: 600; }

/* ---------- index: grid ---------- */
.grid-wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 32px) 80px; }
.grid-head { display: flex; align-items: baseline; gap: 14px; margin: 42px 4px 18px; }
.grid-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin: 0; }
.grid-head span { color: var(--muted); font-size: 13.5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: clamp(16px, 2.4vw, 26px); }
.card { position: relative; background: var(--paper); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: 0 2px 14px -6px rgba(15, 35, 25, 0.18);
  transition: transform .22s cubic-bezier(.2,.8,.3,1), box-shadow .22s;
  display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card .img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.2,.8,.3,1); }
.card:hover .img img { transform: scale(1.05); }
.card .img::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,20,14,0) 45%, rgba(8,20,14,.78) 100%); }
.card .img .title { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 2;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card .img .title h2 { font-family: var(--font-display); font-weight: 600; color: #fff;
  font-size: 22px; margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,.5); line-height: 1.1; }
.card .img .title .ht { color: var(--pine-300); font-weight: 700; font-size: 14px;
  white-space: nowrap; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.card .img .region { position: absolute; top: 12px; left: 14px; z-index: 2;
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: #fff; background: rgba(10, 26, 18, 0.55); border: 1px solid rgba(255,255,255,.18);
  padding: 4px 11px; border-radius: 999px; backdrop-filter: blur(4px); }
.card .body { padding: 14px 17px 17px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .blurb { font-size: 13.5px; line-height: 1.55; color: #45564d; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pill { font-size: 11.5px; font-weight: 600; color: var(--pine-700);
  background: var(--pine-100); border-radius: 999px; padding: 4px 11px; }
.pill.ghost { background: #efece4; color: var(--muted); }

footer.site { background: var(--pine-900); color: #9db8a4; font-size: 12.5px;
  padding: 30px clamp(18px, 4vw, 48px); line-height: 1.7; }
footer.site a { color: var(--pine-300); }

/* ---------- munro page ---------- */
body.munro { background: var(--pine-900); overflow: hidden; }
#stage { position: fixed; inset: 0; touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#stage canvas { display: block; touch-action: none; }
.map-credit { position: fixed; left: 12px; bottom: 10px; z-index: 15;
  font-size: 10.5px; color: rgba(255,255,255,.75); background: rgba(10,26,18,.45);
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px); pointer-events: none; }
.map-credit #imgBadge:not(:empty) { margin-left: 8px; padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.3); color: #95d5b2; font-weight: 700; }

#panel {
  position: fixed; top: 78px; right: 16px; bottom: 16px; width: 432px; z-index: 20;
  background: rgba(252, 251, 247, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 20px 26px;
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  scrollbar-width: thin; scrollbar-color: #c9c4b8 transparent;
}
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb { background: #cfc9bc; border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box; }
#sheetHandle { display: none; }
body.no-ui header.site, body.no-ui #panel, body.no-ui .map-credit { display: none; }

#panel h1 { font-family: var(--font-display); font-weight: 600; font-size: 26px;
  margin: 0; line-height: 1.1; }
#panel h1 .ht { color: var(--pine-500); font-size: 19px; white-space: nowrap; }
#panel .region { color: var(--muted); font-size: 12.5px; margin: 5px 0 10px;
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
#panel .blurb { font-size: 13.5px; line-height: 1.6; color: #3c4a43; margin: 0; }

.section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.section h3 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 1.6px; color: var(--pine-500); font-weight: 800; }

/* condition tiles */
.condtiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { background: linear-gradient(180deg, #fff, #fbfaf6);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px;
  transition: border-color .2s, transform .2s; }
.tile:hover { border-color: var(--pine-300); transform: translateY(-1px); }
.tico { width: 26px; height: 26px; flex: 0 0 auto; color: var(--pine-500);
  background: var(--pine-100); border-radius: 9px; display: grid; place-items: center; }
.tico svg { width: 17px; height: 17px; }
.tile .val { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; line-height: 1.15; }
.tile .vsub { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.tile .lab { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.9px; margin-top: 1px; }
.sunrow { display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(90deg, #fff7e3, #fdfcf9 35%, #fdfcf9 65%, #ece9f7);
  border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px; margin-top: 8px;
  font-size: 12.5px; }
.sunrow b { font-size: 13.5px; }
.sunrow .dawn { color: #9a6d00; } .sunrow .dusk { color: #5b4a92; }

.scrub-label { font-size: 12px; color: var(--muted); display: flex;
  justify-content: space-between; margin-top: 12px; align-items: baseline; }
.scrub-label b { color: var(--ink); font-size: 13px; }
input.scrub { -webkit-appearance: none; appearance: none; width: 100%; height: 26px;
  background: transparent; margin: 2px 0 10px; cursor: pointer; }
input.scrub::-webkit-slider-runnable-track { height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--pine-300), #cfe6d8); }
input.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--pine-700); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); margin-top: -7px; }
input.scrub::-moz-range-track { height: 6px; border-radius: 99px; background: #cfe6d8; }
input.scrub::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%;
  background: var(--pine-700); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

.snownote { font-size: 12px; color: #3d5a8f; background: #e8eefb;
  border-radius: 10px; padding: 8px 12px; margin-top: 10px; line-height: 1.5; }

/* route cards */
.route-card { background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 15px; margin: 12px 0; box-shadow: 0 2px 10px -6px rgba(15,35,25,.12); }
.route-card .head { display: flex; align-items: center; gap: 9px; }
.route-card .dot { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.route-card .head b { font-size: 15px; flex: 1; line-height: 1.25; }
.route-card .head label { font-size: 10.5px; color: var(--muted); display: flex;
  align-items: center; gap: 4px; font-weight: 600; }
.route-card .stats { font-size: 12px; color: var(--muted); margin: 7px 0 8px; }
.route-card .stats b { color: var(--ink); font-weight: 700; }
.route-card .desc { font-size: 12.5px; line-height: 1.55; color: #45564d; margin: 8px 0; }
/* margin-top: the pill sat flush against the button row above and read as overlapping it */
.gradeline { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; margin-top: 10px; }
.grade { display: inline-block; font-weight: 800; border-radius: 9px;
  padding: 4px 12px; font-size: 12.5px; letter-spacing: 0.2px; }
.g1 { background: #d9f0e0; color: #18603a; }
.g2 { background: #eaf3cf; color: #5a6e10; }
.g3 { background: #fdeec7; color: #8a6200; }
.g4 { background: #fddfc7; color: #93470a; }
.g5 { background: #fbd2cb; color: #92281a; }
.gradeline small { font-size: 11px; color: var(--muted); }
.factors { font-size: 11.5px; color: #6b6354; background: #faf6ec;
  border-radius: 9px; padding: 7px 11px; margin-top: 7px; line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 2px; }
.chip { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px;
  background: #eef2ee; color: #4a5a51; }
.chip.need { background: var(--amber-bg); color: var(--amber); }
.chip.have { background: var(--pine-100); color: var(--pine-700); }
.chip.miss { background: var(--red-bg); color: var(--red); }

.timing { font-size: 12.5px; line-height: 1.7; background: #f6f8f4;
  border-radius: 10px; padding: 9px 12px; margin-top: 9px; }
.timing b { color: var(--pine-700); }
.timing .warn { color: var(--amber); font-weight: 700; }

.note { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 8px; }
.note a { color: var(--pine-500); font-weight: 600; }

.verdict { border-radius: 12px; padding: 11px 13px; font-size: 13px; font-weight: 800;
  margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; }
.verdict .vico { font-size: 16px; line-height: 1.2; }
.verdict small { display: block; font-weight: 500; margin-top: 3px; font-size: 12px;
  line-height: 1.5; opacity: .9; }
.verdict.go { background: var(--ok-bg); color: var(--ok); }
.verdict.caution { background: var(--amber-bg); color: var(--amber); }
.verdict.nogo { background: var(--red-bg); color: var(--red); }

.toggles label { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; }
input[type="checkbox"] { accent-color: var(--pine-500); width: 15px; height: 15px; }

/* condition simulator */
.simbadge { background: var(--amber-bg); color: var(--amber); font-size: 10px;
  font-weight: 800; letter-spacing: 1px; padding: 2.5px 9px; border-radius: 999px;
  vertical-align: 1px; text-transform: uppercase; }
.toggles-label { display: flex; gap: 8px; align-items: center; font-size: 13px;
  font-weight: 600; cursor: pointer; flex-wrap: wrap; }
#simControls { margin-top: 10px; background: #fffdf6; border: 1px dashed #e3d9bd;
  border-radius: 14px; padding: 12px 14px 10px; }
.simrow { display: grid; grid-template-columns: 86px 1fr 64px; gap: 10px;
  align-items: center; margin: 2px 0; }
.simlab { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.simval { font-size: 11.5px; text-align: right; white-space: nowrap; }
input.scrub.sim { margin: 0; height: 22px; }
input.scrub.sim::-webkit-slider-runnable-track { background: #ead9b0; }
input.scrub.sim::-webkit-slider-thumb { background: var(--amber); width: 16px; height: 16px; margin-top: -5px; }
.simpresets { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.simpresets button { border: 1px solid #e0d6bb; background: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: var(--font-ui); color: #6b5d35; transition: background .15s, transform .15s; }
.simpresets button:hover { background: var(--amber-bg); transform: translateY(-1px); }
.zonelegend { font-size: 11px; color: var(--muted); display: inline-flex;
  align-items: center; gap: 5px; flex-wrap: wrap; }
.zonelegend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.zonelegend .zr { background: #2a70f2; }
.zonelegend .zs { background: #d6e4fa; border: 1px solid #b9c8de; }
.zonelegend .zl { background: #ff8c1a; height: 4px; border-radius: 2px; }
#walkChip { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(10, 26, 18, 0.82); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 700;
  font-family: var(--font-ui); cursor: pointer; backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35); }
#walkChip small { font-weight: 500; opacity: .6; font-size: 11px; }
#walkChip:hover { background: rgba(20, 46, 32, 0.92); }
#wxToggle { position: fixed; top: 76px; left: 14px; z-index: 25;
  background: rgba(10, 26, 18, 0.78); color: #fff;
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: 9px 16px; font-size: 12.5px; font-weight: 700;
  font-family: var(--font-ui); cursor: pointer;
  backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0,0,0,.3);
  transition: background .15s, border-color .15s; }
#wxToggle:hover { border-color: var(--pine-300); }

/* floating camera cluster: right edge, clear of the sheet and the wx chip */
#camCtl { position: fixed; right: 12px; top: 44%; transform: translateY(-50%); z-index: 25;
  display: flex; flex-direction: column; gap: 8px; }
#camCtl button { width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,0.22);
  background: rgba(18, 30, 24, 0.72); color: #fff; font-size: 22px; line-height: 1; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#camCtl button:active { background: rgba(18, 30, 24, 0.92); }

/* phone-legible 3D labels */
@media (max-width: 480px) {
  .label3d { font-size: 14px; }
  .label3d.minor { font-size: 12px; }
  .label3d.peak { font-size: 12px; }
}
#wxToggle.off { background: rgba(245, 248, 244, 0.92); color: var(--pine-900);
  border-color: rgba(20, 50, 35, 0.2); }
body.no-ui #wxToggle { display: none; }
@media (max-width: 920px) { #wxToggle { top: 64px; } }

/* first-person weather "picture" — live conditions while standing on the hill */
#fpvWx { position: fixed; top: 122px; left: 14px; z-index: 26;
  display: flex; align-items: center; gap: 12px;
  color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 16px;
  padding: 11px 16px 11px 13px; backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4); font-family: var(--font-ui);
  background: rgba(10,26,18,.6); transition: background .5s; }
#fpvWx .wxIcon { font-size: 30px; line-height: 1; }
#fpvWx .wxCol { display: flex; flex-direction: column; gap: 1px; }
#fpvWx .wxTop { display: flex; align-items: baseline; gap: 8px; }
#fpvWx .wxTemp { font-size: 25px; font-weight: 700; font-family: var(--font-display); }
#fpvWx .wxTime { font-size: 11px; opacity: .7; font-weight: 600; }
#fpvWx .wxDesc { font-size: 12.5px; font-weight: 700; }
#fpvWx .wxWind { font-size: 11.5px; opacity: .85; font-weight: 600; }
body.no-ui #fpvWx { display: none !important; }
body.in-app #fpvWx { top: 60px; }
@media (max-width: 920px) { #fpvWx { top: 108px; }
  body.in-app #fpvWx { top: 56px; } }

/* first-person route preview */
.previewBtn { width: 100%; margin-top: 9px; border: 1.5px solid var(--pine-100);
  background: linear-gradient(180deg, #f4faf6, #e9f5ee); color: var(--pine-700);
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; font-weight: 700;
  font-family: var(--font-ui); cursor: pointer; transition: all .15s; }
.previewBtn:hover { background: var(--pine-100); border-color: var(--pine-300);
  transform: translateY(-1px); }
#playHud { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; align-items: center; gap: 10px;
  background: rgba(10, 26, 18, 0.85); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 8px 14px; backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); width: min(520px, calc(100vw - 24px)); }
#playHud button { background: var(--pine-300); color: var(--pine-900); border: 0;
  border-radius: 50%; width: 34px; height: 34px; font-size: 14px; font-weight: 800;
  cursor: pointer; flex: 0 0 auto; display: grid; place-items: center; }
#playHud button:hover { background: #b7e4c7; }
#playHud #playStop { background: rgba(255,255,255,.16); color: #fff; width: 28px; height: 28px; font-size: 12px; }
#playHud input { flex: 1; -webkit-appearance: none; height: 5px; border-radius: 99px;
  background: rgba(255,255,255,.28); cursor: pointer; }
#playHud input::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
#playHud span { color: #d9e8dd; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 920px) { #playHud { bottom: calc(46vh + 12px); } #playHud span { display: none; } }
#miniMap { position: fixed; top: 76px; right: 464px; z-index: 28;
  width: 180px; height: 180px; border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.75); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
#miniMap canvas { width: 100%; height: 100%; display: block; }
body.no-ui #miniMap { display: none !important; }
/* embedded in the native app: its own nav replaces the web header */
body.in-app header.site { display: none; }
body.in-app #wxToggle { top: 14px; }
body.in-app #walkChip { top: 14px; }
body.in-app #miniMap { top: 14px; }
@media (min-width: 921px) { body.in-app #panel { top: 14px; } }
@media (max-width: 920px) {
  #miniMap { top: 64px; right: 12px; width: 130px; height: 130px; }
}

/* ---------- polish pass ---------- */
/* munro switcher in the header */
.switch { -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.08) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6" fill="none" stroke="%2395d5b2" stroke-width="2.4" stroke-linecap="round"/></svg>') no-repeat right 10px center / 14px;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 999px;
  color: #e7f3ea; font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  padding: 8px 34px 8px 14px; cursor: pointer; max-width: 270px;
  text-overflow: ellipsis; transition: background-color .15s, border-color .15s; }
.switch:hover { border-color: var(--pine-300); background-color: rgba(255,255,255,0.14); }
.switch option { color: var(--ink); background: #fff; }
@media (max-width: 920px) { .switch { display: none; } }

/* elevation profile sparkline */
.profwrap { margin: 9px 0 2px; }
.profile { display: block; width: 100%; height: 58px; border-radius: 8px;
  background: linear-gradient(180deg, #fafbf8, #f3f5f0);
  border: 1px solid #edefe8; }
.profmeta { display: flex; justify-content: space-between; font-size: 10px;
  color: var(--muted); margin-top: 3px; letter-spacing: 0.3px; }

/* forecast day + hour picker */
.dayrow { display: flex; gap: 5px; margin: 10px 0 2px; }
.dchip { flex: 1; min-width: 0; padding: 6px 0 5px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; font-family: var(--font-ui);
  font-weight: 800; font-size: 11px; color: #4a5a51; cursor: pointer;
  text-align: center; transition: all .15s; }
.dchip small { display: block; font-size: 9px; color: var(--muted); font-weight: 600; }
.dchip:hover { border-color: var(--pine-300); }
.dchip.active { background: var(--pine-700); border-color: var(--pine-700); color: #fff; }
.dchip.active small { color: #95d5b2; }

/* weekly meteogram */
.weektoggle { display: block; width: 100%; text-align: left; background: none;
  border: 0; padding: 8px 2px 4px; font-family: var(--font-ui); font-size: 11.5px;
  font-weight: 700; color: var(--pine-500); cursor: pointer; }
.weektoggle:hover { color: var(--pine-700); }
#weekChart { background: linear-gradient(180deg, #fbfcfa, #f4f6f1);
  border: 1px solid #e7e9e2; border-radius: 12px; display: block; }
.weeklegend { display: flex; gap: 10px; font-size: 9.5px; color: var(--muted);
  margin-top: 4px; align-items: center; }
.weeklegend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  margin-right: 3px; vertical-align: -1px; }

/* hazard badges */
.hazards { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.hz { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.hz.info { background: #eef1f4; color: #4d5e6b; }
.hz.warn { background: var(--amber-bg); color: var(--amber); }
.hz.danger { background: var(--red-bg); color: var(--red); }

/* verdict icon */
.verdict .vico { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #fff; }
.verdict.go .vico { background: var(--ok); }
.verdict.caution .vico { background: var(--amber); }
.verdict.nogo .vico { background: var(--red); }

/* route card hover + section rules */
.route-card { transition: box-shadow .2s, border-color .2s; }
.route-card:hover { border-color: #d3d9d0; box-shadow: 0 6px 18px -8px rgba(15,35,25,.2); }
.section h3 { display: flex; align-items: center; gap: 10px; }
.section h3::after { content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--pine-100), transparent); }

/* index: search + region filters */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 2px 20px; }
.searchbox { position: relative; flex: 0 1 320px; min-width: 220px; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.searchbox input { width: 100%; padding: 11px 14px 11px 38px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-family: var(--font-ui);
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s; }
.searchbox input:focus { outline: none; border-color: var(--pine-300);
  box-shadow: 0 0 0 4px rgba(116, 198, 157, 0.18); }
.pills { display: flex; gap: 7px; flex-wrap: wrap; }
.rpill { border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 15px; font-size: 12.5px; font-weight: 600; color: #4a5a51;
  cursor: pointer; font-family: var(--font-ui); transition: all .15s; }
.rpill:hover { border-color: var(--pine-300); transform: translateY(-1px); }
.rpill.active { background: var(--pine-700); border-color: var(--pine-700); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14.5px; }

/* ---------- bagging + trip planner ---------- */
.bagbtn { margin: 2px 0 10px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700;
  font-family: var(--font-ui); color: var(--muted); cursor: pointer; transition: all .15s; }
.bagbtn:hover { border-color: var(--pine-300); color: var(--pine-700); }
.bagbtn.bagged { background: var(--pine-700); border-color: var(--pine-700); color: #fff; }
.bagmark { position: absolute; top: 10px; right: 12px; z-index: 2; width: 26px; height: 26px;
  border-radius: 50%; background: var(--pine-300); color: var(--pine-900); font-weight: 900;
  display: grid; place-items: center; font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.bagcount { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--pine-500); }
.btnrow { display: flex; gap: 8px; }
.btnrow .previewBtn { flex: 1; margin-top: 9px; }
.previewBtn.plan { background: linear-gradient(180deg, #fdf7ea, #f8efdb);
  border-color: #ecdfc0; color: #7c5e16; }
.previewBtn.plan:hover { background: #f7ecd2; border-color: #d9c690; }

#planModal { position: fixed; inset: 0; z-index: 110; display: none;
  background: rgba(8, 20, 14, 0.62); align-items: center; justify-content: center;
  backdrop-filter: blur(3px); }
#planModal.open { display: flex; }
#planModal .box.plan { background: var(--paper); border-radius: 20px;
  width: min(760px, 94vw); max-height: 90vh; overflow-y: auto;
  padding: 24px 26px 22px; animation: pop .22s ease-out; }
#planModal h2 { font-family: var(--font-display); font-weight: 600; margin: 0 0 4px; }
#planModal .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.daychips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.daychip { border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 12px; cursor: pointer; font-family: var(--font-ui); text-align: left;
  min-width: 86px; position: relative; transition: all .15s; flex: 0 0 auto; }
.daychip b { display: block; font-size: 13px; }
.daychip small { font-size: 10px; color: var(--muted); }
.daychip.active { border-color: var(--pine-500); background: #f0f8f2;
  box-shadow: 0 0 0 3px rgba(116,198,157,.25); }
.daychip .bestday { position: absolute; top: -7px; right: 8px; background: var(--amber);
  color: #fff; font-size: 8.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  border-radius: 999px; padding: 2px 7px; }
.planwarn { background: var(--amber-bg); color: var(--amber); border-radius: 10px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600; margin: 8px 0; }
.plancols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 6px; }
@media (max-width: 640px) { .plancols { grid-template-columns: 1fr; } }
.planh { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--pine-500); font-weight: 800; margin: 16px 0 8px; }
.timeline { border-left: 2px solid var(--pine-100); padding-left: 14px; }
.tlrow { display: flex; gap: 12px; margin: 10px 0; position: relative; font-size: 13px; }
.tlrow::before { content: ""; position: absolute; left: -19.5px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--pine-300); border: 2px solid #fff; }
.tlrow b { min-width: 44px; color: var(--pine-700); }
.tlrow small { color: var(--muted); }
.moments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.moment { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 10px; font-size: 12.5px; font-weight: 700; }
.moment .mlabel { font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.moment small { font-weight: 500; color: var(--muted); }
.kitgroup { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 10px; }
.kitgroup.amber { background: #fffaf0; border-color: #ecdfc0; }
.kitgroup b { display: block; font-size: 12px; margin-bottom: 6px; }
.kitgroup label { display: flex; gap: 8px; align-items: center; font-size: 12.5px;
  margin: 5px 0; cursor: pointer; color: #3c4a43; }
.kitgroup input:checked + * , .kitgroup label:has(input:checked) { text-decoration: line-through; opacity: .55; }
#planModal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
#planModal button.save, #planModal button.cancel { border: 0; border-radius: 999px;
  padding: 10px 20px; font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: var(--font-ui); }
#planModal .save { background: var(--pine-500); color: #fff; }
#planModal .cancel { background: #ecebe4; color: var(--ink); }

/* card entrance animation */
.grid .card { opacity: 0; transform: translateY(16px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.3,1),
              box-shadow .22s; }
.grid .card.in { opacity: 1; transform: none; }
.grid .card.in:hover { transform: translateY(-5px); }

/* hero: slow drift on the backdrop */
.hero .bg { animation: kenburns 45s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.1) translateY(-12px); } }
@media (prefers-reduced-motion: reduce) {
  .hero .bg { animation: none; }
  .grid .card { opacity: 1; transform: none; }
}

/* 3D labels */
.label3d { color: #fff; font-size: 12px; font-weight: 700; font-family: var(--font-ui);
  text-shadow: 0 1px 4px rgba(0,0,0,.95), 0 0 12px rgba(0,0,0,.65);
  pointer-events: none; white-space: nowrap; letter-spacing: 0.2px; }
.label3d.minor { font-size: 10.5px; font-weight: 500; color: #dbe4f0; }
.label3d.peak { font-size: 10px; font-weight: 600; color: #ffe2a8;
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 8px rgba(0,0,0,.7); }
.label3d.peak::before { content: "▲ "; font-size: 8px; vertical-align: 1px; }

/* loading */
#loading3d { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center; z-index: 40;
  background: radial-gradient(120% 100% at 50% 0%, #16382a 0%, var(--pine-900) 70%);
  color: #cfe0d3; font-size: 14px; letter-spacing: 0.4px; }
#loading3d svg { width: 74px; height: 74px; }
#loading3d .ridge { stroke: var(--pine-300); stroke-width: 2.4; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 2.1s ease-in-out infinite; }
@keyframes draw { 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -220; } }
#loading3d.fade { opacity: 0; transition: opacity .7s; pointer-events: none; }

/* ---------- profile modal ---------- */
#profileModal { position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(8, 20, 14, 0.6); align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px); }
#profileModal.open { display: flex; }
#profileModal .box { background: var(--paper); border-radius: 22px 22px 0 0;
  width: min(520px, 100vw); padding: 24px 24px 30px; max-height: 88vh; overflow-y: auto;
  animation: sheetUp .28s cubic-bezier(.2,.8,.3,1); }
@media (min-width: 700px) {
  #profileModal { align-items: center; }
  #profileModal .box { border-radius: 22px; padding: 26px 28px; animation: pop .22s ease-out; }
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: .4; } }
@keyframes pop { from { transform: scale(.96); opacity: .4; } }
#profileModal h2 { font-family: var(--font-display); font-weight: 600; margin: 0 0 4px; }
#profileModal .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
#profileModal label.row { display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 13px;
  margin: 8px 0; cursor: pointer; transition: border-color .15s, background .15s; }
#profileModal label.row:has(input:checked) { border-color: var(--pine-300); background: #f3faf5; }
#profileModal label.row input { margin-top: 3px; }
#profileModal label.row b { display: block; font-size: 14px; }
#profileModal label.row span span { font-size: 12px; color: var(--muted); line-height: 1.45; }
#profileModal .frow { margin: 13px 0; font-size: 13.5px; font-weight: 700; }
#profileModal select, #profileModal input[type=text] {
  font-size: 14px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  width: 100%; margin-top: 6px; font-family: var(--font-ui); background: #fff; font-weight: 500; }
#profileModal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
#profileModal button { border: 0; border-radius: 999px; padding: 11px 22px;
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--font-ui); }
#profileModal .save { background: var(--pine-500); color: #fff; }
#profileModal .save:hover { background: var(--pine-700); }
#profileModal .cancel { background: #ecebe4; color: var(--ink); }

/* ---------- mobile: bottom sheet ---------- */
@media (max-width: 920px) {
  header.site { height: 56px; }
  header.site nav { display: none; }
  #panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: 46vh; border-radius: 22px 22px 0 0;
    transition: height .32s cubic-bezier(.2,.8,.3,1);
    padding-top: 6px; border-left: 0; border-right: 0; border-bottom: 0;
  }
  #panel.expanded { height: calc(100dvh - 64px); }
  #panel.peek { height: 76px; }                 /* dragged down: just the handle + title peek over the map */
  #sheetHandle { display: block; position: sticky; top: 0; z-index: 5;
    padding: 10px 0 12px; margin: 0 -20px; cursor: grab; text-align: center;
    touch-action: none; -webkit-user-select: none; user-select: none;
    background: linear-gradient(180deg, rgba(252,251,247,1) 60%, rgba(252,251,247,0)); }
  #sheetHandle:active { cursor: grabbing; }
  #sheetHandle::before { content: ""; display: inline-block; width: 44px; height: 5px;
    border-radius: 99px; background: #c9c4b8; }
  #stage { inset: 0; }
  .map-credit { bottom: calc(46vh + 8px); transition: bottom .32s cubic-bezier(.2,.8,.3,1); }
  body:has(#panel.expanded) .map-credit { opacity: 0; }
  .hero { min-height: 70vh; }
}
@media (max-width: 520px) {
  .hero .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .hero .kicker { font-size: 10px; letter-spacing: 1.6px; max-width: 30ch;
    text-shadow: 0 1px 8px rgba(0,0,0,.8); }
  .hero .inner { padding-bottom: 40px; }
}
