/* Plan ogólny Krakowa – geoportal. Paleta: papier, tusz, petrol jako kolor działania, żółć geodezyjna jako znacznik bieżącej pozycji. */
/* Krój Open Sans z plików lokalnych (vendor/fonts, licencja SIL OFL 1.1), jeden plik zmienny na wszystkie grubości. Gdy plik się nie wczyta,
   działa krój systemowy z listy --f. */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(vendor/fonts/OpenSans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(vendor/fonts/OpenSans-latin.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;
}
:root {
  --paper: #ffffff;
  --ground: #eceeed;
  --ink: #1a2226;
  --ink2: #56636a;
  --rule: #c9d0d1;
  --rule2: #e3e7e7;
  --acc: #0b5a66;
  --acc-soft: #e2eff0;
  --mark: #f2c230;
  --mark-soft: #fdf4cf;
  --crit: #b3261e;
  --warn: #9a5b00;
  --ok: #1e6b45;
  --f: 'Open Sans', 'Segoe UI', Tahoma, Arial, sans-serif;
  --fc: 'Open Sans', 'Segoe UI', Tahoma, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font: 13.5px/1.45 var(--f);
  color: var(--ink);
  background: var(--ground);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
[hidden] {
  display: none !important;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
}
a {
  color: var(--acc);
  text-underline-offset: 2px;
}

/* ---------- pasek górny */
#top {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 6px 18px;
  padding: 7px 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand b {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: block;
  line-height: 1.2;
}
.brand small {
  display: block;
  color: var(--ink2);
  font-size: 11.5px;
}
.sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink);
  flex: 0 0 26px;
}
.sheet i:nth-child(1) {
  background: #a67c5b;
}
.sheet i:nth-child(2) {
  background: #ef6f5e;
}
.sheet i:nth-child(3) {
  background: #a9dc6c;
}
.sheet i:nth-child(4) {
  background: #dcb970;
}
.search {
  position: relative;
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 560px;
}
.search input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ground);
}
.search input:focus {
  background: var(--paper);
  border-color: var(--ink);
  outline: none;
}
#qres {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  z-index: 30;
  max-height: 340px;
  overflow: auto;
  box-shadow: 3px 3px 0 rgba(26, 34, 38, 0.14);
}
#qres div {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule2);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
#qres div:hover,
#qres div.cur {
  background: var(--acc-soft);
}
#qres div.cur {
  box-shadow: inset 3px 0 0 var(--acc);
}
#qres div.none {
  cursor: default;
  color: var(--ink2);
  background: none;
}
#qres small {
  color: var(--ink2);
  white-space: nowrap;
}
.tools {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.seg {
  display: flex;
}
.seg button,
.seg a.btn {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 5px 11px;
  margin-left: -1px;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}
.seg > :first-child {
  margin-left: 0;
  border-radius: 3px 0 0 3px;
}
.seg > :last-child {
  border-radius: 0 3px 3px 0;
}
.seg > :only-child {
  border-radius: 3px;
}
.seg button:hover,
.seg a.btn:hover {
  background: var(--ground);
}
.seg button.on {
  background: var(--ink);
  color: #fff;
}
.seg > :focus-visible {
  position: relative;
  z-index: 1;
}

/* ---------- układ */
main {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}
aside {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#left {
  width: 316px;
  border-right: 1px solid var(--rule);
}
#right {
  width: 404px;
  border-left: 1px solid var(--rule);
}
#mapwrap {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
}
#map {
  position: absolute;
  inset: 0;
}
.tabs {
  display: flex;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
  flex: 0 0 auto;
  padding: 5px 6px 0;
  gap: 2px;
}
.tabs button {
  flex: 1;
  background: none;
  border: 1px solid transparent;
  border-bottom: 0;
  border-top: 2px solid transparent;
  padding: 6px 4px 7px;
  color: var(--ink2);
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button.on {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  border-color: var(--rule);
  border-top-color: var(--ink);
}
.pane {
  display: none;
  overflow: auto;
  padding: 10px 12px 16px;
  flex: 1 1 auto;
  min-height: 0;
}
.pane.on {
  display: block;
}

/* ---------- typografia paneli */
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.25;
  text-wrap: balance;
}
h3 {
  font-size: 12.5px;
  font-weight: 600;
  margin: 16px 0 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
}
h3:first-child {
  margin-top: 2px;
}
h4 {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 600;
}
.hint {
  color: var(--ink2);
  font-size: 12.5px;
}
.tag {
  font-family: var(--fc);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- wiersze warstw i pola */
.row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  min-height: 28px;
}
.row > span {
  flex: 1 1 auto;
  min-width: 0;
}
.row.sub {
  padding-left: 22px;
  color: var(--ink2);
}
.row.sub > span {
  flex: 0 0 auto;
}
.row.locked {
  color: var(--ink2);
}
.row input[type='range'] {
  flex: 0 0 64px;
  width: 64px;
  accent-color: var(--ink);
}
.row select,
.row input:not([type]) {
  flex: 1 1 0;
  min-width: 0;
}
.row output {
  flex: 0 0 30px;
  text-align: right;
  color: var(--ink2);
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--acc);
  margin: 0;
  flex: 0 0 auto;
}
select,
input[type='number'],
input:not([type]),
textarea {
  padding: 4px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
}
select:hover,
input[type='number']:hover,
input:not([type]):hover,
textarea:hover {
  border-color: var(--ink2);
}
/* warstwa niedostępna w tej skali: tekst zostaje czytelny (kontrast 6:1), przygasa tylko próbka koloru; wyróżnikiem jest odnośnik skali */
.row.na > span {
  color: var(--ink2);
}
.row.na .sw {
  opacity: 0.45;
}
.row .zb {
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 5px 2px;
  color: var(--acc);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.row:not(.na) .zb {
  display: none;
}
.sw {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(26, 34, 38, 0.35);
  flex: 0 0 14px;
  display: inline-block;
}
.sw.ln {
  height: 0;
  border: 0;
  border-top: 3px solid;
  align-self: center;
}
.sw.pt {
  border-radius: 50%;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  border: 1px solid rgba(26, 34, 38, 0.3);
  display: inline-block;
}
.sum {
  border-left: 3px solid var(--acc);
  background: var(--acc-soft);
  padding: 6px 9px;
  margin: 8px 0;
  font-size: 12.5px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chips label {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px 7px 2px 5px;
  cursor: pointer;
  display: flex;
  gap: 5px;
  align-items: center;
  font-family: var(--fc);
  font-weight: 500;
}
.chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chips label:focus-within {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
}
.chips label.off {
  color: var(--ink2);
  background: var(--ground);
  text-decoration: line-through;
}
.chips label.off .sw {
  opacity: 0.35;
}
.rng {
  display: grid;
  grid-template-columns: 1fr 62px 62px;
  gap: 4px;
  align-items: center;
  margin: 3px 0;
}
.rng input {
  width: 100%;
}
.btnrow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
  align-items: center;
}
.btnrow button,
.card button {
  background: var(--paper);
  border: 1px solid var(--ink2);
  border-radius: 3px;
  padding: 4px 10px;
}
.btnrow button:hover,
.card button:hover {
  border-color: var(--ink);
  background: var(--ground);
}
.btnrow button.pri {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btnrow button.pri:hover {
  background: #2d393f;
}
.mini {
  font-size: 12px;
  color: var(--ink2);
  display: flex;
  gap: 5px;
  align-items: center;
}

/* ---------- pasek kolejki nad kartą */
#qbar {
  position: sticky;
  top: -10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -10px -12px 10px;
  padding: 5px 12px;
  background: var(--mark-soft);
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
}
#qbar[hidden] {
  display: none;
}
#qbar #qbname {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
#qbar #qbname:hover {
  text-decoration: underline;
}
#qbar #qbpos {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--ink2);
}
#qbar #qbprev,
#qbar #qbnext {
  flex: 0 0 auto;
  background: var(--paper);
  border: 1px solid var(--ink2);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
}
#qbar #qbprev:hover {
  border-color: var(--ink);
  background: var(--ground);
}
#qbar #qbnext {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
#qbar #qbnext:hover {
  background: #2d393f;
}
/* ostrzeżenie przy warstwie, której usługa nie odpowiada */
.row .srverr {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11px;
  color: var(--crit);
  white-space: nowrap;
}

