﻿/* CSS para Agora Clima (AGORACLIMA) */
:root {
  --primary-color: #22c55e;
  --warning-color: #facc15;
  --danger-color: #f97316;
  --critical-color: #ef4444;
  --background-dark: #121212;
  --text-light: #f0f0f0;
  --text-dark: #333;
  --panel-width: 320px;
  --sheet-h: 0px;
  --wx-h: 0px;
  --chrome-bottom: 0px;
  --fab-bottom: 96px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-dark);
  color: var(--text-light);
}

#map-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #1a1a1a;
}

#app-container {
  display: flex;
  height: 100%;
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Chrome do sheet / compact bar — ocultos no desktop */
.sheet-chrome,
.wx-compact-bar,
.sheet-state-btns {
  display: none;
}

.wx-expanded-body {
  display: block;
}

.report-fab-icon {
  display: none;
}

#search-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  width: min(420px, calc(100% - 20px));
  z-index: 1100;
  pointer-events: none;
}

#search-overlay > * {
  pointer-events: auto;
}

.map-top-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
}

.map-search-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.map-search-row #search-box {
  flex: 1 1 auto;
  min-width: 0;
}

.map-tool-rail {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.map-tool-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid #333;
  background: rgba(18, 18, 18, 0.94);
  color: #f1f5f9;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.map-play-cluster {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
}

.map-play-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin-left: 0.35rem;
}

.wx-play-agora {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  line-height: 1;
}

/* Play pequeno ao lado do AGORA — timeline abre no mesmo bloco */
.map-tool-play {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  align-self: center;
  font-size: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border-width: 1px;
}

.drawer-open-btn {
  display: none;
}

.map-tool-play span {
  display: block;
  transform: translateX(0.5px);
}

.map-tool-play.is-playing {
  color: #86efac;
  border-color: #22c55e55;
}

.map-tool-play[hidden] {
  display: none !important;
}

.map-tool-btn:hover {
  background: #2a2a2a;
}

.map-tool-btn[aria-expanded='true'] {
  border-color: #22c55e;
  color: #86efac;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.map-tool-layers {
  width: 1.1rem;
  height: 0.85rem;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
}

#search-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(18, 18, 18, 0.94);
  border: 1px solid #333;
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.search-icon {
  color: var(--primary-color);
  font-size: 1.15rem;
  line-height: 1;
  width: 1.2rem;
  text-align: center;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-light);
  font-size: 1.02rem;
  min-width: 0;
}

.search-clear {
  border: none;
  background: #2a2a2a;
  color: #e5e7eb;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.search-clear:hover {
  background: #3a3a3a;
}

/* Compat: locate agora é .map-tool-btn na rail */
.locate-btn {
  border: none;
  background: #2a2a2a;
  color: #e5e7eb;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.search-status {
  margin-top: 0.35rem;
  margin-left: 0.4rem;
  font-size: 0.78rem;
  color: #93c5fd;
}

#search-suggestions {
  margin-top: 0.4rem;
  max-height: min(50vh, 340px);
  overflow-y: auto;
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.suggestion-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid #2a2a2a;
  min-height: 56px;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #243027;
}

.suggestion-icon {
  width: 1.4rem;
  color: var(--primary-color);
  text-align: center;
  margin-top: 0.15rem;
}

.suggestion-body {
  min-width: 0;
}

.suggestion-label {
  font-size: 0.98rem;
  color: #f5f5f5;
  font-weight: 600;
}

.suggestion-meta {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.15rem;
}

.suggestion-cep {
  font-size: 0.75rem;
  color: #86efac;
  margin-top: 0.1rem;
}

.suggestion-empty {
  padding: 0.9rem;
  color: #9ca3af;
  font-size: 0.9rem;
}

.ac-marker {
  background: transparent !important;
  border: none !important;
}

/* Leaflet ancora DivIcon com marginLeft/Top negativos (= iconAnchor).
   NUNCA zerar margin aqui — desloca o POINT do pixel clicado. */
.leaflet-marker-icon.ac-marker,
.leaflet-marker-icon.ac-local-marker,
.leaflet-marker-icon.ac-regional-marker,
.leaflet-div-icon.ac-local-marker {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.ac-marker-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.ac-marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fecaca;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
}

.ac-marker-dot-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  z-index: 2;
}

.ac-local-marker {
  background: transparent !important;
  border: none !important;
  /* NUNCA filter/transform no root .leaflet-marker-icon — desloca o POINT. */
}

.ac-local-indicator {
  display: block;
  overflow: visible;
  /* Sem filter — filter no SVG também pode deslocar o visual do POINT. */
  pointer-events: none;
}

.ac-local-ring {
  fill: rgba(15, 23, 42, 0.55);
  stroke-width: 2.25;
}

.ac-precision-dot {
  /* pin vermelho geográfico no zoom baixo */
}

.ac-local-wind-halo {
  stroke: #0f172a;
  stroke-width: 4.2;
  stroke-linecap: round;
  opacity: 0.8;
}

.ac-local-wind {
  stroke-width: 2.6;
  stroke-linecap: round;
}

.ac-local-speed-bg {
  fill: rgba(15, 23, 42, 0.94);
  stroke: #ef4444;
  stroke-width: 1;
}

.ac-local-speed {
  fill: #ffffff;
  font-size: 8px;
  font-weight: 800;
  font-family: system-ui, sans-serif;
}

.ac-local-wind-streak {
  pointer-events: none;
}

.ac-local-flow-label-wrap {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
}

