/* =============================================================
   ATLAS DA REDE
   A seção de filiais. É a única superfície de produto do site,
   então usa uma escala de raio própria e mais suave que o resto
   da página, que é editorial e reta.

   REGRA DE FORMA (documentada):
     editorial (cartões do arquivo, tiles)  -> --r    2px
     instrumento (atlas, card, sheet, pill) -> --r-lg 22px / --r-md 14px
   Duas famílias, cada uma com um domínio claro. Não se misturam.

   MOTION: um sistema só. Entradas em 0.7s expo.out, câmera em
   1.05s com ease própria, microinterações em 0.25s. Nada quica.
   ============================================================= */

:root {
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;

  /* Superfície de instrumento derivada do texto do tema atual via
     color-mix. Assim o atlas funciona igual numa seção preta ou
     numa branca, sem uma linha de override. */
  --surface:      color-mix(in srgb, var(--fg) 4%,  transparent);
  --surface-2:    color-mix(in srgb, var(--fg) 7%,  transparent);
  --hairline:     color-mix(in srgb, var(--fg) 12%, transparent);
  --hairline-2:   color-mix(in srgb, var(--fg) 20%, transparent);

  --ease-cam:  cubic-bezier(0.32, 0.72, 0, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- CABEÇALHO ---------- */
/* sem max-width em ch no container: isso espremeria a headline */
.atlas-head { }
.atlas-head__eyebrow { display: block; margin-bottom: clamp(1rem, 2.5vh, 1.6rem); }
.atlas-head__h {
  font-variation-settings: "wdth" 108, "wght" 620;
  font-size: clamp(2.4rem, 6.4vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
/* segunda linha em peso leve: hierarquia por peso, não por tamanho */
.atlas-head__h em {
  font-style: normal;
  font-variation-settings: "wdth" 108, "wght" 300;
  color: var(--fg-dim);
}
.atlas-head__p {
  margin-top: clamp(1.1rem, 2.5vh, 1.6rem);
  color: var(--fg-dim);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.5;
  max-width: 42ch;
}

/* ---------- CONTROLES ---------- */
.atlas-ctrl {
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
}

/* o select nativo por baixo garante o picker do sistema no celular */
.pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.15rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  transition: background 0.25s var(--ease-soft), border-color 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
}
.pill:hover { background: var(--surface-2); border-color: var(--hairline-2); }
.pill:active { transform: scale(0.975); }
.pill svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.72; }
.pill--select select {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  border: 0; appearance: none;
}
.pill__val { color: var(--fg); font-variation-settings: "wght" 500; }
.pill--ghost { background: transparent; }
.pill[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* resposta do "mais próxima": uma linha, sem caixa */
.atlas-answer {
  min-height: 1.5em;
  margin-top: 1.1rem;
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 1.5;
}
.atlas-answer b { color: var(--fg); font-variation-settings: "wght" 600; }
.atlas-answer .km { font-family: "JetBrains Mono", monospace; font-size: 0.86em; color: var(--accent-fill); }

/* ---------- PALCO DO MAPA ---------- */
.atlas {
  position: relative;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(217, 31, 38, 0.07) 0%, transparent 58%),
    var(--surface);
  overflow: hidden;
  isolation: isolate;
  /* profundidade mínima: uma luz no topo, nada de sombra pesada */
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 7%, transparent);
  touch-action: pan-y;
}
.atlas__stage { position: relative; width: 100%; aspect-ratio: 16 / 10.5; min-height: 520px; max-height: 88vh; }
.atlas__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* camada dos pins, no mesmo espaço do canvas */
.atlas__pins { position: absolute; inset: 0; pointer-events: none; }

/* ---------- PIN ---------- */
.pin {
  position: absolute;
  width: 46px; height: 46px;          /* alvo de toque confortável */
  margin: -23px 0 0 -23px;
  display: grid; place-items: center;
  pointer-events: auto;
  border: 0; background: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}
.pin__dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.7;
  transition: opacity 0.25s var(--ease-soft), background 0.25s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
  will-change: transform;
}
.pin__ring {
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid var(--fg);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
/* rótulo: some por padrão, aparece no hover e no selecionado */
.pin__label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(14px, -50%);
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-soft);
  text-shadow: 0 1px 7px var(--bg), 0 0 3px var(--bg);
}

