/* Informacja o miejscu: działka, geoportal, profil terenu
   Wydzielone z dawnego 20-legacy.css (17.8.3, 2577 linii) — podział wyłącznie
   mechaniczny, żadna reguła nie zmieniła treści. Kolejność reguł w tym pliku
   jest zachowana z oryginału; tam gdzie ten sam selektor pojawiał się w
   pliku dwukrotnie (np. późniejsza poprawka odstępów), obie deklaracje
   trafiły do TEGO SAMEGO pliku w tej samej kolejności — kaskada więc działa
   identycznie jak wcześniej. Ten plik nadal deklaruje warstwę „legacy"
   (patrz 00-layers.css) — kolejność linków w index.html decyduje o
   kolejności w warstwie, nie nazwa pliku.
*/
@layer legacy {
/* 13.9 — Informacja o miejscu */
.identify-panel {
  position: absolute;
  z-index: var(--z-dock-overlay);
  left: 58px;
  bottom: 39px;
  width: 340px;
  max-width: calc(100vw - 132px);
  max-height: min(68vh, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}
.identify-panel.is-pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.identify-panel-body { min-height: 0; overflow: auto; padding: 8px; }
.identify-loading,
.identify-empty,
.identify-error,
.identify-progress {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}
.identify-error { color: var(--danger); }
.identify-progress { margin-top: 7px; }
.identify-message { margin-top: 7px; padding: 7px 8px; border-radius: 7px; font-size: var(--fs-xs); line-height: 1.35; }
.identify-message--error { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface-raised)); }

@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .identify-panel { left: 52px; right: 8px; width: auto; max-width: none; max-height: 58vh; }
}

/* Informacja o miejscu */
.identify-panel--compact { width: 322px; max-height: min(62vh, 560px); }
.identify-panel--compact .identify-panel-body { padding: 6px; }
.identify-section-heading { margin: 2px 3px 5px; color: var(--text); font-size: var(--fs-md); }
.identify-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}
.identify-fact {
  min-width: 0;
  padding: 5px 7px;
  display: grid;
  gap: 1px;
  background: var(--surface-raised);
}
.identify-fact--wide { grid-column: 1 / -1; }
.identify-fact span { color: var(--text-faint); font-size: var(--fs-xs); }
.identify-fact strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identify-fact-value { display: flex; align-items: center; gap: 5px; min-width: 0; }
.identify-fact-value strong { flex: 1; }
.identify-fact-value button { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; color: var(--text-muted); background: transparent; cursor: pointer; }
.identify-fact-value button:hover, .identify-fact-value button:focus-visible { color: var(--accent); background: var(--surface-hover); }
.identify-layer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.identify-layer-dot--ready { background: var(--success); }
.identify-layer-dot--loading { background: var(--warning); }
.identify-layer-dot--error { background: var(--danger); }
.identify-layer-detail {
  margin: 0;
  padding: 5px 8px 7px 21px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
  white-space: pre-line;
}
.identify-panel--compact .identify-progress { margin: 5px 2px 0; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .identify-panel--compact { max-height: 54vh; }
}@media (max-width: 1366px) and (max-height: 820px) {
  .identify-panel { bottom: 35px; }
  .identify-panel--compact { max-height: 56vh; }
}@media (max-width: 620px) {
  .identify-panel.panel-minimized--identify {
      left: 52px !important;
      right: auto !important;
      bottom: 35px !important;
      width: 42px !important;
    }
}

