.map-area {
    position: relative;
}

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

/* Painel de detalhes */
.details-panel {
    position: relative;
}

.panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.panel-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.panel-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #111827;
    line-height: 1.3;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #374151;
}

.panel-row:last-child {
    border-bottom: none;
}

.panel-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 8px 0 0;
    line-height: 1.5;
}

.legend-item {
    margin: 6px 0;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.risk-critical {
    background: #fecaca;
    border-left: 4px solid #991b1b;
}

.risk-high {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}

.risk-medium-high {
    background: #ffedd5;
    border-left: 4px solid #ea580c;
}

.risk-medium {
    background: #fff7ed;
    border-left: 4px solid #f97316;
}

.risk-medium-low {
    background: #fef9c3;
    border-left: 4px solid #eab308;
}

.risk-low {
    background: #dcfce7;
    border-left: 4px solid #16a34a;
}

.risk-minimal {
    background: #dcfce7;
    border-left: 4px solid #22c55e;
}

.safe {
    background: #bbf7d0;
}

.support {
    background: #bfdbfe;
}

/* Filtros */
.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0 4px;
    color: #374151;
}

.filter-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #374151;
}

.sidebar-share {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.share-btn:hover {
    background: #6d28d9;
}

.share-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.share-modal-overlay.open {
    display: flex;
}

.share-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: min(480px, 92vw);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6b7280;
}

.share-modal-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px;
}

.share-link-wrap {
    display: flex;
    gap: 8px;
}

.share-link-wrap input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    outline: none;
}

.share-link-wrap button {
    padding: 8px 16px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.share-link-wrap button:hover {
    background: #6d28d9;
}

/* Botão de geolocalização */
.geolocate-btn {
    position: absolute;
    bottom: 24px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    transition: background .2s, border-color .2s, color .2s;
}

.geolocate-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.geolocate-btn.locating {
    color: #3b82f6;
    animation: pulse-locate 1.2s ease-in-out infinite;
}

.geolocate-btn.active {
    color: #3b82f6;
    border-color: #3b82f6;
}

.geolocate-btn.error {
    color: #ef4444;
    border-color: #ef4444;
}

@keyframes pulse-locate {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}
/* Popup balão estilo wireframe */
.ol-popup {
    position: absolute;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    padding: 16px 18px;
    min-width: 240px;
    max-width: 320px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    pointer-events: auto;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.5;
}

.ol-popup::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #ffffff;
    filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.12));
}

.ol-popup-closer {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
}

.ol-popup-closer:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.popup-badge {
    display: inline-block;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.popup-title {
    margin: 6px 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 13px;
    color: #334155;
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-row strong {
    color: #0f172a;
    font-weight: 600;
}

.popup-desc {
    margin: 6px 0 0;
    font-size: 13px;
    color: #475569;
}

#map {
    position: relative;
}