.ac-local-flow-label {
  display: block;
  font-size: 8px;
  font-weight: 600;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0 0 2px #0f172a,
    0 1px 2px #0f172a,
    1px 0 0 #0f172a,
    -1px 0 0 #0f172a;
  pointer-events: none;
  user-select: none;
}

.ac-local-flow-chuva {
  font-size: 7.5px;
  font-weight: 500;
  font-style: italic;
}

.ac-local-flow-vento {
  font-size: 7.5px;
  font-weight: 600;
}

.ac-regional-marker { background: transparent !important; border: none !important; }
.ac-regional-beacon {
  position: relative;
  width: 28px;
  height: 28px;
  margin: 7px;
  border: 3px solid var(--ac-risk);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75), 0 1px 4px rgba(0, 0, 0, 0.65);
}
.ac-regional-wind { position: absolute; left: 8px; top: 3px; color: #fbbf24; font-size: 17px; line-height: 20px; transform-origin: 50% 50%; }
.ac-regional-speed { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); color: #f8fafc; font: 700 8px/1 system-ui, sans-serif; text-shadow: 0 1px 2px #000; }

.ac-local-cross {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.25;
}

.ac-local-dot {
  fill: #ef4444 !important;
  stroke: #fff;
  stroke-width: 2.25;
}

.ac-local-storm-sector {
  fill: rgba(249, 115, 22, 0.28);
  stroke: rgba(251, 191, 36, 0.85);
  stroke-width: 1;
}

.ac-local-storm-line {
  stroke: #fbbf24;
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

.ac-approach-chip {
  background: rgba(15, 23, 42, 0.82);
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  white-space: nowrap;
  text-align: center;
}

.ac-approach-label {
  background: transparent !important;
  border: none !important;
}

.associated-phenomena {
  margin-top: 0.55rem;
  padding: 0.5rem 0.55rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  border-radius: 8px;
}

.phenomena-title {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #cbd5e1;
  margin-bottom: 0.3rem;
}

.phenomenon-item {
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(51, 65, 85, 0.7);
}

.phenomenon-head {
  font-size: 0.8rem;
  color: #f1f5f9;
  font-weight: 650;
}

.phenomenon-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

.phenomenon-item.origin-oficial .phenomenon-badge {
  color: #fca5a5;
}

.phenomenon-item.origin-comunidade .phenomenon-badge {
  color: #86efac;
}

.phenomenon-item.origin-alertaclima .phenomenon-badge,
.phenomenon-item.origin-agoraclima .phenomenon-badge {
  color: #7dd3fc;
}

.phenomenon-summary {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.orient-plain {
  font-size: 0.78rem;
  color: #e2e8f0;
  margin-top: 0.12rem;
}

.orient-note-wind {
  font-size: 0.65rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.ac-marker-compass {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.ac-mcompass-ring {
  fill: none;
  stroke: rgba(226, 232, 240, 0.55);
  stroke-width: 1.2;
}

.ac-mcompass-label {
  fill: #e2e8f0;
  font-size: 8px;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.ac-mcompass-tick {
  stroke: rgba(226, 232, 240, 0.7);
  stroke-width: 1.2;
}

.ac-mcompass-dot {
  fill: #22c55e;
  stroke: #ecfdf5;
  stroke-width: 1.5;
}

.ac-mcompass-wind {
  stroke: #f59e0b;
  stroke-width: 2.2;
  stroke-linecap: round;
}

#sidebar {
  flex: 0 0 var(--panel-width);
  width: var(--panel-width);
  background-color: rgba(20, 20, 20, 0.95);
  padding: 1rem;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 2px 0 5px rgba(0,0,0,0.5);
  transition: flex-basis 0.2s ease, width 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
}

#app-container.sidebar-collapsed #sidebar {
  flex-basis: 0;
  width: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  box-shadow: none;
  border: none;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: var(--panel-width);
  transform: translateY(-50%);
  z-index: 1200;
  width: 22px;
  height: 56px;
  border: 1px solid #333;
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: rgba(20, 20, 20, 0.95);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

#app-container.sidebar-collapsed .sidebar-toggle {
  right: 0;
  border-right: 1px solid #333;
  border-radius: 8px 0 0 8px;
}

.empty-selection-hint {
  margin-top: 0.75rem;
  padding: 0.7rem 0.75rem;
  background: rgba(30, 30, 30, 0.75);
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #d1d5db;
  line-height: 1.45;
}

.empty-selection-hint ul {
  margin: 0.45rem 0 0 1.1rem;
}

.empty-selection-hint li {
  margin: 0.15rem 0;
}

.selection-content[hidden],
#conditions-panel[hidden],
#timeline-panel[hidden],
#empty-selection-hint[hidden] {
  display: none !important;
}

/* Leaflet overlays above the map tiles */
.leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
}

.leaflet-tooltip {
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid #555;
  color: #f0f0f0;
  box-shadow: none;
}

.locality-navigation-hit {
  cursor: pointer;
  /* pointer-events controlado por setLayerGroupHitTesting / panes */
}

.locality-navigation-label {
  cursor: pointer;
}

#sidebar h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--primary-color);
}


#municipality-info {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: rgba(30, 30, 30, 0.7);
  border-radius: 4px;
}

.navigation-breadcrumb {
  color: #93c5fd;
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
}

.navigation-breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.navigation-back {
  border: 0;
  padding: 0;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.point-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.point-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 0.28rem;
  cursor: pointer;
  user-select: none;
}