/* ---------- legenda */
.leg section {
  margin: 0 0 10px;
}
.leg b {
  display: block;
  margin: 0 0 3px;
  font-weight: 600;
}
.leg div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 1.5px 0;
  line-height: 1.3;
}
.leg img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}
.leg section.na > div {
  opacity: 0.65;
}
.leg section.na > b {
  color: var(--ink2);
  font-weight: 500;
}
.leg .when {
  display: block;
  font-size: 12px;
  color: var(--ink2);
  font-weight: 400;
}

/* ---------- karta obiektu */
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 10px 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule2);
}
.kv div {
  padding: 6px 8px 7px;
  border-right: 1px solid var(--rule2);
  border-bottom: 1px solid var(--rule2);
}
.kv span {
  display: block;
  color: var(--ink2);
  font-size: 12px;
}
.kv b.nd {
  font: 500 14px/1.7 var(--f);
}
.kv b {
  font: 600 19px/1.2 var(--fc);
  display: block;
}
.kv em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink2);
  display: block;
  line-height: 1.3;
  margin-top: 2px;
}
.kv .bad {
  background: #fbeceb;
}
.kv .bad b {
  color: var(--crit);
}
dl {
  display: grid;
  grid-template-columns: 40% 60%;
  margin: 6px 0;
  gap: 3px 0;
}
dt {
  color: var(--ink2);
}
dd {
  margin: 0;
}
.pill {
  display: inline-block;
  border-radius: 2px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 500;
  margin: 2px 4px 2px 0;
  border-left: 3px solid;
}
.pill.c {
  background: #fbeceb;
  color: var(--crit);
}
.pill.w {
  background: #fbf0d9;
  color: var(--warn);
}
.pill.o {
  background: #e2f1e8;
  color: var(--ok);
}
.pill.n {
  background: var(--ground);
  color: var(--ink2);
}
.vrow {
  border-top: 1px solid var(--rule);
  padding: 7px 0 8px;
  margin: 0;
}
.vrow small {
  color: var(--ink2);
}
.vform {
  border: 1px solid var(--ink);
  margin: 12px 0;
  background: var(--paper);
}
.vform > b {
  display: block;
  background: var(--ink);
  color: #fff;
  padding: 4px 9px;
  font-weight: 500;
}
.vform .st {
  display: flex;
  flex-wrap: wrap;
  margin: 8px 8px 0;
  gap: 0;
}
.vform .st button {
  border: 1px solid var(--ink2);
  background: var(--paper);
  border-radius: 0;
  padding: 5px 9px;
  margin: 0 -1px -1px 0;
  font-size: 12.5px;
  min-height: 28px;
}
/* biały tekst tylko na tłach, na których ma kontrast co najmniej 4,5:1 (niebieski, czerwony); na szarym, pomarańczowym i zielonym tusz */
.vform .st button.on {
  color: var(--ink);
  font-weight: 600;
  border-color: var(--ink);
  position: relative;
}
.vform .st button.on[data-st='t'],
.vform .st button.on[data-st='p'] {
  color: #fff;
}
.vform .st button:focus-visible {
  z-index: 1;
  position: relative;
}
.vform textarea {
  display: block;
  width: calc(100% - 16px);
  min-height: 56px;
  margin: 8px;
  resize: vertical;
}
.vform .hint {
  margin: 0 8px 7px;
}

