
/* === NSRM: styl mapy jak na stronie (kafelki) === */
.nsrm-widget{
  /* obsługa zmiennych z motywu (nsll) + własne fallbacki */
  --nsrm-map-brightness: var(--nsll-map-brightness, 2.5);
  --nsrm-map-contrast:   var(--nsll-map-contrast, 1.0);
  --nsrm-map-saturate:   var(--nsll-map-saturate, 1.3);
}

/* === DESKTOP TOOLBAR: równe odstępy, bez nachodzenia (>=821px) === */
@media (min-width: 821px){
  /* odstępy między sekcjami w toolbarze */
  .nsrm-toolbar{ gap: 14px !important; }

  /* górny rząd przycisków */
  .nsrm-modes{
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
  }

  /* przyciski nie mogą się ściskać/łamać w dziwny sposób */
  .nsrm-modes .nsrm-btn{
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  /* prawa strona zawsze odseparowana */
  .nsrm-modes .nsrm-locate{ margin-left: auto !important; }
  .nsrm-modes .nsrm-opt{ margin-left: 0 !important; }

}

/* === Mobile (do 820px) – przyciski trybów mają się mieścić (szczególnie 641–820) === */
@media (max-width:820px){
  /* 2x2 układ stabilny w zakresie 1–820px (bez uciekania w 641–820) */
  .nsrm-modes{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .nsrm-modes .nsrm-btn{
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  /* na mobile nie wypychaj "Moja lokalizacja" na prawo */
  .nsrm-modes .nsrm-locate{
    margin-left: 0 !important;
  }
}

/* Ukryj stopkę atrybucji kafelków (UWAGA: może naruszać warunki dostawcy map) */
.nsrm-wrap .leaflet-control-attribution{ display:none !important; }

/* ===== NSRM: mobile fullscreen "Miejsca na mapie" panel ===== */
@media (max-width:820px){
body.nsrm-pointsfs-lock{ overflow:hidden !important; }

/* Fullscreen „Miejsca na mapie” na mobile ma przykryć motyw (header/footer często mają ogromne z-index) */
body.nsrm-pointsfs-lock .site-header,
body.nsrm-pointsfs-lock .site-footer,
body.nsrm-pointsfs-lock #wpadminbar{
  display: none !important;
}

  .nsrm-pointsfs-open #nsrm-mapa-points-panel{
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483647 !important; /* przebij z-index motywu */
    max-height: none !important;
    height: 100dvh !important;
    padding: 16px !important;
    padding-top: calc(16px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    /* bez rozmycia (blur) i z czytelnym tłem */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(6,10,14,.98) !important;
  }

  .nsrm-pointsfs-open .nsrm-pointsfs-backdrop{
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    /* Fullscreen (mobile): bez rozmycia tła – czytelniej i bez "blur" na ekranie */
    background: rgba(0,0,0,.72);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nsrm-pointsfs-close{
    width: 100% !important;
    margin: 10px 0 14px !important;
  }
}
.nsrm-widget .leaflet-tile{
  filter: brightness(var(--nsrm-map-brightness)) contrast(var(--nsrm-map-contrast)) saturate(var(--nsrm-map-saturate)) !important;
}

.nsrm-widget [hidden]{ display:none !important; }

/* atrybucja: zostaje (licencja), ale mniej inwazyjna */
.nsrm-widget .leaflet-control-attribution{
  font-size: 11px;
  opacity: .75;
}
.nsrm-widget .leaflet-control-attribution a{
  text-decoration: none;
}

/* Ukrywanie legendy (checkbox) */
@media (min-width: 769px){
  .nsrm-only-mobile{ display:none !important; }
}

/* NS Rolkowa Mapa – czarno-biała skórka */
.nsrm-wrap{max-width:1200px;margin:0 auto;padding:24px;}
.nsrm-intro{margin-bottom:18px;color:#f2f2f2;line-height:1.55;}
.nsrm-toolbar{background:rgba(0,0,0,.55);border:1px solid rgba(255,255,255,.12);border-radius:18px;padding:14px 14px 10px;margin-bottom:14px;backdrop-filter: blur(10px);-webkit-backdrop-filter: blur(10px);}
.nsrm-modes{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:10px;}
/* Desktop/tablet: dwie grupy w jednym wierszu bez nachodzenia.
   'Moja lokalizacja' + 'Opcje' trzymają się prawej strony, a gdy brakuje miejsca — zawijają. */
.nsrm-modes .nsrm-btn{flex:0 0 auto;}
.nsrm-modes .nsrm-btn.nsrm-locate{margin-left:auto;}


.nsrm-filtergroup{display:flex;flex-wrap:wrap;gap:10px;align-items:center;}

/* Twarde przełączanie grup po trybie (żeby nic nie „przeciekało” między Mapą a Trasami
   nawet gdy włączone są opcje / opt-open lub motyw nadpisuje [hidden]) */
.nsrm-wrap[data-nsrm-mode="surface"] .nsrm-filtergroup.nsrm-length{display:none !important;}
.nsrm-wrap[data-nsrm-mode="surface"] .nsrm-filtergroup.nsrm-points{display:none !important;}
.nsrm-wrap[data-nsrm-mode="length"]  .nsrm-filtergroup.nsrm-surface{display:none !important;}
.nsrm-label{opacity:.85;margin-right:6px;font-weight:600;}
.nsrm-btn{appearance:none;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);color:#fff;border-radius:999px;padding:9px 12px;font-size:14px;line-height:1;cursor:pointer;
  z-index:10;transition:transform .06s ease, background .18s ease, border-color .18s ease;}
.nsrm-btn:hover{background:rgba(255,255,255,.10);} 
.nsrm-btn:active{transform:translateY(1px);} 
.nsrm-btn.is-active{background:#fff;color:#000;border-color:rgba(255,255,255,.6);} 
.nsrm-btn.nsrm-locate{margin-left:auto;}

.nsrm-privacy{margin-top:10px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:10px 12px;color:#fff;font-size:13px;}

#nsrm-map,.nsrm-map{width:100%;border-radius:22px;overflow:hidden;border:1px solid rgba(255,255,255,.12);box-shadow:0 10px 40px rgba(0,0,0,.35);} 

/* Leaflet BW */
.nsrm-wrap .leaflet-container{background:#0b0b0b;}
.nsrm-wrap .leaflet-control-attribution{background:rgba(0,0,0,.55);color:#ddd;}
.nsrm-wrap .leaflet-control-zoom a{background:rgba(0,0,0,.6);color:#fff;border:1px solid rgba(255,255,255,.12);} 

/* Popup (jak modal – neon, czytelnie) */
.nsrm-wrap .leaflet-popup-content-wrapper{
  background: rgba(12,14,20,0.92);
  color:#fff;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 0 0 1px rgba(51,167,255,0.14), 0 18px 50px rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow:hidden;
}
.nsrm-wrap .leaflet-popup-tip{ background: rgba(12,14,20,0.92); }

/* Popup: font jak na stronie (dziedzicz z motywu) */
.nsrm-wrap .leaflet-popup-content-wrapper,
.nsrm-wrap .leaflet-popup-content,
.nsrm-wrap .leaflet-popup-close-button{
  font-family: inherit !important;
}

/* Leaflet "X" – jak w panelach */
.nsrm-wrap .leaflet-popup-close-button{
  top:10px !important;
  right:10px !important;
  width:34px !important;
  height:34px !important;
  border-radius:12px !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.92) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  line-height:1 !important;
  font-size:22px !important;
  text-decoration:none !important;
}
.nsrm-wrap .leaflet-popup-close-button:hover{
  border-color: rgba(60,255,220,.28) !important;
}

/* zawartość */
.nsrm-wrap .leaflet-popup-content{ margin:0 !important; }
.nsrm-popup{ padding:14px 14px 12px; min-width: 220px; }
.nsrm-popup__title{
  font-weight:700;
  font-size:16px;
  letter-spacing:.2px;
  margin:0 36px 8px 0; /* miejsce na X */
  color: var(--nsrm-cyan, #3CFFDC);
}
.nsrm-popup__desc{ font-size:14px; opacity:.92; line-height:1.4; }
.nsrm-popup__desc p{ margin:0; }


/* ===== NSRM Legend + Options + Fullscreen ===== */
.nsrm-toolbar{ position: relative; z-index: 2500; }
.nsrm-opt{ margin-left: 8px; }
.nsrm-optpanel{
  position: absolute;
  right: 16px;
  top: 52px;
  min-width: 220px;
  max-width: calc(100% - 32px);
  background: rgba(0,0,0,0.88);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  z-index: 2200;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* dropdown look (desktop + mobile) */
.nsrm-optpanel .nsrm-check{
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
}
.nsrm-optpanel .nsrm-check:hover{ background: rgba(255,255,255,0.06); }
.nsrm-optpanel .nsrm-check input{ margin: 0; }
.nsrm-optpanel .nsrm-btn{
  width: 100%;
  justify-content: center;
}

/* Desktop: mniejszy panel opcji (kompaktowy) */
@media (min-width: 821px){
  .nsrm-optpanel{
    min-width: 180px;
    padding: 10px;
    gap: 8px;
  }
  .nsrm-optpanel .nsrm-check{
    padding: 4px 6px;
    gap: 8px;
  }
  .nsrm-optpanel .nsrm-btn{
    padding: 8px 10px;
  }
}


/* Mobile: opcje obok siebie (checkboxy w 2 kolumnach, przycisk pod spodem) */
@media (max-width: 820px){
  .nsrm-optpanel{
    left: 12px;
    right: 12px;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
  }
  .nsrm-optpanel .nsrm-check{
    flex: 1 1 calc(50% - 12px);
    margin: 0;
    white-space: nowrap;
  }
  .nsrm-optpanel .nsrm-btn{
    flex: 1 1 100%;
    margin-top: 2px;
  }
}

/* ===== Modal opisu trasy (track modal) ===== */
/*
  UWAGA: markup w shortcode używa klas .nsrm-trackmodal__*
  (wcześniej w CSS było .nsrm-modal__*), dlatego mobile wyglądało chaotycznie
  i „X” znikał. Poniżej stylujemy oba warianty dla kompatybilności.
*/
body.nsrm-modal-open{ overflow:hidden; }

.nsrm-trackmodal,
.nsrm-modal{ position:fixed; inset:0; z-index:9999; }

.nsrm-trackmodal[hidden],
.nsrm-modal[hidden]{ display:none; }

.nsrm-trackmodal__backdrop,
.nsrm-modal__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,0.55); backdrop-filter: blur(6px); }

.nsrm-trackmodal__panel,
.nsrm-modal__panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(760px,92vw);
  max-height:min(82vh,760px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(12,14,20,0.92);
  box-shadow:0 0 0 1px rgba(51,167,255,0.15), 0 18px 50px rgba(0,0,0,0.65);
}

.nsrm-trackmodal__close,
.nsrm-modal__close{
  position:absolute;
  right:14px;
  top: max(14px, env(safe-area-inset-top));
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.06);
  color:#fff;
  font-size:24px;
  line-height:34px;
  cursor:pointer;
  z-index:10;
  box-shadow:0 0 0 1px rgba(51,167,255,0.12);
  z-index:3;
}

/* Mobile: upewnij się, że "X" jest zawsze w zasięgu (nawet przy bardzo długim opisie) */
@media (max-width: 640px){
  .nsrm-trackmodal__panel,
  .nsrm-modal__panel{ max-height: calc(100vh - 24px); }
}

.nsrm-trackmodal__title,
.nsrm-modal__title{
  font-weight:800;
  font-size:18px;
  /* zostaw miejsce na X, żeby nie "wchodził" w tytuł */
  padding:18px 72px 6px 18px;
  margin:0;  border-bottom:none;
}

.nsrm-trackmodal__meta,
.nsrm-modal__meta{
  opacity:0.88;
  font-size:13px;
  padding:10px 18px 12px;
  margin:0;
}

.nsrm-trackmodal__body,
.nsrm-modal__body{
  font-size:14px;
  line-height:1.55;
  padding:0 18px 18px;
  overflow:auto;
}

/* Mobile: modal NIE może "ucinać" góry (Safari/iOS). Panel ma mieć top/bottom z safe-area,
   a X ma być zawsze w panelu, nie jako fixed (bo fixed + transform potrafi wariować w iOS). */
@media (max-width: 767px){
  .nsrm-trackmodal__panel,
  .nsrm-modal__panel{
    left: 50%;
    top: calc(10px + env(safe-area-inset-top));
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: calc(100vw - 16px);
    max-height: none;
  }

  .nsrm-trackmodal__close,
  .nsrm-modal__close{
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 50;
  }
}

@media (max-width: 767px){
  /* panel opcji na mobile ma być "w flow" (nie absolutny), żeby nie nachodził na legendę */
  .nsrm-optpanel{
    position: static !important;
    right: auto !important;
    top: auto !important;
    width: 100%;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.nsrm-check{ display:flex; align-items:center; gap:8px; font-size:14px; color:#fff; }
.nsrm-check input{ transform: translateY(1px); }
.nsrm-selectwrap{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-right: 10px; }
.nsrm-select{ background: rgba(255,255,255,0.08); color:#fff; border:1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 8px 10px; min-width: 220px; }
.nsrm-select option{ color:#000; }

.nsrm-legend{
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;              /* desktop: jedna linia */
  overflow-x: auto;               /* gdy brak miejsca */
  -webkit-overflow-scrolling: touch;
}
.nsrm-legend::-webkit-scrollbar{ height: 8px; }
.nsrm-legendtitle{
  font-weight: 700;
  font-size: 13px;
  opacity: 0.9;
  margin: 0;                      /* desktop inline */
  white-space: nowrap;
}

.nsrm-legendtitle{ font-weight: 700; font-size: 13px; opacity: 0.9; margin-bottom: 6px; }
.nsrm-legendrow{ display:flex; align-items:center; gap:8px; font-size: 13px; opacity: 0.95; }

/* ===== Legenda: desktop jedna linia, mobile dwie linie ===== */
@media (min-width: 768px){
  .nsrm-legend{
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nsrm-legendtitle{ margin-bottom:0; white-space:nowrap; }
  .nsrm-legendrow{ white-space:nowrap; }
}
@media (max-width: 767px){
  .nsrm-legend{
    flex-wrap: wrap !important;
    gap: 10px 14px;
  }
  .nsrm-legendset{
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
  }
  .nsrm-legendtitle{ width:100%; }
  /* elementy legendy w dwóch kolumnach */
  .nsrm-legendrow{ flex: 0 0 calc(50% - 10px); }
}

.nsrm-swatch{
  width: 18px; height: 10px;
  border-radius: 999px;
  display:inline-block;
  border: 1px solid rgba(255,255,255,0.25);
}
.nsrm-swatch[data-swatch="asfalt"]{ background:#22c55e; }
.nsrm-swatch[data-swatch="kostka_gladka"]{ background:#f59e0b; }
.nsrm-swatch[data-swatch="do_20"]{ background:#22c55e; }
.nsrm-swatch[data-swatch="do_50"]{ background:#f59e0b; }
.nsrm-swatch[data-swatch="powyzej_50"]{ background:#b91c1c; }

/* Legenda: dopasuj do "taśmy ostrzegawczej" (żółto-czarne zjazdy/podjazdy) */
.nsrm-swatch-slope{ opacity: 0.95; }
.nsrm-swatch-slope{
  /* lekkie skosy jak taśma BHP */
  background: repeating-linear-gradient(45deg,
    #facc15 0 8px,
    #111827 8px 16px
  );
  border-color: rgba(250,204,21,0.35);
}

body.nsrm-noscroll{ overflow:hidden !important; }
.nsrm-wrap.is-fullscreen .nsrm-map{ height: calc(100vh - 200px) !important; }
@media (max-width: 767px){
  .nsrm-optpanel{ right: 10px; top: 54px; }
  .nsrm-select{ min-width: 160px; }
  .nsrm-wrap.is-fullscreen .nsrm-map{ height: calc(100vh - 220px) !important; }
}

/* ===== Mobile: uporządkuj toolbar (żeby nie było "haosu") ===== */
@media (max-width: 640px){
  .nsrm-toolbar{ padding: 12px; border-radius: 18px; }

  /* Mobile: menu w DWÓCH LINIACH (Mapa / Trasy), a akcje pod spodem */
  .nsrm-modes{
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .nsrm-modes .nsrm-btn{ width: 100%; justify-content: center; }
  .nsrm-btn.nsrm-locate{ margin-left: 0; }
  .nsrm-opt{ margin-left: 0; }

  /* panel opcji jako pełna szerokość, bez nachodzenia */
  .nsrm-optpanel{
    left: 12px;
    right: 12px;
    top: auto;
    margin-top: 10px;
    position: static;
    width: auto;
    justify-content: space-between;
  }
}

/* ===== Mobile: legenda na górze (2 linie) ===== */
@media (max-width: 640px){
  /* wymuś kolejność elementów: toolbar -> legenda -> mapa */
  .nsrm-wrap{ display:flex !important; flex-direction:column !important; }
  .nsrm-toolbar{ order: 1 !important; }
  .nsrm-legend{ order: 2 !important; }
  .nsrm-map{ order: 3 !important; }

  .nsrm-legend{
    flex-wrap: wrap !important;
    overflow: visible;
    white-space: normal;
    gap: 10px 14px;
    align-items: flex-start;
  }
  .nsrm-legendset{ display:flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
  .nsrm-legendtitle{ margin: 0; width: 100%; }
}

/* ===== Mobile: w modalu X ma być zawsze widoczny ===== */
@media (max-width: 640px){
  .nsrm-trackmodal__panel,
  .nsrm-modal__panel{
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  /* Close jest w panelu (absolute), a safe-area załatwia sam panel */
  .nsrm-trackmodal__close,
  .nsrm-modal__close{
    top: 10px;
    right: 10px;
  }
}


/* Fullscreen (mobile only) – stabilne, bez psucia bazowej mapy */
@media (max-width: 820px){
  .nsrm-wrap.is-fullscreen{
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #07090c !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    width: 100vw !important;
  }

  .nsrm-wrap.is-fullscreen .nsrm-intro{ display:none !important; }

  .nsrm-wrap.is-fullscreen .nsrm-toolbar,
  .nsrm-wrap.is-fullscreen .nsrm-legend{
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  .nsrm-wrap.is-fullscreen .nsrm-map{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
  }

  /* Leaflet container to fill */
  .nsrm-wrap.is-fullscreen #nsrm-map.leaflet-container{
    width: 100% !important;
    height: 100% !important;
  }

  /* FULLSCREEN: legenda zawsze POD menu (nie może "wisieć" na górze) */
  .nsrm-wrap.is-fullscreen .nsrm-toolbar{ order: 1 !important; position: relative !important; z-index: 3 !important; }
  .nsrm-wrap.is-fullscreen .nsrm-legend{
    order: 2 !important;
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    margin: 8px 12px 0 12px !important;
    align-self: stretch !important;
  }
  .nsrm-wrap.is-fullscreen .nsrm-map{ order: 3 !important; }

}

/* --- Trasy: hint gdy nie wybrano trasy --- */
.nsrm-trackhint{
  width: 100%;
  margin: 10px 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.88);
  font-size: 13px;
  line-height: 1.25;
}

.nsrm-trackhint[hidden]{
  display: none !important;
}

/* szanuj atrybut hidden (na niektórych motywach bywa nadpisany) */
.nsrm-trackhint[hidden]{
  display: none !important;
}

/* blokuj scroll strony w fullscreen */
body.nsrm-noscroll{ overflow:hidden !important; }

/* dla pewności schowaj nakładki motywu podczas fullscreen */
body.nsrm-noscroll header,
body.nsrm-noscroll footer,
body.nsrm-noscroll .elementor-location-header,
body.nsrm-noscroll .elementor-location-footer,
body.nsrm-noscroll .nsw-social,
body.nsrm-noscroll .ns-social,
body.nsrm-noscroll .ns-social-float,
body.nsrm-noscroll .nsw-social-footer{
  display: none !important;
}

/* desktop: nie pokazujemy przycisku pełnego ekranu */
@media (min-width: 821px){
  [data-nsrm-fs]{ display:none !important; }
}


/* nsrm-scroll-lock: blokuj przewijanie tła w fullscreen (mobile) */
@media (max-width: 820px){
  html.nsrm-mapfs,
  body.nsrm-mapfs{
    /* Jeden przewijany kontener (ważne na iOS): */
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    height: 100vh !important;
    width: 100% !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }
}


/* multi-points dropdown (Mapa) */
.nsrm-points-multi{ display:inline-flex; gap:10px; align-items:center; margin-left:10px; position:relative; }
.nsrm-points-toggle{ white-space:nowrap; }
.nsrm-points-panel{
  position:absolute;
  top: calc(100% + 8px);
  left:0;
  z-index: 5000; /* nad mapą (Leaflet ma wysokie z-indexy) */
  min-width: 240px;
  max-width: 340px;
  max-height: 280px;
  overflow:auto;
  background: rgba(10,12,16,.96);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}

/* When a category is expanded, give the panel a bit more room so 2–3 items are visible */
.nsrm-points-panel.has-subopen{
  max-height: 360px;
}

@media (max-width: 600px){
  .nsrm-points-panel.has-subopen{
    max-height: min(62vh, 420px);
  }
}
.nsrm-points-hint{ font-size: 12px; opacity:.8; margin: 2px 0 8px; }
.nsrm-points-item{ display:flex; gap:10px; align-items:center; padding:6px 6px; border-radius:10px; cursor:pointer;
  z-index:10; }
.nsrm-points-item:hover{ background: rgba(255,255,255,.06); }
.nsrm-points-item input{ width:16px; height:16px; }
.nsrm-points-item .dot{ width:10px; height:10px; border-radius:50%; background:#fff; opacity:.85; }


/* =========================
   NSRM Neon UI + Mobile map-first
   v1.3.7
   ========================= */

:root{
  --nsrm-bg0: #05060b;
  --nsrm-bg1: rgba(10,12,18,.78);
  --nsrm-brd: rgba(255,255,255,.10);
  --nsrm-brd2: rgba(60,255,220,.22);
  --nsrm-glow: 0 0 0 1px rgba(60,255,220,.14), 0 12px 40px rgba(0,0,0,.55);
  --nsrm-glow2: 0 0 0 1px rgba(255,60,210,.14), 0 12px 40px rgba(0,0,0,.55);
  --nsrm-cyan: #3CFFDC;
  --nsrm-pink: #FF3CD2;
  --nsrm-blue: #4CB3FF;
}

.nsrm-wrap{ color: rgba(255,255,255,.92); }

/* toolbar look */
.nsrm-toolbar{
  background: linear-gradient(135deg, rgba(10,12,18,.86), rgba(6,10,20,.72));
  border: 1px solid var(--nsrm-brd);
  box-shadow: var(--nsrm-glow);
  backdrop-filter: blur(10px);
}

.nsrm-btn{
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(255,255,255,.04) !important;
  color: rgba(255,255,255,.92) !important;
  box-shadow: none;
}
.nsrm-btn:hover{
  border-color: rgba(60,255,220,.28) !important;
  box-shadow: 0 0 0 1px rgba(60,255,220,.08) inset;
}
.nsrm-btn.is-active,
.nsrm-btn[aria-selected="true"]{
  background: linear-gradient(135deg, rgba(60,255,220,.18), rgba(255,60,210,.10)) !important;
  border-color: rgba(60,255,220,.36) !important;
  box-shadow: 0 0 0 1px rgba(60,255,220,.10) inset, 0 10px 24px rgba(0,0,0,.35);
}

.nsrm-optpanel{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,12,18,.92);
  box-shadow: var(--nsrm-glow2);
  backdrop-filter: blur(12px);
}

/* legend look */
.nsrm-legend{
  background: rgba(10,12,18,.86);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--nsrm-glow);
  backdrop-filter: blur(10px);
}

/* --- Mobile: make map bigger (map-first) --- */
@media (max-width: 820px){
  .nsrm-intro{
    font-size: 14px;
    line-height: 1.45;
    opacity: .92;
    margin-bottom: 10px;
  }

  .nsrm-toolbar{
    position: sticky;
    top: 0;
    z-index: 2000;
    padding: 10px 10px;
    border-radius: 18px;
  }

  .nsrm-modes{ gap: 8px !important; flex-wrap: wrap; }
  .nsrm-modes .nsrm-btn{
    padding: 10px 14px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
  }

  .nsrm-filtergroup{ margin-top: 10px !important; gap: 8px !important; }
  .nsrm-label{
    display:block;
    width:100%;
    margin: 2px 0 6px;
    opacity: .82;
  }

  .nsrm-map{
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(0,0,0,.45);
  }

  /* put legend ON TOP OF MAP (overlay) */
  .nsrm-wrap{ position: relative; }
    .nsrm-legendtitle{ font-size: 13px; margin-bottom: 6px; }
  .nsrm-legendrow{ font-size: 13px; line-height: 1.2; padding: 2px 0; }

  /* dropdown jako bottom sheet – TYLKO na małych ekranach (telefon).
     Na laptopach 768–820px ma być normalny dropdown pod przyciskiem. */
}

@media (max-width: 600px){
  /* Telefon: panel "Miejsca na mapie" jako czytelny bottom-sheet + scroll.
     iOS wymaga jawnego overflow + -webkit-overflow-scrolling. */
  .nsrm-points-panel{
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    top: 140px !important; /* zostaw miejsce na toolbar/filtry */
    z-index: 3000 !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.65) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    /* Jeden przewijany kontener (ważne na iOS): */
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    display: flex !important;
    flex-direction: column !important;
  }
  /* Wewnętrzna lista ma się przewijać, żeby dało się zobaczyć WSZYSTKIE punkty. */
  .nsrm-points-panel .nsrm-points-list{
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (min-width: 601px) and (max-width: 820px){
  .nsrm-points-panel{
    position:absolute !important;
    left:0 !important;
    right:auto !important;
    bottom:auto !important;
    top: calc(100% + 8px) !important;
    max-height: 280px !important;
    border-radius: 14px !important;
    z-index: 5000 !important;
  }

  /* Gdy rozwinięta jest podlista – daj panelowi trochę więcej wysokości,
     żeby na tabletach/małych ekranach było widać 2–3 pozycje bez przewijania.
     (Poniżej 600px panel ma własny „bottom sheet” z pełnym scrollem.) */
  .nsrm-points-panel.has-subopen{
    max-height: 380px !important;
  }
}

/* === Tablet (601–820): panel "Miejsca na mapie" ma być zawsze dostępny === */
@media (min-width: 601px) and (max-width: 820px){
  /* wyrównaj układ: legenda potem cała linia "Mapa:" (filtry) */
  .nsrm-legend--placed{ margin-top: 10px !important; }
  .nsrm-filtergroup.nsrm-surface{ margin-top: 16px !important; }
}

/* Fullscreen overlay */
@media (max-width: 820px){
  body.nsrm-mapfs .nsrm-wrap{ padding: 0 !important; }
  body.nsrm-mapfs .nsrm-toolbar{
    margin: 0 !important;
    border-radius: 0 0 18px 18px !important;
  }
  body.nsrm-mapfs .nsrm-legend{
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

/* (modal styles are defined earlier; keeping only one source of truth) */

/* ===== Mobile: pokaż filtry dopiero po kliknięciu "Opcje" =====
   TYLKO telefon. Na tabletach 601–820 panel ma być widoczny normalnie. */
@media (max-width: 820px){
  .nsrm-filtergroup{ display:none; }
  .nsrm-wrap.nsrm-opt-open .nsrm-filtergroup{ display:flex; }

/*
  IMPORTANT:
  Nie nadpisuj atrybutu [hidden].
  Toolbar w trybie "opt-open" pokazuje grupy filtrów, ale te z [hidden]
  (np. Trasy w widoku Mapa) muszą pozostać ukryte.
*/
  .nsrm-wrap [hidden]{ display:none !important; }
  /* żeby nie było chaosu: grupy w kolumnie, pełna szerokość */
  .nsrm-filtergroup{ flex-wrap:wrap; gap:10px; }
  .nsrm-filtergroup .nsrm-label{ flex: 0 0 100%; }
  .nsrm-filtergroup select{ width:100%; max-width:100%; }
}


/* === 1.6.8 FIX: mobile modal – panel w bezpiecznym obszarze + X zawsze widoczny === */
@media (max-width: 767px){
  .nsrm-trackmodal__panel,
  .nsrm-modal__panel{
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: calc(env(safe-area-inset-top) + 16px) !important;
    bottom: calc(env(safe-area-inset-bottom) + 16px) !important;
    transform: translateX(-50%) !important;
    width: min(760px, 94vw) !important;
    max-height: none !important;
  }
  .nsrm-trackmodal__close,
  .nsrm-modal__close{
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 25 !important;
  }
  .nsrm-trackmodal__title,
  .nsrm-modal__title{
    padding-right: 64px !important; /* miejsce na X */
  }
}

/* === Powrót na mobile: trzymaj fullscreen i pokaż overlay do czasu nawigacji === */
.is-nsrm-backloading .nsrm-backloading{
  display: flex;
}
.nsrm-backloading{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000; /* ponad mapę i modale */
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}
.nsrm-backloading__box{
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 768px){
  .nsrm-legend{ position: relative !important; inset: auto !important; margin-top: 12px !important; }
}


/* === Legenda: desktop 1 linia, mobile 2 linie === */
@media (min-width: 769px){
  .nsrm-legend{
    display:flex;
    align-items:center;
    gap:22px;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
  }
  .nsrm-legendset{
    display:flex;
    align-items:center;
    gap:16px;
    white-space:nowrap;
  }
  .nsrm-legendtitle{ margin-right:6px; white-space:nowrap; }
  .nsrm-legendrow{ white-space:nowrap; }
}
@media (max-width: 768px){
  .nsrm-legend{ display:block; }
  .nsrm-legendset[data-legend="surface"]{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:10px 16px;
  }
  .nsrm-legendset[data-legend="surface"] .nsrm-legendtitle{ grid-column: 1 / -1; }
  .nsrm-legendset[data-legend="slope"]{ margin-top: 10px; }
}
.nsrm-wrap.is-legend-hidden .nsrm-legend{display:none !important;}

/* === Legenda placement === */
.nsrm-legend{ position: relative; inset:auto; }

/* Fullscreen (mobile): legenda jest w toolbarze pod menu (bez "wiszenia") */
@media (max-width: 767px){
  .nsrm-wrap.is-fullscreen .nsrm-toolbar .nsrm-legend{
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin-top: 8px !important;
  }
}


/* === NSRM: wymuszenie filtra kafelków (motyw może nadpisywać) === */
.nsrm-map .leaflet-tile,
.nsrm-widget .leaflet-tile,
.nsrm-map .leaflet-tile-container img,
.nsrm-widget .leaflet-tile-container img{
  filter: brightness(var(--nsrm-map-brightness, 2.5)) contrast(var(--nsrm-map-contrast, 1.0)) saturate(var(--nsrm-map-saturate, 1.3)) !important;
  -webkit-filter: brightness(var(--nsrm-map-brightness, 2.5)) contrast(var(--nsrm-map-contrast, 1.0)) saturate(var(--nsrm-map-saturate, 1.3)) !important;
}


/* ===== Neonowe okno ładowania mapy ===== */
.nsrm-loading{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(2,6,23,0.60);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
}
.nsrm-loading[hidden]{ display:none !important; }
.nsrm-loading__panel{
  width: min(320px, 84vw);
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 0 0 1px rgba(40,255,210,0.10),
    0 0 28px rgba(40,255,210,0.14),
    0 0 54px rgba(140,70,255,0.16);
}
.nsrm-loading__title{
  font-weight: 900;
  letter-spacing: .2px;
  margin-top: 0;
  font-size: 18px;
}
.nsrm-loading__sub{
  opacity: .85;
  font-size: 13px;
  line-height: 1.35;
  max-width: 28ch;
}
.nsrm-loading__ring{
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(40,255,210,1),
    rgba(140,70,255,1),
    rgba(255,43,214,1),
    rgba(255,213,0,1),
    rgba(40,255,210,1));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: nsrmSpin 1.0s linear infinite;
  box-shadow:
    0 0 22px rgba(40,255,210,0.25),
    0 0 40px rgba(140,70,255,0.20),
    0 0 60px rgba(255,43,214,0.12);
}
@keyframes nsrmSpin{ to{ transform: rotate(360deg); } } }


/* === NSRM 1.6.27: legenda mobile zawsze pod menu (nie fixed) === */
@media (max-width: 767px){
  .nsrm-wrap{ display:flex; flex-direction:column; }
  .nsrm-toolbar{ order:1; z-index: 5000; }
  .nsrm-legend{
    order:2;
    position: relative !important;
    left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
    z-index: 1 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .nsrm-mapwrap, #nsrm-map, .nsrm-map{ order:3; }
}



/* === NSRM HOTFIX: legenda zawsze pod menu na mobile (bez przyklejania) === */
@media (max-width: 820px){
  /* legenda ma być w flow pod toolbar (nie fixed/absolute) */
  .nsrm-legend{
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    inset: auto !important;
    z-index: 2 !important;
    margin: 10px 12px 0 12px !important;
    max-height: none !important;
    overflow: visible !important;
    display: flex !important;
  }
  /* pewna kolejność w fullscreen */
  .nsrm-wrap.is-fullscreen{ display:flex !important; flex-direction:column !important; }
  .nsrm-wrap.is-fullscreen .nsrm-toolbar{ order: 1 !important; z-index: 3 !important; }
  .nsrm-wrap.is-fullscreen .nsrm-legend{ order: 2 !important; }
  .nsrm-wrap.is-fullscreen .nsrm-map{ order: 3 !important; }
}


/* ===== NSRM HOTFIX: legenda mobile zawsze widoczna i pod menu (nie pod przyciskami) ===== */
@media (max-width: 640px){
  .nsrm-wrap{ display:flex !important; flex-direction:column !important; gap:10px !important; }
  .nsrm-toolbar{ order:1 !important; }
  .nsrm-legend{ 
    order:2 !important;
    display:flex !important;
    position: relative !important;
    inset: auto !important;
    margin: 0 12px 0 12px !important;
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    z-index: 50 !important; /* ponad przyciskami (.nsrm-btn ma z-index:10) */
    pointer-events: auto !important;
  }
  .nsrm-map{ order:3 !important; }
}


/* === Legend placement fix (mobile + desktop) === */
.nsrm-toolbar .nsrm-legend--placed{
  width: 100%;
  margin-top: 10px;
  order: 50; /* after top controls, before optpanel content if flex */
  position: relative;
  z-index: 5;
}
@media (max-width: 768px){
  .nsrm-toolbar .nsrm-legend--placed{
    margin-top: 8px;
  }
}


/* === MOBILE TOOLBAR LAYOUT === */
@media (max-width: 820px){
  .nsrm-modes{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  .nsrm-modes .nsrm-btn{
    width:100%;
  }

  .nsrm-legend{
    display:flex;
    flex-wrap:nowrap;
    gap:14px;
    justify-content:space-between;
  }
  .nsrm-legendrow{
    white-space:nowrap;
    font-size:13px;
  }
}


/* === MOBILE LEGEND: ONE LINE COMPACT === */
@media (max-width: 820px){
  .nsrm-legendtitle{ display:none!important; }

  .nsrm-legend{
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:14px!important;
    overflow:hidden!important;
  }

  .nsrm-legendset{
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:14px!important;
    margin:0!important;
    padding:0!important;
  }

  .nsrm-legendrow{
    display:inline-flex!important;
    align-items:center!important;
    gap:8px!important;
    white-space:nowrap!important;
    font-size:13px!important;
    line-height:1.15!important;
    margin:0!important;
    padding:0!important;
  }

  .nsrm-swatch{
    flex:0 0 auto;
  }
}


/* Ensure [hidden] wins even when we use display:* !important elsewhere */
.nsrm-legend [hidden],
.nsrm-legendset[hidden],
.nsrm-legendrow[hidden]{ display:none !important; }


/* === Align toolbar blocks (mobile) === */
@media (max-width: 820px){
  .nsrm-toolbar{
    padding:14px !important;
  }
  .nsrm-legend{
    margin-top:10px !important;
  }
  .nsrm-filtergroup{
    margin-top:12px !important;
  }
}

/* === Track modal: nicer neon + divider that doesn't run under X === */
.nsrm-trackmodal__title,
.nsrm-modal__title{
  position:relative;
  background:linear-gradient(90deg, rgba(35,220,255,0.10), rgba(180,80,255,0.08));
  text-shadow:0 0 18px rgba(35,220,255,0.22);
}

.nsrm-trackmodal__title::after,
.nsrm-modal__title::after{
  content:"";
  position:absolute;
  left:18px;
  right:72px; /* leave space for X */
  bottom:0;
  height:1px;
  background:linear-gradient(90deg, rgba(35,220,255,0.25), rgba(180,80,255,0.18));
  opacity:0.9;
}

.nsrm-trackmodal__panel,
.nsrm-modal__panel{
  box-shadow:
    0 0 0 1px rgba(51,167,255,0.18),
    0 0 22px rgba(35,220,255,0.12),
    0 0 32px rgba(180,80,255,0.10),
    0 18px 50px rgba(0,0,0,0.65);
}

.nsrm-trackmodal__close,
.nsrm-modal__close{
  box-shadow:0 0 0 1px rgba(35,220,255,0.20), 0 0 18px rgba(180,80,255,0.10);
}


/* === ALIGN: legend and toolbar widths match on mobile === */
@media (max-width: 820px){
  .nsrm-wrap{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .nsrm-toolbar{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .nsrm-toolbar, .nsrm-legend{
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .nsrm-legend{
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}


/* === HARD OVERRIDE: legend aligns exactly with modes container === */
@media (max-width: 820px){
  /* if any old fullscreen/fixed rules leak in, kill them */
  .nsrm-wrap .nsrm-legend,
  .nsrm-wrap.is-fullscreen .nsrm-legend,
  .nsrm-wrap.is-fullscreen .nsrm-toolbar .nsrm-legend{
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
  /* ensure legend sits in same "content gutter" as modes */
  .nsrm-toolbar{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .nsrm-toolbar .nsrm-modes{ margin:0 !important; }
  .nsrm-toolbar .nsrm-legend{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}


/* === MOBILE LEGEND PADDING / SAFE GAP === */
@media (max-width: 820px){
  .nsrm-toolbar .nsrm-legend{
    margin-top: 10px !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
  }
  .nsrm-toolbar .nsrm-legendrow{
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
}


/* === MOBILE LEGEND: FORCE ONE-LINE + HIDE TITLE (HARD) === */
@media (max-width: 900px){
  .nsrm-wrap .nsrm-legendtitle,
  .nsrm-toolbar .nsrm-legendtitle{
    display:none !important;
  }

  .nsrm-wrap .nsrm-legend,
  .nsrm-toolbar .nsrm-legend{
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:12px !important;
  }

  .nsrm-wrap .nsrm-legendset,
  .nsrm-toolbar .nsrm-legendset{
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:12px !important;
    margin:0 !important;
    padding:0 !important;
  }

  .nsrm-wrap .nsrm-legendrow,
  .nsrm-toolbar .nsrm-legendrow{
    display:inline-flex !important;
    align-items:center !important;
    gap:8px !important;
    white-space:nowrap !important;
    margin:0 !important;
    padding:0 !important;
    font-size:13px !important;
    line-height:1.15 !important;
  }
}


/* === MOBILE: add breathing room between menu and legend === */
@media (max-width: 900px){
  .nsrm-toolbar .nsrm-legend,
  .nsrm-wrap .nsrm-legend{
    margin-top: 12px !important;
  }
}


/* === MOBILE SPACING: menu vs legend === */
@media (max-width: 900px){
  .nsrm-toolbar .nsrm-modes{ margin-bottom: 12px !important; }
  .nsrm-toolbar .nsrm-legend{ margin-top: 0 !important; }
}

/* === LEGEND PER MODE === */
[data-nsrm-mode="length"] .nsrm-legendset[data-legend="surface"]{ display:none !important; }
[data-nsrm-mode="surface"] .nsrm-legendset[data-legend="surface"]{ display:flex !important; }

/* === Points on map (neon icons + popup) === */
.nsrm-pointicon{ position:relative; }
.nsrm-pointicon__glow{
  position:absolute; inset:50% auto auto 50%;
  width:22px; height:22px; transform:translate(-50%,-50%);
  border-radius:50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,255,255,.55), rgba(140,0,255,.25), rgba(0,0,0,0));
  filter: blur(2px);
}
.nsrm-pointicon__img{
  width:28px; height:28px; object-fit:contain;
  transform: translate(-2px, -6px);
  filter: drop-shadow(0 0 8px rgba(0,255,255,.35)) drop-shadow(0 0 10px rgba(140,0,255,.25));
}
.nsrm-pointicon__dot{
  display:block;
  width:12px; height:12px; border-radius:50%;
  background: rgba(0,255,255,.9);
  box-shadow: 0 0 10px rgba(0,255,255,.6), 0 0 18px rgba(140,0,255,.25);
  border: 2px solid rgba(255,255,255,.25);
}

/* Leaflet popup skin (spójny z resztą strony; bez gradientu na tekście) */
.nsrm-leaflet-popup .leaflet-popup-content-wrapper{
  background: rgba(12,14,20,0.92);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(51,167,255,0.14), 0 18px 50px rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
}
.nsrm-leaflet-popup .leaflet-popup-tip{
  background: rgba(12,14,20,0.92);
  border: 1px solid rgba(255,255,255,.10);
}
.nsrm-popup{ padding:14px 14px 12px; color:#fff; min-width: 220px; }
.nsrm-popup__title{
  font-family: inherit;
  font-weight: 700;
  letter-spacing:.2px;
  font-size: 16px;
  color: var(--nsrm-cyan, #3CFFDC);
  margin: 0 42px 6px 0;
  text-shadow: none;
}
.nsrm-popup__desc{ font-size: 14px; line-height: 1.4; opacity:.92; max-width: 260px; }

/* Points panel (category list + nested points) */
.nsrm-points-cat{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items:center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  margin-bottom: 10px;
}
.nsrm-points-cat__label{ display:inline-flex; align-items:center; gap:10px; }
.nsrm-points-cat__icon{ width:22px; height:22px; object-fit:contain; filter: drop-shadow(0 0 10px rgba(0,255,255,.25)); }
.nsrm-points-cat__expand{ padding: 8px 10px !important; font-size: 12px !important; }
.nsrm-points-sub{
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  display:grid;
  gap: 8px;
}
.nsrm-points-sub__chk span{ opacity:.95; font-size: 13px; }

/* Points panel controls (mode toggle + search) */
.nsrm-points-controls{ display:flex; flex-direction:column; gap:10px; margin-bottom: 10px; }
.nsrm-points-mode{ display:flex; align-items:center; gap:10px; padding: 8px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
.nsrm-points-mode__txt{ font-size: 13px; opacity:.95; }

.nsrm-points-search{ width:100%; }
.nsrm-points-search__inp{
  width:100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,255,.18);
  background: rgba(8,10,16,.55);
  color:#fff;
  outline:none;
}
.nsrm-points-search__inp::placeholder{ color: rgba(255,255,255,.6); }

.nsrm-points-results{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 8px;
  display:grid;
  gap: 6px;
}
.nsrm-points-results__item{ display:flex; align-items:center; gap:10px; padding: 7px 8px; border-radius: 12px; cursor:pointer; }
.nsrm-points-results__item:hover{ background: rgba(255,255,255,.06); }
.nsrm-points-results__empty{ padding: 6px 8px; font-size: 12px; opacity:.75; }

/* Mode: categories only
   UWAGA: nie ukrywamy przycisku rozwijania – na mobile/desktop ma być możliwość
   podejrzenia (peek) i przewijania elementów w podkategoriach.
*/
.nsrm-points--catsOnly .nsrm-points-cat__expand{ display:inline-flex !important; }
/*
  "catsOnly" ukrywał podlisty, ale po rozwinięciu kategorii chcemy widzieć 2–3 pozycje
  zarówno na telefonie jak i na komputerze (reszta pozostaje przewijana).
*/
.nsrm-points--catsOnly .nsrm-points-sub{ display:none !important; }

/* Po rozwinięciu kategorii jednak pokazujemy podlistę (scroll zostaje). */
.nsrm-points--catsOnly .nsrm-points-cat__expand[aria-expanded="true"] + .nsrm-points-sub{
  display:block !important;
}
.nsrm-points--catsOnly .nsrm-points-cat__expand[aria-expanded="true"] + .nsrm-points-sub{
  display:block !important;
}

/* Make the points panel scroll nicely on mobile */
@media (max-width: 820px){
  #nsrm-mapa-points-panel{
    max-height: min(60vh, 420px);
    overflow:auto;
  }
}


/* === NSRM Points panel – nicer UI + icons === */
.nsrm-points-panel{
  padding: 12px;
  border-radius: 16px;
  /* mniej prześwitywania – panel ma być czytelny na mapie */
  background: rgba(10,12,16,.92);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nsrm-points-hint{
  opacity:.85;
  font-size: 12px;
  margin-bottom: 10px;
}

.nsrm-points-cat{
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  margin-bottom: 10px;
}

.nsrm-points-cat__chk{
  display:flex;
  align-items:center;
  gap:10px;
}

.nsrm-points-cat__label{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 650;
}

.nsrm-points-cat__icon{
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0,255,255,.35));
}

.nsrm-points-ico--dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display:inline-block;
  background: rgba(0,255,255,.85);
  box-shadow: 0 0 10px rgba(0,255,255,.35);
}

.nsrm-points-cat__expand{
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}

.nsrm-points-sub{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.nsrm-points-sub__chk,
.nsrm-points-results__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border-radius: 12px;
}

.nsrm-points-sub__chk:hover,
.nsrm-points-results__item:hover{
  background: rgba(255,255,255,.06);
}

/* Results: center aligned */
.nsrm-points-results__label{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

/* Sub-list: allow multi-line names */
.nsrm-points-sub__label{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.nsrm-points-sub__name{
  line-height: 1.25;
  display:block;
}

.nsrm-points-sub__icon,
.nsrm-points-results__icon{
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0,255,255,.30));
  display: block;
  align-self: center;
}

/* Search results: keep single-line */
.nsrm-points-results__name{
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity:.95;
}

/* Sub-list: wrap long names */
.nsrm-points-sub__name{
  opacity:.95;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.nsrm-points-sub__chk input[type="checkbox"],
.nsrm-points-cat__chk input[type="checkbox"],
.nsrm-points-results__item input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: #00e5ff;
}

/* === Sublista "Miejsca ▾" – po kliknięciu ma być od razu widać 2–3 pozycje,
   a reszta przewijana (telefon + desktop). === */
.nsrm-points-sub{
  max-height: 0;
  overflow: hidden;
  transition: max-height .22s ease;
}

/* gdy kliknięto "Miejsca ▾" (aria-expanded=true), odsłaniamy sublistę
   i dajemy jej sensowną wysokość (zostawiamy przewijanie). */
.nsrm-points-cat__expand[aria-expanded="true"] + .nsrm-points-sub{
  max-height: 260px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 6px;
}

@media (max-width: 820px){
  .nsrm-points-cat__expand[aria-expanded="true"] + .nsrm-points-sub{
    max-height: 260px; /* ok. 2–3 pozycje na start */
  }
}


/* === NSRM: neonowe pineski punktów (Leaflet divIcon) === */
.leaflet-div-icon.nsrm-pinicon{ background:transparent; border:0; }

/* Hard size guard: prevent any theme/plugin styles from blowing up marker HTML */
.leaflet-div-icon.nsrm-pinicon,
.leaflet-div-icon.nsrm-pinicon *{ box-sizing:border-box; }
.leaflet-div-icon.nsrm-pinicon{ width:34px !important; height:44px !important; }

.nsrm-pin{
  position:relative;
  width:36px; height:46px;
  display:block;
  pointer-events:auto;
}

.nsrm-pin__glow{
  position:absolute; left:50%; top:22px;
  width:44px; height:44px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,255,255,.55), rgba(140,0,255,.28), rgba(0,0,0,0));
  filter: blur(6px);
  opacity:.95;
}

.nsrm-pin__head{
  position:absolute; left:50%; top:0;
  width:32px; height:32px;
  transform:translateX(-50%);
  border-radius:18px;
  background: rgba(8,14,18,.92);
  border:2px solid rgba(0,255,255,.55);
  box-shadow: 0 0 10px rgba(0,255,255,.40), 0 0 18px rgba(140,0,255,.22);
  display:flex; align-items:center; justify-content:center;
}

.nsrm-pin__tail{
  position:absolute; left:50%; top:20px;
  width:18px; height:18px;
  transform:translateX(-50%) rotate(45deg);
  background: rgba(8,14,18,.92);
  border-right:2px solid rgba(0,255,255,.55);
  border-bottom:2px solid rgba(0,255,255,.55);
  border-radius:3px;
  box-shadow: 0 0 10px rgba(0,255,255,.30), 0 0 16px rgba(140,0,255,.18);
}

.nsrm-pin__inner{ display:flex; align-items:center; justify-content:center; }

.nsrm-pin__img{
  width:18px; height:18px;
  object-fit:contain;
  image-rendering:auto;
  filter: drop-shadow(0 0 6px rgba(0,255,255,.35)) drop-shadow(0 0 10px rgba(140,0,255,.20));
}

.nsrm-pin__dot{
  width:10px; height:10px; border-radius:50%;
  background: rgba(0,255,255,.92);
  border:2px solid rgba(255,255,255,.22);
  box-shadow: 0 0 10px rgba(0,255,255,.55), 0 0 16px rgba(140,0,255,.22);
}



/* === Neon pins v1.7.9 polish === */
.nsrm-pin{ width:34px; height:44px; }
.nsrm-pin{ --pin-c: hsl(185 95% 60%); }

.nsrm-pin__glow{
  background: radial-gradient(circle at 35% 30%, rgba(0,0,0,0), rgba(0,0,0,0));
  box-shadow:
    0 0 10px color-mix(in srgb, var(--pin-c) 70%, transparent),
    0 0 22px color-mix(in srgb, var(--pin-c) 40%, transparent);
  opacity:1;
}

@supports not (color-mix(in srgb, #000 50%, #fff)){
  .nsrm-pin__glow{
    box-shadow: 0 0 12px var(--pin-c), 0 0 26px var(--pin-c);
  }
}

.nsrm-pin__head{
  background: rgba(10,16,20,.92);
  border: 2px solid color-mix(in srgb, var(--pin-c) 70%, rgba(255,255,255,.10));
  box-shadow: 0 0 10px color-mix(in srgb, var(--pin-c) 55%, transparent);
}

@supports not (color-mix(in srgb, #000 50%, #fff)){
  .nsrm-pin__head{ border-color: var(--pin-c); box-shadow: 0 0 10px var(--pin-c); }
}

.nsrm-pin__tail{
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--pin-c) 65%, rgba(255,255,255,.10)),
    rgba(0,0,0,0));
}
@supports not (color-mix(in srgb, #000 50%, #fff)){
  .nsrm-pin__tail{ background: linear-gradient(180deg, var(--pin-c), rgba(0,0,0,0)); }
}

.nsrm-pin__inner{
  width:22px; height:22px;
  border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.18);
  overflow:hidden;
}

.nsrm-pin__img{
  width:18px; height:18px;
  object-fit: contain;
  object-position: center;
  border-radius: 999px;
  display:block;
  max-width:18px;
  max-height:18px;
}

/* Ensure any PNG (even huge / odd aspect ratio) always fits inside the inner circle.
   Some themes override img rules; we hard-guard here. */
.nsrm-pin__inner img,
.leaflet-div-icon.nsrm-pinicon .nsrm-pin__inner img{
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
}

/* Force icon sizing even if a theme resets img styles */
.leaflet-div-icon.nsrm-pinicon img,
.nsrm-points-cat__icon,
.nsrm-points-sub__icon,
.nsrm-points-results__icon{
  width:18px !important;
  height:18px !important;
  max-width:18px !important;
  max-height:18px !important;
}

.nsrm-pin__dot{
  width:8px; height:8px;
  border-radius:999px;
  background: var(--pin-c);
  box-shadow: 0 0 10px var(--pin-c);
}

.nsrm-pin__inner.is-img .nsrm-pin__dot{ display:none; }


/* === NSRM PIN OVERRIDES v1.7.9.4 === */

/* Leaflet divIcon container for pins */
.leaflet-marker-icon .nsrm-pin{
  width:34px !important;
  height:44px !important;
  position:relative !important;
  display:block !important;
}

/* ensure correct stacking: glow behind, tail mid, head top */
.nsrm-pin__glow{ position:absolute !important; inset:-7px -7px -10px -7px !important; z-index:0 !important; border-radius:999px !important;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--pin-c, #3cf) 28%, transparent) 0%, transparent 68%) !important;
  filter: blur(1.2px) !important;
  pointer-events:none !important;
}
.nsrm-pin__tail{ position:absolute !important; left:50% !important; bottom:2px !important; transform:translateX(-50%) rotate(45deg) !important;
  width:16px !important; height:16px !important; background: color-mix(in srgb, var(--pin-c, #3cf) 25%, rgba(0,0,0,.85)) !important;
  border:2px solid color-mix(in srgb, var(--pin-c, #3cf) 70%, rgba(255,255,255,.35)) !important;
  border-radius:4px !important;
  z-index:1 !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--pin-c, #3cf) 55%, transparent) !important;
  pointer-events:none !important;
}
.nsrm-pin__head{ position:absolute !important; left:50% !important; top:0px !important; transform:translateX(-50%) !important;
  width:30px !important; height:30px !important;
  border-radius:999px !important;
  background: rgba(0,0,0,.82) !important; /* no gradient on icon */
  border:2px solid color-mix(in srgb, var(--pin-c, #3cf) 85%, rgba(255,255,255,.25)) !important;
  box-shadow: 0 0 12px color-mix(in srgb, var(--pin-c, #3cf) 55%, transparent) !important;
  z-index:2 !important;
  display:grid !important; place-items:center !important;
  pointer-events:none !important;
}

/* inner holder: contains icon/dot, NO gradient */
.nsrm-pin__inner{
  width:18px !important;
  height:18px !important;
  display:grid !important;
  place-items:center !important;
  background: transparent !important;
  border-radius:999px !important;
  overflow:hidden !important;
}

/* icon always fully visible, no crop */
.nsrm-pin__img{
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display:block !important;
  background: transparent !important;
  filter:none !important;
}

/* fallback dot when no icon */
.nsrm-pin__dot{
  width:8px !important;
  height:8px !important;
  border-radius:999px !important;
  background: var(--pin-c, #3cf) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--pin-c, #3cf) 70%, transparent) !important;
}

/* === NSRM PIN FINAL (Opcja B: nowoczesny, płaski neon) ===
   Cel: zero "echo", zero gradientu na ikonie; glow tylko POD spodem.
   Te reguły są na końcu pliku i mają !important, żeby wygrać z motywem i wcześniejszymi stylami.
*/
.leaflet-div-icon.nsrm-pinicon{ overflow:visible !important; }

.nsrm-pin{ width:34px !important; height:44px !important; position:relative !important; }

/* Jeden glow, delikatny, bez podwójnych cieni */
.nsrm-pin__glow{
  position:absolute !important;
  inset:-14px -14px -18px -14px !important;
  z-index:0 !important;
  border-radius:999px !important;
  background: transparent !important;
  box-shadow:
    0 0 18px color-mix(in srgb, var(--pin-c, #3cf) 45%, transparent),
    0 0 40px color-mix(in srgb, var(--pin-c, #3cf) 22%, transparent) !important;
  filter: blur(6px) !important;
  opacity: .75 !important;
  pointer-events:none !important;
}
@supports not (color-mix(in srgb, #000 50%, #fff)){
  .nsrm-pin__glow{ box-shadow: 0 0 18px var(--pin-c, #3cf), 0 0 40px rgba(0,229,255,.25) !important; }
}

/* Płaska głowa pina: jednolite tło, bez gradientów */
.nsrm-pin__head{
  z-index:2 !important;
  width:30px !important;
  height:30px !important;
  border-radius:999px !important;
  background: rgba(6,10,14,.92) !important;
  border: 2px solid color-mix(in srgb, var(--pin-c, #3cf) 90%, rgba(255,255,255,.12)) !important;
  box-shadow: 0 0 14px color-mix(in srgb, var(--pin-c, #3cf) 55%, transparent) !important;
  display:grid !important;
  place-items:center !important;
  pointer-events:none !important;
}

/* Ogon pina: płaski, bez gradientu */
.nsrm-pin__tail{
  z-index:1 !important;
  width:16px !important;
  height:16px !important;
  left:50% !important;
  bottom:2px !important;
  transform:translateX(-50%) rotate(45deg) !important;
  background: rgba(6,10,14,.92) !important;
  border: 2px solid color-mix(in srgb, var(--pin-c, #3cf) 85%, rgba(255,255,255,.10)) !important;
  border-radius:4px !important;
  box-shadow: 0 0 12px color-mix(in srgb, var(--pin-c, #3cf) 40%, transparent) !important;
  pointer-events:none !important;
}

/* Ikona: czysta, bez filtrów/gradientów, zawsze mieści się w całości */
.nsrm-pin__inner{
  width:18px !important;
  height:18px !important;
  background: transparent !important;
  border-radius:999px !important;
  overflow:hidden !important;
}
.nsrm-pin__img{ filter:none !important; background: transparent !important; }



/* === NSRM: Flat neon pin (B) – strict override (no echo, icon clean) === */
.leaflet-marker-icon.nsrm-pinicon,
.leaflet-div-icon.nsrm-pinicon{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

.leaflet-marker-icon.nsrm-pinicon{ outline: none !important; }

.leaflet-div-icon.nsrm-pinicon{
  width: 34px !important;
  height: 44px !important;
  overflow: visible !important;
}

/* Marker root */
.nsrm-pin{
  position: relative !important;
  width: 34px !important;
  height: 44px !important;
  display: block !important;
}

/* ONE glow – under the pin only (no halo around head) */
.nsrm-pin__glow{
  position: absolute !important;
  left: 50% !important;
  top: 26px !important;
  width: 46px !important;
  height: 22px !important;
  transform: translateX(-50%) !important;
  border-radius: 999px !important;
  background: var(--pin-c, #00e5ff) !important;
  opacity: .28 !important;
  filter: blur(12px) !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* Pin head – flat (no extra shadow = no echo) */
.nsrm-pin__head{
  position: absolute !important;
  left: 50% !important;
  top: 0 !important;
  width: 32px !important;
  height: 32px !important;
  transform: translateX(-50%) !important;
  border-radius: 18px !important;
  background: rgba(8,14,18,.92) !important;
  border: 2px solid var(--pin-c, #00e5ff) !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
}

/* Pin tail – flat, no glow */
.nsrm-pin__tail{
  position: absolute !important;
  left: 50% !important;
  top: 20px !important;
  width: 18px !important;
  height: 18px !important;
  transform: translateX(-50%) rotate(45deg) !important;
  background: rgba(8,14,18,.92) !important;
  border-right: 2px solid var(--pin-c, #00e5ff) !important;
  border-bottom: 2px solid var(--pin-c, #00e5ff) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  z-index: 1 !important;
}

/* Inner icon "coin" */
.nsrm-pin__inner{
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,.22) !important;
}

/* Image: always fully visible, centered, no filters/gradients */
.nsrm-pin__img{
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
  background: transparent !important;
  filter: none !important;
  box-shadow: none !important;
}

/* Fallback dot */
.nsrm-pin__dot{
  width: 8px !important;
  height: 8px !important;
  border-radius: 999px !important;
  background: var(--pin-c, #00e5ff) !important;
  box-shadow: none !important;
}


/* === NSRM UI polish: równe odstępy i responsywne układy (v1.8.8) === */
.nsrm-toolbar{gap:14px !important;}
.nsrm-filtergroup{gap:10px !important; flex-wrap:wrap !important;}
.nsrm-filtergroup .nsrm-label{margin-right:6px !important;}

/* Główne przyciski (Mapa/Trasy/Moja lokalizacja/Opcje) */
.nsrm-modes{gap:10px !important; flex-wrap:wrap !important;}
.nsrm-modes .nsrm-btn{min-height:38px !important;}

/* Sekcja legendy i filtrów – równe pill-e */
.nsrm-legend, .nsrm-filtergroup .nsrm-btn{min-height:36px !important;}

/* Wyrównanie na tablet/desktop */
@media (min-width: 700px){
  .nsrm-toolbar{padding:16px 18px !important;}
  .nsrm-filtergroup{align-items:center !important;}
}

/* Telefon – dwa rzędy, równe odstępy */
@media (max-width: 520px){
  .nsrm-toolbar{padding:14px 14px !important;}
  .nsrm-modes{display:grid !important; grid-template-columns:1fr 1fr !important; gap:10px !important;}
  .nsrm-modes .nsrm-btn{width:100% !important; justify-content:center !important;}
  .nsrm-filtergroup{gap:10px !important;}
}

/* Search results – zawsze nad listą i czytelne */
.nsrm-points-results{max-height:240px !important; overflow:auto !important;}


/* === NSRM UI polish: równe odstępy toolbara na wszystkich szerokościach === */
.nsrm-toolbar{
  gap: 12px;
}

.nsrm-filtergroup{
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nsrm-filtergroup .nsrm-label{
  margin-right: 6px;
}

.nsrm-filtergroup .nsrm-btn{
  margin: 0 !important;
}

/* Telefon: 2 rzędy, równe odstępy */
@media (max-width: 520px){
  .nsrm-toolbar{gap: 10px;}
  .nsrm-modes{gap: 8px;}
  .nsrm-modes .nsrm-btn{flex: 1 1 calc(50% - 8px);} 
  .nsrm-filtergroup{gap: 8px;}
  .nsrm-filtergroup .nsrm-btn{flex: 0 0 auto;}
  .nsrm-points-multi{width: 100%;}
  .nsrm-points-toggle{width: 100%; justify-content: center;}
}

/* Tablet/Laptop: zachowaj jeden pasek, ale z równym gap */
@media (min-width: 521px) and (max-width: 1024px){
  .nsrm-toolbar{gap: 12px;}
  .nsrm-filtergroup{gap: 10px;}
  .nsrm-points-panel{max-width: min(420px, 95vw);} 
}

/* ===== NSRM FIX: points panel above map (Opcje / Miejsca na mapie) ===== */
/* gap działa tylko na flex/grid – ustawiamy toolbar jako flex-kolumnę,
   aby odstępy między "rzędami" były równe na desktopie i tablecie. */
.nsrm-toolbar{
  position: relative;
  z-index: 5000;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Dropdown "Opcje" musi być zawsze NAD legendą (desktop/tablet) */
.nsrm-optpanel{
  position: absolute;
  right: 12px;
  top: 50px;
  z-index: 9000;
}

/* Legenda ma niższy priorytet niż dropdowny */
.nsrm-legend--placed{ position: relative; z-index: 1000; }
.nsrm-points-multi{ position: relative; z-index: 5002; }
.nsrm-points-panel{ position: absolute; z-index: 9000; }
.leaflet-container, .leaflet-pane{ z-index: 1; }

/* === Mobile layout tweaks (<=820px) === */
@media (max-width: 820px){
  /* Wybierz trasę (select) + Opis trasy (btn) w jednej linii */
  .nsrm-filtergroup.nsrm-length{ flex-wrap: wrap; }
  .nsrm-filtergroup.nsrm-length .nsrm-selectwrap{
    display:flex;
    align-items:center;
    gap:10px;
    flex:1 1 auto;
    min-width:0;
  }
  /* etykieta jest już czytelna z kontekstu sekcji */
  .nsrm-filtergroup.nsrm-length .nsrm-selectwrap .nsrm-label{ display:none; }
  .nsrm-filtergroup.nsrm-length .nsrm-selectwrap .nsrm-select{
    width:100%;
    min-width:0;
  }
  .nsrm-filtergroup.nsrm-length .nsrm-track-desc{ white-space:nowrap; }
}

/* === Desktop layout (>=821px): równe odstępy, bez nachodzenia === */
@media (min-width: 821px){
  /* górny pasek (Mapa/Trasy + prawa strona) */
  .nsrm-modes{
    display:flex !important;
    align-items:center !important;
    width:100% !important;
    gap:12px !important;
    flex-wrap:nowrap !important;
  }
  .nsrm-modes .nsrm-btn{ flex:0 0 auto !important; white-space:nowrap !important; }
  .nsrm-modes .nsrm-btn.nsrm-locate{ margin-left:auto !important; }

  /* drugi rząd (Legenda / filtry) – pilnujemy oddechu */
  .nsrm-toolbar{ gap:14px !important; }
  .nsrm-legend--placed{ margin-top:0 !important; }
}

/* === Hide Leaflet attribution (NOT RECOMMENDED) === */
.nsrm-wrap .leaflet-control-attribution{ display:none !important; }

/* ===== NSRM: desktop toolbar spacing (override, v1.8.10.17) ===== */
/* W poprzednich podejściach "gap" nie działał, bo toolbar nie był flex. */
.nsrm-wrap .nsrm-toolbar{
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
}
/* usuń przypadkowe marginesy między sekcjami w toolbarze */
.nsrm-wrap .nsrm-toolbar > *{ margin-top:0 !important; margin-bottom:0 !important; }

@media (min-width: 821px){
  .nsrm-wrap .nsrm-toolbar{ gap:14px !important; }

  /* 1. rząd: przyciski trybów + akcje po prawej, bez nachodzenia */
  .nsrm-wrap .nsrm-modes{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    flex-wrap:nowrap !important;
    gap:14px !important;
  }
  /* gdyby coś było wstawione na końcu listy – niech nie wciska się na lewo */
  .nsrm-wrap .nsrm-modes > *{ flex:0 0 auto !important; }

  /* 2. rząd: legenda jako pełna szerokość */
  .nsrm-wrap .nsrm-legend--placed{
    width:100% !important;
    margin:0 !important;
  }

  /* 3. rząd: filtry (Mapa/Trasy) – równe odstępy i zawijanie */
  .nsrm-wrap .nsrm-filtergroup{
    display:flex !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    gap:10px !important;
    row-gap:10px !important;
  }
}

/* ===== NSRM: ukryj stopkę kafelków (attribution) ===== */
.nsrm-wrap .leaflet-control-attribution{ display:none !important; }



/* === Mobile: fullscreen "Miejsca na mapie" – stabilne przewijanie i brak przewijania tła === */
@media (max-width: 820px){
  body.nsrm-pointsfs-open{
    overflow: hidden !important;
    height: 100% !important;
    touch-action: none;
  }
  body.nsrm-pointsfs-open #nsrm-mapa-points-panel{
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 18px;
  }
  body.nsrm-pointsfs-open .nsrm-points-list{
    overflow: visible; /* wewnętrzne sublisty kontrolują własne przewijanie */
  }
  body.nsrm-pointsfs-open .nsrm-points-cats{
    display: grid;
    gap: 10px;
  }
}
/* Wycentruj ikonę z nazwą w wierszu podpunktu */
.nsrm-points-sub__label{
  display:flex;
  align-items:center;
  gap:10px;
}
.nsrm-points-sub__icon{
  flex:0 0 auto;
  align-self:center;
}


/* === V2: Gminy ościenne === */
.nsrm-gminy-multi{ position: relative; display:inline-block; }
.nsrm-gminy-panel{ position:absolute; right:0; top: calc(100% + 8px); min-width: 260px; max-width: 320px; background: rgba(10,10,14,.92); border: 1px solid rgba(255,255,255,.10); border-radius: 18px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); z-index: 80; }
.nsrm-gminy-hint{ font-size: 12px; opacity:.85; margin: 0 0 10px; }
.nsrm-gminy-list label.nsrm-check{ display:flex; align-items:center; gap:10px; padding: 6px 4px; }
.nsrm-optsection--gminy{ margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.nsrm-opttitle{ font-weight: 600; margin-bottom: 6px; }
.nsrm-optbase{ font-size: 12px; opacity:.85; margin-bottom: 8px; }

/* Mobile: pokaż maks 3 powiaty, reszta w scrollu */
@media (max-width: 820px){
  .nsrm-optsection--gminy .nsrm-gminy-list{
    /* Celowo mniejszy limit: na części urządzeń 144px mieściło 4 wiersze. */
    max-height: 118px; /* ~3 wiersze checkboxów */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    display: block;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}
.nsrm-optsection--gminy .nsrm-gminy-list::-webkit-scrollbar{ width: 8px; }
.nsrm-optsection--gminy .nsrm-gminy-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 12px;
}
.nsrm-optsection--gminy .nsrm-gminy-list::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 12px;
}

@media (max-width: 820px){
  .nsrm-gminy-multi{ display:none; }
  .nsrm-optsection--gminy{ display:block; }
}
@media (min-width: 821px){
  .nsrm-optsection--gminy{ display:none; }
}