/* estados */
.pin:hover .pin__dot,
.pin:focus-visible .pin__dot { opacity: 1; }
.pin:hover .pin__label,
.pin:focus-visible .pin__label { opacity: 0.85; }

.pin.is-sede .pin__dot { opacity: 0.8; }

.pin.is-here .pin__dot { background: var(--accent-fill); opacity: 1; }

.pin.is-selected .pin__dot {
  background: var(--accent-fill);
  opacity: 1;
  box-shadow: 0 0 0 6px rgba(217, 31, 38, 0.22);
}
.pin.is-selected .pin__label { opacity: 1; }
.pin.is-selected .pin__ring { border-color: var(--accent-fill); }

/* quando há um selecionado, os outros recuam sem sumir */
.atlas.has-selection .pin:not(.is-selected) .pin__dot { opacity: 0.34; }
.atlas.has-selection .pin:not(.is-selected):hover .pin__dot { opacity: 0.7; }

/* respiro lento só no pin de Barueri, para o olho achar a unidade */
@media (prefers-reduced-motion: no-preference) {
  .pin.is-here .pin__ring {
    opacity: 0.5;
    animation: breathe 3.6s var(--ease-soft) infinite;
  }
  .atlas.has-selection .pin.is-here:not(.is-selected) .pin__ring { animation: none; opacity: 0; }
}
@keyframes breathe {
  0%      { transform: scale(1);   opacity: 0.45; }
  60%     { transform: scale(2.6); opacity: 0; }
  100%    { transform: scale(2.6); opacity: 0; }
}

/* ---------- CARD DA FILIAL ---------- */
.acard {
  position: absolute;
  z-index: 3;
  left: clamp(0.75rem, 1.6vw, 1.5rem);
  bottom: clamp(0.75rem, 1.6vw, 1.5rem);
  width: min(410px, 36%);
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 8%, transparent), 0 18px 50px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.acard.is-on { pointer-events: auto; }

.acard__media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: var(--bg-2); }
.acard__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.06) contrast(1.1) brightness(0.72); }
/* sem foto, uma placa com as coordenadas reais da unidade:
   informação de verdade em vez de imagem genérica */
.acard__plate {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg,  var(--hairline) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(150deg, var(--bg-2), var(--bg));
}
.acard__coord {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem; letter-spacing: 0.16em;
  color: var(--fg-dim);
  text-align: center; line-height: 1.7;
}

.acard__body { padding: clamp(1rem, 1.5vw, 1.35rem); }
.acard__kicker { color: var(--fg-mute); display: block; margin-bottom: 0.45rem; }
.acard__city {
  font-variation-settings: "wdth" 110, "wght" 700;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.05; letter-spacing: -0.022em;
}
.acard__note { color: var(--fg-dim); font-size: 0.9rem; line-height: 1.5; margin-top: 0.5rem; }

.acard__rows { margin-top: 1rem; display: grid; gap: 0.6rem; }
.acard__row { display: grid; grid-template-columns: 15px 1fr; gap: 0.65rem; align-items: start; }
.acard__row svg { width: 15px; height: 15px; margin-top: 3px; color: var(--fg-mute); }
.acard__row span, .acard__row a { font-size: 0.88rem; line-height: 1.45; color: var(--fg-dim); }
.acard__row a:hover { color: var(--fg); }

/* grade de aulas: rótulo da turma em negrito, horário ao lado */
.acard__grade { display: grid; gap: 0.3rem; }
.acard__grade span { display: flex; gap: 0.6rem; font-size: 0.84rem; line-height: 1.4; color: var(--fg-dim); }
.acard__grade b {
  flex: 0 0 5.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-fill); padding-top: 2px;
}
.acard__pend { font-style: italic; }