.point-lock input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.point-lock-mark {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.28rem;
  border: 2px solid #94a3b8;
  background: rgba(15, 23, 42, 0.65);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
  position: relative;
}

.point-lock input:checked + .point-lock-mark {
  border-color: #ef4444;
  background: #ef4444;
}

.point-lock input:checked + .point-lock-mark::after {
  content: '';
  position: absolute;
  left: 0.28rem;
  top: 0.05rem;
  width: 0.28rem;
  height: 0.52rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.point-lock input:focus-visible + .point-lock-mark {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

body.point-locked .point-lock-mark {
  border-color: #ef4444;
}

#municipality-name,
.point-name-link {
  font-size: 1.2rem;
  margin-bottom: 0;
  color: var(--primary-color);
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  color: #86efac;
}

#municipality-name:disabled,
.point-name-link:disabled {
  cursor: default;
  text-decoration: none;
  color: var(--primary-color);
}

#municipality-name:not(:disabled):hover,
.point-name-link:not(:disabled):hover {
  color: #bbf7d0;
}

#selection-subtitle {
  font-size: 0.9rem;
  color: #d1d5db;
  margin-bottom: 0.5rem;
}

.neighborhoods-note {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.weather-status {
  font-size: 0.8rem;
  color: #93c5fd;
  margin: 0.15rem 0 0.55rem;
  min-height: 0;
}

.weather-status:empty {
  display: none;
}

.weather-status.error {
  color: #fca5a5;
}

.confidence-note {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 0.35rem;
}

.risk-evidence {
  margin-top: 0.5rem;
}

.evidence-item {
  font-size: 0.78rem;
  color: #d1d5db;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#timeline-panel {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: rgba(30, 30, 30, 0.7);
  border-radius: 4px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.timeline-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.4rem;
  min-height: 74px;
}

.timeline-item.kind-atual_estimado {
  border-color: #22c55e55;
}

.timeline-label {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 0.2rem;
}

.timeline-temp {
  font-size: 1rem;
  font-weight: 700;
  color: #f0f0f0;
}

.timeline-cond {
  font-size: 0.68rem;
  color: #d1d5db;
  margin-top: 0.15rem;
}

.timeline-meta {
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}

.disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
  text-align: center;
  color: #9ca3af;
}

.risk-level {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.risk-green { background-color: var(--primary-color); color: #000; }
.risk-yellow { background-color: var(--warning-color); color: #000; }
.risk-orange { background-color: var(--danger-color); color: #000; }
.risk-red { background-color: var(--critical-color); color: #fff; }

#legend {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: rgba(30, 30, 30, 0.7);
  border-radius: 4px;
}

.legend-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.3rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  border-radius: 3px;
}

#conditions-panel {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: rgba(30, 30, 30, 0.7);
  border-radius: 4px;
}

.condition-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.condition-label {
  font-weight: bold;
}

.condition-value {
  text-align: right;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background-color: rgba(0,0,0,0.8);
  padding: 1rem;
  border-radius: 4px;
}

/* --- Bloco 3: camadas / timeline / relatos --- */
.map-chip-btn {
  /* legado — Camadas migrou para .map-tool-btn na rail */
  display: none;
}

.layers-panel {
  position: absolute;
  top: 118px;
  left: 10px;
  right: auto;
  width: min(300px, calc(100% - 20px));
  max-height: min(55vh, 420px);
  overflow-y: auto;
  z-index: 1205;
  background: rgba(14, 14, 14, 0.95);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 0.75rem;
  display: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.layers-panel.open {
  display: block;
}

.layers-head {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.layers-head-sub {
  margin-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 0.55rem;
}

.layer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin: 0.35rem 0;
  color: #e5e7eb;
}

.opacity-row {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0.2rem 0 0.55rem;
}

.opacity-row input[type='range'] {
  width: 100%;
}

.status-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-left: 0.35rem;
  background: #6b7280;
  vertical-align: middle;
}

.status-dot[data-state='available'] {
  background: #22c55e;
}

.status-dot[data-state='loading'] {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.status-dot[data-state='unavailable'] {
  background: #6b7280;
}

.layer-note,
.layer-updated {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 0.45rem;
  line-height: 1.4;
}

.reduce-row {
  margin-top: 0.7rem;
  border-top: 1px solid #2a2a2a;
  padding-top: 0.55rem;
}

#wx-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 1100;
  background: rgba(12, 12, 12, 0.9);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 0.35rem 0.55rem 0.3rem;
  pointer-events: auto;
}

#wx-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin-bottom: 0.2rem;
}

.wx-btn {
  border: 1px solid #3f3f46;
  background: #1f1f1f;
  color: #f3f4f6;
  border-radius: 6px;
  padding: 0.18rem 0.4rem;
  font-size: 0.72rem;
  cursor: pointer;
}

.wx-btn.active,
.wx-btn.primary {
  border-color: #22c55e;
  background: #14532d;
}

.wx-loop {
  font-size: 0.7rem;
  color: #d1d5db;
  display: inline-flex;
  gap: 0.2rem;
  align-items: center;
}

.wx-now-clock {
  font-size: 0.72rem;
  color: #facc15;
  font-weight: 700;
  margin-left: 0.35rem;
}

.wx-frame-label {
  font-size: 0.7rem;
  color: #86efac;
  margin-left: auto;
}

#wx-scrub {
  width: 100%;
  max-width: 100%;
  height: 1.1rem;
  box-sizing: border-box;
  display: block;
}

.wx-timeline-track {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  margin-top: 0.2rem;
  padding-bottom: 0.05rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.wx-timeline-past,
.wx-timeline-future {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}

.wx-timeline-gap {
  flex: 0 0 28px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #52525b 0 4px,
    transparent 4px 8px
  );
  opacity: 0.8;
}

.wx-band-label {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: #86efac;
  margin-right: 0.15rem;
  white-space: nowrap;
}

.wx-band-label.forecast {
  color: #93c5fd;
}

.wx-tick {
  border: 1px solid #333;
  background: #1a1a1a;
  color: #d1d5db;
  border-radius: 5px;
  padding: 0.12rem 0.28rem;
  font-size: 0.64rem;
  white-space: nowrap;
  cursor: pointer;
}

.wx-tick.observation {
  border-color: #166534;
}

.wx-tick.forecast {
  border-color: #1d4ed8;
  color: #93c5fd;
  cursor: pointer;
}

.wx-tick.forecast:disabled { opacity: 0.45; cursor: default; }
.wx-tick.forecast.active { background: #1e3a8a; color: #eff6ff; }

.wx-tick.active {
  background: #14532d;
  color: #ecfdf5;
}

.wx-now-mark {
  font-size: 0.64rem;
  color: #facc15;
  font-weight: 700;
  padding: 0 0.15rem;
  white-space: nowrap;
}

.wx-obs-ages,
.storm-motion,
.wx-sources {
  font-size: 0.64rem;
  color: #9ca3af;
  margin-top: 0.12rem;
}

.layer-age {
  font-size: 0.68rem;
  color: #a3e635;
  white-space: nowrap;
}

.official-area-note {
  color: #fbbf24;
  font-size: 0.78rem;
  margin: 0.25rem 0;
}

.wind-particle-canvas {
  pointer-events: none !important;
}

/* A âncora de tracking é única e semanticamente distinta do fluxo de vento. */
.ac-storm-track-head {
  background: transparent;
  border: 0;
  color: #facc15;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.9);
}

#wx-legend {
  margin-top: 0.8rem;
}

.legend-note {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 0.35rem;
}

.report-fab {
  position: absolute;
  right: 14px;
  bottom: 150px;
  z-index: 1105;
  border: none;
  background: #15803d;
  color: #ecfdf5;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
}

.pick-hint {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  z-index: 1200;
  background: rgba(0, 0, 0, 0.85);
  color: #fef08a;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.community-report-bubble-wrap {
  background: transparent;
  border: 0;
}

.community-report-bubble {
  width: 100%;
  height: 100%;
  min-width: 12px;
  min-height: 12px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid #dcfce7;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font: 800 1em/1 system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.report-marker-highlight .community-report-bubble {
  animation: report-community-focus 0.8s ease-in-out 4;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.72), 0 0 14px 7px rgba(250, 204, 21, 0.42);
}