/* ---------- listy */
.list .it {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid var(--rule2);
  cursor: pointer;
}
.list .it:hover {
  background: var(--acc-soft);
}
.list .it:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: -2px;
}
.list .it.cur {
  background: var(--mark-soft);
  box-shadow: inset 3px 0 0 var(--mark);
}
.list .it > div {
  min-width: 0;
  flex: 1 1 auto;
}
.list .it b {
  font-family: var(--fc);
  font-weight: 600;
}
.list .it small {
  color: var(--ink2);
  display: block;
  line-height: 1.3;
}
.list .it .ha {
  margin-left: auto;
  white-space: nowrap;
  color: var(--ink2);
  font-size: 12px;
}
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.t th {
  font-weight: 500;
  color: var(--ink2);
  border-bottom: 1px solid var(--rule);
}
table.t th,
table.t td {
  padding: 3px 5px;
  border-bottom: 1px solid var(--rule2);
  text-align: right;
  vertical-align: top;
}
table.t th:first-child,
table.t td:first-child {
  text-align: left;
}
.bar {
  height: 5px;
  background: var(--acc);
  min-width: 1px;
  margin-top: 2px;
}

/* ---------- stopka */
#status {
  flex: 0 0 auto;
  display: flex;
  gap: 18px;
  padding: 4px 12px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
}
#st-zoom {
  color: var(--ink);
  font-weight: 500;
  min-width: 150px;
}
#st-xy {
  min-width: 170px;
}
#st-2178 {
  min-width: 210px;
}
#status .src {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#status #bsrc {
  flex: 0 0 auto;
  font-size: 12px;
  min-height: 0;
}
/* okno „Źródła danych” */
#modal .box table.srct {
  border-collapse: collapse;
  width: 100%;
  margin: 4px 0 10px;
}
#modal .box table.srct th,
#modal .box table.srct td {
  text-align: left;
  vertical-align: top;
  padding: 4px 8px 4px 0;
  border-top: 1px solid var(--rule2);
  font-size: 12.5px;
}
#modal .box table.srct th {
  font-weight: 600;
  width: 34%;
}
/* komunikat dla przeglądarki bez JavaScriptu */
.nojs {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ground);
}
.nojs div {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 16px 24px;
  max-width: 460px;
  box-shadow: 4px 4px 0 rgba(26, 34, 38, 0.18);
}

