:root{
  --ink:#10205a; --ink2:#4b5675; --muted:#7a839c;
  --accent:#8d0525; --accent2:#b3123b; --gold:#e3a33b;
  --glass:rgba(255,255,255,.86); --glass-b:rgba(16,32,90,.10); --shadow:0 6px 24px rgba(16,32,90,.14);
  --c-academic:#2a62b8; --c-hostel:#d9772b; --c-admin:#8d0525; --c-sports:#2c9a55; --c-housing:#b0891f;
  --c-landmark:#c2410c; --c-guest:#b3477d; --c-shop:#7b4bb3; --c-other:#6b7280;
  --lbl-bg:rgba(255,255,255,.92); --lbl-ink:#16224f;
  --r:14px;
}
body.night{
  --ink:#eef1fb; --ink2:#b4bdd6; --muted:#8a93ad;
  --accent:#ff6b86; --glass:rgba(14,20,40,.80); --glass-b:rgba(255,255,255,.12); --shadow:0 6px 24px rgba(0,0,0,.45);
  --lbl-bg:rgba(14,20,40,.82); --lbl-ink:#f5ecd9;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{margin:0;height:100%;overflow:hidden;background:#cfdde6;font-family:Inter,system-ui,-apple-system,sans-serif;color:var(--ink)}
body.night{background:#0b1226}
button{font:inherit;color:inherit;cursor:pointer}
canvas#c{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
.glass{background:var(--glass);backdrop-filter:blur(14px) saturate(1.2);-webkit-backdrop-filter:blur(14px) saturate(1.2);border:1px solid var(--glass-b);box-shadow:var(--shadow)}
#brand,#searchBox,.chip,#toolbar .tbtn,.sheet,.pop,.modalbox,#toast{background:var(--glass);backdrop-filter:blur(14px) saturate(1.2);-webkit-backdrop-filter:blur(14px) saturate(1.2);border:1px solid var(--glass-b);box-shadow:var(--shadow)}

/* brand */
#brand{position:fixed;left:12px;top:12px;display:flex;gap:10px;align-items:center;padding:9px 14px 9px 10px;border-radius:var(--r);z-index:5}
#brand .mark{width:34px;height:34px;border-radius:10px;background:var(--ink);display:grid;place-items:center;flex:none}
body.night #brand .mark{background:#24346f}
#brand .mark svg{width:24px;height:24px}
#brand .mark path{fill:#fff}#brand .mark circle{fill:#d4374f}
#brand h1{margin:0;font-size:17px;font-weight:800;letter-spacing:-.2px;line-height:1.1}
#brand h1 span{color:#fff;background:var(--accent);border-radius:6px;padding:1px 6px;margin-left:2px;font-size:13px;vertical-align:2px}
#brand p{margin:2px 0 0;font-size:12px;color:var(--ink2)}
.linkish{background:none;border:0;padding:0;color:var(--accent);font-weight:600;font-size:12px}

/* search */
#top{position:fixed;right:12px;top:12px;width:min(420px,calc(100vw - 24px));z-index:6;display:flex;flex-direction:column;align-items:flex-end;gap:8px}
#searchBox{width:100%;display:flex;align-items:center;gap:8px;border-radius:var(--r);padding:6px 6px 6px 12px}
#searchBox .ico{width:18px;height:18px;flex:none;fill:none;stroke:var(--ink2);stroke-width:2;stroke-linecap:round}
#q{flex:1;min-width:0;border:0;background:transparent;font:500 15px Inter,sans-serif;color:var(--ink);outline:none;padding:7px 0}
#q::placeholder{color:var(--muted)}
#q::-webkit-search-cancel-button{display:none}
kbd{font:600 11px Inter,sans-serif;border:1px solid var(--glass-b);border-bottom-width:2px;border-radius:6px;padding:2px 6px;color:var(--ink2);background:rgba(255,255,255,.35)}
body.night kbd{background:rgba(255,255,255,.06)}
.iconbtn{width:36px;height:36px;border-radius:10px;border:0;display:grid;place-items:center;flex:none;background:transparent}
.iconbtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.iconbtn.accent{background:var(--accent);color:#fff}
.iconbtn.ghost:hover{background:rgba(16,32,90,.07)}
#results{list-style:none;margin:0;padding:6px;width:100%;max-height:min(60vh,440px);overflow:auto;border-radius:var(--r);background:var(--glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--glass-b);box-shadow:var(--shadow)}
#results li,#dirSuggest li{display:flex;gap:10px;align-items:center;padding:9px 10px;border-radius:10px;cursor:pointer}
#results li.sel,#results li:hover,#dirSuggest li.sel,#dirSuggest li:hover{background:rgba(141,5,37,.08)}
body.night #results li.sel,body.night #results li:hover{background:rgba(255,255,255,.08)}
.rdot{width:10px;height:10px;border-radius:50%;flex:none;background:var(--c)}
.rmain{min-width:0;flex:1}
.rname{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rsub{font-size:12px;color:var(--ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rtag{font-size:11px;color:var(--muted);flex:none}

/* chips */
#chips{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.chip{border-radius:999px;padding:6px 12px;font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px;color:var(--ink)}
.chip i{width:8px;height:8px;border-radius:50%;background:var(--c)}
.chip.on{background:var(--ink);color:#fff;border-color:transparent}
body.night .chip.on{background:#f1f3fb;color:#0d1630}
.chip.dashed{border-style:dashed;border-color:rgba(16,32,90,.35)}
body.night .chip.dashed{border-color:rgba(255,255,255,.3)}

/* sheets: card, directions, spots */
.sheet{position:fixed;left:12px;bottom:76px;width:min(380px,calc(100vw - 24px));max-height:min(64vh,560px);overflow:auto;border-radius:18px;padding:16px;z-index:7}
.sheet h2{margin:0 0 2px;font-size:20px;font-weight:800;letter-spacing:-.3px;line-height:1.2;padding-right:36px}
.sheet .close{position:absolute;right:10px;top:10px}
.meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:6px 0 10px;font-size:12px;color:var(--ink2)}
.tag{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 9px;font-size:12px;font-weight:600;background:rgba(16,32,90,.06)}
body.night .tag{background:rgba(255,255,255,.08)}
.tag i{width:8px;height:8px;border-radius:50%;background:var(--c)}
.unconf{display:flex;gap:8px;align-items:flex-start;font-size:12px;color:#8a5a00;background:rgba(227,163,59,.16);border-radius:10px;padding:8px 10px;margin:8px 0}
body.night .unconf{color:#ffd28a}
.sheet p.desc{margin:6px 0 10px;font-size:14px;line-height:1.45;color:var(--ink2)}
.actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.btn{text-decoration:none;color:inherit;border:0;border-radius:11px;padding:10px 14px;font-weight:700;font-size:14px;display:inline-flex;align-items:center;gap:8px;background:rgba(16,32,90,.07)}
body.night .btn{background:rgba(255,255,255,.09)}
.btn.primary{background:var(--accent);color:#fff}
.btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.plist{list-style:none;margin:8px 0 0;padding:0;border-top:1px solid var(--glass-b)}
.plist li{display:flex;justify-content:space-between;gap:10px;padding:8px 2px;border-bottom:1px solid var(--glass-b);font-size:13px;cursor:pointer}
.plist li:hover{color:var(--accent)}
.plist li span:last-child{color:var(--muted);flex:none}
.sectitle{font-size:12px;font-weight:700;color:var(--muted);margin:12px 0 2px}

.dirhead{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.dirhead strong{font-size:17px;font-weight:800;flex:1}
.seg{display:flex;background:rgba(16,32,90,.07);border-radius:10px;padding:3px}
body.night .seg{background:rgba(255,255,255,.08)}
.seg button{border:0;background:transparent;border-radius:8px;padding:5px 10px;font-size:13px;font-weight:600}
.seg button.on{background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.12)}
body.night .seg button.on{background:#2a355c}
.dirfields{position:relative;display:flex;flex-direction:column;gap:6px;padding-right:40px}
.fld{display:flex;align-items:center;gap:8px;background:rgba(16,32,90,.05);border-radius:10px;padding:2px 6px 2px 10px}
body.night .fld{background:rgba(255,255,255,.07)}
.fld input{flex:1;min-width:0;border:0;background:transparent;font:500 14px Inter,sans-serif;color:var(--ink);padding:9px 0;outline:none}
.dot{width:10px;height:10px;border-radius:50%;flex:none}
.dot.from{border:2.5px solid var(--ink);background:#fff}
.dot.to{background:var(--accent)}
.mini{border:0;background:transparent;font-size:14px;padding:4px}
.swap{position:absolute;right:0;top:50%;transform:translateY(-50%)}
#dirSuggest{list-style:none;margin:6px 0 0;padding:0}
#dirOut{margin-top:10px}
.routesum{display:flex;align-items:baseline;gap:10px;margin:4px 0 8px}
.routesum b{font-size:24px;font-weight:800;letter-spacing:-.5px}
.routesum span{color:var(--ink2);font-size:14px}
.steps{list-style:none;padding:0;margin:8px 0 0;font-size:13px}
.steps li{display:flex;gap:10px;padding:7px 0;border-top:1px solid var(--glass-b)}
.steps li i{font-style:normal;width:22px;text-align:center;flex:none}
.steps li span{color:var(--muted);margin-left:auto;flex:none}

/* toolbar */
#toolbar{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);display:flex;gap:8px;z-index:6;padding-bottom:env(safe-area-inset-bottom)}
.tbtn{white-space:nowrap;height:44px;border-radius:13px;padding:0 14px;display:flex;align-items:center;gap:8px;font-weight:700;font-size:14px;border:1px solid var(--glass-b)}
.tbtn.sq{width:44px;padding:0;justify-content:center}
.tbtn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tbtn.on{background:var(--accent)!important;color:#fff}
#liveDot{width:7px;height:7px;border-radius:50%;background:#2fbf71;box-shadow:0 0 0 3px rgba(47,191,113,.18)}
#liveDot.off{background:#c3c8d6;box-shadow:none}
.pop{position:fixed;left:50%;bottom:70px;transform:translateX(-50%);width:min(340px,calc(100vw - 24px));border-radius:16px;padding:14px;z-index:8}
.poprow{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.poprow strong{font-size:22px;font-weight:800}
.pill{border:0;border-radius:999px;padding:6px 12px;font-weight:700;font-size:12px;background:rgba(47,191,113,.16);color:#16794a}
#timeRange{width:100%;accent-color:var(--accent)}
.presets{display:flex;gap:6px;margin-top:8px}
.presets button{flex:1;border:0;border-radius:9px;padding:7px 0;font-size:12px;font-weight:600;background:rgba(16,32,90,.07)}
body.night .presets button{background:rgba(255,255,255,.08)}

/* labels */
#labels,#pins{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:2}
.lbl{position:absolute;left:0;top:0;white-space:nowrap;font:600 12px/1 Inter,sans-serif;padding:6px 10px 6px 8px;border-radius:999px;background:var(--lbl-bg);color:var(--lbl-ink);
  box-shadow:0 2px 10px rgba(16,32,90,.16);transform:translate(-9999px,0);opacity:0;transition:opacity .2s;will-change:transform;pointer-events:auto;cursor:pointer;display:flex;align-items:center;gap:6px}
.lbl.show{opacity:1}
.lbl i{width:7px;height:7px;border-radius:50%;background:var(--c);flex:none}
.lbl.t1{font-size:13px;font-weight:700;padding:7px 12px 7px 9px}
.lbl.t1 i{width:9px;height:9px;box-shadow:0 0 0 3px rgba(255,255,255,.6)}
body.night .lbl.t1 i{box-shadow:0 0 0 3px rgba(255,255,255,.12)}
.lbl.t3{font-size:11px;font-weight:600;padding:5px 8px 5px 7px}
.lbl.area{background:transparent;box-shadow:none;color:#2c3a29;font-weight:700;letter-spacing:.2px;text-shadow:0 0 3px #fff,0 0 3px #fff,0 0 8px rgba(255,255,255,.9)}
.lbl.area i{display:none}
body.night .lbl.area{color:#dbe2f3;text-shadow:0 0 3px #0b1226,0 0 6px #0b1226}
.lbl.road{background:transparent;box-shadow:none;padding:2px 4px;font:700 10px/1 Inter,sans-serif;letter-spacing:.8px;text-transform:uppercase;color:#4d5566;text-shadow:0 0 3px #fff,0 0 3px #fff;pointer-events:none}
.lbl.road i{display:none}
body.night .lbl.road{color:#c5cde0;text-shadow:0 0 3px #0b1226,0 0 6px #0b1226}
.lbl.dim{opacity:.25!important}
.pin{position:absolute;left:0;top:0;transform:translate(-9999px,0);will-change:transform}
.pin.sel{width:34px;height:44px;margin:-44px 0 0 -17px}
.pin.sel svg{width:34px;height:44px;filter:drop-shadow(0 4px 6px rgba(0,0,0,.3))}
.pin.spot{pointer-events:auto;cursor:pointer;width:30px;height:30px;margin:-15px 0 0 -15px;border-radius:50%;display:grid;place-items:center;font-size:15px;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.25);border:2px solid var(--accent)}
.pin.me{width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;background:#2f7bf6;border:3px solid #fff;box-shadow:0 0 0 6px rgba(47,123,246,.25)}
.pin.walker{width:16px;height:16px;margin:-8px 0 0 -8px;border-radius:50%;background:var(--accent);border:3px solid #fff;box-shadow:0 0 0 5px rgba(141,5,37,.25)}

/* walk mode */
#walkUI{position:fixed;inset:0;pointer-events:none;z-index:6}
#joy{position:absolute;left:24px;bottom:84px;width:120px;height:120px;border-radius:50%;background:rgba(255,255,255,.28);border:2px solid rgba(255,255,255,.6);pointer-events:auto;touch-action:none;backdrop-filter:blur(4px)}
#knob{position:absolute;left:50%;top:50%;width:48px;height:48px;margin:-24px 0 0 -24px;border-radius:50%;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.25)}
#walkExit{position:absolute;right:16px;bottom:84px;pointer-events:auto}
.walkhint{position:absolute;left:50%;top:76px;transform:translateX(-50%);margin:0;font-size:13px;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.6);white-space:nowrap}
body.walking #brand,body.walking #top,body.walking #chips{opacity:.0;pointer-events:none}
body.walking #toolbar{display:none}

#toast{position:fixed;left:50%;top:76px;transform:translateX(-50%);border-radius:12px;padding:10px 14px;font-size:14px;font-weight:600;z-index:20;max-width:calc(100vw - 32px)}

.modal{position:fixed;inset:0;background:rgba(10,16,36,.35);display:grid;place-items:center;z-index:30;padding:16px}
.modalbox{position:relative;width:min(560px,100%);max-height:calc(100vh - 32px);overflow:auto;border-radius:18px;padding:22px}
.modalbox h2{margin:0 0 8px;font-size:22px;font-weight:800}
.modalbox h3{margin:16px 0 6px;font-size:14px}
.modalbox p,.modalbox li{font-size:14px;line-height:1.5;color:var(--ink2)}
.modalbox ul{padding-left:18px;margin:6px 0}
.modalbox a{color:var(--accent);font-weight:600}
.modalbox .fine{font-size:12px;color:var(--muted)}
.modalbox .close{position:absolute;right:12px;top:12px}
.lite{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:600;margin-top:10px}

#loading{position:fixed;inset:0;display:grid;place-items:center;background:#dfe8ee;z-index:40;transition:opacity .5s}
#loading.done{opacity:0;pointer-events:none}
.ld{text-align:center;color:#10205a;font-weight:600}
.spin{width:38px;height:38px;border-radius:50%;border:4px solid rgba(16,32,90,.15);border-top-color:#8d0525;margin:0 auto 12px;animation:sp 0.9s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.nojs{position:fixed;inset:0;display:grid;place-items:center;margin:0;font:600 16px Inter,sans-serif}

@media (max-width:720px){
  #brand{padding:6px 10px 6px 7px;top:auto;bottom:66px;left:8px;gap:8px;z-index:4}
  #brand .mark{width:26px;height:26px;border-radius:8px}#brand .mark svg{width:18px;height:18px}
  #brand h1{font-size:13px}#brand h1 span{font-size:10px}#brand p{font-size:10.5px}
  body.sheet-open #brand{display:none}
  #top{left:12px;right:12px;width:auto;align-items:stretch}
  #kbdHint{display:none}
  #chips{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;scrollbar-width:none;margin:0 -12px;padding:0 12px 4px}
  #chips::-webkit-scrollbar{display:none}
  .chip{flex:none}
  .sheet{left:8px;right:8px;width:auto;bottom:70px;max-height:58vh}
  #toolbar{gap:6px;bottom:10px}
  .tbtn{height:42px;padding:0 11px;font-size:13px}
  .tbtn.sq{width:42px}
  #walkBtn span{display:none}#walkBtn{width:42px;padding:0;justify-content:center}
}
@media (max-width:380px){ #viewBtn{padding:0 9px} #homeBtn{display:none} }

body.clean #brand,body.clean #top,body.clean #toolbar,body.clean #toast,body.clean .sheet{display:none!important}
