/* Floripa Legal · estilos compartilhados (Bitnix UI) entre o mapa público e a administração */
  /* ===== TOKENS (Bitnix UI): troque só o bloco de marca ===== */
  :root {
    --brand: #C2410C; --on-brand: #FFFFFF;     /* laranja-tijolo: sinal de alerta urbano */
    --ink: #26211E; --on-ink: #FFFFFF;          /* neutro escuro derivado da marca */
    --ink-soft: #5F5752; --muted: #8E8681;
    --surface: #FFFFFF; --surface-alt: #F4F2EF;
    --line: #E2DDD8;
    --success: #2F7D32; --warn: #B45309; --danger: #C62828;
    --line-1: 1px; --line-2: 2px; --line-3: 3px;
    --font: "Montserrat", system-ui, sans-serif;
    --press: inset 0 -3px 0 rgba(0,0,0,.14); --lift: 0 1px 2px rgba(0,0,0,.06);
    --side: 380px; --peek: 152px;
  }
  :root[data-theme="dark"] {
    --ink: #EDE8E3; --on-ink: #171513; --ink-soft: #BDB5AF; --muted: #8C847E;
    --surface: #171513; --surface-alt: #201D1B; --line: #36312D; --lift: none;
  }

  * { box-sizing: border-box; margin: 0; }
  [hidden] { display: none !important; }
  html, body { height: 100%; }
  body {
    background: var(--surface); color: var(--ink);
    font: 400 15px/1.5 var(--font);
    display: grid; grid-template-columns: var(--side) 1fr; overflow: hidden;
  }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  :focus-visible { outline: var(--line-2) solid var(--brand); outline-offset: 3px; }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

  /* ===== TIPOGRAFIA ===== */
  .bx-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .bx-h3 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
  .bx-h3 b { font-weight: 800; }

  /* ===== BOTÕES ===== */
  .bx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 24px; white-space: nowrap;
    border: 0; border-radius: 0; font: 700 13px/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
    background: var(--brand); color: var(--on-brand); box-shadow: var(--press);
  }
  .bx-btn--ink { background: var(--ink); color: var(--on-ink); }
  .bx-btn--block { width: 100%; }
  .bx-btn--outline { background: none; box-shadow: none; border: var(--line-2) solid currentColor; color: var(--ink); min-height: 48px; }
  .bx-btn--outline::before { content: ""; width: 12px; height: var(--line-2); background: currentColor; }
  .bx-btn:disabled { opacity: .45; cursor: not-allowed; }
  .bx-icon-btn {
    width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 0;
    background: var(--ink); color: var(--on-ink); box-shadow: var(--press);
  }

  /* ===== SIDEBAR ===== */
  aside {
    background: var(--surface); border-right: var(--line-1) solid var(--line);
    display: flex; flex-direction: column; min-height: 0; z-index: 500; position: relative;
  }
  .bx-topline { display: flex; height: 3px; flex: none; }
  .bx-topline::before, .bx-topline::after { content: ""; flex: 1; }
  .bx-topline::before { background: var(--ink); }
  .bx-topline::after { background: var(--brand); }

  /* header de marca com o CTA cavalgando a divisória */
  .side-head { background: var(--brand); color: var(--on-brand); padding: 22px 24px 50px; position: relative; flex: none; }
  .side-head .bx-label { color: rgba(255,255,255,.78); }
  .side-head h1 { font-size: 30px; font-weight: 300; letter-spacing: .02em; line-height: 1; text-transform: uppercase; margin: 8px 0 10px; }
  .side-head h1 b { font-weight: 800; }
  .side-head p { font-size: 14px; max-width: 30ch; opacity: .92; }
  .theme-btn {
    position: absolute; top: 18px; right: 20px; width: 36px; height: 36px; display: grid; place-items: center;
    background: none; color: #fff; border: var(--line-1) solid rgba(255,255,255,.6); border-radius: 50%;
  }
  .cta-wrap { padding: 0 24px; margin-top: -26px; position: relative; z-index: 2; flex: none; }
  .cta-wrap .bx-btn { width: 100%; padding: 0 16px; font-size: 12px; white-space: nowrap; }
  .cta-wrap .bx-btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

  .scroll { overflow-y: auto; flex: 1; min-height: 0; }
  .block { padding: 20px 24px; border-bottom: var(--line-1) solid var(--line); }
  .block:last-child { border-bottom: 0; }
  .section-head {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
    padding-bottom: 10px; margin-bottom: 4px; border-bottom: var(--line-1) solid var(--ink);
  }
  .link-btn { border: 0; background: none; padding: 0; font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }

  /* pares de dado */
  .bx-data { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); border: var(--line-1) solid var(--line); border-right: 0; }
  .bx-data > div { padding: 12px 8px; text-align: center; border-right: var(--line-1) solid var(--line); }
  .bx-data strong { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .bx-data .bx-label { display: block; margin-top: 4px; font-size: 10px; }

  /* busca: campo com ação */
  .bx-input-action { display: grid; grid-template-columns: 1fr 52px; border: var(--line-1) solid var(--line); }
  .bx-input-action input { min-height: 50px; padding: 0 16px; border: 0; border-radius: 0; background: var(--surface); outline: none; min-width: 0; font-size: 14px; }
  .bx-input-action input::placeholder { color: var(--muted); }
  .bx-input-action span { display: grid; place-items: center; background: var(--ink); color: var(--on-ink); }
  .bx-input-action:focus-within { outline: var(--line-2) solid var(--brand); outline-offset: 2px; }

  /* categorias: acento de família */
  .cats { display: flex; flex-direction: column; }
  .cat {
    display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: center; min-height: 52px; padding: 0 2px;
    border: 0; border-bottom: var(--line-1) solid var(--line); background: none; text-align: left; width: 100%;
  }
  .cat:last-child { border-bottom: 0; }
  .sq { width: 32px; height: 32px; display: grid; place-items: center; background: var(--c); color: #fff; border: var(--line-2) solid var(--c); }
  .cat .name { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
  .cat .count { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
  .cat:hover .name { color: var(--c); }
  .cat[aria-pressed="false"] .sq { background: none; color: var(--muted); border-color: var(--line); }
  .cat[aria-pressed="false"] .name { color: var(--muted); font-weight: 500; }

  /* abas */
  .bx-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: var(--line-1) solid var(--line); }
  .bx-tabs button {
    padding: 14px 2px 12px; background: none; border: 0; border-bottom: var(--line-3) solid transparent; margin-bottom: -1px;
    font: 700 10.5px var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  }
  .bx-tabs button:hover { color: var(--ink); }
  .bx-tabs [aria-pressed="true"] { color: var(--ink); border-color: var(--brand); }
  .tabs-label { margin: 18px 0 0; }
  .tabs-label:first-child { margin-top: 0; }

  /* lista de ocorrências */
  .list { display: flex; flex-direction: column; }
  .bx-list-row {
    display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; padding: 14px 2px 14px 0;
    border: 0; border-bottom: var(--line-1) solid var(--line); background: none; text-align: left; width: 100%;
    position: relative;
  }
  .bx-list-row::before { content: ""; position: absolute; left: -24px; top: 0; bottom: 0; width: var(--line-3); background: transparent; }
  .bx-list-row:hover::before { background: var(--line); }
  .bx-list-row.active::before { background: var(--brand); }
  .bx-list-row h3 { font-size: 14px; font-weight: 600; line-height: 1.3; }
  .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
  .empty { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }

  .tag { white-space: nowrap; font: 700 9.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border: var(--line-1) solid currentColor; }
  .tag.aberto { color: var(--danger); }
  .tag.analise { color: var(--warn); }
  .tag.resolvido { color: var(--success); }
  .tag.pendente { color: var(--ink-soft); border-style: dashed; }
  .sev { display: inline-flex; gap: 2px; }
  .sev i { width: 6px; height: 11px; background: var(--line); }
  .sev[data-l="1"] i:nth-child(-n+1), .sev[data-l="2"] i:nth-child(-n+2), .sev[data-l="3"] i:nth-child(-n+3) { background: var(--ink); }

  .side-foot { padding: 20px 24px 28px; font-size: 11.5px; color: var(--muted); border-top: var(--line-1) solid var(--line); background: var(--surface-alt); }
  .scope-note { color: var(--ink); font-size: 12.5px; padding-left: 10px; border-left: var(--line-3) solid var(--brand); margin-bottom: 8px; }
  .scope-note b { font-weight: 700; }
  .scope-note a { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

  /* ===== CAMPOS ===== */
  .bx-field-label { position: relative; display: block; }
  .bx-field-label > span { position: absolute; left: 14px; top: 8px; font: 600 9px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
  .bx-field-label > input, .bx-field-label > select, .bx-field-label > textarea {
    width: 100%; height: 52px; padding: 20px 14px 0; border: var(--line-1) solid var(--line); border-radius: 0;
    background: var(--surface); font: 400 14px var(--font); color: var(--ink); outline: none;
  }
  .bx-field-label > textarea { height: 92px; padding-top: 24px; resize: vertical; line-height: 1.4; }
  .bx-field-label > select {
    appearance: none; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8681' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
  }
  .bx-field-label > :focus { border-color: var(--ink); box-shadow: inset 0 calc(-1 * var(--line-2)) 0 var(--brand); }
  .bx-field-label > ::placeholder { color: var(--muted); }
  /* foto opcional */
  .photo-drop {
    display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; min-height: 64px; padding: 12px 14px;
    border: var(--line-1) dashed var(--muted); background: var(--surface); cursor: pointer;
  }
  .photo-drop:hover, .photo-drop.drag { border-style: solid; border-color: var(--brand); }
  .photo-drop:focus-within { outline: var(--line-2) solid var(--brand); outline-offset: 2px; }
  .photo-drop .ic { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); }
  .photo-drop b { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .photo-drop small { font-size: 12px; color: var(--muted); }
  .photo-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .photo-preview { position: relative; border: var(--line-3) solid var(--surface); outline: var(--line-1) solid var(--line); margin-bottom: 22px; }
  .photo-preview img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
  .photo-preview .bx-icon-btn { position: absolute; right: 12px; bottom: -22px; border-radius: 50%; border: var(--line-3) solid var(--surface); box-shadow: none; }
  .photo-preview .bx-label { position: absolute; left: 0; bottom: -20px; }
  .photo-error { font-size: 12px; color: var(--danger); }

  /* ===== CADASTRO EM PASSOS ===== */
  .wizard {
    position: fixed; z-index: 1100; display: flex; flex-direction: column; background: var(--surface);
    left: 0; top: 0; bottom: 0; width: var(--side); border-right: var(--line-1) solid var(--line);
    transform: translateX(-100%); transition: transform .25s ease-out;
  }
  .wizard.open { transform: none; }
  .wz-head { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; padding: 14px 16px 12px; border-top: var(--line-3) solid var(--brand); }
  .wz-head .bx-h3 { font-size: 17px; font-weight: 300; letter-spacing: .03em; line-height: 1.15; margin-top: 2px; }
  .wz-icon { width: 44px; height: 44px; display: grid; place-items: center; border: var(--line-1) solid var(--line); background: var(--surface); color: var(--ink); }
  .wz-icon:hover { border-color: var(--ink); }
  .wz-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 16px; }
  .wz-progress i { height: 4px; background: var(--line); transition: background .2s; }
  .wz-progress i.on { background: var(--brand); }
  .wz-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; }
  .wz-help { color: var(--ink-soft); font-size: 15px; margin-bottom: 14px; }
  .wz-place {
    display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 12px 14px;
    border: var(--line-1) solid var(--line); background: var(--surface-alt); font-size: 14px; font-weight: 600; margin-bottom: 12px; min-height: 48px;
  }
  .wz-place small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
  .wz-place svg { color: var(--brand); margin-top: 1px; }
  .wz-foot { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: var(--line-1) solid var(--line); background: var(--surface); }
  .wz-foot .bx-btn { width: 100%; min-height: 56px; font-size: 13px; }
  .wz-group { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
  .wz-group > legend { padding: 0; margin-bottom: 10px; }
  .wz-error { color: var(--danger); font-size: 13px; font-weight: 600; margin-top: 8px; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .wz-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wz-cat {
    position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; min-height: 68px; padding: 10px 12px;
    border: var(--line-1) solid var(--line); background: var(--surface); cursor: pointer;
    font: 700 11.5px/1.25 var(--font); letter-spacing: .04em; text-transform: uppercase; touch-action: manipulation;
  }
  .wz-cat input, .wz-sev input { position: absolute; opacity: 0; pointer-events: none; }
  .wz-cat:has(input:checked) { box-shadow: inset 0 0 0 var(--line-3) var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
  .wz-cat:has(input:checked)::after {
    content: ""; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; background: var(--c)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat;
  }
  .wz-cat:has(input:focus-visible), .wz-sev label:has(input:focus-visible) { outline: var(--line-2) solid var(--brand); outline-offset: 2px; }
  .wz-cat:active { background: var(--surface-alt); }

  .wz-sev { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .wz-sev label {
    position: relative; display: grid; justify-items: center; gap: 4px; min-height: 76px; padding: 12px 6px; text-align: center;
    border: var(--line-1) solid var(--line); background: var(--surface); cursor: pointer; touch-action: manipulation;
  }
  .wz-sev b { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .wz-sev small { font-size: 11.5px; color: var(--muted); }
  .wz-sev label:has(input:checked) { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
  .wz-sev label:has(input:checked) small { color: inherit; opacity: .75; }
  .wz-sev label:has(input:checked) .sev i { background: var(--line); }
  .wz-sev label:has(input:checked) .sev[data-l="1"] i:nth-child(-n+1),
  .wz-sev label:has(input:checked) .sev[data-l="2"] i:nth-child(-n+2),
  .wz-sev label:has(input:checked) .sev[data-l="3"] i:nth-child(-n+3) { background: var(--brand); }
  .wz-fields { display: grid; gap: 8px; }

  /* alvo fixo no centro da área visível do mapa */
  .center-pin { position: absolute; left: 50%; top: calc((100% - var(--wz-h, 0px)) / 2); z-index: 650; width: 0; height: 0; pointer-events: none; }
  .center-pin .pin { position: absolute; left: -16px; top: -42px; --c: #26211E; transition: transform .15s ease-out; }
  .center-pin::after { content: ""; position: absolute; left: -5px; top: -2px; width: 10px; height: 4px; border-radius: 50%; background: rgba(0,0,0,.45); }
  .center-pin.moving .pin { transform: translateY(-8px); }

  .toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 1500; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 14px 18px;
    background: var(--ink); color: var(--on-ink); font: 600 13px var(--font); transition: opacity .2s, transform .2s;
  }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }
  .toast svg { color: var(--brand); flex: none; }

  /* foto no card do mapa e visualização ampliada */
  .pop-photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 0; padding: 0; cursor: zoom-in; background: var(--surface-alt); }
  .pop-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .lightbox {
    position: fixed; inset: 0; z-index: 2000; display: none; place-items: center; padding: 24px;
    background: rgba(23, 21, 19, .86); cursor: zoom-out;
  }
  .lightbox.open { display: grid; }
  .lightbox img { max-width: min(1100px, 100%); max-height: 86vh; border: var(--line-3) solid #fff; }
  .lightbox .bx-icon-btn { position: absolute; top: 20px; right: 20px; background: #fff; color: #171513; }

  /* ===== MAPA ===== */
  main { position: relative; min-width: 0; }
  #map { position: absolute; inset: 0; background: var(--surface-alt); }
  .base-tiles { filter: grayscale(1) contrast(.92) brightness(1.04); }
  .dark-map .base-tiles { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); }

  .map-tools { position: absolute; right: 20px; bottom: 32px; z-index: 600; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

  /* compartilhar: barra compacta no canto do mapa */
  .share-bar { display: flex; align-items: center; background: var(--surface); border: var(--line-1) solid var(--line); box-shadow: var(--lift); margin-top: 8px; }
  .share-label { padding: 0 12px; font: 700 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
  .share-btn {
    width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-left: var(--line-1) solid var(--line);
    background: var(--surface); color: var(--ink); text-decoration: none;
  }
  .share-btn:hover { background: var(--brand); color: var(--on-brand); }
  .map-tools .legend-toggle { display: none; }

  /* ranking de bairros: escada tonal da marca para o grafite */
  .bx-ladder { display: grid; gap: 6px; margin-top: 10px; }
  .bx-ladder > button {
    display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; min-height: 48px; padding: 0 14px;
    border: 0; border-radius: 0; color: #fff; text-align: left; box-shadow: var(--press);
    font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase;
  }
  .bx-ladder > button:nth-child(1) { background: var(--brand); }
  .bx-ladder > button:nth-child(2) { background: color-mix(in srgb, var(--brand) 82%, #26211E); }
  .bx-ladder > button:nth-child(3) { background: color-mix(in srgb, var(--brand) 64%, #26211E); }
  .bx-ladder > button:nth-child(4) { background: color-mix(in srgb, var(--brand) 46%, #26211E); }
  .bx-ladder > button:nth-child(n+5) { background: color-mix(in srgb, var(--brand) 28%, #26211E); }
  .bx-ladder b { font-size: 15px; font-weight: 800; opacity: .7; font-variant-numeric: tabular-nums; }
  .bx-ladder small { font: 500 11px var(--font); letter-spacing: .02em; text-transform: none; opacity: .85; }
  .bx-ladder > button:hover { filter: brightness(1.1); }
  .hot-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

  /* legenda do mapa de calor */
  .heat-legend {
    position: absolute; left: 20px; bottom: 32px; z-index: 600; width: 220px; padding: 12px 14px;
    background: var(--surface); border: var(--line-1) solid var(--line); box-shadow: var(--lift);
  }
  .heat-legend .bar { height: 10px; margin: 8px 0 6px; background: linear-gradient(90deg, #22C55E, #A3E635 30%, #FACC15 55%, #F97316 78%, #DC2626); }
  .heat-legend .ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

  /* pino: quadrado de família + haste de linha */
  .pin {
    position: relative; width: 28px; height: 28px; display: grid; place-items: center;
    background: var(--c); color: #fff; border: var(--line-2) solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.28);
  }
  .pin::after { content: ""; position: absolute; left: 50%; top: calc(100% + 2px); width: 3px; height: 10px; margin-left: -1.5px; background: var(--c); box-shadow: 0 0 0 1px #fff; }
  .pin.resolvido { opacity: .5; }
  .pin.pendente { opacity: .75; outline: var(--line-2) dashed var(--c); outline-offset: 3px; }
  .pin.new { --c: #26211E; animation: drop .22s ease-out; }
  @keyframes drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* popup no padrão de card */
  .leaflet-popup-content-wrapper { border-radius: 0; background: var(--surface); color: var(--ink); box-shadow: var(--lift); border: var(--line-1) solid var(--line); padding: 0; }
  .leaflet-popup-tip { background: var(--surface); box-shadow: none; border: var(--line-1) solid var(--line); }
  .leaflet-popup-content { margin: 0; font-family: var(--font); width: 280px !important; line-height: 1.45; }
  .leaflet-container a.leaflet-popup-close-button {
    top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; font: 400 20px/1 var(--font);
    background: var(--surface); color: var(--ink); z-index: 2;
  }
  .pop { border-top: var(--line-3) solid var(--c); }
  .pop-body { padding: 16px 18px 14px; }
  .pop-cat { display: flex; align-items: center; gap: 8px; font: 700 10px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
  .pop-cat i { width: 8px; height: 8px; background: var(--c); }
  .pop h4 { margin: 8px 24px 6px 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
  .pop p { margin: 0; color: var(--ink-soft); font-size: 13px; }
  .pop .pop-addr { font-size: 12px; color: var(--muted); margin: -2px 0 6px; }
  .pop .bx-data { --cols: 3; border-left: 0; border-right: 0; }
  .pop .bx-data > div { padding: 10px 6px; }
  .pop .bx-data > div:last-child { border-right: 0; }
  .pop .bx-data strong { font-size: 12px; font-weight: 700; display: flex; justify-content: center; min-height: 16px; align-items: center; }
  .pop .bx-data .bx-label { font-size: 9px; }
  .pop-pending { margin: 0; padding: 10px 18px; font-size: 12.5px; color: var(--ink-soft); background: var(--surface-alt); border-top: var(--line-1) solid var(--line); }
  .pop-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .pop-actions .bx-btn { min-height: 46px; font-size: 11px; padding: 0 12px; }
  .pop-actions .bx-btn[data-on="true"] { background: var(--ink); color: var(--on-ink); }
  .pop-actions .bx-btn--quiet { background: var(--surface-alt); color: var(--ink); box-shadow: none; border-left: var(--line-1) solid var(--line); }

  .leaflet-bar { border: 0 !important; box-shadow: none !important; }
  .leaflet-bar a {
    width: 44px !important; height: 44px !important; line-height: 44px !important; border-radius: 0 !important;
    background: var(--ink); color: var(--on-ink); border-bottom: var(--line-1) solid rgba(255,255,255,.15) !important; font: 400 20px/44px var(--font);
  }
  .leaflet-bar a:hover { background: var(--brand); color: var(--on-brand); }
  .leaflet-top.leaflet-right { top: 10px; right: 10px; }
  .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 88%, transparent) !important; color: var(--muted); font-family: var(--font); }
  .leaflet-control-attribution a { color: var(--ink-soft); }

  /* ===== DIÁLOGOS ===== */
  .bx-dialog {
    /* o reset global (* { margin: 0 }) tira a centralização nativa do <dialog> */
    margin: auto; max-height: calc(100dvh - 32px); overflow: auto;
    width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-top: var(--line-3) solid var(--brand);
    background: var(--surface); color: var(--ink); box-shadow: var(--lift);
  }
  .bx-dialog::backdrop { background: rgba(23, 21, 19, .6); }
  .bx-dialog form { display: grid; gap: 12px; padding: 20px; }
  .bx-dialog .bx-h3 { font-size: 17px; font-weight: 300; letter-spacing: .03em; }
  .dlg-text { font-size: 14px; color: var(--ink-soft); }
  .dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
  .dlg-actions .bx-btn { min-height: 48px; font-size: 12px; }

  /* contato */
  .contact-form .full { grid-column: 1 / -1; }
  .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .contact-form .wz-error { margin-top: -4px; }
  .contact-form .bx-field-label > textarea { height: 120px; }
  .bx-field-label[data-invalid] > input, .bx-field-label[data-invalid] > textarea { border-color: var(--danger); box-shadow: inset 0 calc(-1 * var(--line-2)) 0 var(--danger); }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .dlg-close { position: absolute; top: 10px; right: 10px; }
  .contact-done { display: grid; justify-items: center; gap: 10px; padding: 28px 20px 20px; text-align: center; }
  .contact-done .circle { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; }
  .contact-done .bx-h3 { font-size: 17px; font-weight: 300; letter-spacing: .03em; }
  .contact-done .bx-btn { margin-top: 6px; min-width: 160px; min-height: 48px; font-size: 12px; }
  .scope-note button.link-inline { border: 0; background: none; padding: 0; font: inherit; color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
  @media (max-width: 520px) { .contact-grid { grid-template-columns: 1fr; } }

  /* ===== MOBILE: sidebar vira bottom sheet ===== */
  @media (max-width: 820px) {
    body { grid-template-columns: 1fr; }
    aside {
      position: fixed; left: 0; right: 0; bottom: 0; height: 74vh; border-right: 0;
      transform: translateY(calc(100% - var(--peek))); transition: transform .25s ease;
    }
    aside.expanded { transform: none; }
    .side-head { padding: 16px 16px 44px; }
    .side-head h1 { font-size: 24px; margin: 6px 0 0; }
    .side-head p { display: none; }
    .theme-btn { top: 14px; right: 14px; }
    .cta-wrap { padding: 0 16px; }
    .block, .side-foot { padding-left: 16px; padding-right: 16px; }
    .side-foot { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
    .bx-list-row::before { left: -16px; }
    main { position: fixed; inset: 0; }
    .map-tools { bottom: calc(var(--peek) + 16px); right: 12px; }
    .map-tools .legend-toggle { display: grid; }
    .bx-ribbon { top: 12px; font-size: 10px; gap: 10px; padding-right: 12px; }
    .heat-legend { left: 12px; bottom: calc(var(--peek) + 16px); width: 180px; }

    /* cadastro vira bottom sheet do tamanho do conteúdo; o mapa que sobra mostra o pino */
    .wizard {
      top: auto; right: 0; width: auto; max-height: 88dvh; border-right: 0;
      transform: translateY(100%); box-shadow: 0 -1px 0 var(--line);
    }
    .wizard.open { transform: none; }
    .wizard[data-step="1"] .wz-body { padding-top: 12px; }
    .wizard[data-step="1"] .wz-help { font-size: 14px; margin-bottom: 10px; }
    body.reporting aside { transform: translateY(100%); }
    body.reporting .map-tools, body.reporting .heat-legend { display: none; }
    .share-label { display: none; }
    .bx-field-label > input, .bx-field-label > textarea, .bx-input-action input { font-size: 16px; }
    .toast { bottom: calc(var(--peek) + 16px); }
  }


.tag.improprio { color: var(--danger); }
/* pino de esgoto: bolinha com o 💩 */
.poop-pin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; line-height: 1; background: #fff; border: 2px solid #7A4A1E; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.poop-pin.sel { box-shadow: 0 0 0 3px var(--brand), 0 2px 6px rgba(0,0,0,.3); }

/* camadas públicas (OpenStreetMap) */
.layer-list { display: grid; gap: 6px; margin-bottom: 8px; }
.layer-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: var(--line-1) solid var(--line); background: var(--surface); color: var(--ink); font: 600 12.5px var(--font); text-align: left; cursor: pointer; }
.layer-row .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); background: transparent; }
.layer-row .count { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.layer-row[aria-pressed="true"] { border-color: var(--c); box-shadow: inset 3px 0 0 var(--c); }
.layer-row[aria-pressed="true"] .dot { background: var(--c); }
.layer-row:disabled { opacity: .6; cursor: progress; }
.pop-pending a { color: inherit; text-decoration: underline; }