/* ---------- okna na mapie */
#mapbtns {
  position: absolute;
  top: calc(10px + var(--nh, 0px));
  right: 22px;
  z-index: 6;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100% - 80px);
}
.mapbtn {
  min-height: 30px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 5px 12px;
  box-shadow: 2px 2px 0 rgba(26, 34, 38, 0.18);
}
.mapbtn[aria-expanded='true'] {
  background: var(--ink);
  color: #fff;
}
.float {
  z-index: 5;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(26, 34, 38, 0.16);
  display: flex;
  flex-direction: column;
}
.fhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 4px 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--ground);
  flex: 0 0 auto;
}
.fhead b {
  font-weight: 600;
}
.fhead button {
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
  min-width: 28px;
  min-height: 28px;
  color: var(--ink2);
}
.fhead button:hover {
  color: var(--ink);
}
.fbody {
  padding: 9px 11px;
  overflow: auto;
  min-height: 0;
}
#p3d .hint {
  margin: 6px 0 0;
}
#p3d .btnrow.sub {
  margin: 2px 0 4px 22px;
}
#p3d .row output {
  flex: 0 0 40px;
}
#d-meshinfo {
  margin: 2px 0 6px 22px !important;
}
#p3d .leg {
  margin: 2px 0 4px 0;
  font-size: 12px;
}
/* objaśnienie kolorów budynków w oknie „Widok 3D”: zwinięte, a gdy okno „Legenda” jest otwarte, tylko odsyłacz do niego */
#d-bldleg {
  margin: 2px 0 4px 22px !important;
}
#d-bldinfo details {
  margin-top: 2px;
}
#p3d details > summary {
  cursor: pointer;
  color: var(--acc);
  font-size: 12.5px;
}
#d-notedet {
  margin: 6px 0 0;
}
#d-notedet .hint {
  margin-top: 2px;
}
#d-bldleg summary {
  cursor: pointer;
  color: var(--acc);
  font-size: 12.5px;
}
#d-bldleg details[open] {
  margin-bottom: 4px;
}
#d-bldleg button.lnk {
  font-size: 12.5px;
}
/* objaśnienie tekstowe w legendzie (progi tolerancji) i kreskowana próbka stref bez określonej wysokości */
.leg div.lnote {
  display: block;
  color: var(--ink2);
  font-size: 11.5px;
  line-height: 1.35;
  padding: 3px 0 1px;
}
.sw.hatch {
  background: repeating-linear-gradient(135deg, #fff, #fff 3px, #8a9499 3px, #8a9499 4.5px);
}
.hint .warn,
.hint.warn {
  color: #b3261e;
}
button.lnk {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--acc, #0b5a66);
  text-decoration: underline;
  cursor: pointer;
}
#focusbar table.t small {
  color: var(--ink2);
}
#focusbar table.t td:nth-child(2) {
  white-space: nowrap;
}
#focusbar details {
  margin: 6px 0;
}
#focusbar summary {
  cursor: pointer;
  color: var(--acc);
  font-size: 12.5px;
}
#focusbar .hint {
  margin: 6px 0;
}
/* okno klikniętego budynku; gdy otwarta jest legenda na mapie, staje obok niej */
#bldbar dl {
  grid-template-columns: 43% 57%;
  gap: 5px 0;
  margin: 0 0 6px;
}
#bldbar dd small {
  color: var(--ink2);
  font-size: 11.5px;
  line-height: 1.3;
  display: inline-block;
}
#bldbar .hint {
  margin: 6px 0 0;
}
#bldbar .nd {
  color: var(--ink2);
}
#bldbar b.bad {
  color: #b3261e;
}
#bldbar b.warn {
  color: #a15c00;
}
#bldbar b.ok {
  color: #0b4f8a;
}
.maplibregl-popup-content {
  font: 12.5px/1.4 var(--f);
  border-radius: 0;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(26, 34, 38, 0.16);
  padding: 8px 26px 8px 10px;
  color: var(--ink);
}
.maplibregl-popup-content b {
  font-weight: 600;
}
.maplibregl-popup-tip {
  display: none;
}
.maplibregl-ctrl-group {
  border-radius: 3px !important;
  box-shadow: 0 0 0 1px var(--ink) !important;
}
.maplibregl-ctrl-scale {
  font: 11.5px var(--f);
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- okno pomocy i wczytywanie */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 34, 38, 0.45);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal .box {
  background: var(--paper);
  border: 1px solid var(--ink);
  max-width: 720px;
  width: 92%;
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px 26px;
  position: relative;
  box-shadow: 6px 6px 0 rgba(26, 34, 38, 0.25);
}
#modal .box p,
#modal .box li {
  max-width: 68ch;
}
#modal .box li {
  margin: 4px 0;
}
#modal .box h2 {
  padding-right: 90px;
}
#modal .box ul,
#modal .box ol {
  padding-left: 20px;
  margin: 4px 0;
}
/* przewija się treść, a nie całe okno: przycisk Zamknij zostaje na miejscu */
#mbody {
  overflow: auto;
  min-height: 0;
}
.vform .undo {
  display: block;
  margin: 2px 0 4px;
}
#wrestore .vrow {
  margin: 6px 0;
}
#mclose {
  position: absolute;
  right: 14px;
  top: 14px;
  background: var(--paper);
  border: 1px solid var(--ink2);
  border-radius: 3px;
  padding: 3px 10px;
}
#loading {
  position: fixed;
  inset: 0;
  background: rgba(236, 238, 237, 0.9);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loading div {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 16px 24px;
  box-shadow: 4px 4px 0 rgba(26, 34, 38, 0.18);
}
#loading b {
  font-weight: 600;
  font-size: 15px;
}
#loading span {
  display: block;
  color: var(--ink2);
  margin-top: 3px;
}
#loading div {
  max-width: 520px;
}
#loading.fail div {
  border-left: 5px solid var(--crit);
}
#loading.fail span {
  color: var(--ink);
}

