@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-500-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-600-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-700-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-500-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-600-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --line: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f1f5f9;
  --sans: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app {
  display: flex;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg);
}

.nav {
  width: 15rem;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 30;
}

.nav.is-collapsed { width: 4.25rem; }
.nav.is-collapsed .nav-text { display: none; }
.nav.is-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.nav.is-collapsed .brand { justify-content: center; }

.nav-top, .brand, .nav-item, .topbar, .topbar-left, .topbar-right, .kpis, .legend-bar, .drawer-head {
  display: flex;
  align-items: center;
}

.nav-top {
  height: 3.5rem;
  padding: 0 0.7rem 0 0.85rem;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  gap: 0.4rem;
}

.brand { gap: 0.6rem; min-width: 0; }

.brand-mark {
  width: 2rem;
  height: 2rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
}

.brand-name, .brand-sub { display: block; }
.brand-name { font-weight: 700; font-size: 0.86rem; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 0.72rem; }

.nav-scroll {
  flex: 1;
  overflow: auto;
  padding: 0.85rem 0.65rem;
}

.nav-label {
  margin: 0.85rem 0.45rem 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-label span { float: right; letter-spacing: 0; text-transform: none; }

.nav-item {
  width: 100%;
  gap: 0.55rem;
  margin: 0.15rem 0;
  padding: 0.48rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  text-align: left;
}

.nav-item svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:disabled {
  opacity: 0.55;
  cursor: default;
}

.nav-item.is-active {
  background: #0f172a;
  color: #fff;
  font-weight: 600;
}

.nav-item .nav-text:nth-child(2) { flex: 1; min-width: 0; }

.badge {
  flex: none;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: #94a3b8;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
}

.badge-on {
  border-color: transparent;
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
}

.nav-foot {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
}

.foot-note { color: var(--muted); font-family: var(--mono); font-size: 0.65rem; }

.filters {
  width: 20rem;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 20;
}

body.sidebar-off .filters { display: none; }

.filters-head, .filters-body { padding: 0.85rem 0.9rem; }
.filters-head { border-bottom: 1px solid var(--line); }
.filters-body { border-bottom: 1px solid var(--line); background: rgba(248, 250, 252, 0.7); }

h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 0.95rem; }
.filters-head p, .hint, .empty, .map-status, .crumb { margin: 0.3rem 0 0; color: var(--muted); }

.filters-head p, .hint { font-size: 0.75rem; }

#szukaj, select, .seg-btn, #kadr, .modal-card button, .chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
}

#szukaj, select {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.48rem 0.65rem;
  background: var(--soft);
}

#szukaj:focus, select:focus, .seg-btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, #kadr:focus-visible, .nav-item:focus-visible, .modal-card button:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.filter-block { margin-top: 0.75rem; }
.filter-block:first-child { margin-top: 0; }

.filter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#reset {
  border: 0;
  background: none;
  padding: 0;
  color: #0369a1;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}

.chip-row, .seg { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }

.chip, .seg-btn {
  padding: 0.28rem 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
}

.chip span { color: var(--muted); font-weight: 500; }

.chip[aria-pressed="true"] {
  background: var(--c);
  border-color: var(--c);
  color: var(--on);
}

.chip[aria-pressed="true"] span { color: inherit; opacity: 0.8; }

.chip.is-static {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.seg { margin-top: 0.4rem; padding: 0.15rem; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.seg-btn { border-color: transparent; background: transparent; }
.seg-btn.is-on { background: #fff; border-color: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }

.unit-list {
  flex: 1;
  overflow: auto;
  padding: 0.75rem;
  background: rgba(248, 250, 252, 0.55);
}

.empty {
  margin: 0;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.82rem;
}

.unit {
  width: 100%;
  display: block;
  margin: 0 0 0.4rem;
  padding: 0.65rem 0.7rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.unit strong { display: block; }
.unit small { color: var(--muted); }

.legend-bar {
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.legend-bar i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.25rem;
  border-radius: 99px;
  vertical-align: middle;
}

.legend-bar .diamond {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 1px;
  background: #1e293b;
  transform: rotate(45deg);
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  height: 3.5rem;
  flex: none;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  z-index: 25;
}

.topbar-left, .topbar-right { gap: 0.55rem; min-width: 0; }
.topbar-right { flex: none; }

.crumb { margin: 0; font-size: 0.8rem; white-space: nowrap; }
.crumb span { color: var(--muted); }

.kpis { gap: 0.35rem; }
.kpi {
  margin: 0;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}
.kpi span { color: var(--muted); margin-right: 0.25rem; }

.link-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  white-space: nowrap;
}

.icon-btn, #kadr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.icon-btn { width: 2rem; height: 2rem; padding: 0; color: #334155; }
.icon-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#kadr {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.stage { position: relative; flex: 1; min-height: 0; }

#map { position: absolute; inset: 0; background: #f1f5f9; }

#map.mode-osm-clean .leaflet-tile-pane {
  filter: saturate(55%) contrast(96%) brightness(103%);
}

.on-map, .map-status {
  position: absolute;
  z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.on-map {
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.92rem;
}

.map-status {
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  max-width: min(36rem, calc(100% - 8rem));
  margin: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 700;
  width: min(24rem, 100%);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.06);
  transform: translateX(100%);
}

.drawer.is-open { transform: none; }

.drawer-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.drawer-kicker {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.drawer-body { padding: 0.9rem; overflow: auto; font-size: 0.85rem; }
.drawer-body p { margin: 0 0 0.7rem; }
#kopiuj { padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.drawer-body dt { color: var(--muted); font-size: 0.72rem; }
.drawer-body dd { margin: 0 0 0.65rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.4);
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(24rem, 100%);
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.modal-card h2 { margin: 0.45rem 0; font-size: 1.05rem; }
.modal-card p { margin: 0; color: #334155; }
.modal-card button { margin-top: 0.9rem; padding: 0.45rem 0.7rem; background: #0f172a; color: #fff; border-color: #0f172a; }

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #64748b !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-top-left-radius: 6px;
}

.leaflet-control-attribution a { color: #0369a1 !important; }

.leaflet-bar {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

.leaflet-bar a {
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  background: #fff !important;
  color: #334155 !important;
  border-bottom-color: var(--soft) !important;
}

.olioc-pin { background: transparent; border: 0; }

.pin {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  border: 2.5px solid var(--c, #4d4d4d);
  color: var(--c, #4d4d4d);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.pin-label {
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.pin-command {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.pin-command::before {
  content: "";
  width: 16px;
  height: 16px;
  background: #1e293b;
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.noscript { margin: 0; padding: 1rem; background: #fff; }

@media (max-width: 1100px) {
  .kpis, .link-note, .crumb { display: none; }
}

@media (max-width: 860px) {
  .nav { width: 4.25rem; }
  .nav .nav-text { display: none; }
  .nav .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
  .filters { position: absolute; top: 3.5rem; bottom: 0; left: 4.25rem; z-index: 40; box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08); }
  .on-map { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