@keyframes report-community-focus {
  50% { transform: scale(1.28); }
}

.ac-local-pulse {
  fill: none;
  stroke-width: 2;
  transform-origin: center;
}

.ac-local-pulse-orange { animation: ac-attention-pulse 2.2s ease-out infinite; }
.ac-local-pulse-red { animation: ac-attention-pulse 1.45s ease-out infinite; }
.ac-regional-beacon.ac-risk-orange { animation: ac-attention-pulse 2.2s ease-out infinite; }
.ac-regional-beacon.ac-risk-red { animation: ac-attention-pulse 1.45s ease-out infinite; }

@keyframes ac-attention-pulse {
  0% { opacity: 0.85; transform: scale(0.9); }
  70% { opacity: 0.15; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  .ac-local-pulse-orange,
  .ac-local-pulse-red,
  .ac-regional-beacon.ac-risk-orange,
  .ac-regional-beacon.ac-risk-red { animation: none; opacity: 0.85; }
  .report-marker-highlight .community-report-bubble { animation: none; }
}

.community-reports-popup { min-width: 210px; max-height: 280px; overflow-y: auto; }
.community-reports-popup-title { font-weight: 800; margin-bottom: 0.45rem; }
.community-report-detail { border-top: 1px solid #d1d5db; padding: 0.45rem 0; }
.community-report-detail:first-of-type { border-top: 0; }
.community-report-detail ul { margin: 0.3rem 0; padding-left: 1.1rem; }
.community-report-detail time { color: #4b5563; font-size: 0.76rem; }
.community-reports-zoom { width: 100%; margin: 0.35rem 0; padding: 0.35rem; border: 0; border-radius: 6px; background: #15803d; color: #fff; cursor: pointer; }

.report-popup-note,
.community-note,
.report-privacy {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 0.35rem;
}

.community-signals {
  margin-top: 0.65rem;
  padding: 0.45rem;
  background: rgba(30, 30, 30, 0.65);
  border-radius: 6px;
}

.community-count-line {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}

.community-count-num {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.35;
}

.badge-oficial,
.badge-alertaclima,
.badge-agoraclima,
.badge-comunidade {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.badge-oficial {
  background: #7f1d1d;
  color: #fecaca;
}

.badge-alertaclima,
.badge-agoraclima {
  background: #14532d;
  color: #bbf7d0;
}

.badge-comunidade {
  background: #1e3a5f;
  color: #bfdbfe;
}

.community-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.community-map-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.4rem;
  border: 2px solid #ef4444;
  border-radius: 0.4rem;
  background: rgba(127, 29, 29, 0.25);
}

.community-map-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #16a34a;
  cursor: pointer;
  flex: 0 0 auto;
}

.community-map-toggle .badge-comunidade {
  margin-bottom: 0;
}

.community-map-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #86efac;
}

.community-map-toggle input:not(:checked) + .community-map-label {
  color: #94a3b8;
}

.local-orientation {
  margin: 0.55rem 0 0.7rem;
  padding: 0.55rem 0.6rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid #334155;
  border-radius: 8px;
}

.orient-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
}

.orient-mode {
  font-size: 0.68rem;
  font-weight: 700;
  color: #86efac;
  margin-bottom: 0.2rem;
}

.orient-mode[data-mode='device'] {
  color: #fde68a;
}

.orient-approx {
  font-size: 0.62rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.orient-rose-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.25rem 0 0.45rem;
}

.ac-wind-rose {
  flex: 0 0 auto;
}

.ac-rose-ring {
  fill: rgba(15, 23, 42, 0.35);
  stroke: rgba(148, 163, 184, 0.55);
  stroke-width: 1.2;
}

.ac-rose-center {
  fill: #22c55e;
}

.ac-rose-tick {
  stroke: rgba(226, 232, 240, 0.55);
  stroke-width: 1;
}

.ac-rose-label {
  fill: #cbd5e1;
  font-size: 9px;
  font-weight: 600;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.ac-rose-n {
  fill: #f8fafc;
  font-weight: 800;
}

.ac-rose-wind-arrow {
  stroke: #f59e0b;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.ac-rose-wind-tip {
  fill: #f59e0b;
}

.ac-rose-storm-arrow {
  stroke: #f59e0b;
  stroke-width: 2.2;
  stroke-dasharray: 4 3;
  stroke-linecap: round;
}

.orient-legend {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.65rem;
  color: #94a3b8;
}

.leg-wind {
  color: #fbbf24;
}

.leg-storm {
  color: #f59e0b;
}

.orient-row {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.orient-k {
  color: #94a3b8;
}

.orient-v {
  color: #e2e8f0;
  font-weight: 700;
  text-align: right;
}

.orient-v.storm {
  color: #fbbf24;
}

.orient-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.orient-eta {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fde68a;
  margin: 0.15rem 0 0.25rem;
}

.orient-btn {
  margin-top: 0.4rem;
  width: 100%;
}

.orient-empty {
  font-size: 0.75rem;
  color: #94a3b8;
}

.official-day {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #fde68a;
}

.official-when {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
}

.official-meta {
  font-size: 0.7rem;
  color: #a1a1aa;
}

.official-item.official-now {
  border-left: 3px solid #f97316;
  padding-left: 0.4rem;
}

.storm-system-label {
  color: #fbbf24 !important;
  font-size: 0.7rem !important;
}

/* Alertas oficiais são contexto visual; detalhes são acionados no painel. */
path.official-alert-poly.leaflet-interactive {
  pointer-events: none !important;
}

.official-details-btn {
  margin-top: 0.35rem;
  border: 1px solid #fca5a5;
  border-radius: 0.35rem;
  background: transparent;
  color: #fee2e2;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}

.local-precipitation {
  margin: 0.55rem 0;
  padding: 0.5rem 0.6rem;
  border-left: 2px solid #38bdf8;
  color: #dbeafe;
  font-size: 0.78rem;
  line-height: 1.45;
}

.official-alert-popup .leaflet-popup-content-wrapper {
  background: #1c1212;
  color: #fee2e2;
  border: 1px solid #7f1d1d;
  border-radius: 10px;
}

.official-alert-popup .leaflet-popup-tip {
  background: #1c1212;
}

.official-alert-popup .leaflet-popup-close-button {
  color: #fecaca !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  top: 6px !important;
  right: 8px !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  padding: 0 !important;
}

.official-popup {
  position: relative;
  padding-right: 1.2rem;
}

.official-popup-x {
  position: absolute;
  top: -0.15rem;
  right: -0.35rem;
  border: none;
  background: transparent;
  color: #fecaca;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
}

.sat-mode-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.15rem 0 0.35rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.sat-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.clouds-overlay,
.sat-overlay {
  pointer-events: none !important;
}

/* Base OSM mais neutra no regional — só tiles, não overlays meteo */
#map-wrap.map-base-neutral .leaflet-tile-pane {
  filter: saturate(0.55) contrast(1.03);
  transition: filter 0.35s ease;
}

#map-wrap.map-base-street .leaflet-tile-pane {
  filter: none;
  transition: filter 0.35s ease;
}

.wind-particle-canvas {
  opacity: 0.92;
}

.official-alerts-panel {
  margin-top: 0.65rem;
  padding: 0.55rem 0.6rem;
  background: rgba(50, 20, 20, 0.75);
  border: 1px solid #7f1d1d;
  border-radius: 8px;
}

.official-title {
  font-size: 0.82rem;
  color: #fecaca;
  font-weight: 700;
}

.official-item,
.official-count,
.official-empty,
.official-event {
  font-size: 0.78rem;
  color: #fee2e2;
  margin-top: 0.25rem;
}

.official-note {
  font-size: 0.7rem;
  color: #fca5a5;
  margin-top: 0.35rem;
}

.data-sources-status {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: #9ca3af;
  line-height: 1.45;
}

.sources-title {
  color: #d1d5db;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.storm-approach {
  margin-top: 0.65rem;
  padding: 0.55rem 0.6rem;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid #334155;
  border-radius: 8px;
}

.storm-approach-title {
  font-size: 0.82rem;
  color: #fde047;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.storm-approach-line,
.storm-approach-empty,
.storm-community {
  font-size: 0.78rem;
  color: #e2e8f0;
  margin-top: 0.15rem;
}

.storm-approach-eta {
  font-size: 0.86rem;
  color: #7dd3fc;
  margin-top: 0.25rem;
  font-weight: 600;
}

.storm-approach-note,
.storm-popup-note {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.community-title {
  font-size: 0.78rem;
  color: #86efac;
  margin-bottom: 0.25rem;
}

.community-summary,
.community-item,
.community-empty {
  font-size: 0.78rem;
  color: #d1d5db;
  margin-top: 0.15rem;
}

.community-city-group {
  margin: 0.35rem 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(134, 239, 172, 0.22);
  border-radius: 8px;
  background: rgba(20, 35, 28, 0.34);
}

.community-city-group summary {
  cursor: pointer;
  color: #bbf7d0;
  font-size: 0.78rem;
  font-weight: 700;
}

.community-city-group .community-area-link {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  text-align: left;
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: manipulation;
}

.report-modal[hidden] {
  display: none !important;
}

html.report-modal-open,
body.report-modal-open {
  overflow: hidden !important;
}

.report-modal-card {
  width: min(480px, 100%);
  max-height: min(88dvh, 88vh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #141414;
  color: #f3f4f6;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.report-modal-card h3,
.report-location-label {
  color: #f3f4f6;
}

.report-events {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
}

.report-status-label {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0;
  color: #d1d5db;
  font-size: 0.86rem;
}

.report-status-label select {
  background: #1f2937;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #f8fafc;
  padding: 0.45rem;
}

.report-event-option {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
  padding: 0.7rem 0.75rem;
  border: 1px solid #333;
  border-radius: 10px;
  background: #1a1a1a;
  color: #f3f4f6;
  font-size: 1rem;
  cursor: pointer;
}

.report-event-option > label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  color: #f3f4f6;
  -webkit-tap-highlight-color: transparent;
}

.report-event-option input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  accent-color: #22c55e;
}

.report-event-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0.35rem 0 0.15rem 1.5rem;
  font-size: 0.78rem;
}

.report-event-controls label {
  display: grid;
  gap: 0.15rem;
}

.report-event-controls select {
  min-width: 0;
}

@media (max-width: 520px) {
  .report-modal {
    align-items: flex-end;
  }
  .report-modal-card {
    width: 100%;
    max-height: min(82dvh, 82vh);
    border-radius: 16px 16px 10px 10px;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
  .report-event-controls { grid-template-columns: 1fr; }
  .report-actions .wx-btn {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
  }
}

.report-event-icon {
  font-size: 1.25rem;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.report-error {
  color: #fca5a5;
  font-size: 0.8rem;
  min-height: 1.1em;
}

/* ===== MOBILE MAP APP (<=768px) — mapa 100% viewport + bottom sheet ===== */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  #app-container,
  #app-container.is-mobile {
    display: block;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
  }

  #map-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    flex: none;
  }

  #map {
    width: 100%;
    height: 100%;
  }

  /* Sidebar vira MENU LATERAL ESQUERDO (recolhido por padrão) */
  #sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: min(340px, 88vw);
    max-width: none;
    height: 100% !important;
    height: 100dvh !important;
    flex: none;
    z-index: 1400;
    border-radius: 0 16px 16px 0;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
    padding: 0;
    padding-bottom: var(--safe-bottom);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(14, 14, 14, 0.98);
    transition: transform 0.22s ease;
    pointer-events: auto;
    transform: translateX(-100%);
  }

  #sidebar.drawer-open {
    transform: translateX(0);
  }

  #sidebar.drawer-closed {
    transform: translateX(-100%);
    pointer-events: none;
  }

  #sidebar.sheet-dragging {
    transition: none;
  }

  #app-container.sidebar-collapsed #sidebar {
    opacity: 1;
    width: min(340px, 88vw);
    flex: none;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .drawer-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: calc(96px + var(--safe-top));
    left: 8px;
    z-index: 1260;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #333;
    background: rgba(18, 18, 18, 0.94);
    color: #f1f5f9;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
  }

  .drawer-open-btn[hidden] {
    display: none !important;
  }

  .sheet-chrome {
    display: block;
    flex: 0 0 auto;
    padding: 0.35rem 0.7rem 0.35rem;
    border-bottom: 1px solid #2a2a2a;
  }

  #sidebar.sheet-peek .sheet-state-btns,
  .sheet-state-btns {
    display: none !important;
  }

  .sheet-handle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    touch-action: none;
    padding: 0.2rem 0;
    color: #cbd5e1;
    font-size: 0.85rem;
  }

  .sheet-handle-bar {
    width: 4px;
    height: 28px;
    border-radius: 999px;
    background: #64748b;
  }

  .drawer-close-label {
    font-weight: 600;
  }

  .sheet-state-btns {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 0.25rem;
  }

  .sheet-state-btn {
    min-height: 32px;
    min-width: 44px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #3f3f46;
    background: #1f1f1f;
    color: #d4d4d8;
    font-size: 0.68rem;
    cursor: pointer;
  }

  #sidebar.sheet-peek .sheet-state-btn[data-sheet-set='peek'],
  #sidebar.sheet-half .sheet-state-btn[data-sheet-set='half'],
  #sidebar.sheet-full .sheet-state-btn[data-sheet-set='full'] {
    border-color: #22c55e;
    color: #86efac;
  }

  .sheet-peek {
    display: block;
  }

  .peek-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
    min-width: 0;
  }

  .peek-title .point-lock {
    margin-top: 0;
  }

  .peek-title-text {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  button.peek-title-text,
  .peek-title-text.point-name-link {
    background: transparent;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
  }

  .peek-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .peek-risk {
    margin-top: 0.12rem;
    font-size: 0.68rem;
    color: #bbf7d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .peek-community {
    margin-top: 0.18rem;
    font-size: 0.68rem;
    color: #fdba74;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .peek-track {
    margin-top: 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fecaca;
    line-height: 1.25;
  }

  .peek-track-note {
    font-weight: 500;
    color: #94a3b8;
  }

  .peek-track-ahead {
    margin-top: 0.12rem;
    font-weight: 800;
    color: #fbbf24;
  }

  .peek-wind {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #bae6fd;
    margin-top: 0.2rem;
  }

  .peek-wind-detail,
  .peek-wind-plain,
  .peek-wind-gust {
    font-size: 0.7rem;
    color: #cbd5e1;
    margin-top: 0.05rem;
  }

  .peek-storm {
    font-size: 0.7rem;
    color: #fde68a;
    margin-top: 0.2rem;
  }

  .peek-phenomena {
    margin-top: 0.15rem;
  }

  .peek-phen {
    font-size: 0.68rem;
    color: #e2e8f0;
    margin-top: 0.05rem;
  }

  .peek-wind-legacy {
    font-size: 0.68rem;
    color: #7dd3fc;
    margin-top: 0.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .peek-official {
    margin-top: 0.1rem;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid #ea580c;
    background: rgba(234, 88, 12, 0.15);
    color: #fdba74;
    border-radius: 8px;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    max-width: 100%;
  }

  #sidebar.sheet-peek .sheet-chrome {
    overflow: hidden;
    max-height: 100%;
  }

  .sheet-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0.55rem 0.75rem calc(0.75rem + var(--safe-bottom));
  }

  #sidebar.sheet-half .sheet-scroll,
  #sidebar.sheet-full .sheet-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sidebar.sheet-peek .sheet-scroll {
    display: none;
  }

  #sidebar.sheet-peek #sheet-peek {
    display: block;
  }

  #sidebar.sheet-half #sheet-peek,
  #sidebar.sheet-full #sheet-peek {
    display: none !important;
  }

  #search-overlay {
    top: calc(8px + var(--safe-top));
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    z-index: 1300;
  }

  /* Menu aberto cobre a busca — Fechar precisa receber toque */
  #app-container.is-mobile:has(#sidebar.drawer-open) #search-overlay {
    z-index: 1200;
    pointer-events: none;
  }

  #app-container.is-mobile:has(#sidebar.drawer-open) #search-overlay > * {
    pointer-events: none;
  }

  .map-top-bar {
    gap: 0.3rem;
  }

  .map-search-row {
    gap: 0.35rem;
  }

  .map-tool-rail {
    gap: 0.35rem;
  }

  .map-tool-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .map-play-row {
    gap: 0.35rem;
    margin-left: 0.2rem;
  }

  .wx-play-agora {
    font-size: 0.78rem;
  }

  .map-tool-play {
    width: 14px;
    height: 14px;
    min-width: 14px;
    font-size: 8px;
    margin-left: 0;
    margin-top: 0;
    z-index: 1301;
  }

  /* Camadas some da rail no mobile — fica no fim do menu lateral */
  .map-tool-layers-btn {
    display: none !important;
  }

  .drawer-tools {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .drawer-play-btn,
  .drawer-layers-toggle {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #3f3f46;
    background: #1a1a1a;
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    padding: 0.55rem 0.75rem;
  }

  .drawer-play-btn.is-playing {
    border-color: #22c55e66;
    color: #86efac;
  }

  .drawer-layers-toggle[aria-expanded='true'] {
    border-color: #22c55e66;
    color: #86efac;
  }

  .drawer-layers-host {
    min-height: 0;
  }

  #app-container.is-mobile #drawer-layers-host .layers-panel,
  #app-container.is-mobile .drawer-layers-host .layers-panel {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-height: none;
    display: none;
    margin: 0;
    border-radius: 10px;
    box-shadow: none;
    z-index: auto;
  }

  #app-container.is-mobile #drawer-layers-host .layers-panel.open,
  #app-container.is-mobile .drawer-layers-host .layers-panel.open {
    display: block !important;
  }

  #sheet-peek {
    display: none !important;
  }

  .map-play-cluster {
    gap: 0.35rem;
  }

  .map-play-cluster[hidden] {
    display: none !important;
  }

  /* Timeline fica colada no play (não mais no rodapé do mapa) */
  .wx-compact-bar {
    display: none !important;
  }

  #wx-dock.wx-mobile-compact {
    display: none !important;
  }

  #wx-dock.wx-mobile-expanded,
  #wx-dock.wx-dock-with-play.wx-mobile-expanded {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100%;
    max-width: 100%;
    padding: 0.45rem 0.5rem 0.5rem;
    border-radius: 12px;
    z-index: 1;
    min-height: 0;
    box-sizing: border-box;
  }

  #wx-dock.wx-mobile-expanded .wx-expanded-body {
    display: block;
  }

  #wx-dock.wx-mobile-expanded #wx-controls {
    margin-bottom: 0.3rem;
    gap: 0.3rem;
  }

  #wx-dock.wx-mobile-expanded .wx-now-clock {
    font-size: 0.8rem;
  }

  #wx-dock.wx-mobile-expanded .wx-frame-label {
    flex: 1 1 100%;
    margin-left: 0;
    margin-top: 0.1rem;
  }

  #wx-dock.wx-mobile-expanded #wx-scrub {
    height: 1.4rem;
    margin: 0.1rem 0 0.2rem;
  }

  #wx-dock.wx-mobile-expanded .wx-compact-bar {
    display: flex !important;
    justify-content: flex-end;
    min-height: 0;
    margin-bottom: 0.15rem;
  }

  #wx-dock.wx-mobile-expanded .wx-compact-label {
    display: none;
  }

  #wx-dock.wx-mobile-expanded .wx-compact-btn {
    min-width: 36px;
    min-height: 32px;
    border-radius: 999px;
  }

  /* Com timeline aberta, o bloco do play fica acima do menu lateral */
  #app-container.is-mobile:has(#wx-dock.wx-mobile-expanded) #search-overlay {
    z-index: 1450;
    pointer-events: auto;
  }

  #app-container.is-mobile:has(#wx-dock.wx-mobile-expanded) #search-overlay > * {
    pointer-events: auto;
  }

  #search-box {
    border-radius: 999px;
    padding: 0.4rem 0.55rem;
    min-height: 44px;
  }

  #search-input {
    font-size: 1rem;
  }

  #search-input::placeholder {
    font-size: 0.92rem;
  }

  #search-suggestions {
    max-height: 40dvh;
  }

  .suggestion-item {
    min-height: 52px;
    padding: 0.7rem 0.75rem;
  }

  .search-clear {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  /* Zoom Leaflet: canto inferior esquerdo, acima do chrome */
  .leaflet-top.leaflet-left {
    top: auto !important;
    bottom: calc(var(--chrome-bottom, 160px) + 8px) !important;
    left: 8px !important;
  }

  .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
  }

  .leaflet-bottom.leaflet-right {
    bottom: calc(var(--chrome-bottom, 160px) + 4px) !important;
    right: 6px !important;
  }

  .leaflet-control-attribution {
    max-width: min(52vw, 180px);
    font-size: 9px !important;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.65) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .map-chip-btn {
    display: none;
  }

  .layers-panel {
    top: calc(118px + var(--safe-top));
    right: 8px;
    left: 8px;
    bottom: auto;
    width: auto;
    max-height: min(50dvh, 360px);
    z-index: 1350;
  }

  .report-fab {
    left: auto;
    right: 10px;
    bottom: calc(var(--fab-bottom, 170px) + var(--safe-bottom));
    padding: 0.65rem 0.85rem;
    min-height: 48px;
    z-index: 1260;
  }

  .report-fab-icon {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
  }

  .report-fab-text {
    font-size: 0.85rem;
  }

  #wx-dock.wx-dock-with-play {
    left: auto;
    right: auto;
    width: 100%;
    bottom: auto;
    padding: 0.45rem 0.5rem 0.5rem;
    z-index: 1;
    border-radius: 12px;
    box-sizing: border-box;
  }

  .wx-compact-btn {
    min-width: 36px;
    min-height: 32px;
    border: 1px solid #3f3f46;
    background: #1f1f1f;
    color: #f3f4f6;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
  }

  .wx-compact-label {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    color: #fde68a;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #wx-scrub {
    width: 100%;
  }

  .wx-timeline-track {
    max-height: 3.4rem;
    min-height: 2.4rem;
    width: 100%;
    overflow-x: auto;
    margin-top: 0.3rem;
    gap: 0.35rem;
  }

  .wx-tick {
    font-size: 0.72rem;
    padding: 0.2rem 0.35rem;
  }

  .wx-now-mark {
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
  }

  .wx-band-label {
    font-size: 0.58rem;
  }

  .wx-sources,
  .wx-obs-ages {
    font-size: 0.62rem;
  }

  /* Condições em grid 2 colunas */
  #conditions-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.55rem;
  }

  #conditions-panel .condition-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.35rem 0.4rem;
    background: rgba(30, 30, 30, 0.55);
    border-radius: 6px;
  }

  #conditions-panel .condition-label {
    font-size: 0.65rem;
    color: #94a3b8;
  }

  #conditions-panel .condition-value {
    text-align: left;
    font-size: 0.9rem;
    font-weight: 700;
  }

  .local-orientation {
    padding: 0.45rem 0.5rem;
  }

  .orient-rose-wrap {
    justify-content: space-between;
  }

  .ac-wind-rose {
    width: 96px;
    height: 96px;
  }

  /* Peek: esconder título duplicado do scroll */
  #sidebar.sheet-peek h2 {
    display: none;
  }
}

/* Landscape mobile: sheet um pouco mais baixo no half/full */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  #sidebar.sheet-half {
    /* half calculado em JS; reforço visual */
  }

  #search-overlay {
    width: min(52vw, 360px);
  }

  .layers-panel {
    max-height: 55dvh;
    width: min(320px, 46vw);
    left: 8px;
    right: auto;
  }

  .leaflet-control-zoom {
    display: none;
  }
}

/* Telas muito estreitas */
@media (max-width: 360px) {
  #search-input::placeholder {
    content: 'Buscar lugar';
  }

  .report-fab-text {
    font-size: 0.78rem;
  }

  .peek-title {
    font-size: 0.9rem;
  }

  .map-chip-btn {
    display: none;
  }
}