#print {
  display: none;
}
@media (max-width: 1180px) {
  #left {
    width: 270px;
  }
  #right {
    width: 350px;
  }
  .seg button,
  .seg a.btn {
    padding: 5px 8px;
  }
  .tabs button {
    padding: 6px 2px 7px;
  }
  #status .src {
    display: none;
  }
  #status #bsrc {
    margin-left: auto;
  }
}
@media (max-width: 1320px) {
  .brand small {
    display: none;
  }
}
@media (max-width: 760px) {
  #st-2178 {
    display: none;
  }
  #left,
  #right {
    max-width: 86vw;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- okna na mapie: dwie kolumny, w których okna układają się jedno pod drugim; okno przeciągnięte (.free) ma własne miejsce */
.dock {
  position: absolute;
  top: calc(10px + var(--nh, 0px));
  bottom: 34px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
/* prawa kolumna (legenda, budynek) zaczyna się pod przyciskami na mapie; lewa (pomiar, strefa, widok 3D) obok przycisków powiększania */
#dockr {
  top: calc(48px + var(--nh, 0px));
  right: 22px;
  width: clamp(236px, 42%, 316px);
  align-items: flex-end;
}
#dockl {
  left: 54px;
  width: min(372px, calc(100% - 84px - clamp(236px, 42%, 316px)));
  min-width: 200px;
}
/* wąska mapa (poniżej 520 px, klasa ustawiana w WIN.fit): kolumny jedna pod drugą, lewa w górnej połowie, prawa w dolnej */
#mapwrap.narrow #dockl {
  top: calc(48px + var(--nh, 0px));
  width: auto;
  min-width: 0;
  right: 22px;
  bottom: 50%;
}
#mapwrap.narrow #dockr {
  left: 54px;
  width: auto;
  top: calc(50% + 4px);
  align-items: flex-start;
}
#mapwrap.narrow .dock > #p3d {
  margin-top: 0;
}
/* przycisk odstawienia okna do kolumny: tylko przy oknie przeciągniętym */
.float:not(.free) .fdock {
  display: none;
}
.float.min > .fhead {
  background: var(--mark-soft);
}
#mapwrap .dock > .float {
  position: static;
  pointer-events: auto;
  width: 100%;
  max-width: 100%;
  flex: 0 1 auto;
  min-height: 31px;
}
#mapwrap .dock > #p3d {
  max-width: 306px;
  margin-top: auto;
}
#mapwrap .dock > #flegend {
  max-width: 268px;
}
#mapwrap .dock > #measure {
  max-width: 330px;
  flex: 0 0 auto;
}
#mapwrap > .float.free {
  position: absolute;
  z-index: 7;
}
.float.min > .fbody {
  display: none;
}
.float.min {
  flex: 0 0 auto;
}
.float.min > .fhead {
  border-bottom: 0;
}
.fhead {
  cursor: move;
  touch-action: none;
  user-select: none;
  gap: 6px;
}
.fhead > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fbtns {
  display: flex;
  flex: 0 0 auto;
}
body.dragging {
  user-select: none;
  cursor: move;
}
body.dragging iframe {
  pointer-events: none;
}
.float .btnrow {
  margin-bottom: 2px;
}
#measure .fbody {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
#ms-val {
  font-weight: 600;
  font-size: 14px;
}
#measure .msbtn {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
#measure .msbtn button {
  background: var(--paper);
  border: 1px solid var(--ink2);
  border-radius: 3px;
  padding: 3px 9px;
}
#measure .msbtn button:hover {
  background: var(--ground);
}
#focusbar table.t td:nth-child(2) {
  white-space: normal;
}