.acard__act { display: flex; gap: 0.5rem; margin-top: 1.1rem; flex-wrap: wrap; }
.acard__act .btn { flex: 1; min-width: 0; padding-inline: 1rem; }

/* elementos que entram e saem em sequência dentro do card */
.acard [data-c] { will-change: transform, opacity; }

/* ---------- MOBILE: bottom sheet ---------- */
.atlas__grab { display: none; }

@media (max-width: 860px) {
  .atlas__stage { aspect-ratio: 3 / 3.5; }

  .acard {
    left: 0; right: 0; bottom: 0;
    width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    max-height: 82%;
    display: flex; flex-direction: column;
    touch-action: none;
  }
  /* alça de arraste: alvo generoso, visual discreto */
  /* alvo de arraste de 44px, ainda que o traço visual seja fino */
  .atlas__grab {
    display: block;
    padding: 1.25rem 0 0.9rem;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
  }
  .atlas__grab:active { cursor: grabbing; }
  .atlas__grab::before {
    content: "";
    display: block;
    width: 38px; height: 4px;
    margin-inline: auto;
    border-radius: var(--r-pill);
    background: var(--hairline-2);
  }
  .acard__scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .acard__media { aspect-ratio: 16 / 7; }
  .acard__act .btn { min-height: 48px; }

  .atlas-ctrl { width: 100%; }
  .pill { flex: 1; justify-content: center; min-width: 0; }
  .pill__val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 420px) {
  .atlas__stage { aspect-ratio: 3 / 4; }
  .pin { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .pin__label { font-size: 0.58rem; }
}

/* ---------- MOVIMENTO REDUZIDO ---------- */
@media (prefers-reduced-motion: reduce) {
  .pin__ring { display: none; }
  .acard { opacity: 1; }
  .pin, .acard, .acard [data-c] { transition: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .acard { background: var(--bg-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- FECHAR / LIMPAR ----------
   O usuário nunca pode ficar preso numa filial: existem quatro
   saídas -> o X do card, o clique no vazio do mapa, o ESC e a
   opção "Todas as unidades" no seletor. */
.acard__x {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 4;
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--hairline);
  color: var(--fg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
}
.acard__x:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.acard__x:active { transform: scale(0.92); }
.acard__x svg { width: 15px; height: 15px; }

/* o palco inteiro é clicável para limpar; os pins param o evento */
.atlas__stage { cursor: default; }
.atlas.has-selection .atlas__stage { cursor: zoom-out; }
.atlas.has-selection .atlas__pins,
.atlas.has-selection .acard { cursor: default; }

@media (max-width: 860px) {
  /* no celular o X sobe para não brigar com a alça de arraste,
     e cresce para o mínimo de 44px de alvo de toque */
  .acard__x { top: 8px; right: 12px; width: 46px; height: 46px; }
}
/* ---------- MAPA DE BORDA A BORDA ----------
   O atlas sai da largura de texto e ocupa a viewport inteira. Ele é
   o conteúdo principal da seção, não uma ilustração de apoio. */
/* já está fora do .wrap, então preencher 100% da seção basta.
   nada de 100vw com margem negativa: isso somaria a largura da
   barra de rolagem e criaria overflow lateral. */
.atlas--bleed {
  width: 100%;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}
@media (max-width: 860px) {
  .atlas--bleed .atlas__stage { aspect-ratio: 3 / 3.9; min-height: 440px; max-height: 78vh; }
  /* no celular o pin cresce mais: dedo é maior que cursor */
  .pin__dot  { width: 16px; height: 16px; }
  .pin__ring { width: 16px; height: 16px; }
}
/* =============================================================
   DIRETÓRIO MUNDIAL
   Mapa à esquerda, árvore de navegação à direita. O nível atual
   manda: no mundo existem países, não academias.
   ============================================================= */

.dir-head { max-width: 62ch; }
.dir-head__eyebrow { display: block; margin-bottom: clamp(0.9rem, 2vh, 1.4rem); }
.dir-head__h {
  font-family: "Big Shoulders Display", "Archivo", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 0.86; letter-spacing: -0.008em; text-transform: uppercase;
}
.dir-head__p { margin-top: 1.2rem; color: var(--fg-dim); font-size: clamp(1rem, 1.2vw, 1.15rem); line-height: 1.55; max-width: 52ch; }

.dir-stats { display: flex; gap: clamp(1.75rem, 4vw, 3.5rem); margin-top: clamp(1.75rem, 4vh, 2.5rem); }
.dir-stats div { display: grid; gap: 0.3rem; }
.dir-stats .num { font-size: clamp(1.8rem, 3.2vw, 3rem); line-height: 1; }
.dir-stats .mono { color: var(--fg-mute); }

/* --- controles --- */
.dir-ctrl { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; margin-top: clamp(1.75rem, 4vh, 2.5rem); }
.dir-search { position: relative; flex: 1 1 320px; min-width: 260px; display: flex; align-items: center; gap: 0.65rem;
  min-height: 48px; padding: 0 1.1rem; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); background: var(--surface); }
.dir-search svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.6; }
.dir-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font-size: 0.95rem; }
.dir-search input::placeholder { color: var(--fg-mute); }

.dir-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 6;
  background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--r-md);
  box-shadow: 0 22px 60px rgba(0,0,0,0.18); overflow: hidden; max-height: 340px; overflow-y: auto;
}
.dres { display: grid; gap: 0.15rem; width: 100%; text-align: left; padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule); transition: background 0.2s var(--ease-soft); }
.dres:last-child { border-bottom: 0; }
.dres:hover { background: var(--surface-2); }
.dres__n { font-variation-settings: "wght" 600; font-size: 0.94rem; }
.dres__w { font-family: "JetBrains Mono", monospace; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-mute); }
.dres__none { padding: 1rem; color: var(--fg-mute); font-size: 0.9rem; }

