:root { color-scheme:light; --ink:#1b2630; --muted:#5a6872; --line:#d5dde2; --bg:#f6f8f9; --accent:#0b5d8f; --alert:#b3202a; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:var(--ink); background:var(--bg); }
header { padding:12px 16px; border-bottom:1px solid var(--line); background:#fff; }
h1 { font-size:1.2rem; margin:0; } h2 { font-size:.95rem; margin:0 0 6px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.sub { margin:2px 0 0; color:var(--muted); font-size:.9rem; }
.badge { font-size:.7rem; background:#f0a830; color:#1b2630; padding:2px 8px; border-radius:10px; vertical-align:middle; font-weight:600; }
.badge.ok { background:#2e8b57; color:#fff; }
#banner { padding:10px 16px; background:#fff3cd; color:#5c4400; border-bottom:1px solid #e6cf85; }
.legend { list-style:none; margin:0; padding:0; } .legend li { display:flex; align-items:center; gap:8px; margin:3px 0; font-size:.9rem; }
.sw { width:18px; height:14px; border:1px solid #6b7780; border-radius:3px; flex:none; } .sw.line { height:0; border-top:4px solid; border-radius:0; border-left:0; border-right:0; border-bottom:0; }
.muted { color:var(--muted); } .kinds { margin:0; padding-left:18px; font-size:.88rem; }
table { width:100%; border-collapse:collapse; font-size:.85rem; } th,td { text-align:left; padding:3px 4px; border-bottom:1px solid var(--line); }
.tag { display:inline-block; padding:1px 8px; border-radius:10px; font-size:.8rem; font-weight:600; color:#1b2630; }
.small { font-size:.82rem; color:var(--muted); } ul.plain { margin:4px 0; padding-left:18px; font-size:.85rem; }
footer { padding:10px 16px; font-size:.8rem; color:var(--muted); border-top:1px solid var(--line); }

/* Painel: abas, naturezas do dado e visões */
#abas { display:flex; gap:4px; flex-wrap:wrap; margin-top:10px; }
#abas button { padding:7px 14px; border:1px solid var(--line); background:var(--bg); color:var(--ink); border-radius:6px 6px 0 0; cursor:pointer; font:inherit; font-size:.92rem; }
#abas button[aria-selected="true"] { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; }
#abas button:focus-visible, .btn:focus-visible, select:focus-visible, textarea:focus-visible { outline:3px solid #f0a830; outline-offset:2px; }
.vista { padding:14px 16px; max-width:1200px; margin:0 auto; } #vista-mapa { padding:0; max-width:none; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin:10px 0 16px; }
.card { border:1px solid var(--line); border-radius:8px; padding:12px 14px; background:#fff; }
.card .big { font-size:1.9rem; font-weight:700; line-height:1.1; margin:4px 0; font-variant-numeric:tabular-nums; }
.kind { display:inline-block; padding:1px 8px; font-size:.72rem; font-weight:700; border-radius:4px; vertical-align:middle; }
.k-observado { background:#e3f0fa; color:#0b3d62; border:2px solid #1f6fb2; }
.k-previsto { background:#fff4dc; color:#5c3d00; border:2px dashed #c27a00; }
.k-simulado { background:#f1e6f7; color:#4a1a63; border:2px dotted #7b2d8e; }
.k-confirmado { background:#1b2630; color:#fff; border:2px solid #000; } .k-confirmado::before { content:"✓ "; }
.k-nenhum { background:#eee; color:#444; border:2px solid #999; }
.kinds-legend { display:flex; gap:10px; flex-wrap:wrap; font-size:.85rem; margin:6px 0 12px; }
.aviso { border-left:4px solid #c27a00; background:#fff8e6; padding:8px 12px; margin:10px 0; font-size:.88rem; color:#4a3800; }
.btn { padding:8px 14px; border:1px solid var(--accent); background:var(--accent); color:#fff; border-radius:6px; cursor:pointer; font:inherit; }
.btn.sec { background:transparent; color:var(--accent); } .btn[disabled] { opacity:.5; cursor:not-allowed; }
.escopo { display:flex; gap:6px; margin-bottom:8px; } .escopo button { flex:1; padding:6px; border:1px solid var(--line); background:var(--bg); color:var(--ink); border-radius:6px; cursor:pointer; font:inherit; }
.escopo button[aria-pressed="true"] { background:var(--accent); color:#fff; border-color:var(--accent); }
input[type=range] { width:100%; } select, textarea, input[type=datetime-local], input[type=password] { font:inherit; padding:5px 6px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); max-width:100%; }
.chart { width:100%; height:auto; max-height:190px; display:block; } .chart text { font-size:11px; fill:#5a6872; }
.alerta { border:2px solid #999; border-radius:8px; padding:10px 14px; margin:10px 0; } .alerta h3 { margin:0 0 4px; font-size:1rem; }
.alerta.alto { border-color:#b3202a; background:#fdecee; } .alerta.atencao { border-color:#c27a00; background:#fff4dc; } .alerta.sem_risco_estimado { border-color:#2e8b57; background:#eef8f2; } .alerta.sem_dados { border-color:#8d99a0; background:#eef1f3; }
#mapa-rotas { height:420px; background:#cfd8de; border-radius:8px; margin:8px 0; }
.form-linha { display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin:8px 0; } .form-linha label { display:flex; flex-direction:column; gap:3px; font-size:.85rem; color:var(--muted); }
.sit { font-weight:700; } .sit.reportada { color:#1f6fb2; } .sit.confirmada { color:#111; } .sit.descartada { color:#888; text-decoration:line-through; }
.x-int { background:#000; color:#fff; font-weight:700; text-align:center; line-height:18px; width:18px; height:18px; border-radius:3px; border:2px solid #fff; }
details { margin:6px 0; font-size:.88rem; } summary { cursor:pointer; color:var(--accent); }
@media (max-width:820px) { #abas button { flex:1 1 30%; } }

.rolagem { overflow-x:auto; max-width:100%; } .vista { overflow-wrap:anywhere; } .vista pre, .vista code { white-space:pre-wrap; }

/* Território, perguntas, cobertura e mapa 3D */
header { padding:10px 16px 0; } .topo { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
#territorios { display:flex; gap:6px; } #territorios button { display:flex; flex-direction:column; align-items:flex-start; padding:7px 14px; border:1px solid var(--line); background:var(--bg); color:var(--ink); border-radius:8px; cursor:pointer; font:inherit; min-height:44px; text-align:left; }
#territorios button small { color:var(--muted); font-size:.74rem; } #territorios button[aria-checked="true"] { background:var(--accent); color:#fff; border-color:var(--accent); } #territorios button[aria-checked="true"] small { color:#dcecf7; }
#territorios button:focus-visible, .entrada:focus-visible, .link:focus-visible, .camada input:focus-visible { outline:3px solid #f0a830; outline-offset:2px; }
.titulo { font-size:1.15rem; margin:4px 0 10px; text-transform:none; letter-spacing:0; color:var(--ink); }
.entradas { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:10px; margin:6px 0 12px; }
.entrada { display:flex; flex-direction:column; gap:3px; align-items:flex-start; text-align:left; padding:12px 14px; border:1px solid var(--line); background:var(--card,#fff); color:var(--ink); border-radius:10px; cursor:pointer; font:inherit; }
.entrada.atual { border:2px solid var(--accent); }
.pergunta { border-top:1px solid var(--line); padding:10px 0 4px; } .pergunta h2 { text-transform:none; letter-spacing:0; font-size:1rem; color:var(--ink); display:flex; align-items:center; gap:8px; }
.pergunta .n { display:inline-flex; width:24px; height:24px; border-radius:50%; background:var(--accent); color:#fff; align-items:center; justify-content:center; font-size:.8rem; flex:none; }
.indisp { border-left:4px solid #8d99a0; background:#eef1f3; color:#37434b; padding:8px 12px; margin:8px 0; font-size:.88rem; border-radius:4px; }
.cls { display:inline-block; padding:2px 10px; border-radius:12px; font-size:.78rem; font-weight:700; border:2px solid; }
.cls-disponivel { background:#e8f5ee; color:#0f5a3f; border-color:#2e8b57; } .cls-parcial { background:#fff4dc; color:#5c3d00; border-color:#c27a00; border-style:dashed; } .cls-insuficiente, .cls-nenhum { background:#eceff1; color:#37434b; border-color:#8d99a0; border-style:dotted; }
.dims { list-style:none; margin:4px 0; padding:0; font-size:.88rem; } .dims li { margin:2px 0; } .dims .sim span:first-child { color:#2e8b57; font-weight:700; } .dims .nao span:first-child { color:#b3202a; font-weight:700; }
#painel-mapa section { margin-bottom:14px; }
.camada { display:block; margin:5px 0; font-size:.9rem; } .camada.inativa { color:var(--muted); } .camada .small { display:block; margin-left:22px; }
.link { background:none; border:0; padding:0; color:var(--accent); cursor:pointer; font:inherit; text-decoration:underline; text-align:left; }
.legend li span:last-child { flex:1; }
.maplibregl-ctrl-group button { min-width:36px; min-height:36px; }
@media (max-width:820px) { #territorios { width:100%; } #territorios button { flex:1; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto !important; transition:none !important; animation:none !important; } }

/* Linguagem visual: o mapa é o protagonista e os painéis flutuam sobre ele, translúcidos, com cantos grandes (inspirada em mapas nativos e
   em interfaces espaciais). Onde o navegador não faz desfoque, o vidro vira um fundo quase opaco, com o mesmo contraste. */
:root { --vidro:rgba(255,255,255,.74); --vidro-borda:rgba(255,255,255,.6); --vidro-sombra:0 12px 40px rgba(20,35,50,.24); --raio:20px; --seg:rgba(110,125,138,.18); }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) { :root { --vidro:rgba(255,255,255,.97); }  }
header { position:sticky; top:0; z-index:30; background:var(--vidro); -webkit-backdrop-filter:blur(22px) saturate(1.5); backdrop-filter:blur(22px) saturate(1.5); border-bottom:1px solid var(--vidro-borda); padding-bottom:8px; }
#territorios { background:var(--seg); padding:3px; border-radius:13px; gap:2px; }
#territorios button { border:0; background:transparent; border-radius:10px; min-height:44px; }
#territorios button[aria-checked="true"] { background:var(--card,#fff); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.2); } #territorios button[aria-checked="true"] small { color:var(--muted); }
#abas { gap:6px; } #abas button { border-radius:999px; background:transparent; border-color:transparent; min-height:36px; } #abas button[aria-selected="true"] { background:var(--accent); border-color:var(--accent); }
.leaflet-container, .maplibregl-map { isolation:isolate; }
.mapa-layout { position:relative; display:block; height:calc(100vh - 150px); height:calc(100svh - 150px); min-height:520px; overflow:hidden; }
#mapa-gl { position:absolute; inset:0; background:#cfd8de; }
#painel-mapa { position:absolute; z-index:10; top:12px; right:12px; bottom:12px; width:min(380px, calc(100% - 24px)); overflow-y:auto; overscroll-behavior:contain; padding:10px 16px 12px; border:1px solid var(--vidro-borda); border-radius:var(--raio); background:var(--vidro); -webkit-backdrop-filter:blur(26px) saturate(1.6); backdrop-filter:blur(26px) saturate(1.6); box-shadow:var(--vidro-sombra); }
.alca-linha { display:flex; justify-content:center; margin:-10px -16px 6px; padding:8px 0 6px; position:sticky; top:-10px; z-index:1; background:var(--vidro); -webkit-backdrop-filter:blur(26px); backdrop-filter:blur(26px); border-radius:var(--raio) var(--raio) 0 0; }
.alca { display:flex; align-items:center; gap:8px; padding:6px 14px; min-height:36px; border:0; border-radius:999px; background:var(--seg); color:var(--ink); font:inherit; font-size:.82rem; cursor:pointer; }
.alca::before { content:""; width:34px; height:4px; border-radius:2px; background:currentColor; opacity:.45; }
.alca:focus-visible { outline:3px solid #f0a830; outline-offset:2px; }
#painel-mapa.recolhido { bottom:auto; overflow:hidden; padding-bottom:6px; } #painel-mapa.recolhido > :not(.alca-linha) { display:none; } #painel-mapa.recolhido .alca-linha { margin-bottom:0; }
.maplibregl-ctrl-group, .leaflet-bar { border-radius:12px !important; overflow:hidden; box-shadow:var(--vidro-sombra) !important; }
@media (max-width:820px) {
  header { position:static; }
  .mapa-layout { height:calc(100vh - 190px); height:calc(100svh - 190px); min-height:480px; }
  #painel-mapa { top:auto; left:8px; right:8px; bottom:8px; width:auto; max-height:40%; border-radius:24px 24px 18px 18px; transition:max-height .25s ease; }
  #painel-mapa.aberto { max-height:76%; } #painel-mapa.recolhido { max-height:56px; }
}
.assistente { border-top:1px solid var(--line); margin-top:12px; padding-top:8px; } .assistente summary { font-weight:600; }
.assistente .perguntas { display:flex; flex-direction:column; gap:6px; margin:8px 0; } .assistente .perguntas .btn { text-align:left; border-radius:14px; min-height:40px; }
.assistente .livre { display:flex; gap:6px; flex-wrap:wrap; align-items:end; } .assistente .livre label { flex:1 1 150px; display:flex; flex-direction:column; gap:3px; font-size:.82rem; color:var(--muted); } .assistente .livre input { width:100%; font:inherit; padding:8px 10px; border:1px solid var(--line); border-radius:12px; background:var(--card,#fff); color:var(--ink); }
.assistente .resposta { margin-top:8px; padding:8px 12px; border-radius:14px; background:var(--seg); } .assistente .resposta:empty { display:none; } .assistente .resposta p { margin:4px 0; }
.card, .alerta, .entrada { border-radius:16px; }
@media (prefers-reduced-motion: reduce) { #painel-mapa { transition:none; } }

.duas { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; } .duas p { margin:2px 0; }

/* seletor de dados (real ou demonstração) */
.topo { align-items:center; }
#modo { display:flex; padding:3px; border-radius:999px; background:var(--seg); gap:2px; } #modo[hidden] { display:none; }
#modo button { border:0; background:transparent; color:var(--muted); font:inherit; font-size:.8125rem; font-weight:600; padding:6px 14px; border-radius:999px; min-height:32px; cursor:pointer; }
#modo button[aria-pressed="true"] { background:var(--ink); color:var(--bg); } #modo.demo button[aria-pressed="true"] { background:#9a5200; color:#fff; }

/* ===== Refinamento visual (mesma linguagem da página inicial): tinta azul-marinho, um acento, selos suaves, sem bordas tracejadas ===== */
:root { --ink:#0a1c27; --muted:#546672; --line:rgba(10,28,39,.1); --bg:#f3f7f9; --accent:#0b5d8f; --card:#fff; --acento2:#f2a33a;
  --obs-bg:#e1eef7; --obs-ink:#0a4a73; --prev-bg:#fdefd0; --prev-ink:#7a4700; --sim-bg:#ece5f5; --sim-ink:#4a2a66; --conf-bg:#0a1c27; --conf-ink:#fff;
  --fonte:"SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Text","Segoe UI","Helvetica Neue",Arial,sans-serif; }
body { font-family:var(--fonte); font-size:15px; line-height:1.5; letter-spacing:-.005em; }
h1, h2, h3 { letter-spacing:-.02em; }
header { background:var(--vidro); padding:12px 20px 10px; border-bottom:1px solid var(--line); }
h1 { font-size:1.25rem; font-weight:800; letter-spacing:-.03em; } h1 a { color:inherit; text-decoration:none; } h1 a:hover { color:var(--accent); }
.sub { font-size:.8125rem; margin-top:1px; }
#abas { gap:2px; margin-top:12px; padding:3px; background:var(--seg); border-radius:999px; width:max-content; max-width:100%; overflow-x:auto; }
#abas button { padding:7px 16px; font-weight:500; font-size:.875rem; color:var(--muted); border:0; background:transparent; transition:background-color .2s, color .2s; white-space:nowrap; }
#abas button:hover { color:var(--ink); } #abas button[aria-selected="true"] { background:var(--card); color:var(--ink); font-weight:600; box-shadow:0 1px 3px rgba(10,28,39,.18); }
#territorios button small { font-size:.72rem; }
#territorios button[aria-checked="true"] { box-shadow:0 1px 3px rgba(10,28,39,.18); }
#banner { display:flex; align-items:center; gap:10px; padding:9px 20px; background:#0a1c27; color:#eaf2f6; border:0; font-size:.8125rem; line-height:1.4; }
#banner[hidden] { display:none; } #banner::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--acento2); flex:none; }
.vista { padding:28px 20px 56px; max-width:1180px; }
h2 { text-transform:none; letter-spacing:-.01em; font-size:.875rem; font-weight:600; color:var(--muted); margin:0 0 8px; }
.titulo { font-size:1.75rem; font-weight:800; letter-spacing:-.03em; margin:0 0 18px; line-height:1.1; color:var(--ink); }
/* selos de natureza do dado: tinta suave, sem moldura; a forma do ponto distingue além da cor */
.kind { display:inline-flex; align-items:center; gap:6px; padding:3px 10px 3px 8px; font-size:.75rem; font-weight:600; line-height:1.3; border:0; border-radius:999px; vertical-align:middle; letter-spacing:0; }
.kind::before { content:""; width:7px; height:7px; flex:none; background:currentColor; border-radius:50%; }
.k-observado { background:var(--obs-bg); color:var(--obs-ink); border:0; }
.k-previsto { background:var(--prev-bg); color:var(--prev-ink); border:0; } .k-previsto::before { background:transparent; box-shadow:inset 0 0 0 2px currentColor; }
.k-simulado { background:var(--sim-bg); color:var(--sim-ink); border:0; } .k-simulado::before { border-radius:1px; transform:rotate(45deg); }
.k-confirmado { background:var(--conf-bg); color:var(--conf-ink); border:0; } .k-confirmado::before { content:"✓"; width:auto; height:auto; background:none; font-size:.75rem; transform:none; border-radius:0; }
.k-nenhum { background:var(--seg); color:var(--muted); border:0; }
.cls { border:0; font-weight:600; padding:3px 10px; } .cls-disponivel { background:#dcf1e6; color:#0b5236; } .cls-parcial { background:var(--prev-bg); color:var(--prev-ink); } .cls-insuficiente, .cls-nenhum { background:var(--seg); color:var(--muted); }
.kinds-legend { gap:6px 18px; font-size:.8125rem; color:var(--muted); margin:8px 0 18px; align-items:center; }
.kinds-legend .small { font-size:.8125rem; }
/* cartões e blocos */
.card, .alerta, .entrada { border:1px solid var(--line); border-radius:18px; background:var(--card); }
.card { padding:18px 20px; } .card .big { font-size:2.25rem; font-weight:800; letter-spacing:-.04em; }
.entradas { gap:14px; margin:4px 0 20px; } .entrada { padding:18px 20px; transition:transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s; } .entrada:hover { transform:translateY(-2px); border-color:var(--accent); }
.entrada.atual { border:2px solid var(--accent); padding:17px 19px; }
.aviso, .indisp { border:0; border-radius:14px; padding:12px 16px; }
.aviso { background:var(--prev-bg); color:var(--prev-ink); } .indisp { background:var(--seg); color:var(--muted); }
.alerta { border-width:1px; padding:14px 18px; } .alerta.alto { border-color:#d9626b; } .alerta.atencao { border-color:#e0a23a; } .alerta.sem_risco_estimado { border-color:#6bbd96; }
.pergunta { border-top:0; padding:22px 0 6px; } .pergunta h2 { font-size:1.125rem; font-weight:700; color:var(--ink); gap:10px; }
.pergunta .n { width:26px; height:26px; font-size:.8125rem; font-weight:700; }
table { font-size:.875rem; font-variant-numeric:tabular-nums; } th { font-weight:600; color:var(--muted); font-size:.8125rem; border-bottom:1px solid var(--line); padding:8px 10px; }
td { padding:10px; border-bottom:1px solid var(--line); } tbody tr:hover td { background:var(--seg); }
.btn { border-radius:999px; padding:10px 20px; font-weight:600; transition:transform .2s, background-color .2s; } .btn:hover { transform:translateY(-1px); } .btn:active { transform:none; }
.btn.sec { border-color:var(--line); color:var(--ink); background:transparent; } .btn.sec:hover { border-color:var(--accent); }
select, textarea, input[type=datetime-local], input[type=password] { border:1px solid var(--line); border-radius:12px; padding:8px 12px; background:var(--card); }
select:focus-visible, textarea:focus-visible, input:focus-visible { outline:3px solid var(--acento2); outline-offset:1px; }
.escopo { background:var(--seg); padding:3px; border-radius:999px; gap:2px; } .escopo button { border:0; background:transparent; border-radius:999px; padding:7px; font-weight:500; color:var(--muted); }
.escopo button[aria-pressed="true"] { background:var(--card); color:var(--ink); font-weight:600; box-shadow:0 1px 3px rgba(10,28,39,.18); border:0; }
#modo button[aria-pressed="true"] { background:var(--ink); color:var(--bg); }
/* painel do mapa */
#painel-mapa { padding:12px 20px 16px; border-radius:24px; } #painel-mapa section { margin-bottom:20px; }
#painel-mapa h2 { font-size:.8125rem; margin-bottom:10px; } #painel-mapa label { font-size:.875rem; }
.camada { font-size:.875rem; margin:8px 0; } .camada .kind { margin-left:4px; }
input[type=checkbox] { accent-color:var(--accent); width:16px; height:16px; vertical-align:-2px; margin-right:6px; }
.legend li { font-size:.875rem; margin:6px 0; } .sw { border-radius:4px; border-color:rgba(10,28,39,.25); }
.alca { background:var(--seg); }
.link { font-weight:500; text-decoration-thickness:1.5px; text-underline-offset:3px; }
footer { border-top:1px solid var(--line); padding:16px 20px; }
@media (max-width:820px) { header { padding:10px 14px 8px; } .vista { padding:20px 14px 48px; } .titulo { font-size:1.5rem; } }
/* A linha da alça é fixa no topo do painel e precisa de fundo próprio: sem ele o conteúdo rolado passava por baixo e se sobrepunha ao texto da alça (390 px). */
.alca-linha { background:rgba(255,255,255,.95); }
/* Camada de escoamento potencial (Fase 3) */
#f3-opcoes h3 { font-size:.85rem; margin:12px 0 2px; }
.f3-aviso { padding:8px 10px; border-left:4px solid var(--accent); background:var(--seg); border-radius:8px; color:var(--ink); }
.f3-modos { border:0; padding:0; margin:10px 0 6px; } .f3-modos legend { font-size:.82rem; color:var(--muted); padding:0; margin-bottom:2px; }
.f3-radio { display:block; margin:4px 0; cursor:pointer; } .f3-radio input { accent-color:var(--accent); }
#f3-opcoes select { width:100%; max-width:100%; min-height:40px; margin:2px 0 6px; }
#f3-opcoes table { margin:4px 0; }
.f3-ind { border-top:1px solid var(--line); padding:8px 0 2px; } .f3-rot { font-size:.82rem; color:var(--muted); } .f3-val { font-size:1.05rem; margin:2px 0; overflow-wrap:anywhere; }
.f3-ind details { margin:2px 0 4px; }
.f3-sem { padding:8px 10px; border-left:4px solid #7d8a93; background:var(--seg); border-radius:8px; }
.f3-ctx { margin:2px 0 6px; } #f3-trecho code { font-size:.78rem; overflow-wrap:anywhere; }
.legend li.f3-tit { display:block; margin-top:6px; } .legend li.f3-nota { display:block; }
.sw.line { min-width:18px; }
/* Drenagem cadastrada */
.dren-resumo { display:grid; grid-template-columns:auto 1fr; gap:2px 12px; margin:6px 0; font-size:.88rem; } .dren-resumo dt { color:var(--muted); } .dren-resumo dd { margin:0; overflow-wrap:anywhere; }
#dren-registro table th { font-weight:500; width:48%; overflow-wrap:anywhere; } #dren-registro table td { overflow-wrap:anywhere; } #dren-registro code { font-size:.78rem; overflow-wrap:anywhere; }
.opcoes-camada { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
/* Aba Resultados: leitura executiva e territorial */
#vista-resultados { max-width: 1100px; }
.rs-topo h1 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.2; letter-spacing: -.01em; max-width: 34em; margin: 4px 0 12px; }
.rs-tag { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: #3a4752; color: color-mix(in srgb, var(--dim, var(--accent)) 68%, #000); margin: 0; }   /* a cor da dimensão escurecida: texto pequeno exige 4,5:1 (a barra e o realce mantêm a cor cheia) */
.rs-aviso { padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--seg, rgba(110,125,138,.14)); border-radius: 8px; font-size: .92rem; max-width: 56em; margin: 10px 0; }
.rs-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; } .rs-nav a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: .88rem; color: var(--ink); } .rs-nav a:hover { border-color: var(--accent); }
.rs-sec { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: 90px; } .rs-sec > h2 { font-size: clamp(1.25rem, 1.05rem + 1vw, 1.8rem); text-transform: none; letter-spacing: -.01em; color: var(--ink); margin: 4px 0 14px; }
.rs-dim { border-top: 5px solid var(--dim); }
.rs-lead { max-width: 52em; font-size: 1.02rem; }
.rs-sub { margin-top: 22px; font-size: 1rem; }
.rs-seletor { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--seg, rgba(110,125,138,.18)); margin: 8px 0 14px; }
.rs-seletor button { font: inherit; font-weight: 600; min-height: 42px; min-width: 84px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; } .rs-seletor button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.rs-chuva { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } .rs-chuva h3 { font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.rs-eixo { position: relative; height: 130px; margin: 12px 0 8px; border-bottom: 2px solid var(--ink); background: linear-gradient(to right, transparent 0, transparent 100%); }
.rs-eixo .cen { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--muted); } .rs-eixo .cen b { position: absolute; top: 0; left: 4px; font-size: .78rem; white-space: nowrap; } .rs-eixo .cen.sel { border-left: 3px solid var(--accent); } .rs-eixo .cen.sel b { color: var(--accent); }
.rs-eixo .qt { position: absolute; background: var(--bg); font-size: .74rem; white-space: nowrap; padding-left: 5px; border-left: 2px solid var(--dim, #5b3a8c); transform: translateX(-2px); }
.rs-tab { width: 100%; border-collapse: collapse; font-size: .88rem; } .rs-tab th, .rs-tab td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } .rs-tab caption { text-align: left; font-size: .84rem; color: var(--muted); padding: 4px 0 8px; } .rs-tab .sel { background: rgba(242,163,58,.18); font-weight: 600; }
.rolagem { overflow-x: auto; }
.rs-achado { margin-top: 26px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); }
.rs-achado h3 { font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); line-height: 1.3; letter-spacing: -.005em; text-transform: none; color: var(--ink); margin: 0 0 12px; }
.rs-cinco { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; } .rs-cinco h4 { margin: 0 0 2px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); } .rs-cinco p { margin: 0; font-size: .92rem; } .rs-cinco .lim { grid-column: 1 / -1; padding: 8px 12px; border-left: 4px solid #7d8a93; background: var(--seg, rgba(110,125,138,.14)); border-radius: 8px; }
.rs-grafico { margin-top: 16px; } .rs-grafico h4 { font-size: .92rem; margin: 0 0 8px; }
.rs-barra { display: grid; grid-template-columns: minmax(130px, 24%) 1fr minmax(120px, 30%); gap: 10px; align-items: center; margin: 5px 0; font-size: .84rem; }
.rs-trilho { height: 14px; background: var(--seg, rgba(110,125,138,.2)); border-radius: 7px; position: relative; overflow: hidden; } .rs-trilho i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 7px; }
.rs-leg span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }
.rs-bairros { margin-top: 18px; } .rs-bairros select { margin: 4px 0 10px; max-width: 100%; }
.rs-ficha, .rs-indic { margin-top: 12px; font-size: .88rem; } .rs-json { max-height: 220px; overflow: auto; font-size: .74rem; background: var(--seg, rgba(110,125,138,.14)); padding: 8px; border-radius: 8px; }
.rs-dl { display: grid; grid-template-columns: 110px 1fr; gap: 3px 12px; margin: 10px 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: .84rem; } .rs-dl dt { color: var(--muted); } .rs-dl dd { margin: 0; overflow-wrap: anywhere; }
.rs-sintese h3 { font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 20px 0 6px; } .rs-sintese h4 { font-size: .9rem; margin: 14px 0 4px; }
@media (max-width: 760px) { .rs-chuva, .rs-cinco { grid-template-columns: 1fr; } .rs-barra { grid-template-columns: 1fr; gap: 3px; } .rs-dl { grid-template-columns: 1fr; } }
.rs-eixo .qt.dir { transform: translateX(calc(-100% + 2px)); border-left: 0; border-right: 2px solid var(--dim, #5b3a8c); padding: 0 5px 0 0; }

/* Dimensões de análise do mapa (Porto Alegre) */
.dim-lista { list-style:none; margin:6px 0; padding:0; display:grid; gap:6px; }
.dim { display:flex; gap:10px; align-items:flex-start; width:100%; text-align:left; padding:9px 10px; border:1px solid var(--line,#c9d1d6); border-radius:8px; background:#fff; color:inherit; font:inherit; cursor:pointer; }
.dim b { display:block; font-size:.9rem; } .dim .small { display:block; margin-top:2px; }
.dim-id { flex:none; width:24px; height:24px; border-radius:50%; background:#e6ecef; display:grid; place-items:center; font-weight:700; font-size:.8rem; }
.dim.on { border-color:#1f6f8b; box-shadow:inset 0 0 0 1px #1f6f8b; background:#eef6f9; } .dim.on .dim-id { background:#1f6f8b; color:#fff; }
.dim:focus-visible { outline:3px solid #f0a830; outline-offset:2px; }
.dim-nota p, .dim-chuva, .dim-nav { margin:6px 0; } .dim-nota summary { cursor:pointer; font-weight:600; }

.rs-ir { font-weight:600; } .rs-tab tr.sel th, .rs-tab tr.sel td { background: rgba(11,93,143,.09); } .rs-tab tr.sel th { color: var(--ink); }


/* Celular: as abas ficam em uma só linha, rolável, para deixar o mapa e o conteúdo com a tela */
@media (max-width:820px) { #abas { flex-wrap:nowrap; width:100%; overflow-x:auto; scrollbar-width:none; border-radius:14px; } #abas::-webkit-scrollbar { display:none; } #abas button { flex:0 0 auto; } }

/* Texto só para leitores de tela (cabeçalho de tabela sem texto visível, por exemplo). */
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }
/* Aviso de dados de demonstração: compacto no celular (ocupava 5 linhas do topo). */
@media (max-width:600px) { #banner { padding:6px 14px; font-size:.75rem; line-height:1.3; gap:8px; } #banner::before { width:6px; height:6px; } }
#abas button[hidden] { display:none; }   /* abas que dependem de servidor, na versão estática */