/* ---------- pasek powiadomień u góry mapy */
/* dwa wiersze: trwały błąd i zwykły komunikat. Na czas komunikatu okna i przyciski na mapie zsuwają się pod pasek (zmienna --nh). */
#notice {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  width: max-content;
  max-width: min(640px, calc(100% - 120px));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#notice .nrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--acc);
  color: #fff;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(26, 34, 38, 0.2);
  padding: 7px 6px 7px 12px;
  font-weight: 500;
  line-height: 1.35;
}
#notice .nrow > span {
  flex: 1 1 auto;
}
#notice .nrow.err {
  background: #fbeceb;
  color: var(--crit);
  border-color: var(--crit);
  font-weight: 600;
}
#notice button {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  min-width: 26px;
  min-height: 24px;
  padding: 0 6px;
}
#notice button:focus-visible {
  outline-color: currentColor;
}

/* ---------- zwijanie paneli bocznych: wąski przycisk na krawędzi mapy */
.pcol {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  width: 20px;
  height: 88px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* niewidoczne pole trafienia szersze od paska, tylko w stronę mapy */
.pcol::before {
  content: '';
  position: absolute;
  top: -8px;
  bottom: -8px;
}
#cl-left::before {
  left: 0;
  right: -10px;
}
#cl-right::before {
  right: 0;
  left: -10px;
}
main.nol .pcol#cl-left,
main.nor .pcol#cl-right {
  width: 24px;
}
main.nol .pcol#cl-left i,
main.nor .pcol#cl-right i {
  width: 9px;
  height: 9px;
  border-width: 0 0 3px 3px;
}
/* w zwiniętym panelu czeka nowa karta */
.pcol.new {
  background: var(--acc) !important;
}
.pcol.new i {
  border-color: #fff;
}
.pcol:hover {
  background: var(--mark-soft);
}
#cl-left {
  left: 0;
  border-left: 0;
  border-radius: 0 3px 3px 0;
}
#cl-right {
  right: 0;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}