.dir-answer { min-height: 1.5em; margin-top: 1rem; color: var(--fg-dim); font-size: 0.95rem; }
.dir-answer b { color: var(--fg); font-variation-settings: "wght" 650; }
.dir-answer .km { font-family: "JetBrains Mono", monospace; color: var(--accent-fill); }

/* --- palco: mapa + coluna --- */
.dir-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  margin-top: clamp(2rem, 5vh, 3rem);
  padding-inline: var(--gut);
  max-width: var(--maxw); margin-inline: auto;
}
.dir-stage .atlas { margin-top: 0; }
.dir-stage .atlas__stage { aspect-ratio: auto; height: clamp(520px, 74vh, 820px); min-height: 0; max-height: none; }

.dir-side {
  display: flex; flex-direction: column;
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
  max-height: clamp(520px, 74vh, 820px);
}

/* --- breadcrumbs --- */
.dir-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem;
  padding: 1rem 1.1rem; border-bottom: 1px solid var(--rule); flex-shrink: 0; }
/* o traço é pequeno, mas o alvo de toque não pode ser: padding
   vertical leva o botão ao mínimo de 44px sem inchar o visual */
.crumb { font-family: "JetBrains Mono", monospace; font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-mute); transition: color 0.2s var(--ease-soft);
  min-height: 44px; display: inline-flex; align-items: center; padding-inline: 0.15rem; }
.crumb:hover { color: var(--accent-fill); }
.crumb--now { color: var(--fg); font-weight: 700; }
.crumb__sep { color: var(--fg-mute); opacity: 0.5; font-size: 0.7rem; }