/* 14.3 — Informacja o działce+ */
.identify-panel--parcelplus { width: 372px; max-height: min(72vh, 700px); }
.parcelplus-disclaimer {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 7px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-raised));
  font-size: var(--fs-xs);
  line-height: 1.35;
}
.parcelplus-section { margin-top: 7px; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.parcelplus-section-head {
  min-height: 24px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  background: var(--surface-raised);
}
.parcelplus-section-head::-webkit-details-marker { display: none; }
.parcelplus-section-head::before { content: '›'; color: var(--text-muted); font-size: var(--fs-xl); line-height: 1; }
.parcelplus-section[open] .parcelplus-section-head::before { transform: rotate(90deg); }
.parcelplus-section-head:hover { background: var(--surface-hover); }
.parcelplus-section-content { padding: 4px; }
.parcelplus-section-head strong { font-size: var(--fs-md); }
.parcelplus-section-head small {
  min-width: 27px;
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-raised);
  text-align: center;
  font-size: var(--fs-xs);
}
.parcelplus-note {
  margin: -1px 3px 4px;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  line-height: 1.3;
}
.parcelplus-list {
  display: grid;
  gap: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--border);
}
.parcelplus-row {
  overflow: hidden;
  background: var(--surface-solid);
}
.parcelplus-row summary {
  min-height: 29px;
  padding: 0 7px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}
.parcelplus-row summary::-webkit-details-marker { display: none; }
.parcelplus-row summary:hover { background: var(--surface-hover); }
.parcelplus-row summary strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identify-layer-copy { min-width: 0; display: grid; gap: 2px; }
.identify-layer-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.parcelplus-status {
  min-width: 34px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-raised);
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.parcelplus-row .identify-layer-detail { padding-left: 21px; }
/* 17.8.10 — uproszczony widok: sekcje screeningu chowają domyślnie źródła
   bez wyniku; ta linijka wyjaśnia, że zostały sprawdzone, a przycisk
   pozwala je jednak pokazać (np. do dokumentacji negatywnego wyniku). */
.parcelplus-note--empty {
  margin: 3px 3px 0;
  padding: 6px 8px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
}
.parcelplus-more-toggle {
  margin: 4px 3px 0;
  padding: 3px 6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.parcelplus-more-toggle:hover { color: var(--text); background: var(--surface-hover); }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .identify-panel--parcelplus { width: auto; max-height: 64vh; }
}
.map-selection-hint {
  position: absolute; z-index: 70; top: 12px; left: 50%; transform: translateX(-50%);
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent); color: var(--text);
  box-shadow: var(--shadow-soft); font-size: var(--fs-md); font-weight: 600; pointer-events: none;
}

/* 16.5.0 — Map Utilities: context menu + terrain profile */
.map-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 168px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}
.map-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.map-context-menu button:hover { background: var(--hover-bg); }

