/* Publiczna mapa „czy da się budować” – dopełnia styles.css (te same zmienne, czcionki, przyciski). */
:root {
  --s-mpzp: #0e7c86; --s-pog_ouz: #7fb83e; --s-pog_poza_ouz: #f0a81d; --s-pog_nie_obowiazuje: #8e6bc4; --s-brak_pog: #c0392b;
  --s-mpzp_czesciowo: #0e7c86;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s-mpzp: #3cc0cc; --s-pog_ouz: #a2d65f; --s-pog_poza_ouz: #f5be4a; --s-pog_nie_obowiazuje: #b39ae0; --s-brak_pog: #ef6e61;
    --s-mpzp_czesciowo: #3cc0cc;
  }
}

/* strona przewija się jak zwykła strona; mapa ma stałą wysokość na wąskich ekranach */
body.pub { height: auto; min-height: 100dvh; overflow: auto; display: block; }
body.pub .topbar { position: sticky; top: 0; }
.topbar-title { font: 600 .95rem var(--f-display); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .btn.primary { margin-left: auto; text-decoration: none; }
a.brand { color: inherit; text-decoration: none; }

.pubmain { display: grid; grid-template-columns: minmax(0, 1fr) 430px; height: calc(100dvh - var(--topbar-h)); }
.mapcol { position: relative; min-height: 0; min-width: 0; }
.mapcol #map { position: absolute; inset: 0; }
.side { overflow-y: auto; background: var(--bg); border-left: 1px solid var(--line); overscroll-behavior: contain; }
.side:focus { outline: none; }
.side-inner { padding: 20px 20px 36px; display: flex; flex-direction: column; gap: 10px; }
.side h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.015em; }
.sec { font-size: 1.05rem; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.explain { display: flex; flex-direction: column; gap: 8px; font-size: .95rem; margin-top: 4px; }
.explain p { max-width: 62ch; }

.headline { margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-left: 5px solid var(--s-brak_pog); border-radius: 10px; background: var(--paper); font-size: .92rem; }
.headline strong { font: 800 1.5rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; display: block; }

/* legenda */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.legend button, .legend .static {
  width: 100%; text-align: left; display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.legend button:hover { border-color: var(--accent); }
.legend button[aria-pressed="false"] { opacity: .5; }
.legend button[aria-pressed="false"] .lg-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.lg-sw { width: 20px; height: 20px; border-radius: 5px; margin-top: 1px; background: var(--c); border: 1px solid rgba(0, 0, 0, .18); }
.lg-sw.hatch { background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); }
.lg-name { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.lg-desc { grid-column: 2; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.legend-note { margin-top: 2px; }

/* gminy */
.gminy { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gm { width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 5px; }
.gm:hover, .gm:focus-visible { border-color: var(--accent); }
.gm-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gm-name { font: 700 1rem var(--f-display); }
.gm-area { font: 400 .74rem var(--f-mono); color: var(--muted); white-space: nowrap; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--na-bg); border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--c); min-width: 0; }
.gm-pcts { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8rem; }
.gm-pcts span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.gm-pcts i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); display: inline-block; }
.gm-warn { font-size: .76rem; line-height: 1.35; color: var(--warn); }
.gm-pog { font-size: .78rem; color: var(--muted); line-height: 1.35; }

.foot { display: flex; flex-direction: column; gap: 8px; }
.foot p { max-width: 62ch; }

/* wynik po kliknięciu */
.verdict {
  position: absolute; z-index: 12; left: 12px; bottom: 36px; width: min(380px, calc(100% - 24px));
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px 14px;
  border-top: 5px solid var(--c, var(--accent));
}
.verdict .x { position: absolute; top: 6px; right: 6px; }
.v-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--c); color: #fff; font: 700 .95rem/1.2 var(--f-display); padding: 5px 13px 5px 10px; border-radius: 99px; max-width: calc(100% - 28px); }
:root[data-theme="dark"] .v-pill { color: #0b1210; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .v-pill { color: #0b1210; } }
.v-pill i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .75; flex: none; }
.v-where { margin-top: 8px; font-size: .86rem; color: var(--muted); }
.v-text { margin-top: 6px; font-size: .92rem; }
.v-pct { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.v-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v-actions a.btn { text-decoration: none; }
.v-load { color: var(--muted); font-size: .9rem; }

.maphint { bottom: 12px; }
.maplegend { display: none; }

/* wąskie ekrany: mapa na górze, opis pod mapą, werdykt jako karta przy dolnej krawędzi mapy */
@media (max-width: 860px) {
  .pubmain { display: block; height: auto; }
  .mapcol { height: 62dvh; min-height: 360px; }
  .side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .side-inner { padding: 18px 16px 40px; max-width: 720px; margin: 0 auto; }
  .topbar-title { display: none; }
  .verdict { left: 8px; right: 8px; bottom: 28px; width: auto; }
  .maplegend {
    display: flex; flex-wrap: wrap; gap: 3px 10px; position: absolute; z-index: 9; top: 8px; left: 8px; right: 56px;
    background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: .72rem; line-height: 1.3;
  }
  .maplegend span { display: inline-flex; align-items: center; gap: 4px; }
  .maplegend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); display: inline-block; flex: none; }
}
@media (max-width: 460px) {
  .side h1 { font-size: 1.4rem; }
  .topbar .btn.primary { padding: 7px 10px; font-size: .88rem; }
  .brand-name { font-size: 1.05rem; }
}

/* wybór regionu (T11): etykieta i lista nad legendą */
.region { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; flex-wrap: wrap; }
.region label { font-size: .9rem; font-weight: 600; }
.region select { flex: 1 1 200px; max-width: 280px; }