/* --- lista do nível atual --- */
.dir-list { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.drow { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; text-align: left; min-height: 56px; padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s var(--ease-soft), padding-left 0.3s var(--ease-soft); }
.drow:hover { background: var(--surface-2); padding-left: 1.4rem; }
.drow__l { font-variation-settings: "wdth" 106, "wght" 600; font-size: 0.98rem; line-height: 1.2; }
.drow__c { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-mute); flex-shrink: 0; }
.drow--nocoord .drow__l { color: var(--fg-mute); }
.drow--nocoord::after { content: "?"; font-family: "JetBrains Mono", monospace; font-size: 0.6rem; color: var(--fg-mute); }

/* --- card da academia --- */
.dcard { padding: 1.2rem 1.1rem 1.4rem; border-top: 1px solid var(--rule); flex-shrink: 0; overflow-y: auto; }
.dcard__top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.dcard__cat, .dcard__badge {
  font-family: "JetBrains Mono", monospace; font-size: 0.58rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.32rem 0.6rem; border-radius: var(--r-pill); }
.dcard__cat { background: var(--accent-fill); color: #fff; }
.dcard__badge { border: 1px solid var(--hairline-2); color: var(--fg-mute); }
.dcard__badge.is-ok { color: var(--fg); border-color: var(--fg); }
.dcard__name { font-variation-settings: "wdth" 110, "wght" 700; font-size: 1.25rem; line-height: 1.15; }
.dcard__where { font-family: "JetBrains Mono", monospace; font-size: 0.64rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-mute); margin-top: 0.4rem; }
.dcard__note { color: var(--fg-dim); font-size: 0.88rem; line-height: 1.5; margin-top: 0.7rem; }
.dcard__rows { display: grid; gap: 0.5rem; margin-top: 0.9rem; }
.dcard__row { display: grid; grid-template-columns: 15px 1fr; gap: 0.6rem; align-items: start; }
.dcard__row svg { width: 15px; height: 15px; margin-top: 3px; color: var(--fg-mute); }
.dcard__row span, .dcard__row a { font-size: 0.86rem; line-height: 1.45; color: var(--fg-dim); }
.dcard__row a:hover { color: var(--accent-fill); }
.dcard__pend { font-size: 0.8rem; font-style: italic; color: var(--fg-mute); margin-top: 0.8rem; }
.dcard__act { margin-top: 1rem; }
.dcard__act .btn { width: 100%; }

/* --- marcadores hierárquicos --- */
.mk { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center; pointer-events: auto; border: 0; background: none;
  -webkit-tap-highlight-color: transparent; will-change: transform, opacity; }
/* ALFINETE. O ícone é o marcador; o número, quando existe, é um
   selo preso a ele. Antes era um balão só com o dígito, que lia
   como etiqueta de dado e não como ponto no mapa. */
.mk__pin { position: relative; display: grid; place-items: center;
  transition: transform 0.25s var(--ease-soft); }
.mk__pin svg { display: block; fill: var(--accent-fill);
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.45)); }
.mk--cluster .mk__pin svg { width: 34px; height: 34px; }
.mk--spot .mk__pin svg { width: 25px; height: 25px; opacity: 1; }
.mk__n { position: absolute; top: -6px; right: -10px;
  min-width: 21px; height: 21px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--fg); color: var(--bg);
  font-family: "JetBrains Mono", monospace; font-size: 0.64rem; font-weight: 700;
  border: 1.5px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.55); }
.mk:hover .mk__pin, .mk:focus-visible .mk__pin { transform: scale(1.16) translateY(-2px); }

/* O rótulo era `opacity: 0` até o hover — no celular, que não tem hover,
   o nome do lugar NUNCA aparecia: só um alfinete vermelho sem contexto.
   Agora fica sempre visível, sobre uma tarja que garante a leitura em
   cima de qualquer parte do mapa. */
.mk__label { position: absolute; top: 50%; left: 50%; transform: translate(22px, -50%);
  white-space: nowrap; font-family: "JetBrains Mono", monospace; font-size: 0.64rem;
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--fg);
  padding: 3px 7px; border-radius: 4px;
  background: rgba(11, 13, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 1; pointer-events: none;
  transition: background 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft); }
