/* report-bug.css — przycisk „Zgłoś błąd" + kafelek (czat) ze zrzutem ekranu */

/* v6.37.7 (feedback usera): STAŁA pozycja — na LEWO od przycisków zoom (+/-), NAD przełącznikiem
   „mapa / obrys działek", z wyraźnym odstępem od obu. ZAWSZE widoczny (także przy otwartym raporcie):
   z-index ponad panelem raportu (.parcel-drawer = 2600). Pozycje per breakpoint — patrz niżej.
   Pomiar na żywo (1536×695): zoom prawy-dół right:24/bottom:24 (szer.42), pasek warstw right:84/bottom:24
   (wys.47). Guzik right:84/bottom:84 → 18px na lewo od zoomu, 13px nad paskiem warstw, zero kolizji. */
.report-bug-btn {
  position: fixed;
  right: 84px;
  left: auto;
  bottom: 84px;
  z-index: 2700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid rgba(16, 50, 33, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #103221;
  font: 700 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(4, 26, 14, 0.18);
  backdrop-filter: blur(6px);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.report-bug-btn:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(4, 26, 14, 0.24); }
.report-bug-btn:active { transform: translateY(0); }
.report-bug-btn .rbug-ico { font-size: 15px; line-height: 1; }

/* Nakładka + kafelek */
.rbug-overlay {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(6, 20, 12, 0.46);
  backdrop-filter: blur(3px);
}
.rbug-overlay[hidden] { display: none; }
body.rbug-lock { overflow: hidden; }

.rbug-card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(4, 26, 14, 0.34);
  animation: rbug-pop .16s ease;
}
@keyframes rbug-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.rbug-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  font: 800 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #106238, #17824d);
}
.rbug-x {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.rbug-x:hover { background: rgba(255, 255, 255, 0.30); }

.rbug-body { padding: 14px 16px 16px; overflow-y: auto; }
.rbug-hint { margin: 0 0 10px; font-size: 12.5px; color: #5d7064; line-height: 1.45; }

.rbug-shot {
  position: relative;
  border: 1px solid rgba(16, 50, 33, 0.12);
  border-radius: 12px;
  background: #f1f4f1;
  overflow: hidden;
  margin-bottom: 12px;
}
.rbug-shot img { display: block; width: 100%; max-height: 230px; object-fit: contain; background: #e8ede9; }
.rbug-shot-cap {
  display: block; padding: 7px 10px;
  font-size: 11px; color: #6b7d71; background: #fff;
  border-top: 1px solid rgba(16, 50, 33, 0.08);
}
.rbug-shot--loading { min-height: 120px; }
.rbug-shot--loading img { min-height: 120px; }
.rbug-shot--failed { background: #fff4f0; }
.rbug-shot--failed .rbug-shot-cap { color: #b5471f; background: #fff4f0; }

.rbug-msg, .rbug-email {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid rgba(16, 50, 33, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #103221; background: #fff;
  outline: none;
  transition: border-color .12s ease;
}
.rbug-msg { resize: vertical; min-height: 84px; margin-bottom: 10px; }
.rbug-msg:focus, .rbug-email:focus { border-color: #17ad52; }
.rbug-label { display: grid; gap: 5px; margin: 0 0 10px; color: #365444; font-size: 12px; font-weight: 700; }
.rbug-type { width: 100%; min-height: 44px; border: 1.5px solid rgba(16, 50, 33, .16); border-radius: 12px; padding: 8px 10px; color: #103221; background: #fff; font: 600 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.rbug-type:focus-visible { outline: 3px solid rgba(23, 173, 82, .35); outline-offset: 2px; border-color: #17ad52; }

.rbug-actions { margin-top: 12px; }
.rbug-send {
  width: 100%; border: 0; border-radius: 12px;
  padding: 13px; cursor: pointer;
  font: 800 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #17ad52, #0f8f41);
  box-shadow: 0 8px 18px rgba(23, 173, 82, 0.30);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.rbug-send:hover { transform: translateY(-1px); }
.rbug-send:disabled { opacity: .6; cursor: default; transform: none; }

.rbug-status { margin-top: 10px; min-height: 18px; font-size: 12.5px; font-weight: 700; color: #5d7064; }
.rbug-status--ok  { color: #0f8f41; }
.rbug-status--err { color: #c0392b; }

/* AUDYT-V2 A4 (2026-07-11): przy OTWARTYM raporcie pływak jest CHOWANY (wcześniej force-show
   inline-flex → na desktopie nachodził na treść drawera przy scrollu). Zgłoszenie z raportu robi
   wbudowany przycisk w stopce karty (.ig-report-bug-cta), który przewija się z treścią. */
body.report-open .report-bug-btn { display: none !important; }

/* AUDYT-V2 A4: wbudowany („inline") wariant przycisku na KONIEC treści — jeden wzorzec dla wszystkich
   przewijanych widoków (raport, strona gminy). Nie fixed → przewija się z treścią, nie nachodzi.
   Zdefiniowany też w finalize-2026.css (raport na home); tu dla stron ładujących report-bug.css bez
   finalize (np. /gmina). Wartości identyczne. */
.ig-report-bug-row { margin-top: 14px; display: flex; justify-content: center; }
.ig-report-bug-cta {
  appearance: none;
  border: 1px solid rgba(225, 29, 72, 0.28);
  background: rgba(225, 29, 72, 0.06);
  color: #b4123a;
  font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ig-report-bug-cta:hover { background: rgba(225, 29, 72, 0.12); }
.ig-report-bug-cta:active { transform: translateY(1px); }

/* Dolna reklama (sticky) wypycha kontrolki mapy w górę (~+84px) — guzik jedzie razem z nimi. */
body.bottom-ad-active.has-map-shell .report-bug-btn { bottom: 168px; }

/* Tablet (769–860px): pasek „mapa/obrys" przeskakuje w prawy-GÓRNY róg, a zoom zostaje w prawym-dole.
   Trzymamy guzik w prawym-dole, wyraźnie NAD zoomem (zoom: bottom ~20px) — bez kolizji. */
@media (min-width: 769px) and (max-width: 860px) {
  .report-bug-btn { right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); }
  body.bottom-ad-active.has-map-shell .report-bug-btn { bottom: calc(env(safe-area-inset-bottom, 0px) + 200px); }
}

/* Mobile (≤768px): zoom ląduje w lewym-dole, a „mapa/obrys" w prawym-dole. Guzik trzymamy
   w prawym-dole, wyraźnie NAD paskiem „mapa/obrys" (toggle: bottom ~26px, wys. ~44px) — dzięki
   czemu nie nachodzi ani na zoom (lewy-dół), ani na pasek warstw. Kafelek czatu nieco mniejszy. */
@media (max-width: 768px) {
  .report-bug-btn { right: 14px; left: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); padding: 8px 12px; font-size: 12px; }
  body.bottom-ad-active.has-map-shell .report-bug-btn { bottom: calc(env(safe-area-inset-bottom, 0px) + 166px); }
  .rbug-card { width: 100%; max-height: calc(100dvh - 24px); }
  .rbug-shot img { max-height: 180px; }
}
