body.tela-mapa { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
#mapa { flex: 1; min-height: 0; background: var(--surface-2); }
.leaflet-container { font: 13px/1.4 var(--body); }
.leaflet-control-attribution { font-size: 10px; max-width: 70vw; }

.flutua {
  position: absolute; z-index: 1040; top: calc(var(--topo-h, 56px) + .6rem); right: .6rem; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 12px; padding: .55rem .8rem; font-family: var(--head); font-weight: 600; box-shadow: var(--shadow); cursor: pointer; min-height: 44px;
}
.painel-ctl {
  position: absolute; z-index: 1050; top: calc(var(--topo-h, 56px) + .6rem); right: .6rem; width: min(340px, calc(100vw - 1.2rem)); max-height: calc(100dvh - 80px);
  overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: .7rem .8rem 1rem;
}
.painel-ctl h4 { margin: .9rem 0 .35rem; font-size: 1rem; }
.ctl-cab { display: flex; justify-content: space-between; align-items: center; font-family: var(--head); font-size: 1.15rem; }
.seg { display: flex; flex-wrap: wrap; gap: .25rem; }
.seg button { flex: 1; min-height: 38px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; cursor: pointer; font-size: .84rem; padding: .2rem .4rem; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.legenda { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .5rem; font-size: .74rem; color: var(--muted); margin-top: .45rem; }
.legenda i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; }
.lista-rotas { display: grid; gap: .3rem; }
.chk { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; cursor: pointer; padding: .2rem 0; }
.chk input { width: 18px; height: 18px; margin-top: .12rem; accent-color: var(--accent); flex: none; }
.chk .cor { width: 14px; height: 6px; border-radius: 3px; display: inline-block; margin-top: .45rem; flex: none; }
.chk small { color: var(--muted); display: block; font-size: .74rem; }

/* marcadores */
.mk { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--none); background: var(--surface-2) center/cover; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.mk.bo { border-style: dashed; }
.mk .sem { display: grid; place-items: center; width: 100%; height: 100%; font: 700 13px var(--head); color: var(--ink); }
.mk-sp { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.rot-sp { font: 700 12px var(--head); color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; }
.grupo-mk {
  width: 50px; height: 50px; border-radius: 50%; background: var(--surface) center/cover; border: 4px solid var(--ink);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.45); position: relative;
}
.grupo-mk b { position: absolute; right: -6px; top: -6px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; font: 700 12px var(--body); padding: 1px 6px; }
.rotulo-dia { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 1px 6px; font: 700 11px var(--head); box-shadow: var(--shadow); white-space: nowrap; }

/* painel do lugar: folha de baixo no celular, lateral no computador */
.painel-lugar {
  position: absolute; z-index: 1100; left: 0; right: 0; bottom: 0; max-height: 78dvh; overflow-y: auto; background: var(--surface);
  border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.3); padding: 0 0 1.2rem; -webkit-overflow-scrolling: touch;
}
.painel-lugar .alca { display: flex; justify-content: center; padding: .45rem 0 .2rem; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.painel-lugar .alca span { width: 44px; height: 5px; border-radius: 9px; background: var(--line); }
.painel-lugar .fechar { position: absolute; right: .5rem; top: .25rem; z-index: 3; background: var(--surface); border-radius: 50%; width: 36px; height: 36px; border: 1px solid var(--line); cursor: pointer; }
.painel-lugar .conteudo { padding: 0 .9rem; }
.carrossel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .4rem; padding: 0 .9rem .2rem; scrollbar-width: thin; }
.carrossel figure { margin: 0; flex: 0 0 88%; scroll-snap-align: center; }
.carrossel img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 12px; background: var(--surface-2); display: block; }
.carrossel figure:only-child { flex-basis: 100%; }
.painel-lugar h2 { margin: .6rem 0 0; }
.ficha { display: grid; grid-template-columns: auto 1fr; gap: .25rem .7rem; font-size: .86rem; margin: .6rem 0; }
.ficha dt { color: var(--muted); }
.ficha dd { margin: 0; }
.votos-casais { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .5rem 0; font-size: .85rem; }
.votos-casais div { background: var(--surface-2); border-radius: 10px; padding: .4rem .55rem; }
.fontes-lista { font-size: .7rem; color: var(--muted); padding-left: 1rem; margin: .3rem 0; }
.fontes-lista a { color: inherit; }

@media (min-width: 860px) {
  .painel-lugar { left: auto; top: var(--topo-h, 56px); width: 420px; max-height: none; border-radius: 0; box-shadow: -6px 0 24px rgba(0,0,0,.18); }
  .painel-lugar .alca { display: none; }
  .painel-lugar .fechar { position: sticky; float: right; margin: .5rem .5rem 0 0; }
  .painel-lugar .carrossel { padding-top: .5rem; }
}
