#nsafm-map,
.nsafm-map {
    width: 100%;
    min-height: 760px;
    height: min(78vh, 900px);
    border-radius: 24px;
    overflow: hidden;
    background: #dfe8e7;
    box-shadow: 0 24px 60px rgba(9, 34, 43, .22);
}

.nsafm-map-shell {
    width: min(1500px, calc(100% - 32px));
    margin: 40px auto 70px;
}

.nsafm-map-heading { margin-bottom: 22px; }
.nsafm-kicker {
    margin: 0 0 8px;
    color: #f7941d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.nsafm-map-heading h1 {
    margin: 0;
    color: #122b63;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    font-weight: 800;
}
.nsafm-subtitle {
    max-width: 850px;
    margin: 14px 0 0;
    color: #667085;
    font-size: 16px;
    line-height: 1.65;
}

.nsafm-toolbar { display:flex; gap:10px; margin-bottom:14px; }
.nsafm-search {
    flex:1; display:flex; align-items:center; gap:10px; padding:0 15px; height:48px;
    border:1px solid #d8dee6; border-radius:12px; background:#fff;
    box-shadow:0 5px 18px rgba(16,42,67,.06);
}
.nsafm-search span { color:#f7941d; font-size:22px; }
.nsafm-search input { width:100%; border:0; outline:0; background:transparent; font-size:15px; }
.nsafm-button {
    height:48px; padding:0 18px; border:0; border-radius:12px; background:#122b63;
    color:#fff; font-weight:700; cursor:pointer;
}
.nsafm-button:hover { transform:translateY(-1px); }

.nsafm-basemap-switcher {
    display:flex; gap:6px; padding:4px; margin-bottom:14px; width:max-content;
    border-radius:14px; background:rgba(10,28,37,.9); box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.nsafm-basemap-switcher button {
    border:0; background:transparent; color:#d8e3e7; padding:9px 14px; border-radius:10px;
    font-size:12px; font-weight:800; cursor:pointer;
}
.nsafm-basemap-switcher button.is-active { background:#f7941d; color:#fff; }

.nsafm-layout { display:grid; grid-template-columns:320px minmax(0,1fr); gap:14px; }
.nsafm-layers {
    max-height:760px; overflow:auto; padding:15px; border:1px solid rgba(255,255,255,.65);
    border-radius:18px; background:rgba(255,255,255,.93); backdrop-filter:blur(12px);
    box-shadow:0 12px 35px rgba(16,42,67,.12);
}
.nsafm-layers-title {
    margin:2px 4px 12px; color:#122b63; font-size:14px; font-weight:800;
    text-transform:uppercase; letter-spacing:1.5px;
}
.nsafm-layer-row {
    display:grid; grid-template-columns:18px 10px minmax(0,1fr) auto; align-items:center;
    gap:8px; min-height:46px; padding:7px 6px; border-bottom:1px solid #eef1f4; cursor:pointer;
}
.nsafm-layer-row input { margin:0; }
.nsafm-swatch { width:9px; height:9px; border-radius:50%; box-shadow:0 0 0 3px rgba(255,255,255,.8),0 2px 7px rgba(0,0,0,.18); }
.nsafm-layer-name { color:#243447; font-size:12px; line-height:1.3; }
.nsafm-count { color:#7b8794; font-size:10px; }
.nsafm-map-wrap { position:relative; min-width:0; }
.nsafm-status {
    position:absolute; left:15px; bottom:15px; z-index:500; padding:8px 12px; border-radius:9px;
    background:rgba(255,255,255,.94); color:#243447; font-size:12px; box-shadow:0 5px 18px rgba(0,0,0,.12);
}
.nsafm-loading,.nsafm-layer-error { padding:15px 5px; color:#7b8794; font-size:12px; }
.nsafm-layer-error { color:#b42318; }

/* 3D-inspired map treatment: depth shadow + dimensional boundary emphasis. */
.nsafm-map .leaflet-overlay-pane svg { filter: drop-shadow(3px 6px 5px rgba(0,0,0,.22)); }
.nsafm-map .leaflet-tile-pane { filter:saturate(1.06) contrast(1.03); }
.nsafm-map .leaflet-control-zoom a { background:rgba(255,255,255,.94); color:#122b63; }
.nsafm-map .leaflet-control-zoom { box-shadow:0 8px 24px rgba(0,0,0,.18); }

.nsafm-popup-title { color:#122b63; font-weight:800; font-size:14px; margin-bottom:8px; }
.nsafm-popup table { width:100%; border-collapse:collapse; margin-top:8px; }
.nsafm-popup th,.nsafm-popup td { padding:5px 7px; border-bottom:1px solid #edf0f3; vertical-align:top; text-align:left; font-size:11px; }
.nsafm-popup th { width:40%; color:#52606d; }

@media (max-width:900px) {
    .nsafm-layout { grid-template-columns:1fr; }
    .nsafm-layers { max-height:280px; }
    #nsafm-map,.nsafm-map { height:650px; min-height:560px; }
}
@media (max-width:600px) {
    .nsafm-map-shell { width:min(100% - 20px,1500px); margin-top:25px; }
    .nsafm-toolbar { flex-direction:column; }
    .nsafm-button { width:100%; }
    .nsafm-basemap-switcher { width:100%; }
    .nsafm-basemap-switcher button { flex:1; }
    #nsafm-map,.nsafm-map { height:560px; min-height:500px; border-radius:16px; }
}


/* =========================================================
   GEOSITE POINTS
========================================================= */

.nsafm-geosite-layer-row {
    background: linear-gradient(90deg, rgba(247,148,29,.10), transparent);
    border-radius: 10px;
    margin-bottom: 4px;
}

.nsafm-geosite-layer-row .nsafm-swatch {
    box-shadow: 0 0 0 3px rgba(247,148,29,.16);
}

.nsafm-geosite-popup {
    min-width: 270px;
}

.nsafm-geosite-popup h3 {
    margin: 5px 0 5px;
    color: #122b63;
    font-size: 20px;
    line-height: 1.15;
}

.nsafm-geosite-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f7941d;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.nsafm-geosite-location {
    margin: 0 0 8px;
    color: #52606d;
    font-size: 12px;
}

.nsafm-geosite-protection {
    margin: 0 0 10px;
    padding: 7px 9px;
    border-left: 3px solid #2a9d8f;
    background: #f3f8f7;
    color: #36534d;
    font-size: 11px;
    line-height: 1.4;
}

.nsafm-geosite-data {
    border-top: 1px solid #edf0f3;
    padding-top: 6px;
}

.nsafm-geosite-data .nsafm-popup-title {
    display: none;
}

.leaflet-interactive {
    transition: filter .18s ease;
}