/* znak kierunku rysowany ramką: wskazuje stronę, w którą panel się schowa albo z której wróci */
.pcol i {
  width: 7px;
  height: 7px;
  border: solid var(--ink);
  border-width: 0 0 2px 2px;
  transform: translateX(2px) rotate(45deg);
}
#cl-right i,
main.nol #cl-left i {
  transform: translateX(-2px) rotate(225deg);
}
main.nor #cl-right i {
  transform: translateX(2px) rotate(45deg);
}
main.nol #left,
main.nor #right {
  display: none;
}
main.nol .pcol#cl-left,
main.nor .pcol#cl-right {
  background: var(--mark);
}

/* ---------- odnośniki do analizy i instrukcji, objaśnienia sygnałów */
a.doc {
  white-space: normal;
}
.row a.inf,
#f-fl a.inf {
  flex: 0 0 auto;
  font-size: 12px;
  padding: 4px 2px;
}
#f-fl .row > span {
  flex: 1 1 auto;
}
details.sgh {
  margin: 4px 0 8px;
  font-size: 12.5px;
}
details.sgh summary,
.zl summary {
  cursor: pointer;
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px 0;
}
details.sgh ul {
  margin: 4px 0;
  padding-left: 18px;
}
details.sgh li {
  margin: 4px 0;
}
.zl {
  line-height: 1.9;
}
.zl a {
  margin-right: 6px;
  white-space: nowrap;
}
.vrow > a {
  text-decoration: none;
}
.vrow > a:hover b {
  text-decoration: underline;
}
.multi {
  background: var(--mark-soft);
  border: 1px solid var(--ink);
  padding: 6px 8px;
  margin: 0 0 10px;
  font-size: 12.5px;
}
.multi b {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.multi button {
  margin: 2px 4px 2px 0;
}
.multi button.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.vform .how {
  margin-top: -3px;
}
.whowarn b {
  color: var(--crit);
  font-weight: 600;
}
.vform .hint.warn {
  font-weight: 600;
}
.hint.warnbox {
  border-left: 3px solid var(--mark);
  background: var(--mark-soft);
  color: var(--ink);
  padding: 7px 9px;
  margin: 8px 0;
}
.stleg {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink2);
}
.stleg span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
#modal .box li .dot {
  vertical-align: -1px;
}
.btnrow a.doc {
  padding: 4px 0;
}