.terrain-profile-panel {
  position: absolute;
  z-index: 36;
  left: 54px;
  right: 12px;
  bottom: 34px;
  max-width: 860px;
  min-width: 420px;
  padding: 0;
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.terrain-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.terrain-profile-header > div { display: flex; flex-direction: column; gap: 1px; }
.terrain-profile-header small { opacity: .68; font-size: var(--fs-md); }
.terrain-profile-loading, .terrain-profile-error {
  display: flex; align-items: center; gap: 8px; padding: 12px;
}
.terrain-profile-error { justify-content: space-between; color: var(--danger); }
.terrain-profile-body { padding: 9px 11px 8px; }
.terrain-profile-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 5px;
  margin-bottom: 7px;
}
.terrain-profile-stats span {
  display: flex; flex-direction: column; gap: 1px;
  padding: 5px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--text-muted) 8%, transparent);
}
.terrain-profile-stats b { font-size: var(--fs-md); white-space: nowrap; }
.terrain-profile-stats small { font-size: var(--fs-xs); opacity: .65; }
.terrain-profile-chart { width: 100%; height: 190px; }
.terrain-profile-chart svg { width: 100%; height: 100%; overflow: visible; }
.terrain-axis { stroke: currentColor; stroke-opacity: .28; stroke-width: 1; }
.terrain-profile-fill { fill: color-mix(in srgb, var(--chart-line) 12%, transparent); stroke: none; }
.terrain-profile-line { fill: none; stroke: var(--chart-line); stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.terrain-chart-label { fill: currentColor; opacity: .7; font-size: var(--fs-sm); }
.terrain-profile-note { margin-top: 2px; font-size: var(--fs-sm); opacity: .65; text-align: right; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .terrain-profile-panel { left: 8px; right: 8px; bottom: 32px; min-width: 0; }
  .terrain-profile-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .terrain-profile-chart { height: 150px; }
}

/* 16.5.0 — Geoportal context action + parcel terrain analysis */
.terrain-hover-line { stroke: currentColor; stroke-width: 1; stroke-dasharray: 3 3; opacity: .45; }
.terrain-hover-point { fill: var(--surface-solid); stroke: var(--text); stroke-width: 2; }
.terrain-hover-label { fill: currentColor; font-size: var(--fs-sm); font-weight: 600; paint-order: stroke; stroke: var(--panel-bg); stroke-width: 3px; stroke-linejoin: round; }
.terrain-area-panel { min-width: min(760px, calc(100vw - 36px)); }
.terrain-area-body { padding: 10px 11px 11px; display: grid; gap: 10px; }
.terrain-area-intro { font-size: var(--fs-md); line-height: 1.45; opacity: .78; }
.terrain-parcel-selector { display: grid; grid-template-columns: minmax(220px,1fr) auto; gap: 10px; align-items: stretch; }
.terrain-parcel-list { max-height: 152px; overflow: auto; border: 1px solid var(--panel-border); border-radius: 8px; padding: 4px; background: color-mix(in srgb, var(--text) 3.5%, transparent); }

.terrain-area-actions { display: flex; flex-direction: column; gap: 6px; min-width: 126px; }
.terrain-area-actions button { min-height: 30px; }
.terrain-area-empty { border: 1px dashed var(--panel-border); border-radius: 8px; padding: 12px; font-size: var(--fs-md); opacity: .75; }
.terrain-area-results { display: grid; gap: 9px; }
.terrain-area-stats { margin: 0; }
.terrain-hypsometry { display: grid; gap: 3px; }
.terrain-hypsometry-bar { height: 12px; border-radius: 999px; background: var(--hypsometry); border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); }
.terrain-hypsometry-labels { display: flex; justify-content: space-between; font-size: var(--fs-sm); font-weight: 600; }
.terrain-hypsometry small { font-size: var(--fs-xs); opacity: .64; }
.terrain-parcel-comparison { display: grid; gap: 5px; }
.terrain-parcel-comparison > strong { font-size: var(--fs-md); }
.terrain-parcel-table { border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden; font-size: var(--fs-sm); }
.terrain-parcel-table-head,.terrain-parcel-table-row { display: grid; grid-template-columns: minmax(130px,1.4fr) 1fr .7fr .55fr; gap: 7px; align-items: center; padding: 5px 7px; }
.terrain-parcel-table-head { font-weight: 600; background: color-mix(in srgb, var(--text) 8%, transparent); }
.terrain-parcel-table-row + .terrain-parcel-table-row { border-top: 1px solid var(--panel-border); }
.terrain-parcel-table-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .terrain-parcel-selector { grid-template-columns: 1fr; }
  .terrain-area-actions { flex-direction: row; flex-wrap: wrap; }
  .terrain-area-actions button { flex: 1 1 110px; }
  .terrain-parcel-table-head,.terrain-parcel-table-row { grid-template-columns: 1.2fr 1fr .8fr; }
  .terrain-parcel-table-head span:last-child,.terrain-parcel-table-row span:last-child { display: none; }
}

/* 16.5.0 — analiza wysokości: działki / ręczny prostokąt / dokładność siatki */
.terrain-area-controls{display:flex;align-items:end;justify-content:space-between;gap:10px;flex-wrap:wrap}.terrain-area-mode{display:flex;gap:5px}.terrain-rectangle-selector{display:grid;grid-template-columns:minmax(240px,1fr) auto;gap:10px;align-items:center;border:1px solid var(--panel-border);border-radius:8px;padding:8px;background:color-mix(in srgb, var(--text) 3.5%, transparent)}.terrain-rectangle-info{display:grid;gap:2px;font-size:var(--fs-md)}.terrain-rectangle-info strong{font-size:var(--fs-md)}.terrain-rectangle-info span{opacity:.72}.terrain-rectangle-actions{min-width:146px}@media(max-width:720px) {
  .terrain-area-controls{align-items:stretch}
  
  .terrain-rectangle-selector{grid-template-columns:1fr}
  .terrain-rectangle-actions{flex-direction:row;min-width:0}
}
}
