/* Mapa de Maceió Offline — desenvolvido por Alequizão (instagram.com/alequizao) */
:root{--fundo:#f8fafc;--cx:#ffffff;--txt:#0f172a;--sub:#475569;--linha:#e2e8f0;--dest:#0f766e;--dest2:#14b8a6;--sombra:0 4px 18px rgba(15,23,42,.16);--r:14px;
  --st:env(safe-area-inset-top,0px);--sb:env(safe-area-inset-bottom,0px);--sl:env(safe-area-inset-left,0px);--sr:env(safe-area-inset-right,0px)}
@media (prefers-color-scheme:dark){:root{--fundo:#0b1220;--cx:#111a2e;--txt:#e2e8f0;--sub:#94a3b8;--linha:#22304a;--dest:#2dd4bf;--dest2:#5eead4;--sombra:0 4px 18px rgba(0,0,0,.5)}}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:var(--fundo);color:var(--txt);font:15px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
#mapa{position:fixed;inset:0}
button{font:inherit;color:inherit;cursor:pointer}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

#topo{position:fixed;z-index:5;top:calc(10px + var(--st));left:calc(10px + var(--sl));right:calc(10px + var(--sr));max-width:520px}
#f-busca{display:flex;align-items:center;background:var(--cx);border-radius:999px;box-shadow:var(--sombra);height:48px;padding:0 4px 0 14px}
#f-busca .lupa{color:var(--sub);display:flex}
#q{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--txt);font-size:16px;padding:0 10px;height:100%}
#q::-webkit-search-cancel-button{display:none}
#q-x,#b-menu{border:0;background:transparent;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:24px;color:var(--sub)}
#b-menu:active,#q-x:active{background:var(--linha)}
#res{list-style:none;margin:8px 0 0;padding:4px 0;background:var(--cx);border-radius:var(--r);box-shadow:var(--sombra);max-height:min(60vh,420px);overflow:auto;overscroll-behavior:contain}
#res li{padding:10px 16px;border-bottom:1px solid var(--linha);cursor:pointer}
#res li:last-child{border-bottom:0}
#res li:active,#res li:hover{background:var(--linha)}
#res li b{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#res li small{display:block;color:var(--sub);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#res li.vz{color:var(--sub);cursor:default}

#botoes{position:fixed;z-index:4;right:calc(12px + var(--sr));bottom:calc(28px + var(--sb));display:flex;flex-direction:column;gap:10px}
#botoes button{width:50px;height:50px;border-radius:50%;border:0;background:var(--cx);box-shadow:var(--sombra);display:flex;align-items:center;justify-content:center;color:var(--sub);transition:transform .2s}
#botoes button.on{color:var(--dest)}
#botoes button.seg{background:var(--dest);color:#fff}
#b-norte{display:none!important}
#b-norte.on{display:flex!important}
body.cartao-on #botoes{bottom:calc(var(--altc,150px) + 18px + var(--sb))}

#estado{position:fixed;z-index:8;left:50%;top:calc(70px + var(--st));transform:translate(-50%,-10px);background:rgba(15,23,42,.92);color:#fff;padding:9px 16px;border-radius:999px;font-size:14px;opacity:0;pointer-events:none;transition:.25s;max-width:calc(100% - 32px);text-align:center}
#estado.on{opacity:1;transform:translate(-50%,0)}

#cartao{position:fixed;z-index:6;left:calc(10px + var(--sl));right:calc(10px + var(--sr));bottom:calc(10px + var(--sb));max-width:520px;background:var(--cx);border-radius:var(--r);box-shadow:var(--sombra);padding:14px 16px}
#cartao[hidden]{display:none}
#c-x{position:absolute;right:6px;top:4px;border:0;background:transparent;font-size:26px;width:40px;height:40px;color:var(--sub)}
#c-tit{font-weight:700;font-size:17px;padding-right:34px}
#c-sub{color:var(--sub);margin-top:2px}
#c-coord{color:var(--sub);font-size:12px;margin-top:4px;font-variant-numeric:tabular-nums}
.c-bts{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.c-bts button,.c-bts a,.bt2{flex:1;min-width:130px;text-align:center;border:1px solid var(--linha);background:transparent;border-radius:10px;padding:10px 12px;color:var(--dest);font-weight:600;text-decoration:none;font-size:14px}
.c-bts button:active,.c-bts a:active,.bt2:active{background:var(--linha)}

#baixando{position:fixed;z-index:9;left:calc(10px + var(--sl));right:calc(10px + var(--sr));bottom:calc(10px + var(--sb));display:flex;justify-content:center}
#baixando[hidden]{display:none}
#baixando .bx{background:var(--cx);border-radius:var(--r);box-shadow:var(--sombra);padding:14px 16px;width:100%;max-width:520px}
#bx-txt{font-weight:600;font-size:14px}
.barra{height:8px;background:var(--linha);border-radius:99px;margin-top:10px;overflow:hidden}
.barra i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--dest),var(--dest2));transition:width .2s}
#bx-pct{font-size:12px;color:var(--sub);margin-top:4px;text-align:right;font-variant-numeric:tabular-nums}

