/* =====================================================================
   Kresy.info v10.32 — UKŁAD „MAPA JAKO APLIKACJA"
   Strona bez przewijania: mapa na pełny ekran, wszystko inne pływa nad nią.
   Przewijają się wyłącznie okna/panele. Kolory = paleta portalu.
   ===================================================================== */
html.kp-app{ --kp-top:84px; --kp-gap:12px; --kp-dock-h:0px; --kp-win-w:min(500px, calc(100vw - 24px)); --kp-list-w:min(400px, calc(100vw - 24px)); }
html.kp-app, html.kp-app body{ height:100% !important; overflow:hidden !important; overscroll-behavior:none; margin:0 !important; }
html.kp-app body{ position:fixed; inset:0; width:100%; }
html.kp-app .kp-root{ height:100% !important; min-height:0 !important; padding:0 !important; overflow:hidden !important; }

/* ---------- wspólne: szkło + karta ---------- */
html.kp-app .kp-root .kp-mapbar,
html.kp-app .kp-root .kp-mapctl,
html.kp-app .kp-root .kp-appdock,
html.kp-app .kp-root .kp-mapx-count{
  background:color-mix(in srgb, var(--kp-paper-3,#fff) 90%, transparent);
  -webkit-backdrop-filter:saturate(160%) blur(14px); backdrop-filter:saturate(160%) blur(14px);
  border:1px solid var(--kp-line,#ece2ce); box-shadow:0 10px 30px -12px rgba(43,35,32,.35);
}

/* ---------- PŁYWAJĄCY GÓRNY PASEK ---------- */
html.kp-app .kp-root .kp-topbar{
  position:fixed !important; top:var(--kp-gap) !important; left:var(--kp-gap) !important; right:var(--kp-gap) !important;
  z-index:1300 !important; border-radius:18px !important; border:1px solid var(--kp-line,#ece2ce) !important;
  box-shadow:0 14px 40px -18px rgba(43,35,32,.45) !important; padding:8px 14px !important; margin:0 !important;
}
html.kp-app .kp-root .kp-skip{ z-index:1400; }
@media (max-width:1439px) and (min-width:641px){
  html.kp-app .kp-root .kp-nav button span[data-i18n]{ display:none !important; }
  html.kp-app .kp-root .kp-nav button{ padding-left:10px !important; padding-right:10px !important; }
  html.kp-app .kp-root .kp-tools .kp-t-btn > span[data-i18n]{ display:none !important; }
}
@media (max-width:1180px) and (min-width:641px){
  html.kp-app .kp-root .kp-font-ctrl{ display:none !important; }
}

/* ---------- DASHBOARD = płótno (bez przepływu dokumentu) ---------- */
html.kp-app .kp-root .kp-dashboard,
html.kp-app .kp-root .kp-dashboard[hidden]{ display:block !important; padding:0 !important; margin:0 !important; max-width:none !important; width:auto !important; background:transparent !important; }
html.kp-app .kp-root .kp-row-magsidebar{ display:contents !important; }

/* ---------- MAPA NA PEŁNY EKRAN ---------- */
html.kp-app .kp-root .kp-mapx{ position:fixed !important; inset:0 !important; z-index:1 !important; display:block !important; padding:0 !important; margin:0 !important; }
html.kp-app .kp-root .kp-mapx-stage{ position:absolute; inset:0; display:block; }
html.kp-app .kp-root .kp-mapx-canvas{ position:absolute !important; inset:0 !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; overflow:hidden; }
html.kp-app .kp-root .kp-mapx #kp-map{ position:absolute !important; inset:0 !important; z-index:0 !important; height:100% !important; width:100% !important; min-height:0 !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; background:#efe8d8; }
html.kp-app .kp-root .kp-mapx-status{ top:calc(var(--kp-top) + 70px) !important; z-index:820; }
html.kp-app .kp-root .leaflet-control-attribution{ font-size:10px; background:color-mix(in srgb, var(--kp-paper-3,#fff) 75%, transparent); border-radius:8px 0 0 0; }
html.kp-app .kp-root .kp-map-hint{ bottom:calc(var(--kp-dock-h) + 84px); transition:opacity .5s; }
html.kp-app .kp-root .kp-map-hint.kp-hint-out{ opacity:0; }

/* ---------- PASEK WYSZUKIWANIA + FILTRY ---------- */
html.kp-app .kp-root .kp-mapbar{
  position:absolute; z-index:930; top:calc(var(--kp-top) + 10px); left:var(--kp-gap); width:var(--kp-list-w); box-sizing:border-box;
  display:flex; align-items:center; gap:6px; padding:6px; border-radius:16px;
  animation:kpapp-drop .45s cubic-bezier(.2,.8,.2,1) both .1s;
}
html.kp-app .kp-root .kp-mapbar-search{ flex:1 1 auto; min-width:0; position:relative; display:flex; align-items:center; }
html.kp-app .kp-root .kp-mapbar-search > .kp-ico{ position:absolute; left:12px; width:18px; height:18px; color:var(--kp-burgundy); pointer-events:none; }
html.kp-app .kp-root .kp-mapbar-search input{
  width:100%; box-sizing:border-box; height:44px; border:1px solid transparent; border-radius:12px; padding:0 34px 0 40px;
  background:var(--kp-paper-2,#f5efe3); color:var(--kp-ink); font:500 15px/1 var(--kp-sans,'Inter',sans-serif);
  transition:border-color .2s, background-color .2s, box-shadow .2s;
}
html.kp-app .kp-root .kp-mapbar-search input::-webkit-search-cancel-button{ display:none; }
html.kp-app .kp-root .kp-mapbar-search input:focus{ outline:none; background:var(--kp-surface,#fff); border-color:var(--kp-gold); box-shadow:0 0 0 3px rgba(184,138,60,.22); }
html.kp-app .kp-root .kp-mapbar-clear{ position:absolute; right:6px; width:28px; height:28px; border:0; border-radius:50%; background:transparent; color:var(--kp-ink-soft); font-size:20px; line-height:1; cursor:pointer; transition:background-color .15s, color .15s; }
html.kp-app .kp-root .kp-mapbar-clear:hover{ background:var(--kp-paper-2); color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-mapbar-btn{
  position:relative; flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; height:44px; padding:0 12px; border-radius:12px;
  border:1px solid var(--kp-line); background:var(--kp-surface,#fff); color:var(--kp-ink); font:700 13px/1 var(--kp-sans,'Inter',sans-serif);
  cursor:pointer; transition:background-color .2s, color .2s, border-color .2s, transform .15s;
}
html.kp-app .kp-root .kp-mapbar-btn .kp-ico{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
html.kp-app .kp-root .kp-mapbar-btn:hover{ border-color:var(--kp-burgundy); color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-mapbar-btn:active{ transform:scale(.97); }
html.kp-app .kp-root .kp-mapbar-btn[aria-expanded="true"]{ background:var(--kp-burgundy); border-color:var(--kp-burgundy); color:#fff; }
html.kp-app .kp-root .kp-mapbar-badge{ position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 5px; box-sizing:border-box; border-radius:999px; background:var(--kp-gold); color:#2b2320; font:800 11px/18px var(--kp-sans); text-align:center; box-shadow:0 0 0 2px var(--kp-paper-3,#fff); }

/* Filtry: rozwijany panel pod paskiem (własny scroll) */
html.kp-app .kp-root .kp-mapx-panel{
  position:absolute !important; z-index:960 !important; top:calc(var(--kp-top) + 72px) !important; left:var(--kp-gap) !important; right:auto !important; bottom:auto !important;
  width:var(--kp-list-w) !important; max-height:calc(100dvh - var(--kp-top) - 90px - var(--kp-dock-h)) !important; box-sizing:border-box;
  margin:0 !important; padding:0 18px 16px !important; overflow:auto !important; overscroll-behavior:contain; border-radius:16px !important;
  background:var(--kp-surface,#fff) !important; box-shadow:0 22px 60px -20px rgba(43,35,32,.5) !important;
  opacity:0; visibility:hidden; transform:translateY(-8px) !important; transition:opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s linear .25s !important;
}
html.kp-app .kp-root .kp-mapx.kp-panel-open .kp-mapx-panel{ opacity:1; visibility:visible; transform:none !important; transition:opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s !important; }
html.kp-app .kp-root .kp-mapx-panel-head{ display:flex !important; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:2; background:var(--kp-surface,#fff); padding:14px 0 10px; border-bottom:1px solid var(--kp-line); font:700 15px var(--kp-sans); color:var(--kp-ink); }
html.kp-app .kp-root .kp-mapx-panel-head::before{ display:none !important; }
html.kp-app .kp-root .kp-mapx-close{ border:0; background:var(--kp-paper-2); width:32px; height:32px; border-radius:50%; font-size:20px; line-height:1; cursor:pointer; color:var(--kp-ink); }
html.kp-app .kp-root .kp-mapx-backdrop{ display:none !important; }
html.kp-app .kp-root .kp-mapx-drawer-btn{ display:none !important; }

/* ---------- PANEL LISTY (wysuwany z lewej) ---------- */
html.kp-app .kp-root .kp-list{
  position:absolute; z-index:920; left:var(--kp-gap); top:calc(var(--kp-top) + 72px); bottom:calc(var(--kp-gap) + var(--kp-dock-h));
  width:var(--kp-list-w); box-sizing:border-box; display:flex; flex-direction:column;
  background:var(--kp-surface,#fff); border:1px solid var(--kp-line); border-radius:16px; box-shadow:0 22px 60px -22px rgba(43,35,32,.5);
  transform:translateX(calc(-100% - 30px)); transition:transform .32s cubic-bezier(.2,.8,.2,1); overflow:hidden;
}
html.kp-app .kp-root.kp-list-open .kp-list{ transform:none; }
html.kp-app .kp-root .kp-list-head{ display:flex; align-items:center; gap:8px; padding:12px 12px 10px 16px; border-bottom:1px solid var(--kp-line); flex:0 0 auto; }
html.kp-app .kp-root .kp-list-titles{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
html.kp-app .kp-root .kp-list-kicker{ font:700 10.5px/1.3 var(--kp-sans); letter-spacing:1.1px; text-transform:uppercase; color:var(--kp-ink-soft); }
html.kp-app .kp-root .kp-list-titles strong{ font:700 20px/1.2 var(--kp-script,'Cormorant Garamond',serif); color:var(--kp-burgundy); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html.kp-app .kp-root .kp-list-back{ flex:0 0 auto; border:1px solid var(--kp-line); background:var(--kp-paper-2); color:var(--kp-ink); border-radius:999px; padding:6px 10px; font:600 12px/1 var(--kp-sans); cursor:pointer; transition:border-color .15s, color .15s; }
html.kp-app .kp-root .kp-list-back:hover{ border-color:var(--kp-burgundy); color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-list-close, html.kp-app .kp-root .kp-win-close, html.kp-app .kp-root .kp-place-x, html.kp-app .kp-root .kp-page-x, html.kp-app .kp-root .kp-welcome-close{
  flex:0 0 auto; width:34px; height:34px; border:0; border-radius:50%; background:var(--kp-paper-2,#f5efe3); color:var(--kp-ink);
  font-size:22px; line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:background-color .15s, color .15s, transform .15s;
}
html.kp-app .kp-root .kp-list-close:hover, html.kp-app .kp-root .kp-win-close:hover, html.kp-app .kp-root .kp-place-x:hover, html.kp-app .kp-root .kp-page-x:hover, html.kp-app .kp-root .kp-welcome-close:hover{ background:var(--kp-burgundy); color:#fff; transform:rotate(90deg); }
html.kp-app .kp-root .kp-list-body{ flex:1 1 auto; overflow:auto; overscroll-behavior:contain; padding:8px 10px 14px; scrollbar-width:thin; }
html.kp-app .kp-root .kp-list-rows{ list-style:none; margin:0; padding:0; }
html.kp-app .kp-root .kp-list-row{
  width:100%; display:flex; align-items:center; gap:10px; text-align:left; border:0; background:transparent; padding:9px 8px; border-radius:10px; cursor:pointer;
  font:500 13px/1.3 var(--kp-sans); color:var(--kp-ink); transition:background-color .15s;
}
html.kp-app .kp-root .kp-list-row:hover, html.kp-app .kp-root .kp-list-row:focus-visible{ background:var(--kp-paper-2,#f5efe3); outline:none; }
html.kp-app .kp-root .kp-list-row strong{ font-weight:700; font-size:14px; }
html.kp-app .kp-root .kp-list-row small{ display:block; margin-top:2px; color:var(--kp-ink-soft); font-size:11.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html.kp-app .kp-root .kp-list-main{ flex:1 1 auto; min-width:0; }
html.kp-app .kp-root .kp-list-go{ color:var(--kp-ink-muted); font-size:18px; transition:transform .15s, color .15s; }
html.kp-app .kp-root .kp-list-row:hover .kp-list-go{ transform:translateX(3px); color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-list-dot{ flex:0 0 auto; width:11px; height:11px; border-radius:50%; background:#4a8347; border:2px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.12); }
html.kp-app .kp-root .kp-list-dot.dalsze{ background:#8a2a7a; }
html.kp-app .kp-root .kp-list-dot.approx{ opacity:.55; border-style:dashed; border-color:#b88a3c; }
html.kp-app .kp-root .kp-list-dot.gone{ background:#f2eee7; border-color:#3d3730; }
html.kp-app .kp-root .kp-list-empty{ display:block; padding:14px 8px; color:var(--kp-ink-soft); font:500 13px/1.5 var(--kp-sans); }
html.kp-app .kp-root .kp-list-empty .kp-mapx-spin{ display:inline-block; vertical-align:-3px; margin-right:8px; }
html.kp-app .kp-root .kp-list-sec{ margin:6px 8px 4px; }
html.kp-app .kp-root .kp-region.kp-region--inlist{ position:static; width:auto; max-width:none; max-height:none; overflow:visible; margin:12px 4px 4px; box-shadow:none; animation:none; }
html.kp-app .kp-root .kp-region--inlist h3{ margin:2px 0 0; font:700 21px/1.15 var(--kp-script,'Cormorant Garamond',serif); color:var(--kp-burgundy); }

/* ---------- PRZYCISKI MAPY (prawa krawędź) ---------- */
html.kp-app .kp-root .kp-mapctl{
  position:absolute; z-index:900; right:var(--kp-gap); top:50%; transform:translateY(-50%);
  display:flex; flex-direction:column; gap:2px; padding:5px; border-radius:16px; transition:right .32s cubic-bezier(.2,.8,.2,1);
}
html.kp-app .kp-root.kp-win-open .kp-mapctl{ right:calc(var(--kp-win-w) + var(--kp-gap) * 2); }
html.kp-app .kp-root .kp-mapctl-btn{
  width:40px; height:40px; border:0; border-radius:11px; background:transparent; color:var(--kp-ink); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; transition:background-color .15s, color .15s;
}
html.kp-app .kp-root .kp-mapctl-btn .kp-ico{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
html.kp-app .kp-root .kp-mapctl-btn:hover{ background:var(--kp-burgundy); color:#fff; }
html.kp-app .kp-root .kp-mapctl-btn.is-busy .kp-ico{ animation:kpmx-spin 1s linear infinite; }
html.kp-app .kp-root .kp-mapctl-sep{ height:1px; margin:3px 6px; background:var(--kp-line); }
html.kp-app .kp-root .kp-mapx-count{
  position:absolute; z-index:880; left:var(--kp-gap); bottom:var(--kp-gap); padding:7px 12px; border-radius:999px;
  font:600 12px/1 var(--kp-sans); color:var(--kp-ink); font-variant-numeric:tabular-nums; transition:opacity .2s;
}
html.kp-app .kp-root .kp-mapx-count:empty{ display:none; }
html.kp-app .kp-root.kp-list-open .kp-mapx-count{ opacity:0; pointer-events:none; }

/* ---------- POWITANIE (dawny hero) ---------- */
html.kp-app .kp-root .kp-hero.kp-welcome{
  position:fixed !important; z-index:940 !important; left:var(--kp-gap) !important; bottom:calc(var(--kp-gap) + 44px) !important; top:auto !important; right:auto !important;
  width:min(400px, calc(100vw - 24px)) !important; min-height:0 !important; box-sizing:border-box; margin:0 !important; padding:22px 22px 20px !important;
  text-align:left !important; border-radius:18px !important; overflow:hidden !important; display:block !important;
  background:linear-gradient(160deg, var(--kp-burgundy,#8a2632) 0%, var(--kp-burgundy-2,#6d1c26) 60%, #2b2320 100%) !important; color:#fbf8f1 !important;
  border:0 !important; box-shadow:0 24px 60px -20px rgba(43,35,32,.6) !important;
  animation:kpapp-rise .55s cubic-bezier(.2,.8,.2,1) both .35s; transition:opacity .25s, transform .25s;
}
html.kp-app .kp-root .kp-hero.kp-welcome::after{ content:""; position:absolute; inset:0; pointer-events:none; background-image:radial-gradient(rgba(230,195,74,.12) 1px, transparent 1px); background-size:14px 14px; }
html.kp-app .kp-root .kp-hero.kp-welcome > *{ position:relative; z-index:1; }
html.kp-app .kp-root .kp-hero.kp-welcome.is-closed,
html.kp-app .kp-root.kp-list-open .kp-hero.kp-welcome,
html.kp-app .kp-root.kp-filters-open .kp-hero.kp-welcome,
html.kp-app .kp-root.kp-win-open .kp-hero.kp-welcome,
html.kp-app .kp-root.kp-page-open .kp-hero.kp-welcome{ opacity:0 !important; transform:translateY(12px) !important; pointer-events:none !important; visibility:hidden; }
html.kp-app .kp-root .kp-hero.kp-welcome h1{ font-size:26px !important; line-height:1.1 !important; margin:0 34px 8px 0 !important; color:#fbf8f1 !important; text-align:left !important; max-width:none !important; text-shadow:none !important; }
html.kp-app .kp-root .kp-hero.kp-welcome .kp-lead{ font-size:14px !important; line-height:1.55 !important; margin:0 !important; color:rgba(251,248,241,.85) !important; text-align:left !important; max-width:none !important; }
html.kp-app .kp-root .kp-hero.kp-welcome .kp-hero-buttons{ display:flex !important; flex-direction:row !important; flex-wrap:wrap; gap:8px !important; margin:16px 0 0 !important; justify-content:flex-start !important; width:auto !important; }
html.kp-app .kp-root .kp-hero.kp-welcome .kp-btn{ width:auto !important; min-height:40px; padding:9px 16px !important; border-radius:999px !important; font-size:13px !important; background:linear-gradient(135deg,#e6c34a,#c9a227) !important; color:#2b2320 !important; border:0 !important; box-shadow:none !important; }
html.kp-app .kp-root .kp-hero.kp-welcome .kp-btn .kp-ico{ color:#2b2320 !important; }
html.kp-app .kp-root .kp-hero.kp-welcome .kp-btn.ghost{ background:rgba(251,248,241,.08) !important; color:#fbf8f1 !important; border:1px solid rgba(251,248,241,.4) !important; }
html.kp-app .kp-root .kp-hero.kp-welcome .kp-btn.ghost .kp-ico{ color:#e6c34a !important; }
html.kp-app .kp-root .kp-welcome-close{ position:absolute !important; top:12px; right:12px; z-index:2 !important; background:rgba(251,248,241,.12) !important; color:#fbf8f1 !important; }

/* ---------- DOCK PANELI (dół, środek) ---------- */
html.kp-app .kp-root .kp-appdock{
  position:fixed; z-index:1000; left:50%; bottom:var(--kp-gap); transform:translateX(-50%);
  display:flex; gap:4px; padding:6px; border-radius:18px; max-width:calc(100vw - 24px); box-sizing:border-box;
  animation:kpapp-rise-c .5s cubic-bezier(.2,.8,.2,1) both .25s;
}
html.kp-app .kp-root .kp-appdock button{
  display:inline-flex; align-items:center; gap:7px; height:42px; padding:0 14px; border:0; border-radius:13px; background:transparent;
  color:var(--kp-ink); font:700 13px/1 var(--kp-sans); white-space:nowrap; cursor:pointer; transition:background-color .2s, color .2s, transform .15s;
}
html.kp-app .kp-root .kp-appdock button[hidden]{ display:none; }
html.kp-app .kp-root .kp-appdock button .kp-ico{ width:18px; height:18px; color:var(--kp-burgundy); transition:color .2s; }
html.kp-app .kp-root .kp-appdock button:hover{ background:var(--kp-paper-2,#f5efe3); }
html.kp-app .kp-root .kp-appdock button:active{ transform:scale(.96); }
html.kp-app .kp-root .kp-appdock button.active{ background:var(--kp-burgundy); color:#fff; }
html.kp-app .kp-root .kp-appdock button.active .kp-ico{ color:var(--kp-gold-soft,#ecd5a1); }

/* ---------- OKNA NAD MAPĄ (prawa strona, własny scroll) ---------- */
html.kp-app .kp-root .kp-win{
  position:fixed !important; z-index:1100 !important; top:calc(var(--kp-top) + 10px) !important; right:var(--kp-gap) !important; bottom:calc(var(--kp-gap) + 66px + var(--kp-dock-h)) !important; left:auto !important;
  width:var(--kp-win-w) !important; max-width:none !important; box-sizing:border-box; margin:0 !important; padding:0 !important;
  display:flex !important; flex-direction:column !important; gap:0 !important; grid-template-columns:none !important;
  background:var(--kp-paper,#fbf8f1) !important; color:var(--kp-ink); border:1px solid var(--kp-line) !important; border-radius:18px !important;
  box-shadow:0 30px 80px -24px rgba(43,35,32,.55) !important; overflow:hidden !important; text-align:left !important;
  opacity:0; visibility:hidden; transform:translateX(24px); pointer-events:none;
  transition:opacity .22s, transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s;
}
html.kp-app .kp-root .kp-win.is-open{ opacity:1; visibility:visible; transform:none; pointer-events:auto; transition:opacity .22s, transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s; }
html.kp-app .kp-root .kp-win-head{
  flex:0 0 auto; order:-1; display:flex; align-items:center; gap:10px; padding:14px 14px 12px 18px; border-bottom:1px solid var(--kp-line);
  background:var(--kp-surface,#fff);
}
html.kp-app .kp-root .kp-win-head > .kp-ico{ width:20px; height:20px; color:var(--kp-burgundy); flex:0 0 auto; }
html.kp-app .kp-root .kp-win-head h2{ flex:1 1 auto; margin:0 !important; font:700 22px/1.15 var(--kp-script,'Cormorant Garamond',serif) !important; color:var(--kp-ink) !important; }
html.kp-app .kp-root .kp-win-body{ flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; padding:16px 18px 22px; scrollbar-width:thin; display:flex; flex-direction:column; gap:16px; }
html.kp-app .kp-root .kp-win-body > *{ flex-shrink:0; }
/* treść w oknach: jedna kolumna, bez podwójnych ramek */
html.kp-app .kp-root .kp-win .kp-wall-row{ display:flex !important; flex-direction:column !important; gap:16px !important; max-width:none !important; margin:0 !important; }
html.kp-app .kp-root .kp-win .kp-wall-row > *{ max-width:100% !important; width:100% !important; position:static !important; }
html.kp-app .kp-root .kp-win .kp-card{ border:0 !important; box-shadow:none !important; padding:0 !important; background:transparent !important; margin:0 !important; }
html.kp-app .kp-root .kp-win .kp-card > h2{ font-size:18px !important; margin:0 0 10px !important; }
html.kp-app .kp-root .kp-win .kp-grid-2{ grid-template-columns:1fr !important; }
html.kp-app .kp-root .kp-win .kp-side-card{ margin:0 !important; }
html.kp-app .kp-root .kp-win #kp-feed{ display:flex !important; flex-direction:column !important; overflow:visible !important; margin:0 !important; padding:0 !important; gap:14px !important; }
html.kp-app .kp-root .kp-win #kp-feed .kp-article{ flex:0 0 auto !important; grid-template-columns:1fr !important; }
html.kp-app .kp-root .kp-win .kp-hyde-quote{ margin:0 !important; }
html.kp-app .kp-root .kp-win .kp-mag-head{ margin:0 !important; }
html.kp-app .kp-root .kp-footer.kp-win .kp-win-body{ display:flex !important; flex-direction:column; gap:18px; }
html.kp-app .kp-root .kp-footer.kp-win .kp-win-body > div{ min-width:0; }
html.kp-app .kp-root .kp-footer.kp-win h5{ margin:0 0 8px; }
html.kp-app .kp-root .kp-footer.kp-win{ border-top:1px solid var(--kp-line) !important; }
html.kp-app .kp-root .kp-footer.kp-win .kp-win-body{ background:var(--kp-dark-bar,#2b2320); color:var(--kp-dark-bar-ink,#e5dbc6); }
html.kp-app .kp-root .kp-footer.kp-win .kp-countdown{ border:1px solid rgba(230,195,74,.35); }
html.kp-app .kp-root .kp-win .kp-countdown{ position:static !important; margin:0 !important; border-radius:12px !important; justify-content:center; }
html.kp-app .kp-root .kp-win .kp-mapx-sources{ padding:12px 14px !important; border:1px dashed var(--kp-line); border-radius:12px; background:var(--kp-surface,#fff); }
html.kp-app .kp-root > .kp-countdown{ display:none !important; }

/* ---------- PODSTRONY jako duże okno nad mapą ---------- */
html.kp-app .kp-root .kp-app-dim{ position:fixed; inset:0; z-index:1150; background:rgba(30,20,14,.42); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px); opacity:0; pointer-events:none; transition:opacity .25s; }
html.kp-app .kp-root.kp-page-open .kp-app-dim{ opacity:1; pointer-events:auto; }
html.kp-app .kp-root .kp-page{
  position:fixed !important; z-index:1200 !important; top:calc(var(--kp-top) + 12px) !important; bottom:calc(var(--kp-gap) + var(--kp-dock-h)) !important;
  left:max(var(--kp-gap), calc((100vw - 1240px) / 2)) !important; right:max(var(--kp-gap), calc((100vw - 1240px) / 2)) !important;
  min-height:0 !important; overflow:auto !important; overscroll-behavior:contain; border-radius:20px !important; background:var(--kp-paper,#fbf8f1) !important;
  border:1px solid var(--kp-line); box-shadow:0 40px 100px -30px rgba(0,0,0,.6) !important; animation:kpapp-pop .3s cubic-bezier(.2,.8,.2,1) both;
}
html.kp-app .kp-root .kp-page[hidden]{ display:none !important; }
html.kp-app .kp-root .kp-page-x{ position:sticky; top:12px; float:right; margin:12px 12px -46px 0; z-index:30; box-shadow:0 4px 14px rgba(43,35,32,.18); }
html.kp-app .kp-root.kp-reader-fs .kp-page{ inset:0 !important; border-radius:0 !important; border:0 !important; }
html.kp-app .kp-root.kp-reader-fs .kp-page-x{ display:none; }
html.kp-app .kp-root.kp-page-open .kp-appdock,
html.kp-app .kp-root.kp-page-open .kp-mapbar,
html.kp-app .kp-root.kp-page-open .kp-mapctl{ opacity:0 !important; visibility:hidden; pointer-events:none; }

/* ---------- OKNO SZCZEGÓŁÓW MIEJSCOWOŚCI (środek ekranu) ---------- */
html.kp-app .kp-root .kp-place{ position:fixed; inset:0; z-index:5000; display:flex; align-items:center; justify-content:center; padding:20px; }
html.kp-app .kp-root .kp-place[hidden]{ display:none; }
html.kp-app .kp-root .kp-place-dim{ position:absolute; inset:0; background:rgba(30,20,14,.55); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); animation:kpapp-fade .2s ease-out both; }
html.kp-app .kp-root .kp-place-card{
  position:relative; width:min(640px, 100%); max-height:min(86dvh, 860px); display:flex; flex-direction:column; outline:none;
  background:var(--kp-paper,#fbf8f1); color:var(--kp-ink); border-radius:22px; overflow:hidden; box-shadow:0 40px 100px -30px rgba(0,0,0,.7);
  border-top:5px solid var(--kp-burgundy); animation:kpapp-pop .28s cubic-bezier(.2,.8,.2,1) both;
}
html.kp-app .kp-root .kp-place-head{ position:relative; flex:0 0 auto; padding:20px 64px 16px 24px; background:var(--kp-surface,#fff); border-bottom:1px solid var(--kp-line); }
html.kp-app .kp-root .kp-place-x{ position:absolute; top:16px; right:16px; }
html.kp-app .kp-root .kp-place-kicker{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:6px; }
html.kp-app .kp-root .kp-place-kicker .kp-cert, html.kp-app .kp-root .kp-place-kicker .kp-popup-gone{ margin-left:0; }
html.kp-app .kp-root .kp-place-chip{ font:700 10px/1 var(--kp-sans); letter-spacing:.6px; text-transform:uppercase; border-radius:999px; padding:4px 9px; border:1px solid; }
html.kp-app .kp-root .kp-place-chip.blizsze{ background:#e7efe3; color:#3c5a34; border-color:#cfe0c6; }
html.kp-app .kp-root .kp-place-chip.dalsze{ background:#efe4ef; color:#5a2a52; border-color:#e0cfdd; }
html.kp-app .kp-root .kp-place-head h2{ margin:0 !important; font:700 34px/1.05 var(--kp-script,'Cormorant Garamond',serif) !important; color:var(--kp-burgundy) !important; }
html.kp-app .kp-root .kp-place-native{ display:block; margin-top:4px; font:italic 600 17px/1.3 var(--kp-script,'Cormorant Garamond',serif); color:#8a6d4b; }
html.kp-app .kp-root .kp-place-missing{ display:block; margin-top:4px; font-size:12.5px; font-style:italic; color:var(--kp-ink-soft); }
html.kp-app .kp-root .kp-place-missing a{ color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-place-body{ flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; padding:18px 24px 20px; font:14px/1.55 var(--kp-sans); scrollbar-width:thin; }
html.kp-app .kp-root .kp-place-loading{ display:flex; align-items:center; gap:10px; color:var(--kp-ink-soft); padding:12px 0; }
html.kp-app .kp-root .kp-place-loading .kp-mapx-spin{ display:inline-block; }
html.kp-app .kp-root .kp-place-facts{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; margin:0 0 18px; }
html.kp-app .kp-root .kp-place-facts > div{ background:var(--kp-surface,#fff); border:1px solid var(--kp-line); border-radius:12px; padding:9px 12px; min-width:0; }
html.kp-app .kp-root .kp-place-facts dt{ font:700 10px/1.3 var(--kp-sans); letter-spacing:.8px; text-transform:uppercase; color:var(--kp-ink-soft); }
html.kp-app .kp-root .kp-place-facts dd{ margin:3px 0 0; font-weight:600; overflow-wrap:anywhere; }
html.kp-app .kp-root .kp-place-sec{ margin:0 0 16px; }
html.kp-app .kp-root .kp-place-sec h3{ margin:0 0 6px; font:700 11px/1.3 var(--kp-sans); letter-spacing:1.2px; text-transform:uppercase; color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-place-sec ul{ margin:0; padding-left:18px; }
html.kp-app .kp-root .kp-place-sec a{ color:var(--kp-burgundy); }
html.kp-app .kp-root .kp-place-note{ margin:0 0 8px; font-size:12.5px; color:var(--kp-ink-soft); }
html.kp-app .kp-root .kp-place-archs{ display:grid; gap:8px; }
html.kp-app .kp-root .kp-place-arch{ display:block; text-decoration:none; padding:10px 14px; border:1px solid var(--kp-line); border-radius:12px; background:var(--kp-surface,#fff); transition:border-color .15s, transform .15s, box-shadow .15s; }
html.kp-app .kp-root .kp-place-arch:hover{ border-color:var(--kp-gold); transform:translateY(-1px); box-shadow:0 8px 20px -12px rgba(43,35,32,.4); }
html.kp-app .kp-root .kp-place-arch strong{ display:block; color:var(--kp-burgundy); font-size:14px; }
html.kp-app .kp-root .kp-place-arch span{ display:block; margin-top:2px; color:var(--kp-ink-soft); font-size:12.5px; }
html.kp-app .kp-root .kp-place-foot{ flex:0 0 auto; display:flex; flex-wrap:wrap; gap:8px; padding:14px 24px calc(14px + env(safe-area-inset-bottom)); border-top:1px solid var(--kp-line); background:var(--kp-surface,#fff); }
html.kp-app .kp-root .kp-place-foot .kp-btn{ min-height:40px; padding:8px 14px; font-size:13px; border-radius:999px; }
html.kp-app .kp-root .kp-place-foot .kp-btn.ghost{ background:transparent; color:var(--kp-burgundy); border:1px solid var(--kp-line); }
html.kp-app .kp-root .kp-place-foot .kp-btn.ghost:hover{ border-color:var(--kp-burgundy); }

/* ---------- inne pływające elementy portalu ---------- */
html.kp-app:has(.kp-root.kp-place-open) .kmsg-fab,
html.kp-app:has(.kp-root.kp-page-open) .kmsg-fab{ opacity:0 !important; visibility:hidden !important; pointer-events:none !important; }
@media (max-width:1023px){
  html.kp-app:has(.kp-root.kp-list-open) .kmsg-fab,
  html.kp-app:has(.kp-root.kp-filters-open) .kmsg-fab,
  html.kp-app:has(.kp-root.kp-win-open) .kmsg-fab{ opacity:0 !important; visibility:hidden !important; pointer-events:none !important; }
}
html.kp-app .kp-root .kp-page .kp-tree-graph{ align-items:safe center !important; overflow-x:auto !important; max-width:100% !important; }
html.kp-app .kp-root .kp-page .kp-tree-gen{ justify-content:safe center !important; }
html.kp-app .kp-root .kp-builder-bar{ bottom:78px; }
html.kp-app .kp-footer.kp-win{ display:flex !important; padding:0 !important; }

/* ---------- animacje ---------- */
@keyframes kpapp-drop{ from{ opacity:0; transform:translateY(-10px); } to{ opacity:1; transform:none; } }
@keyframes kpapp-rise{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }
@keyframes kpapp-rise-c{ from{ opacity:0; transform:translate(-50%,14px); } to{ opacity:1; transform:translate(-50%,0); } }
@keyframes kpapp-pop{ from{ opacity:0; transform:translateY(10px) scale(.98); } to{ opacity:1; transform:none; } }
@keyframes kpapp-fade{ from{ opacity:0; } to{ opacity:1; } }
@media (prefers-reduced-motion:reduce){
  html.kp-app .kp-root *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ---------- ciemny motyw ---------- */
html.kp-app .kp-root.kp-dark .kp-place-chip.blizsze{ background:#2c3a28; color:#cfe0c6; border-color:#3e5236; }
html.kp-app .kp-root.kp-dark .kp-place-chip.dalsze{ background:#3a2836; color:#e8cfe3; border-color:#523a4e; }
html.kp-app .kp-root.kp-dark .kp-region.kp-region--inlist{ background:var(--kp-surface); }
html.kp-app .kp-root.kp-dark .kp-mapx #kp-map{ background:#2a231c; }


/* ---------- ≤1023: jedna wyszukiwarka na mapie; wyszukiwarka serwisu jako ikona ---------- */
@media (max-width:1023px){
  html.kp-app .kp-root .kp-topbar > .kp-searchbar{ display:none !important; }
  html.kp-app .kp-root .kp-topbar > .kp-nav-search{ display:inline-flex !important; order:2 !important; margin-left:auto !important; width:42px; height:42px; padding:0 !important; justify-content:center; border-radius:50% !important; }
  html.kp-app .kp-root .kp-topbar > .kp-nav-search .kp-nav-search-label{ display:none !important; }
  html.kp-app .kp-root .kp-topbar .kp-user{ margin-left:6px !important; }
}

/* =====================================================================
   TABLET (641–1023): pasek nawigacji z hamburgerem, okna węższe
   ===================================================================== */
@media (max-width:1023px) and (min-width:641px){
  html.kp-app{ --kp-win-w:min(460px, calc(100vw - 24px)); }
  html.kp-app .kp-root .kp-win{ top:calc(var(--kp-top) + 72px) !important; }
  html.kp-app .kp-root .kp-appdock button span{ display:none; }
  html.kp-app .kp-root .kp-appdock button{ padding:0 12px; }
}

/* =====================================================================
   TELEFON (≤640): dolny dock nawigacji portalu + arkusze od dołu
   ===================================================================== */
@media (max-width:640px){
  html.kp-app{ --kp-gap:8px; --kp-dock-h:calc(68px + env(safe-area-inset-bottom)); --kp-list-w:calc(100vw - 16px); }
  html.kp-app .kp-root .kp-topbar{ top:8px !important; left:8px !important; right:8px !important; padding:7px 10px !important; border-radius:16px !important; -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }
  html.kp-app .kp-root .kp-topbar > .kp-nav, html.kp-app .kp-root .kp-nav{ border-radius:20px 20px 0 0 !important; }

  html.kp-app .kp-root .kp-mapbar{ top:calc(var(--kp-top) + 8px); left:8px; right:8px; width:auto; padding:5px; border-radius:14px; }
  html.kp-app .kp-root .kp-mapbar-search input{ height:42px; font-size:16px; }
  html.kp-app .kp-root .kp-mapbar-btn{ height:42px; width:42px; padding:0; justify-content:center; }
  html.kp-app .kp-root .kp-mapbar-btn span{ display:none; }

  /* Filtry i lista = arkusze od dołu nad dockiem */
  html.kp-app .kp-root .kp-mapx-panel,
  html.kp-app .kp-root .kp-list{
    left:0 !important; right:0 !important; width:auto !important; top:auto !important; bottom:var(--kp-dock-h) !important;
    border-radius:20px 20px 0 0 !important; border-bottom:0 !important;
  }
  html.kp-app .kp-root .kp-mapx-panel{ max-height:calc(100dvh - var(--kp-top) - var(--kp-dock-h) - 70px) !important; transform:translateY(24px) !important; }
  html.kp-app .kp-root .kp-list{ height:min(58dvh, calc(100dvh - var(--kp-top) - var(--kp-dock-h) - 70px)); transform:translateY(calc(100% + var(--kp-dock-h) + 20px)); }
  html.kp-app .kp-root .kp-list-head{ position:relative; padding-top:16px; }
  html.kp-app .kp-root .kp-list-head::before, html.kp-app .kp-root .kp-mapx-panel-head::before{ content:""; display:block !important; position:absolute; top:6px; left:50%; width:40px; height:4px; margin-left:-20px; border-radius:4px; background:var(--kp-line); }

  html.kp-app .kp-root .kp-mapctl{ top:auto; transform:none; bottom:calc(var(--kp-dock-h) + 66px); right:8px; padding:4px; border-radius:14px; }
  html.kp-app .kp-root .kp-mapctl-btn{ width:38px; height:38px; }
  html.kp-app .kp-root .kp-mapctl #kp-map-reset{ display:none; }
  html.kp-app .kp-root.kp-win-open .kp-mapctl{ right:8px; }
  html.kp-app .kp-root .kp-mapx-count{ display:none; }
  html.kp-app .kp-root .kp-mapx-status{ top:calc(var(--kp-top) + 64px) !important; }
  html.kp-app .kp-root .leaflet-bottom{ bottom:calc(var(--kp-dock-h) + 52px); }

  html.kp-app .kp-root .kp-appdock{
    left:8px; right:8px; transform:none; bottom:calc(var(--kp-dock-h) + 8px); max-width:none; padding:4px; gap:2px; border-radius:14px;
    overflow-x:auto; scrollbar-width:none; animation-name:kpapp-rise;
  }
  html.kp-app .kp-root .kp-appdock::-webkit-scrollbar{ display:none; }
  html.kp-app .kp-root .kp-appdock button{ height:36px; padding:0 11px; font-size:12px; flex:0 0 auto; }
  html.kp-app .kp-root .kp-appdock button .kp-ico{ width:16px; height:16px; }

  html.kp-app .kp-root .kp-hero.kp-welcome{ left:8px !important; right:8px !important; width:auto !important; top:calc(var(--kp-top) + 66px) !important; bottom:auto !important; padding:16px 16px 14px !important; animation-name:kpapp-drop; }
  html.kp-app .kp-root .kp-hero.kp-welcome h1{ font-size:22px !important; }
  html.kp-app .kp-root .kp-hero.kp-welcome .kp-lead{ font-size:13px !important; }

  html.kp-app .kp-root .kp-win{
    left:0 !important; right:0 !important; width:auto !important; top:calc(var(--kp-top) + 8px) !important; bottom:var(--kp-dock-h) !important;
    border-radius:20px 20px 0 0 !important; border-bottom:0 !important; transform:translateY(30px);
  }
  html.kp-app .kp-root .kp-win-body{ padding:14px 14px 20px; }
  html.kp-app .kp-root.kp-win-open .kp-appdock{ opacity:0 !important; visibility:hidden; pointer-events:none; }

  html.kp-app .kp-root .kp-page{ left:0 !important; right:0 !important; top:calc(var(--kp-top) + 8px) !important; bottom:var(--kp-dock-h) !important; border-radius:20px 20px 0 0 !important; }
  html.kp-app .kp-root .kp-page-x{ margin:10px 10px -44px 0; }

  html.kp-app .kp-root .kp-place{ padding:8px; align-items:flex-end; }
  html.kp-app .kp-root .kp-place-card{ max-height:calc(100dvh - 16px); border-radius:20px; }
  html.kp-app .kp-root .kp-place-head{ padding:16px 58px 12px 18px; }
  html.kp-app .kp-root .kp-place-head h2{ font-size:28px !important; }
  html.kp-app .kp-root .kp-place-body{ padding:14px 18px 16px; }
  html.kp-app .kp-root .kp-place-facts{ grid-template-columns:1fr; }
  html.kp-app .kp-root .kp-place-foot{ padding:12px 14px calc(12px + env(safe-area-inset-bottom)); }
  html.kp-app .kp-root .kp-place-foot .kp-btn{ flex:1 1 auto; justify-content:center; }
  html.kp-app .kp-root .kp-map-hint{ bottom:calc(var(--kp-dock-h) + 112px); }
  html.kp-app .kp-root .kp-hero.kp-welcome .kp-lead{ display:-webkit-box !important; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  html.kp-app .kp-root .kp-hero.kp-welcome .kp-hero-buttons{ margin-top:12px !important; flex-wrap:nowrap !important; }
  html.kp-app .kp-root .kp-hero.kp-welcome .kp-btn{ padding:8px 12px !important; font-size:12px !important; min-height:36px; }
  html.kp-app .kp-root.kp-list-open .kp-appdock, html.kp-app .kp-root.kp-filters-open .kp-appdock{ opacity:0 !important; visibility:hidden; pointer-events:none; }
  html.kp-app .kp-root .kp-mapctl{ bottom:calc(var(--kp-dock-h) + 128px); }
  html.kp-app .kmsg-fab{ bottom:calc(var(--kp-dock-h) + 60px) !important; right:10px !important; width:52px; height:52px; }
  html.kp-app .kp-root .kp-appdock{ right:70px; 
}
}

/* v10.33.0 — wszystkie przyciski „X" (zamknij) jako równy okrąg, krzyżyk idealnie na środku */
.kp-root .kp-list-close, .kp-root .kp-win-close, .kp-root .kp-place-x, .kp-root .kp-page-x, .kp-root .kp-welcome-close,
.kp-root .kp-mapx-close, .kp-region-close, .kp-tour-close, .kp-search-modal-close,
.kp-person-close, .kp-import-close, .kp-root .kp-toc-hide,
.kp-auth-close, .kp-cms-modal__close, .kmsg-close, .kresy-a11y-close, .klist-modal-x{
  box-sizing:border-box !important; width:36px !important; height:36px !important;
  min-width:36px !important; max-width:36px !important; min-height:36px !important; max-height:36px !important;
  aspect-ratio:1 / 1 !important; padding:0 !important; border-radius:50% !important;
  display:inline-flex !important; align-items:center !important; justify-content:center !important;
  flex:0 0 36px !important; line-height:1 !important; font-family:Arial, Helvetica, sans-serif !important;
  font-size:22px !important; font-weight:400 !important; letter-spacing:0 !important; text-indent:0 !important;
  overflow:hidden !important; vertical-align:middle !important;
}
.kp-root .kp-toc-hide .kp-ico{ width:18px; height:18px; }
.kp-root .kp-region-close, .kresy-a11y-close{ background:var(--kp-paper-2,#f5efe3) !important; }

/* v10.33.0 — Genealogia na pełny ekran, jak Czytelnia */
.kp-root .kp-tree-reader .kp-reader-body.kp-tree-reader-body{ padding:0 !important; }
.kp-root .kp-tree-reader .kp-tree-wrap{ min-height:100%; padding:40px clamp(16px,4vw,56px) 60px; box-sizing:border-box; }
@media (max-width:640px){ .kp-root .kp-tree-reader .kp-tree-wrap{ padding:20px 12px 40px; } }

/* v10.34.0 — TELEFON: dolne menu (Poszukiwania, Społeczność, Magazyn, Mój panel, O portalu) mieści się w całości,
   bez ucinania i przewijania: równe kolumny, ikona nad podpisem. */
@media (max-width:640px){
  html.kp-app .kp-root .kp-appdock{
    left:8px !important; right:8px !important; transform:none !important; max-width:none !important;
    display:grid !important; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:2px !important;
    overflow:visible !important; padding:4px !important;
  }
  html.kp-app .kp-root .kp-appdock button{
    flex-direction:column; justify-content:center; gap:3px !important; min-width:0 !important; width:100%;
    height:52px !important; padding:4px 2px !important; font-size:10.5px !important; line-height:1.1 !important; border-radius:11px !important;
  }
  html.kp-app .kp-root .kp-appdock button span{
    display:block !important; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; letter-spacing:-.1px;
  }
  html.kp-app .kp-root .kp-appdock button .kp-ico{ width:19px !important; height:19px !important; flex:none; }
  html.kp-app .kmsg-fab{ bottom:calc(var(--kp-dock-h) + 76px) !important; }
}
@media (max-width:360px){
  html.kp-app .kp-root .kp-appdock button{ font-size:9.5px !important; }
}
