/* Offline trek map (offline-map.html, offline-map.js). The site's colours and shapes (app.css), but no web font: the
   page must not call any other host, so it uses the phone's own fonts (which also carry Devanagari). */
:root{--bar:#0A1628;--red:#DC143C;--ink:#1C1917;--ink2:#44403C;--mute:#78716C;--line:#E7E5E0;--line2:#D6D3CD;--paper:#F7F6F2;
  --f:system-ui,-apple-system,'Segoe UI',Roboto,'Noto Sans','Noto Sans Devanagari','Nirmala UI',sans-serif;--r:8px}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--paper);color:var(--ink);font:400 15px/1.45 var(--f);-webkit-font-smoothing:antialiased}
body{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}
button{font:inherit;color:inherit;cursor:pointer}
:focus-visible{outline:2px solid var(--red);outline-offset:2px}

.om-bar{flex:none;display:flex;align-items:center;gap:14px;height:54px;padding:0 16px 0 8px;background:var(--bar);color:#fff;padding-top:env(safe-area-inset-top)}
.om-back{display:flex;align-items:center;gap:4px;height:40px;padding:0 12px 0 6px;border:1px solid rgba(255,255,255,.3);border-radius:var(--r);color:#fff;text-decoration:none;font-weight:600;font-size:14.5px;flex:none}
.om-back:hover{background:rgba(255,255,255,.08)}
.om-back svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.om-title{min-width:0;display:flex;flex-direction:column;line-height:1.15}
.om-k{font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.66)}
.om-title h1{margin:0;font-size:18px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.om-map{position:relative;flex:1;min-height:0;overflow:hidden;background:#E4E0D6}
#om-c{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab}
#om-c:active{cursor:grabbing}
#om-c:focus-visible{outline-offset:-3px}

.om-side{position:absolute;right:12px;top:12px;display:flex;flex-direction:column;align-items:flex-end;gap:10px}
.om-north{width:36px;height:44px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);border:1px solid var(--line2);border-radius:var(--r)}
.om-north svg{width:22px;height:30px}
.om-north text{font:700 9px var(--f);fill:var(--bar)}
.om-ctl{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line2);border-radius:var(--r);box-shadow:0 2px 12px rgba(10,22,40,.16);overflow:hidden}
.om-ctl button{width:44px;height:44px;border:0;background:#fff;display:flex;align-items:center;justify-content:center}
.om-ctl button+button{border-top:1px solid var(--line)}
.om-ctl button:hover{background:#F5F4F0}
.om-ctl svg{width:20px;height:20px;fill:none;stroke:var(--ink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#om-gps[aria-pressed="true"] svg{stroke:#1A73E8}
#om-gps[aria-pressed="true"] svg circle{fill:rgba(26,115,232,.2)}

.om-ways{position:absolute;left:12px;top:12px;display:flex;background:#fff;border:1px solid var(--line2);border-radius:var(--r);overflow:hidden;box-shadow:0 2px 12px rgba(10,22,40,.16);max-width:calc(100% - 84px)}
.om-ways[hidden]{display:none}
.om-ways button{border:0;background:#fff;padding:8px 12px;font-size:13.5px;font-weight:500;white-space:nowrap}
.om-ways button+button{border-left:1px solid var(--line)}
.om-ways button[aria-pressed="true"]{background:var(--bar);color:#fff;font-weight:600}

.om-msg{position:absolute;left:50%;top:12px;transform:translateX(-50%);max-width:min(460px,calc(100% - 140px));padding:9px 14px;background:#fff;border:1px solid var(--line2);border-left:3px solid #1A73E8;border-radius:var(--r);box-shadow:0 4px 18px rgba(10,22,40,.18);font-size:13.5px;line-height:1.4}
.om-msg[hidden]{display:none}
.om-msg.warn{border-left-color:var(--red)}

.om-foot{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:0 12px 10px;padding-bottom:max(10px,env(safe-area-inset-bottom));pointer-events:none}
.om-left{display:flex;align-items:flex-end;gap:12px;pointer-events:auto}
.om-keybtn{height:36px;padding:0 14px;border:1px solid var(--line2);border-radius:var(--r);background:#fff;font-weight:600;font-size:14px;box-shadow:0 2px 12px rgba(10,22,40,.16)}
.om-keybtn[aria-expanded="true"]{background:var(--bar);color:#fff;border-color:var(--bar)}
.om-scale{display:flex;flex-direction:column;align-items:flex-start;gap:1px;font-size:12px;font-weight:600;color:var(--ink)}
.om-scale span{order:-1;padding:0 3px;background:rgba(255,255,255,.8);border-radius:3px}
.om-scale i{display:block;height:7px;border:2px solid var(--ink);border-top:0;background:rgba(255,255,255,.6)}
.om-cred .short{display:none}
.om-cred{max-width:60%;padding:2px 6px;background:rgba(255,255,255,.82);border-radius:4px;font-size:11px;line-height:1.35;color:var(--ink2);text-align:right;pointer-events:auto}

.om-key{position:absolute;left:12px;bottom:58px;width:252px;max-height:calc(100% - 84px);overflow:auto;padding:10px 12px 8px;background:#fff;border:1px solid var(--line2);border-radius:var(--r);box-shadow:0 8px 26px rgba(10,22,40,.2);font-size:13px}
.om-key[hidden]{display:none}
.om-key h2{margin:0 0 6px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mute)}
.om-key h2+ul{margin-bottom:8px}
.om-key ul{list-style:none;margin:0;padding:0}
.om-key li{display:flex;align-items:center;gap:8px;min-height:22px;line-height:1.25}
.om-key svg{flex:none;width:30px;height:16px}
.om-key p{margin:6px 0 2px;font-size:12px;color:var(--mute);line-height:1.4}
.om-key details{margin-top:6px;border-top:1px solid var(--line);padding-top:6px}
.om-key summary{cursor:pointer;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mute);padding:2px 0}
.om-key details[open] summary{margin-bottom:4px}

@media (max-width:600px){
  .om-bar{gap:10px;height:52px}
  .om-title h1{font-size:16.5px}
  .om-msg{top:auto;bottom:62px;max-width:calc(100% - 24px)}
  .om-cred{max-width:56%;font-size:10.5px}
  .om-cred .full{display:none}.om-cred .short{display:inline}
  .om-key{right:12px;width:auto;max-height:calc(100% - 140px)}
}