.painel{position:fixed;inset:0;z-index:20;background:rgba(2,6,23,.5);display:flex;align-items:flex-end;justify-content:center}
.painel[hidden]{display:none}
.painel .cx{background:var(--cx);width:100%;max-width:560px;max-height:88vh;overflow:auto;border-radius:18px 18px 0 0;padding:20px 20px calc(20px + var(--sb));position:relative}
@media (min-width:700px){.painel{align-items:center}.painel .cx{border-radius:18px}}
.painel h1{font-size:21px;margin:0 40px 2px 0}
.painel h2{font-size:16px;margin:18px 0 6px}
.painel p,.painel li{color:var(--txt)}
.painel ul{padding-left:20px;margin:6px 0}
.painel li{margin:4px 0}
.painel details{border-top:1px solid var(--linha);padding:8px 0}
.painel summary{font-weight:600;cursor:pointer}
.painel details p{margin:6px 0 0;color:var(--sub)}
.painel a{color:var(--dest)}
.ver{color:var(--sub);font-size:13px;margin:0}
.peq{font-size:12px;color:var(--sub)!important}
.credito{text-align:center;margin:14px 0 0;color:var(--sub)!important}
.credito a{font-weight:700;text-decoration:underline}
.fechar{position:absolute;right:10px;top:10px;border:0;background:var(--linha);width:36px;height:36px;border-radius:50%;font-size:22px;line-height:1}

.maplibregl-ctrl-attrib{font-size:11px}
.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right{margin-bottom:var(--sb)}
body.cartao-on .maplibregl-ctrl-bottom-right{display:none}

/* ---------- rotas e navegação ---------- */
.c-bts button,.c-bts a{min-width:88px}
.c-bts .pri{background:var(--dest);color:#fff;border-color:var(--dest);display:inline-flex;align-items:center;justify-content:center;gap:6px}
.c-bts .pri svg{width:17px;height:17px;fill:#fff;stroke:none}
.c-bts .pri:disabled{opacity:.45}
#rp{position:fixed;z-index:7;left:calc(10px + var(--sl));right:calc(10px + var(--sr));bottom:calc(10px + var(--sb));max-width:520px;max-height:calc(100dvh - 90px - var(--st) - var(--sb));overflow:auto;background:var(--cx);border-radius:var(--r);box-shadow:var(--sombra);padding:14px 16px}
#rp[hidden],#nv[hidden],#nv-centro[hidden]{display:none}
#rp-x{position:absolute;top:6px;right:8px;border:0;background:transparent;font-size:26px;color:var(--sub);width:40px;height:40px}
.rp-de,.rp-para{display:flex;align-items:center;gap:10px;padding:3px 40px 3px 0;font-size:14px;color:var(--sub);min-width:0}
.rp-para{color:var(--txt);font-weight:600;font-size:15px}
.rp-de span,.rp-para span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pt-de,.pt-para{flex:none;width:12px;height:12px;border-radius:50%;background:#2563eb;box-shadow:0 0 0 3px #fff3}
.pt-para{background:var(--dest);border-radius:50% 50% 50% 0;transform:rotate(-45deg)}
.rp-modos{display:flex;gap:6px;margin:10px 0 8px}
.rp-modos button{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;border:1px solid var(--linha);background:transparent;border-radius:10px;padding:7px 4px;color:var(--sub);font-size:13px;font-weight:600}
.rp-modos svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.rp-modos button.on{background:var(--dest);border-color:var(--dest);color:#fff}
#rp-res{font-size:15px;color:var(--sub);min-height:22px}
#rp-res b{color:var(--txt);font-size:19px}
#rp-passos{list-style:none;margin:10px 0 0;padding:0;border-top:1px solid var(--linha)}
#rp-passos li{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--linha);font-size:14px}
#rp-passos li span{flex:1;min-width:0}
#rp-passos li small{color:var(--sub);white-space:nowrap}
#rp-passos svg,#nv-seta{flex:none;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--dest)}
body.rota-on #botoes{bottom:calc(var(--altr,250px) + 18px + var(--sb))}
body.nav-on #topo,body.nav-on #botoes,body.nav-on #res,body.nav-on #cartao{display:none!important}
#nv-topo{position:fixed;z-index:8;top:calc(8px + var(--st));left:calc(8px + var(--sl));right:calc(8px + var(--sr));max-width:560px;margin:0 auto;display:flex;gap:14px;align-items:center;background:#0f766e;color:#fff;border-radius:var(--r);box-shadow:var(--sombra);padding:12px 16px}
#nv-topo #nv-seta{width:46px;height:46px;color:#fff;stroke-width:2.2}
#nv-topo>div{min-width:0}
#nv-dist{font-size:26px;font-weight:700;line-height:1.1}
#nv-txt{font-size:17px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
#nv-dep{font-size:13px;opacity:.85;margin-top:2px}
#nv-dep:empty{display:none}
#nv-baixo{position:fixed;z-index:8;bottom:calc(8px + var(--sb));left:calc(8px + var(--sl));right:calc(8px + var(--sr));max-width:560px;margin:0 auto;display:flex;gap:10px;align-items:center;background:var(--cx);border-radius:var(--r);box-shadow:var(--sombra);padding:10px 12px}
#nv-baixo>div{flex:1;min-width:0}
#nv-resto{font-size:15px;color:var(--sub)}
#nv-resto b{font-size:20px;color:var(--txt)}
#nv-vel{font-size:12px;color:var(--sub)}
#nv-voz{flex:none;width:46px;height:46px;border-radius:50%;border:1px solid var(--linha);background:transparent;color:var(--dest)}
#nv-voz svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#nv-voz .corte,#nv-voz.mudo .ondas{display:none}
#nv-voz.mudo .corte{display:inline}
#nv-voz.mudo{color:var(--sub)}
#nv-fim{flex:none;border:0;background:#dc2626;color:#fff;font-weight:700;border-radius:10px;padding:12px 14px;font-size:15px}
#nv-centro{position:fixed;z-index:8;right:calc(12px + var(--sr));bottom:calc(90px + var(--sb));border:0;background:var(--cx);color:var(--dest);font-weight:700;box-shadow:var(--sombra);border-radius:22px;padding:11px 16px}