/* ---------- podgląd rozdziału analizy albo instrukcji: panel z prawej strony, mapa zostaje widoczna z lewej */
#doc {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(780px, 56vw);
  min-width: min(100vw, 420px);
  z-index: 45;
  background: var(--paper);
  border-left: 2px solid var(--ink);
  box-shadow: -6px 0 0 rgba(26, 34, 38, 0.16);
  display: flex;
  flex-direction: column;
}
#doc .dhead {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 6px 6px 14px;
  background: var(--ground);
  border-bottom: 1px solid var(--ink);
  flex: 0 0 auto;
}
#doc .dhead b {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}
#doc .dhead button {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  min-width: 32px;
  min-height: 30px;
  color: var(--ink2);
}
#doc .dhead button:hover {
  color: var(--ink);
}
#doc iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  min-height: 0;
}

/* ---------- wydruk: arkusz A4 poziomo z mapą, podziałką i legendą */
@page {
  size: A4 landscape;
  margin: 10mm;
}
@media print {
  html,
  body {
    height: auto;
    overflow: visible;
    background: #fff;
  }
  body {
    display: block;
    font-size: 10pt;
  }
  #top,
  main,
  #status,
  #modal,
  #doc,
  #loading {
    display: none !important;
  }
  #print {
    display: block;
  }
  .phead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12mm;
    border-bottom: 1.5pt solid #000;
    padding-bottom: 2mm;
    margin-bottom: 3mm;
  }
  .phead b {
    font-size: 13pt;
    font-weight: 600;
    display: block;
  }
  .phead span,
  #ph-right {
    font-size: 9pt;
    color: #333;
  }
  #ph-right {
    text-align: right;
    white-space: nowrap;
  }
  .pmap {
    position: relative;
    border: 0.75pt solid #000;
    line-height: 0;
    display: table;
    margin: 0 auto;
  }
  #printimg {
    max-width: 100%;
    max-height: 120mm;
    width: auto;
    height: auto;
  }
  #pbar {
    position: absolute;
    left: 3mm;
    bottom: 3mm;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.2mm 2mm;
    line-height: 1.2;
    font-size: 8.5pt;
    text-align: left;
  }
  #pbar i {
    display: block;
    height: 1.6mm;
    border: 0.75pt solid #000;
    border-top: 0;
    margin-bottom: 0.6mm;
  }
  #printleg {
    margin-top: 3mm;
    font-size: 8.5pt;
    column-count: 4;
    column-gap: 7mm;
  }
  #printleg .leg section {
    margin-bottom: 2.5mm;
  }
  #printleg .leg b {
    break-after: avoid;
  }
  #printleg .leg div {
    break-inside: avoid;
  }
  #printleg .leg section.na {
    display: none;
  }
  #printleg .sw,
  #printleg .dot {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pfoot {
    margin-top: 2mm;
    border-top: 0.5pt solid #000;
    padding-top: 1.5mm;
    font-size: 8pt;
    color: #333;
  }
}