.mk:hover .mk__label, .mk:focus-visible .mk__label {
  background: rgba(255, 59, 48, 0.92); border-color: #ff3b30; color: #fff; }
.mk--spot .mk__label { transform: translate(16px, -50%); font-size: 0.6rem; }

/* segunda posição possível: à esquerda do alfinete, usada pelo
   anti-colisão quando o lado direito já está ocupado */
.mk__label--esq { transform: translate(calc(-100% - 22px), -50%); }
.mk--spot .mk__label--esq { transform: translate(calc(-100% - 16px), -50%); }

/* Em telas estreitas o mapa é pequeno e 13 tarjas se atropelam. Ali só os
   agrupamentos (país/estado) mostram o nome; os pontos soltos mantêm o
   alfinete maior e revelam o nome ao toque. */
@media (max-width: 700px) {
  .mk__label { font-size: 0.58rem; padding: 2px 5px; transform: translate(18px, -50%); }
  .mk--spot .mk__label { opacity: 0; }
  .mk--spot:focus-visible .mk__label, .mk--spot.is-on .mk__label { opacity: 1; }
}

/* --- CONTROLES DE ZOOM DO MAPA --- */
.atlas__zoom {
  position: absolute;
  top: clamp(0.75rem, 1.5vw, 1.25rem);
  right: clamp(0.75rem, 1.5vw, 1.25rem);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.atlas__zoom-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--fg);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s var(--ease-soft), transform 0.2s var(--ease-soft), border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.atlas__zoom-btn:hover {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: #fff;
  transform: scale(1.08);
}
.atlas__zoom-btn:active {
  transform: scale(0.92);
}
.atlas__zoom-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.atlas__zoom-btn--reset {
  margin-top: 0.25rem;
}

/* seletor de idioma no header — precisa ser óbvio, é a porta de entrada
   para 6 idiomas. Fica visível em TODA largura de tela. */
.nav__lang {
  min-height: 40px;
  padding: 0 0.6rem 0 0.55rem;
  flex-shrink: 0;
  gap: 0.4rem;
  border: 1px solid var(--rule-2);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.nav__lang:hover,
.nav__lang:focus-within {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.nav__lang .pill__val {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.nav__lang-globe {
  width: 17px; height: 17px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav__lang-caret {
  width: 13px; height: 13px;
  flex-shrink: 0;
  opacity: 0.6;
}

@media (max-width: 1100px) {
  /* mobile: o mapa em cima, a navegação vira painel abaixo */
  .dir-stage { grid-template-columns: 1fr; padding-inline: 0; }
  .dir-stage .atlas { border-radius: 0; border-left: 0; border-right: 0; }
  .dir-stage .atlas__stage { height: clamp(380px, 52vh, 560px); }
  .dir-side { max-height: 62vh; margin-inline: var(--gut); border-radius: var(--r-lg); }
  .dir-search { flex: 1 1 100%; }
  .dir-ctrl .pill { flex: 1; justify-content: center; }
  .drow { min-height: 60px; }
  /* Antes havia `display:none` aqui com um fallback em `.nav__links
     .nav__lang`, mas o elemento fica em `.nav__inner` — o seletor nunca
     casava e o troca-idioma sumia por completo abaixo de 1100px.
     Agora ele permanece na barra, ao lado do menu. */
  .nav__lang { margin-left: auto; margin-right: 0.5rem; }
  .atlas__zoom { top: 0.6rem; right: 0.6rem; }
  .atlas__zoom-btn { width: 44px; height: 44px; }
}

@media (max-width: 860px) {
  .dir-head__h {
    font-size: clamp(2rem, 6.8vw, 4rem);
    line-height: 0.92;
    overflow-wrap: break-word;
    word-break: normal;
  }
}

/* ---------- PAINEL DO MAPA EM ESCURO ----------
   A seção da rede é clara, mas o mapa em si é um painel escuro.
   Ponto claro sobre fundo escuro tem muito mais contraste que o
   inverso, e o alfinete vermelho salta. Como todo o atlas lê
   tokens semânticos, basta redefini-los aqui dentro. */
.atlas {
  --bg:        #0d0f14;
  --bg-2:      #151922;
  --fg:        #e8eaf0;
  --fg-dim:    #a8adba;
  --fg-mute:   #767c8a;
  --accent:    #ff4a42;
  --accent-fill: #ff3b30;
  color: var(--fg);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 59, 48, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #11141b 0%, #0b0d12 100%);
  border-color: rgba(255, 255, 255, 0.10);
  touch-action: pan-y pinch-zoom;
}
/* O mapa trata pan e zoom por conta própria (pointerdown/touchstart em
   atlas.js). Com `touch-action: pan-y` o navegador interpretava o arrasto
   vertical como rolagem e a página descia junto com o mapa. `none` entrega
   o gesto ao mapa. A seção tem área livre acima e abaixo do palco, então
   ainda dá para rolar a página normalmente. */
.atlas__stage,
.atlas__canvas,
.atlas__markers { touch-action: none; }

/* ---------- SAÍDA DO NÍVEL, SOBRE O MAPA ----------
   O breadcrumb vive na lateral; no celular ele fica abaixo do mapa e a
   pessoa não acha como voltar. Estes dois ficam sobre o próprio mapa. */
.atlas__back,
.atlas__exit {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 13, 18, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e8eaf0;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
}
.atlas__back[hidden],
.atlas__exit[hidden] { display: none; }

.atlas__back {
  top: 0.6rem; left: 0.6rem;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.9rem 0 0.7rem;
  max-width: calc(100% - 6rem);
  border-radius: var(--r-pill);
}
.atlas__back:hover { background: rgba(255, 59, 48, 0.9); border-color: #ff3b30; }
.atlas__back-i { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.atlas__back-t {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.atlas__exit {
  top: 0.6rem; right: 0.6rem;
  width: 44px; height: 44px;
  border-radius: 50%;
}
.atlas__exit:hover { background: rgba(255, 59, 48, 0.9); border-color: #ff3b30; transform: rotate(90deg); }
.atlas__exit svg { width: 16px; height: 16px; fill: currentColor; }

/* o X de sair ocupa o canto superior direito: o zoom desce para não colidir */
.atlas:not([data-level="world"]) .atlas__zoom { top: 3.6rem; }

/* o traço do rótulo precisa do fundo escuro por baixo */
.mk__label { text-shadow: 0 1px 8px #0b0d12, 0 0 4px #0b0d12; }

/* ---------- SAÍDA DO CARD ----------
   Sem isto o usuário selecionava uma filial no celular e não tinha
   como voltar: os breadcrumbs ficavam fora da área visível. */
.dcard { position: relative; }
.dcard__close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  width: 46px; height: 46px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  border: 1px solid var(--hairline-2); background: var(--surface-2); color: var(--fg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s var(--ease-soft), transform 0.2s var(--ease-soft), color 0.2s;
}
.dcard__close:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.dcard__close:active { transform: scale(0.92); }
.dcard__close svg { width: 18px; height: 18px; }
.dcard__top { padding-right: 52px; }

@media (max-width: 860px) {
  /* Estas duas pílulas dividiam a linha em 163px cada e cortavam o
     rótulo. Como atlas.css carrega depois de style.css, a correção
     precisa morar AQUI para vencer a regra `flex: 1` anterior.
     min-width:0 é o que deixa o texto encolher dentro do flex. */
  .dir-ctrl .pill { flex: 1 1 100%; justify-content: flex-start; min-height: 52px; }
  .dir-ctrl .pill__val { flex: 1; min-width: 0; white-space: normal; line-height: 1.25; }
}

@media (max-width: 1100px) {
  /* a coluna do diretório rola junto com a página no celular */
  .dir-side { max-height: none; }
  .dir-list { max-height: 46vh; }
  .dir-crumbs { position: sticky; top: 0; z-index: 2;
    background: var(--bg); }
}