:root {
  color-scheme: light;
  --app-sidebar: 244px;
  --app-topbar: 64px;
  --app-content-max: 1440px;
  --app-content-gutter: 28px;
  --app-content-gutter-mobile: 16px;
  --app-card-radius: 6px;
  --app-card-padding: 22px;
  --app-card-padding-mobile: 16px;
  --app-control-height: 40px;
  --app-touch-target: 44px;
  --app-section-gap: 24px;
  --app-grid-gap: 16px;
  --zpd-bg-accent-subtle: #edf3df;
  --zpd-text-muted: #697064;
  --zpd-radius-full: 999px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: var(--zpd-bg-surface);
}

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


.app-skip {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 9999;
  padding: 8px 12px;
  color: var(--zpd-text-on-inverse);
  background: var(--zpd-bg-inverse);
  border-radius: var(--zpd-radius-md);
  transform: translateY(-150%);
}

.app-skip:focus {
  transform: translateY(0);
}

.app-shell {
  grid-template-columns: var(--app-sidebar) minmax(0, 1fr);
  min-height: 100dvh;
}

.app-main {
  min-width: 0;
}

.brand-img {
  width: 135px;
  filter: invert(1)
}

.zpd-sidebar__link {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.app-user-chevron {
  margin-inline-start: auto;
}

.app-topbar {
  min-height: var(--app-topbar);
  padding-inline: 20px;
  gap: 12px;
}

.app-project-switcher {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(130px, 260px) 16px;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 4px 12px 4px 6px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-page);
  transition: border-color var(--zpd-duration-fast), box-shadow var(--zpd-duration-fast);
}

.app-project-switcher:focus-within,
.app-project-switcher:hover {
  border-color: var(--zpd-border-strong);
  box-shadow: 0 0 0 3px var(--zpd-action-ring);
}

.app-project-switcher__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--zpd-action-default);
  background: var(--zpd-bg-accent-subtle);
  border-radius: var(--zpd-radius-md);
}

.app-project-switcher__icon .lucide {
  width: 18px;
  height: 18px;
}

.app-project-switcher__copy {
  min-width: 0;
}

.app-project-switcher__label,
.app-project-switcher__value {
  display: block;
}

.app-project-switcher__label {
  margin-bottom: 1px;
  color: var(--zpd-text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.app-project-switcher__value {
  overflow: hidden;
  color: var(--zpd-text-heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-project-switcher select {
  position: absolute;
  inset: 0;
  width: 100%;
  cursor: pointer;
  opacity: 0;
}

.app-project-switcher__chevron {
  color: var(--zpd-text-muted);
  pointer-events: none;
}

.app-account-button {
  gap: 8px;
  padding-inline: 6px 8px;
}

.app-account-name {
  color: var(--zpd-text-primary);
  font-size: 13px;
  font-weight: 600;
}

.app-notification-trigger {
  position: relative;
}

.app-notification-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-health-critical);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.app-notification-badge[hidden] {
  display: none;
}

.app-notification-panel {
  display: flex;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 560px);
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.app-notification-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

/* subtelne wygaszenie w trakcie akcji Live (atrybut `busy` dokłada live_controller) */
.app-notification-list[busy] .app-notification-list__scroll {
  opacity: .55;
  pointer-events: none;
  transition: opacity var(--zpd-duration-fast) var(--zpd-ease);
}

.app-notification-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zpd-space-2);
  padding: var(--zpd-space-2) var(--zpd-space-3);
  border-bottom: 1px solid var(--zpd-border-subtle);
}

.app-notification-list__title {
  display: flex;
  align-items: center;
  gap: var(--zpd-space-2);
  padding: 0;
}

.app-notification-list__count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-health-critical);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.app-notification-list__mark-all,
.app-notification-list__load-more {
  border: none;
  background: none;
  color: var(--zpd-text-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.app-notification-list__mark-all {
  min-height: 32px;
  padding-inline: var(--zpd-space-2);
  border-radius: var(--zpd-radius-sm);
  white-space: nowrap;
}

.app-notification-list__mark-all:hover {
  background: var(--zpd-bg-accent-subtle);
}

.app-notification-list__mark-all[disabled],
.app-notification-list__load-more[disabled] {
  color: var(--zpd-text-muted);
  cursor: progress;
}

.app-notification-list__scroll {
  min-height: 0;
  flex: 1;
  padding: var(--zpd-space-1);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-notification-list__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-notification-list__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--zpd-space-2);
  padding: var(--zpd-space-6) var(--zpd-space-4);
  text-align: center;
}

.app-notification-list__empty-icon,
i[data-lucide].app-notification-list__empty-icon {
  width: 28px;
  height: 28px;
  color: var(--zpd-text-muted);
}

.app-notification-item {
  position: relative;
  align-items: flex-start;
  gap: var(--zpd-space-3);
}

.app-notification-item--unread {
  background: color-mix(in srgb, var(--zpd-bg-accent-subtle) 55%, transparent);
}

.app-notification-item:focus-within {
  background: var(--zpd-color-leaf-50);
}

.app-notification-item:has(.app-notification-item__stretched-link:focus-visible) {
  outline: 2px solid var(--zpd-action-accent);
  outline-offset: -2px;
}

.app-notification-item__dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--zpd-border-default);
}

.app-notification-item--unread .app-notification-item__dot {
  background: var(--zpd-action-accent);
}

.app-notification-item__content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  color: var(--zpd-text-primary);
}

/* dwie linie zamiast ucięcia w jednej — pełna treść czytelna też na wąskim ekranie */
.app-notification-item__label {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-notification-item--unread .app-notification-item__label {
  font-weight: 600;
}

.app-notification-item__date {
  color: var(--zpd-text-muted);
}

/* przyciski "przeczytane"/"usuń" leżą nad stretched linkiem (z-index), na desktopie
   odsłaniają się dopiero przy hoverze/fokusie, na ekranach dotykowych są zawsze widoczne */
.app-notification-item__mark,
.app-notification-item__delete {
  position: relative;
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border: none;
  border-radius: var(--zpd-radius-sm);
  background: none;
  color: var(--zpd-text-muted);
  cursor: pointer;
}

.app-notification-item__mark .lucide,
.app-notification-item__delete .lucide {
  color: currentcolor;
}

.app-notification-item__mark:hover,
.app-notification-item__mark:focus-visible {
  background: var(--zpd-bg-raised);
  color: var(--zpd-text-accent);
}

/* usunięcie jest nieodwracalne — kolor ostrzegawczy zamiast akcentu, żeby odróżnić od "oznacz jako przeczytane" */
.app-notification-item__delete:hover,
.app-notification-item__delete:focus-visible {
  background: var(--zpd-health-critical-bg);
  color: var(--zpd-health-critical);
}

.app-notification-item__mark:focus-visible,
.app-notification-item__delete:focus-visible {
  outline: 2px solid var(--zpd-action-accent);
  outline-offset: -2px;
}

@media (hover: hover) and (pointer: fine) {
  .app-notification-item__mark,
  .app-notification-item__delete {
    opacity: 0;
  }

  .app-notification-item:hover .app-notification-item__mark,
  .app-notification-item:hover .app-notification-item__delete,
  .app-notification-item__mark:focus-visible,
  .app-notification-item__delete:focus-visible {
    opacity: 1;
  }
}

.app-notification-item__stretched-link {
  position: absolute;
  z-index: 0;
  inset: 0;
}

.app-notification-list__load-more {
  width: 100%;
  min-height: 40px;
  padding: var(--zpd-space-2) var(--zpd-space-3);
  border-top: 1px solid var(--zpd-border-subtle);
  text-align: center;
}

.app-notification-list__load-more:hover {
  background: var(--zpd-bg-accent-subtle);
}

.app-content {
  width: 100%;
  max-width: var(--app-content-max);
  margin-inline: auto;
  padding: 24px var(--app-content-gutter) 40px;
}

.app-view[hidden] {
  display: none !important;
}

.app-page-header {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
}

.app-page-header--compact .zpd-page-header__title {
  font-size: clamp(25px, 3vw, 32px);
}

.app-page-header .zpd-page-header__desc {
  max-width: 720px;
}

.app-header-badges {
  margin-bottom: 8px;
}

.app-section-title {
  margin: 3px 0 0;
  color: var(--zpd-text-heading);
  font-size: 17px;
  line-height: 1.3;
}

.zpd-badge--info {
  color: var(--zpd-color-forest-700);
  background: var(--zpd-bg-surface);
}

.zpd-badge--success {
  color: var(--zpd-health-good);
  background: var(--zpd-health-good-bg);
}

.zpd-badge--warning {
  color: var(--zpd-health-fair);
  background: var(--zpd-health-fair-bg);
}

.zpd-badge--danger {
  color: var(--zpd-health-critical);
  background: var(--zpd-health-critical-bg);
}

.app-card-header {
  align-items: center;
  padding: var(--app-card-padding); /*  var(--app-card-padding) 0; */
}

.app-card-header > div {
  flex-grow: 1;
}

.app-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--app-grid-gap);
  margin-bottom: var(--app-section-gap);
}

.app-stat-card {
  min-width: 0;
}

.app-stat-card .zpd-card__body {
  padding: 16px;
}

.app-stat {
  gap: 8px;
}

.app-stat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-stat__head .zpd-stat__label {
  overflow: hidden;
  font-size: 14px;
  font-weight: var(--zpd-font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-stat .zpd-stat__value {
  min-height: 35px;
  font-size: 28px;
}

.app-stat .zpd-stat__note,
.app-stat .zpd-stat__trend {
  min-height: 17px;
}

.app-stat__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 17px;
  color: var(--zpd-action-default);
  font-size: 12px;
  font-weight: var(--zpd-font-weight-semibold);
  cursor: pointer;
}

.app-stat__link:hover {
  color: var(--zpd-action-accent);
}

.app-stat__link .lucide {
  width: 13px;
  height: 13px;
}

.app-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
  gap: var(--app-grid-gap);
}

.app-overview-map-card,
.app-care-card {
  overflow: hidden;
}

.app-overview-map-card {
  /* jak .app-map-card — mini-mapa Leaflet nie może przebić swoim z-index przez topbar/sidebar */
  isolation: isolate;
}

.app-mini-map {
  height: 390px;
  border-top: 1px solid var(--zpd-border-subtle);
  background: var(--zpd-bg-surface);
}

.app-care-card .zpd-timeline {
  padding: 4px 20px 20px;
}

.app-map-toolbar,
.app-list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-page);
}

.zpd-modal__body {
  max-height: 64dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Filtry pozostają widoczne bez JavaScriptu i na desktopie. Kontroler odsłania
   przycisk dopiero po uruchomieniu, więc nie zostawiamy użytkownika bez filtrów. */
.app-mobile-filters__toggle {
  display: none;
}

.app-filter-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 230px;
  height: 36px;
}

.app-filter-search--wide {
  min-width: min(100%, 320px);
}

.app-filter-search > .lucide {
  position: absolute;
  left: 10px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--zpd-text-muted);
  pointer-events: none;
}

.app-filter-search input {
  width: 100%;
  height: 36px;
  padding: 0 38px 0 34px;
  color: var(--zpd-text-primary);
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-md);
  outline: 0;
}

.app-filter-search input:focus {
  border-color: var(--zpd-action-accent);
  box-shadow: 0 0 0 3px var(--zpd-action-ring);
}

.app-filter-search kbd {
  position: absolute;
  right: 9px;
  padding: 1px 5px;
  color: var(--zpd-text-muted);
  font-size: 10px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-sm);
  background: var(--zpd-bg-surface);
  pointer-events: none;
}

.app-compact-select {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px 0 10px;
  color: var(--zpd-text-muted);
  font-size: 12px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-page);
}

.app-compact-select select {
  max-width: 145px;
  color: var(--zpd-text-primary);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  outline: 0;
  background: transparent;
}

.app-document-filters {
  display: inline-flex;
  align-items: center;
  gap: var(--zpd-space-2);
  margin-bottom: var(--zpd-space-4);
}

.app-filter-check {
  position: relative;
  display: flex;
  height: 36px;
}

.app-filter-check input {
  position: absolute;
  opacity: 0;
}

.app-filter-check span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 11px;
  color: var(--zpd-text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-md);
  cursor: pointer;
}

.app-filter-check .lucide {
  width: 16px;
  height: 16px;
}

.app-filter-check input:checked + span {
  color: var(--zpd-action-default);
  border-color: var(--zpd-border-strong);
  background: var(--zpd-bg-accent-subtle);
}

.app-filter-check input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--zpd-action-ring);
}

.app-map-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: min(650px, calc(100dvh - 222px));
  overflow: hidden;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-xl);
  background: var(--zpd-bg-page);
  box-shadow: var(--zpd-shadow-sm);
}

.app-map-list-panel {
  min-width: 0;
  border-right: 1px solid var(--zpd-border-subtle);
  background: var(--zpd-bg-page);
}

.app-map-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--zpd-border-subtle);
}

.app-map-list {
  height: calc(min(650px, 100dvh - 222px) - 48px);
  min-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-map-tree {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 13px;
  color: var(--zpd-text-primary);
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--zpd-border-subtle);
  background: transparent;
  cursor: pointer;
  transition: background var(--zpd-duration-fast);
}

.app-map-tree:hover,
.app-map-tree.is-active {
  background: var(--zpd-bg-accent-subtle);
}

.app-map-tree.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--zpd-action-accent);
}

.app-map-tree__number {
  display: grid;
  place-items: center;
  width: 64px;
  height: 38px;
  color: var(--zpd-text-on-inverse);
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--zpd-radius-lg);
  background: var(--marker-color, var(--zpd-action-accent));
}

.app-map-tree__copy {
  min-width: 0;
}

.app-map-tree__name,
.app-map-tree__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-map-tree__name {
  font-size: 13px;
  font-weight: 700;
}

.app-map-tree__meta {
  margin-top: 2px;
  color: var(--zpd-text-muted);
  font-size: 11px;
}

.app-map-tree > .lucide {
  width: 16px;
  height: 16px;
  color: var(--zpd-text-muted);
}

.app-map-card {
  position: relative;
  min-width: 0;
  background: var(--zpd-bg-surface);
  /* Leaflet nadaje swoim panelom i kontrolkom z-index do 1000 (leaflet.css z CDN),
     a nasze własne nakładki (.app-basemap-switch, .app-map-legend, .app-map-loading)
     dochodzą do 600 — bez własnego kontekstu warstwowania te wartości „uciekały"
     ponad .zpd-topbar (z-index: 30) i .zpd-sidebar (z-index: 60) */
  isolation: isolate;
}

.app-map-fullscreen-toggle {
  position: absolute;
  z-index: 700;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--zpd-text-heading);
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-page);
  box-shadow: var(--zpd-shadow-md);
}

.app-map-fullscreen-toggle:hover {
  background: var(--zpd-bg-accent-subtle);
}

.app-map-fullscreen-toggle__close,
.app-map-card.is-fullscreen .app-map-fullscreen-toggle__open {
  display: none;
}

.app-map-card.is-fullscreen .app-map-fullscreen-toggle__close {
  display: block;
}

.app-map-card.is-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

.app-map-card.is-fullscreen .app-map-fullscreen-toggle {
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
}

.app-map-card.is-fullscreen .app-basemap-switch {
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
}

.app-map-card.is-fullscreen .app-map-legend {
  bottom: calc(18px + env(safe-area-inset-bottom));
}

body.app-map-fullscreen-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.app-leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--zpd-bg-surface);
}

.app-basemap-switch {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  display: flex;
  padding: 3px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-page);
  box-shadow: var(--zpd-shadow-md);
}

.app-basemap-switch button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--zpd-text-secondary);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  border-radius: var(--zpd-radius-md);
  background: transparent;
  cursor: pointer;
}

.app-basemap-switch button[aria-pressed="true"] {
  color: var(--zpd-text-on-inverse);
  background: var(--zpd-action-default);
}

.app-basemap-switch .lucide {
  width: 15px;
  height: 15px;
}

.app-map-legend {
  position: absolute;
  z-index: 500;
  right: 12px;
  bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  color: var(--zpd-text-secondary);
  font-size: 10px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-md);
  background: color-mix(in srgb, var(--zpd-bg-page) 94%, transparent);
  box-shadow: var(--zpd-shadow-sm);
}

.app-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.app-map-legend i {
  width: 7px;
  height: 7px;
  border-radius: var(--zpd-radius-full);
}

.is-excellent { background: var(--zpd-health-excellent); }
.is-good { background: var(--zpd-health-good); }
.is-fair { background: var(--zpd-health-fair); }
.is-poor { background: var(--zpd-health-poor); }
.is-critical { background: var(--zpd-health-critical); }

.app-map-loading {
  position: absolute;
  z-index: 600;
  inset: 50% auto auto 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  color: var(--zpd-text-secondary);
  font-size: 12px;
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-page);
  box-shadow: var(--zpd-shadow-md);
  transform: translate(-50%, -50%);
}

.app-map-loading[hidden] {
  display: none;
}

.tree-marker-wrap {
  border: 0 !important;
  background: transparent !important;
}

.tree-marker {
  display: grid;
  place-items: center;

  width: 36px;
  height: 36px;

  color: var(--zpd-text-on-inverse);
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;

  border: 2px solid var(--zpd-bg-page);
  border-radius: 50% 50% 50% 10%;
  background: var(--marker-color, var(--zpd-action-accent));
  box-shadow: 0 2px 8px rgb(18 32 12 / .28);

  transform: rotate(-45deg);
  transition:
    transform var(--zpd-duration-fast),
    box-shadow var(--zpd-duration-fast);
}

.tree-marker span {
  display: block;
  max-width: 30px;

  white-space: nowrap;
  text-align: center;

  transform: rotate(45deg);
}

.tree-marker.is-selected {
  box-shadow:
    0 0 0 4px rgb(255 255 255 / .7),
    0 5px 14px rgb(18 32 12 / .35);

  transform: rotate(-45deg) scale(1.2);
}

.leaflet-popup-content-wrapper {
  border-radius: var(--zpd-radius-lg);
  box-shadow: var(--zpd-shadow-lg);
}

.leaflet-popup-content {
  width: 224px !important;
  margin: 14px;
  font-family: var(--zpd-font-body);
}

.app-map-popup__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-map-popup__number {
  color: var(--zpd-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.app-map-popup h3 {
  margin: 8px 0 1px;
  color: var(--zpd-text-heading);
  font-size: 14px;
}

.app-map-popup__latin {
  color: var(--zpd-text-secondary);
  font-size: 11px;
  font-style: italic;
}

.app-map-popup__meta {
  margin: 8px 0 10px;
  color: var(--zpd-text-muted);
  font-size: 11px;
}

body .app-map-popup .app-map-popup__button {
  width: 100%;
  min-height: 32px;
  color: var(--zpd-text-on-inverse);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-action-default);
  cursor: pointer;
  padding: 4px 10px;
  text-decoration: none;
}

.app-table-card {
  overflow: hidden;
}

.app-document-table td {
  vertical-align: middle;
}

.app-document-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
}

.app-document-icon {
  display: flex;
  flex: 0 0 auto;
  place-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--zpd-action-default);
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-accent-subtle);
}

.app-document-icon .lucide {
  width: 17px;
  height: 17px;
}

.app-document-name strong,
.app-document-name span {
  display: flex;
}

.app-document-name strong {
  color: var(--zpd-text-heading);
  font-size: 13px;
  line-height: 1.35;
}

.app-document-name div > span {
  margin-top: 2px;
  color: var(--zpd-text-muted);
  font-size: 10px;
  font-weight: var(--zpd-font-weight-bold);
  letter-spacing: .04em;
}

.app-document-tree {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 14px;
  align-items: center;
  gap: 6px;
  max-width: 230px;
  color: var(--zpd-text-primary);
  text-align: left;
  cursor: pointer;
}

.app-document-tree span:first-child {
  padding: 3px 6px;
  color: var(--zpd-action-default);
  font-size: 11px;
  font-weight: var(--zpd-font-weight-bold);
  border-radius: var(--zpd-radius-sm);
  background: var(--zpd-bg-accent-subtle);
}

.app-document-tree span:nth-child(2) {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-document-tree .lucide {
  width: 13px;
  height: 13px;
  color: var(--zpd-text-muted);
}

.app-document-tree:hover span:nth-child(2) {
  color: var(--zpd-action-default);
}

.app-document-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--zpd-text-secondary);
  font-size: 12px;
}

.app-document-project .lucide {
  width: 15px;
  height: 15px;
  color: var(--zpd-text-muted);
}

.app-document-download {
  white-space: nowrap;
}

.app-document-row--blocked {
  opacity: .55;
  filter: grayscale(.6);
}

.app-document-restricted-note {
  display: flex;
  margin-left: 4px;
  color: var(--zpd-text-muted);
  font-size: 10px;
  font-weight: var(--zpd-font-weight-bold);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.app-tree-table td {
  vertical-align: middle;
}

.app-tree-table__detail-link {
  color: inherit;
  text-decoration: none;
}

.app-tree-table__detail-link:hover {
  color: var(--zpd-action-default);
}

.app-tree-table__species strong,
.app-tree-table__species em {
  display: block;
}

.app-tree-table__species strong {
  color: var(--zpd-text-heading);
}

.app-tree-table__species em {
  margin-top: 2px;
  color: var(--zpd-text-muted);
  font-size: 11px;
}

.app-tree-table__params {
  white-space: nowrap;
}

/*
    Znacznik nieopublikowanej inspekcji (ADR-0031) — drobny, w tej samej komórce co data
    aktualizacji, bo mówi o świeżości oceny, a nie o samym drzewie. Bursztyn jak w panelu
    „Inspekcje w toku”: praca w toku, nie problem ze stanem drzewa.
*/
.app-tree-table__draft {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-top: 2px;
  font-size: 11px;
  font-weight: var(--zpd-font-weight-semibold);
  color: var(--zpd-health-fair);
  white-space: nowrap;
}

.app-tree-table__draft .lucide {
  flex: none;
  width: 12px;
  height: 12px;
}

.app-tree-table__number {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 30px;
  padding-inline: 6px;
  color: var(--zpd-action-default);
  font-weight: 800;
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-accent-subtle);
}

.app-table-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--zpd-action-default);
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-page);
  cursor: pointer;
}

.app-table-action:hover {
  border-color: var(--zpd-border-strong);
  background: var(--zpd-bg-accent-subtle);
}

.app-table-action .lucide {
  width: 16px;
  height: 16px;
}

.app-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--zpd-space-2);
}

.app-empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 32px;
  text-align: center;
}

.app-empty-state[hidden] {
  display: none;
}

.app-empty-state h2 {
  margin: 12px 0 4px;
  font-size: 18px;
}

.app-empty-state p {
  margin: 0;
  color: var(--zpd-text-muted);
  padding-bottom: 12px;
}

.app-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  padding: 5px 0;
  color: var(--zpd-text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-back-link:hover {
  color: var(--zpd-action-default);
}

.app-back-link .lucide {
  width: 16px;
  height: 16px;
}

.app-tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zpd-space-4);
  margin-bottom: var(--zpd-space-4);
}

.app-tree-action-menu--client-mobile {
  display: none;
}

.app-tree-action-menu {
  justify-self: end;
}

.app-tree-action-menu .zpd-menu {
  width: min(18rem, calc(100vw - 2 * var(--zpd-space-4)));
}

.app-tree-action-menu .zpd-menu__item {
  min-height: 44px;
}

.app-tree-action-menu .app-tree-action-form {
  width: 100%;
}

.app-tree-hero {
  display: grid;
  grid-template-columns: minmax(340px, .88fr) minmax(0, 1.42fr);
  overflow: hidden;
  margin-bottom: var(--zpd-space-5);
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--app-card-radius);
  background: var(--zpd-bg-raised);
  box-shadow: none;
}

.app-tree-photo {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: var(--zpd-bg-surface);
}

.app-tree-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(18 32 12 / .28), transparent 30%, transparent 66%, rgb(18 32 12 / .58));
  pointer-events: none;
}

.app-tree-photo > img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.app-tree-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--zpd-space-2);
  width: 100%;
  height: 100%;
  min-height: 520px;
  color: var(--zpd-text-muted);
}

.app-tree-photo-placeholder span {
  font-size: 13px;
}

.app-tree-photo figcaption {
  position: absolute;
  z-index: 2;
  inset: auto var(--zpd-space-5) var(--zpd-space-4) auto;
  color: var(--zpd-text-on-inverse);
  font-size: 11px;
}

.app-tree-brand-tag,
.app-tree-number-tag {
  position: absolute;
  z-index: 2;
  left: var(--zpd-space-5);
  box-shadow: var(--zpd-shadow-md);
}

.app-tree-brand-tag {
  top: var(--zpd-space-5);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--zpd-space-3);
  padding: var(--zpd-space-4);
  font-size: 12px;
  font-weight: var(--zpd-font-weight-extrabold);
  line-height: 1.15;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.app-tree-number-tag {
  bottom: var(--zpd-space-5);
}

.app-tree-summary {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--zpd-space-8);
}

.app-tree-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--zpd-space-6);
}

.app-tree-heading-row h1 {
  margin-top: var(--zpd-space-2);
}

.app-tree-heading-row .zpd-latin {
  margin-top: var(--zpd-space-1);
}

.app-tree-health-summary {
  display: grid;
  justify-items: end;
  gap: var(--zpd-space-2);
}

.app-qr {
  display: grid;
  justify-items: center;
  gap: var(--zpd-space-2);
  padding: var(--zpd-space-3);
  color: var(--zpd-text-secondary);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-surface);
}

a.app-qr:hover {
  color: var(--zpd-text-accent);
  border-color: var(--zpd-border-strong);
}

.app-qr__code {
  display: block;
  padding: 4px;
  background: var(--zpd-bg-page);
}

.app-qr__code svg {
  display: block;
  width: 112px;
  height: 112px;
}

.app-tree-qr {
  max-width: 168px;
}

.app-tree-address {
  display: flex;
  align-items: flex-start;
  gap: var(--zpd-space-3);
  margin-top: var(--zpd-space-6);
  color: var(--zpd-text-secondary);
  font-style: normal;
}

.app-tree-address strong,
.app-tree-address span span,
.app-tree-address small {
  display: block;
}

.app-tree-address strong {
  color: var(--zpd-text-heading);
}

.app-tree-address small {
  margin-top: 2px;
  color: var(--zpd-text-muted);
  font-size: 12px;
}

.app-tree-description {
  margin-top: var(--zpd-space-5);
}

.app-tree-description p {
  color: var(--zpd-text-secondary);
  line-height: 1.55;
}

.app-tree-params {
  gap: var(--zpd-space-5) var(--zpd-space-4);
  margin-top: auto;
  padding-top: var(--zpd-space-8);
}

.app-tree-params .zpd-datalist__item {
  align-items: flex-start;
  gap: var(--zpd-space-3);
}

.app-tree-params .zpd-datalist__value {
  margin-top: var(--zpd-space-1);
  font-size: 15px;
}

.app-tree-inspection-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--zpd-space-3);
  margin-top: var(--zpd-space-6);
  padding-top: var(--zpd-space-4);
  border-top: 1px solid var(--zpd-border-subtle);
}

.app-tree-inspection-date {
  padding: var(--zpd-space-4);
}

.app-tree-inspection-value {
  display: flex;
  align-items: center;
  gap: var(--zpd-space-3);
  margin-top: var(--zpd-space-3);
}

.app-tree-inspection-value strong {
  display: block;
}

.app-tree-inspection-value strong {
  color: var(--zpd-text-heading);
  font-size: 16px;
  font-weight: var(--zpd-font-weight-semibold);
}

.app-tree-inspection-value div > span {
  margin-top: 2px;
  color: var(--zpd-text-muted);
  font-size: 11px;
}

.app-tree-environment-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
  gap: var(--zpd-space-4);
  margin-bottom: var(--zpd-space-4);
}

.app-tree-environment-card .zpd-card__header {
  padding-bottom: var(--zpd-space-3);
}

.app-tree-eco-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--zpd-space-3);
}

.app-tree-eco-grid .app-stat-card {
  background: var(--zpd-bg-surface);
}

.app-tree-eco-grid .app-stat__head .zpd-stat__label {
  white-space: normal;
}

.app-tree-eco-note {
  display: flex;
  align-items: center;
  gap: var(--zpd-space-2);
  margin-top: var(--zpd-space-4);
  color: var(--zpd-text-muted);
  font-size: 12px;
}

.app-tree-eco-note .lucide {
  width: 14px;
  height: 14px;
}

.app-tree-health-card .zpd-card__body {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--zpd-space-3);
  text-align: center;
}

.app-tree-health-card .zpd-overline,
.app-tree-health-card .zpd-caption {
  justify-content: center;
}

.app-tree-map-inline {
  position: relative;
  min-height: 210px;
  margin-top: var(--zpd-space-5);
  overflow: hidden;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-surface);
  /* jak .app-map-card — kontener mapy nie może przebić swoim z-index (Leaflet, .app-tree-map-action)
     przez topbar/sidebar aplikacji */
  isolation: isolate;
}

.app-tree-map-inline .app-tree-detail-map {
  min-height: 210px;
  margin: 0;
  border-radius: inherit;
}

.app-tree-map-action {
  position: absolute;
  z-index: 500;
  top: var(--zpd-space-3);
  right: var(--zpd-space-3);
  background: color-mix(in srgb, var(--zpd-bg-raised) 92%, transparent);
  box-shadow: var(--zpd-shadow-md);
  backdrop-filter: blur(6px);
}

.app-tree-tabs {
  overflow: visible;
}

.app-tree-tabs > .zpd-tabs__list {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  overflow-y: hidden;
}

.app-tree-tabs > .zpd-tabs__list .zpd-tabs__tab {
  flex: 0 0 auto;
}

.app-tree-tab-panel {
  padding-top: 14px;
}

.app-detail-card {
  padding: 22px;
}

.app-detail-card p {
  color: var(--zpd-text-secondary);
}

.app-tree-detail-map {
  flex: 1 1 auto;
  min-height: 168px;
  margin: 0 8px 8px;
  overflow: hidden;
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-page);
}

.app-care-history {
  min-width: 0;
}

.app-care-history .zpd-timeline {
  margin-top: 20px;
}

.app-inspection-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 4px 2px;
}

.app-inspection-title {
  margin: 3px 0 4px;
  font-size: 22px;
}

.app-inspection-head p {
  color: var(--zpd-text-muted);
  font-size: 12px;
}

.app-inspection-card {
  min-width: 0;
  margin-bottom: 14px;
  padding: 20px;
}

.app-inspection-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--zpd-border-subtle);
}


summary.app-inspection-section-head {
  cursor: pointer;
  list-style: none;
  margin: 0 -8px 17px;
  padding: 0px 8px 14px;
  border-radius: var(--zpd-radius-md);
  transition: background-color var(--zpd-duration-base) var(--zpd-ease);
}

summary.app-inspection-section-head::-webkit-details-marker {
  display: none;
}

/* summary.app-inspection-section-head:hover {
  background: var(--zpd-color-leaf-50);
}

summary.app-inspection-section-head:focus-visible {
  outline: 2px solid var(--zpd-action-accent);
  outline-offset: -2px;
} */

.app-inspection-section-head__chevron {
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  color: var(--zpd-text-secondary);
  transition: transform var(--zpd-duration-base) var(--zpd-ease);
}

/* legenda skali (sekcja 03) ma własny `margin-inline-start: auto` — gdy jest obecna,
   to ona ma przesunąć się do prawej, a chevron ma tylko podążyć zaraz za nią
   (dwa konkurujące auto-marginy w tym samym wierszu flex dzielą wolne miejsce
   po połowie i legenda „zawisa” na środku zamiast przy prawej krawędzi) */
.app-score-legend + .app-inspection-section-head__chevron {
  margin-left: 0;
}

details.app-inspection-card[open] .app-inspection-section-head__chevron {
  transform: rotate(180deg);
}

details.app-inspection-card:not([open]) > summary.app-inspection-section-head {
  margin-bottom: 0;
  padding-bottom: 0px;
  border-bottom: none;
}

.app-inspection-section-head__number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--zpd-action-default);
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--zpd-radius-md);
  color: var(--zpd-bg-accent-subtle);
}

.app-inspection-section-head__number .lucide {
  width: 17px;
  height: 17px;
}

.app-inspection-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.app-inspection-section-head p {
  margin: 2px 0 0;
  color: var(--zpd-text-muted);
  font-size: 12px;
}

.app-inspection-record,
.app-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.app-inspection-record > div,
.app-context-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--zpd-border-subtle);
  border-bottom: 1px solid var(--zpd-border-subtle);

}


.app-inspection-record > div:nth-child(3n),
.app-context-grid > div:nth-child(3n) {
  border-right: 0;
}

.app-inspection-record dt,
.app-context-grid dt {
  margin-bottom: 4px;
  color: var(--zpd-text-muted);
  font-size: 12px;
}

.app-inspection-record dd,
.app-context-grid dd {
  overflow-wrap: anywhere;
  color: var(--zpd-text-heading);
  font-size: 14px;
  font-weight: 600;
}

.app-context-grid dd {
  font-weight: 500;
}

.app-context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.app-context-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--zpd-text-secondary);
  font-size: 11px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-bg-surface);
}

.app-score-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
  color: var(--zpd-text-muted);
  font-size: 10px;
}

.app-score-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.app-score {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--zpd-text-primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-surface);
}

.app-score--1 {
  color: var(--zpd-health-excellent);
  background: var(--zpd-health-excellent-bg);
}

.app-score--2 {
  color: var(--zpd-health-good);
  background: var(--zpd-health-good-bg);
}

.app-score--3 {
  color: var(--zpd-health-fair);
  background: var(--zpd-health-fair-bg);
}

.app-score--4 {
  color: var(--zpd-health-poor);
  background: var(--zpd-health-poor-bg);
}

.app-score--5 {
  color: var(--zpd-health-critical);
  background: var(--zpd-health-critical-bg);
}

.app-assessment-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--zpd-radius-md);
  scrollbar-width: thin;
}

.app-assessment-table,
.app-care-table {
  width: 100%;
  min-width: 560px;
  border-spacing: 0;
  border-collapse: separate;
  color: var(--zpd-text-primary);
  font-size: 13px;
  table-layout: fixed;
}

.app-assessment-table caption,
.app-care-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-assessment-table th,
.app-assessment-table td,
.app-care-table th,
.app-care-table td {
  padding: 10px 13px;
  text-align: left;
  border-right: 1px solid var(--zpd-border-subtle);
  border-bottom: 1px solid var(--zpd-border-subtle);
}

.app-assessment-table th:last-child,
.app-assessment-table td:last-child,
.app-care-table th:last-child,
.app-care-table td:last-child {
  border-right: 0;
}

.app-assessment-table tbody tr:last-child td,
.app-assessment-table tbody tr:last-child th,
.app-care-table tbody tr:last-child td {
  border-bottom: 0;
}

.app-assessment-table thead th,
.app-care-table thead th {
  color: var(--zpd-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--zpd-bg-surface);
}

.app-assessment-table thead th:first-child,
.app-assessment-table tbody th {
  position: sticky;
  left: 0;
}

.app-assessment-table thead th:first-child {
  z-index: 2;
}

.app-assessment-table tbody th {
  z-index: 1;
}

.app-assessment-table tbody th {
  width: 120px;
  color: var(--zpd-text-heading);
  font-size: 13px;
  font-weight: 600;
  background: var(--zpd-bg-page);
}

.app-assessment-table thead th:not(:first-child),
.app-assessment-table td {
  text-align: center;
}

.app-assessment-table--compact {
  min-width: 560px;
}

.app-assessment-table--compact tbody th {
  width: auto;
}

.app-assessment-table--compact td {
  width: 76px;
}

.app-inspection-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.app-conclusion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.app-conclusion-item {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-surface);
}

.app-conclusion-item span,
.app-conclusion-item strong {
  display: block;
}

.app-conclusion-item span {
  margin-bottom: 5px;
  color: var(--zpd-text-muted);
  font-size: 11px;
}

.app-conclusion-item strong {
  color: var(--zpd-text-heading);
  font-size: 13px;
}

.app-vitality {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.app-vitality i {
  width: 18px;
  height: 5px;
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-border-default);
}

.app-vitality i.is-filled {
  background: var(--zpd-action-accent);
}

.app-inspection-risk {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
  color: var(--zpd-text-secondary);
  font-size: 13px;
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-accent-subtle);
}

.app-inspection-risk--warning {
  background: var(--zpd-health-fair-bg);
}

.app-inspection-risk--danger {
  background: var(--zpd-health-critical-bg);
}

.app-inspection-risk .lucide {
  width: 18px;
  height: 18px;
  color: var(--zpd-action-accent);
}

.app-inspection-risk--warning .lucide {
  color: var(--zpd-health-fair);
}

.app-inspection-risk--danger .lucide {
  color: var(--zpd-health-critical);
}

.app-care-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 14px;
}

.app-care-main,
.app-care-aside {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.app-care-table {
  min-width: 660px;
}

.app-care-table td:first-child {
  width: 32%;
}

.app-care-code {
  display: inline-block;
  margin-right: 7px;
  padding: 3px 6px;
  color: var(--zpd-action-default);
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--zpd-radius-sm);
  background: var(--zpd-bg-accent-subtle);
}

.app-urgency {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.app-urgency__bars {
  display: inline-flex;
  gap: 2px;
}

.app-urgency__bars i {
  width: 4px;
  height: 12px;
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-border-default);
}

.app-urgency--1 .app-urgency__bars i:nth-child(-n+1),
.app-urgency--2 .app-urgency__bars i:nth-child(-n+2),
.app-urgency--3 .app-urgency__bars i:nth-child(-n+3),
.app-urgency--4 .app-urgency__bars i:nth-child(-n+4) {
  background: currentcolor;
}

.app-urgency--1 { color: var(--zpd-health-excellent); }
.app-urgency--2 { color: var(--zpd-health-fair); }
.app-urgency--3 { color: var(--zpd-health-poor); }
.app-urgency--4 { color: var(--zpd-health-critical); }

.zpd-password-strength {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.zpd-password-strength__bars {
  display: inline-flex;
  gap: 2px;
}

.zpd-password-strength__bars i {
  width: 18px;
  height: 4px;
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-border-default);
}

.zpd-password-strength--1 .zpd-password-strength__bars i:nth-child(-n+1),
.zpd-password-strength--2 .zpd-password-strength__bars i:nth-child(-n+2),
.zpd-password-strength--3 .zpd-password-strength__bars i:nth-child(-n+3),
.zpd-password-strength--4 .zpd-password-strength__bars i:nth-child(-n+4) {
  background: currentcolor;
}

.zpd-password-strength--0 { color: var(--zpd-health-critical); }
.zpd-password-strength--1 { color: var(--zpd-health-poor); }
.zpd-password-strength--2 { color: var(--zpd-health-fair); }
.zpd-password-strength--3 { color: var(--zpd-health-good); }
.zpd-password-strength--4 { color: var(--zpd-health-excellent); }

.zpd-password-strength__label {
  font-size: 12px;
  font-weight: 600;
}

.app-care-next {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  padding: 17px;
  border-color: var(--zpd-border-strong);
  background: var(--zpd-bg-accent-subtle);
}

.app-care-next strong,
.app-care-next p {
  display: block;
}

.app-care-next strong {
  margin-top: 3px;
  color: var(--zpd-text-heading);
  font-size: 15px;
}

.app-care-next p {
  margin: 2px 0 0;
  color: var(--zpd-text-secondary);
  font-size: 11px;
}

.app-care-dictionary {
  padding: 18px;
}

.app-care-glossary {
  display: grid;
  gap: 6px;
  margin-top: 13px;
}

.app-care-glossary details {
  overflow: hidden;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-page);
}

.app-care-glossary summary {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px;
  color: var(--zpd-text-heading);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.app-care-glossary summary::-webkit-details-marker {
  display: none;
}

.app-care-glossary summary::after {
  content: "+";
  color: var(--zpd-text-muted);
  font-size: 16px;
}

.app-care-glossary details[open] summary::after {
  content: "−";
}

.app-care-glossary summary span {
  color: var(--zpd-action-default);
  font-size: 10px;
  font-weight: 800;
}

.app-care-glossary details p {
  margin: 0;
  padding: 0 10px 11px;
  color: var(--zpd-text-secondary);
  font-size: 11px;
  line-height: 1.55;
}

.app-gallery {
  grid-template-columns: repeat(4, 1fr);
}

.app-gallery .zpd-gallery__item {
  aspect-ratio: 4 / 3;
}

.app-gallery-lightbox {
  width: calc(100vw - 2 * var(--zpd-space-4));
  max-width: none;
  height: calc(100dvh - 2 * var(--zpd-space-4));
  max-height: none;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-gallery-lightbox[open] {
  display: grid;
  place-items: center;
}

.app-gallery-lightbox > img {
  max-width: 100%;
  max-height: 90dvh;
  object-fit: contain;
  border-radius: var(--zpd-radius-sm);
  box-shadow: var(--zpd-shadow-lg);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.app-gallery-lightbox .zpd-modal__close,
.app-gallery-lightbox__navigation,
.app-gallery-lightbox__counter {
  position: absolute;
  color: #fff;
  background: rgb(18 32 12 / 72%);
  box-shadow: var(--zpd-shadow-md);
}

.app-gallery-lightbox .zpd-modal__close {
  top: var(--zpd-space-3);
  right: var(--zpd-space-3);
  margin: 0;
}

.app-gallery-lightbox .zpd-modal__close:hover,
.app-gallery-lightbox__navigation:hover {
  color: #fff;
  background: rgb(18 32 12 / 90%);
}

.app-gallery-lightbox__navigation {
  display: none;
  place-items: center;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: var(--zpd-radius-full);
  transform: translateY(-50%);
}

.app-gallery-lightbox__navigation--previous {
  left: var(--zpd-space-3);
}

.app-gallery-lightbox__navigation--next {
  right: var(--zpd-space-3);
}

.app-gallery-lightbox__counter {
  bottom: var(--zpd-space-3);
  left: 50%;
  padding: 5px 10px;
  border-radius: var(--zpd-radius-full);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

@media (min-width: 768px) {
  .app-gallery-lightbox__navigation {
    display: grid;
  }
}

.app-request-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.app-filter-pill {
  min-height: 34px;
  padding: 0 12px;
  color: var(--zpd-text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-bg-page);
  cursor: pointer;
}

.app-filter-pill.is-active {
  color: var(--zpd-text-on-inverse);
  border-color: var(--zpd-action-default);
  background: var(--zpd-action-default);
}

.app-request-list {
  display: grid;
  gap: 10px;
}

/*
 * Wiersz zgłoszenia (klient + kolejka arborysty). Kolejność skanowania: kafel
 * statusu, tytuł, wiersz faktów z ikonami, po prawej pilność/status i data.
 */
.app-request-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--zpd-border-subtle);
  border-left: 3px solid transparent;
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-page);
  box-shadow: none;
}

/* Pilne widać przed przeczytaniem tytułu — ten sam sygnał co karta projektu wymagającego uwagi. */
.app-request-item--urgent {
  border-left-color: var(--zpd-health-critical);
}

.app-request-item--clickable {
  cursor: pointer;
  transition: background-color var(--zpd-duration-fast) var(--zpd-ease), border-color var(--zpd-duration-fast) var(--zpd-ease);
}

.app-request-item--clickable:hover,
.app-request-item--clickable:focus-visible,
.app-request-item--clickable:focus-within {
  border-color: var(--zpd-border-strong);
  background: color-mix(in srgb, var(--zpd-bg-accent-subtle) 45%, var(--zpd-bg-page));
}

.app-request-item--clickable.app-request-item--urgent:hover,
.app-request-item--clickable.app-request-item--urgent:focus-visible,
.app-request-item--clickable.app-request-item--urgent:focus-within {
  border-left-color: var(--zpd-health-critical);
}

.app-request-item--clickable:focus-visible {
  outline: 2px solid var(--zpd-action-ring);
  outline-offset: 2px;
}

.app-request-item__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--zpd-action-default);
  border-radius: var(--zpd-radius-md);
  background: var(--zpd-bg-accent-subtle);
}

/* Kafel niesie ten sam ton co badge statusu — status czytelny bez czytania etykiety. */
.app-request-item__icon--info {
  color: var(--zpd-color-forest-700);
  background: var(--zpd-bg-surface);
}

.app-request-item__icon--warning {
  color: var(--zpd-health-fair);
  background: var(--zpd-health-fair-bg);
}

.app-request-item__icon--success {
  color: var(--zpd-health-good);
  background: var(--zpd-health-good-bg);
}

.app-request-item__icon .lucide {
  width: 19px;
  height: 19px;
}

.app-request-item__main {
  min-width: 0;
}

.app-request-item__title {
  margin: 0 0 5px;
  color: var(--zpd-text-heading);
  font-size: 15px;
  font-weight: var(--zpd-font-weight-bold);
  line-height: 1.35;
}

.app-request-item__title a {
  color: inherit;
  text-decoration: none;
}

.app-request-item__title a:hover,
.app-request-item__title a:focus-visible {
  text-decoration: underline;
}

.app-request-item__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 0;
  color: var(--zpd-text-secondary);
  font-size: 12px;
}

.app-request-item__fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.app-request-item__fact .lucide {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--zpd-text-muted);
}

.app-request-item__reference {
  color: var(--zpd-text-muted);
  font-weight: var(--zpd-font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.app-request-item__project a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--zpd-text-accent);
  font-weight: var(--zpd-font-weight-semibold);
  text-decoration: none;
}

.app-request-item__project a:hover,
.app-request-item__project a:focus-visible {
  text-decoration: underline;
}

.app-request-item__project a .lucide {
  color: inherit;
  width: 12px;
  height: 12px;
}

/* Zgłoszenie bez wykonawcy to dla arborysty zaproszenie do przyjęcia, nie brak danych. */
.app-request-item__fact--free {
  color: var(--zpd-text-accent);
  font-weight: var(--zpd-font-weight-semibold);
}

.app-request-item__fact--free .lucide {
  color: inherit;
}

.app-request-item__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 8px 0 0;
  color: var(--zpd-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.app-request-item__comment {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-left: 2px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-sm);
  background: var(--zpd-bg-surface);
  color: var(--zpd-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.app-request-item__comment-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  color: var(--zpd-text-muted);
  font-size: 11px;
  font-weight: var(--zpd-font-weight-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.app-request-item__comment-label .lucide {
  width: 13px;
  height: 13px;
}

.app-request-item__aside {
  display: grid;
  justify-items: end;
  gap: 7px;
  text-align: right;
}

.app-request-item__flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.app-request-item__date {
  color: var(--zpd-text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.app-request-modal {
  max-width: 620px;
}

.app-request-detail {
  display: grid;
  gap: 20px;
}

.app-request-detail__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-request-description {
  margin-top: var(--zpd-space-3);
}

.app-request-description p {
  margin: var(--zpd-space-1) 0 0;
  white-space: pre-line;
}

.app-request-form {
  display: grid;
  gap: 20px;
}

.app-urgency-fieldset {
  padding: 0;
  border: 0;
}

.app-urgency-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.app-urgency-options label {
  position: relative;
}

.app-urgency-options input {
  position: absolute;
  opacity: 0;
}

.app-urgency-options span {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 8px;
  padding: 12px;
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-md);
  cursor: pointer;
}

.app-urgency-options .lucide {
  grid-row: 1 / 3;
  width: 20px;
  height: 20px;
  color: var(--zpd-text-muted);
}

.app-urgency-options strong {
  color: var(--zpd-text-heading);
  font-size: 13px;
}

.app-urgency-options small {
  color: var(--zpd-text-muted);
  font-size: 11px;
}

.app-urgency-options input:checked + span {
  border-color: var(--zpd-action-accent);
  background: var(--zpd-bg-accent-subtle);
  box-shadow: 0 0 0 2px var(--zpd-action-ring);
}

.app-toast-region {
  position: fixed;
  z-index: 9999;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  width: min(360px, calc(100vw - 36px));
  padding: 12px;
  color: var(--zpd-text-primary);
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-lg);
  background: var(--zpd-bg-page);
  box-shadow: var(--zpd-shadow-lg);
  animation: app-toast-in var(--zpd-duration-slow) var(--zpd-ease) both;
  pointer-events: auto;
}

.app-toast__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--zpd-action-accent);
  border-radius: var(--zpd-radius-full);
  background: var(--zpd-bg-accent-subtle);
}

.app-toast--success .app-toast__icon {
  color: var(--zpd-health-good);
  background: var(--zpd-health-good-bg);
}

.app-toast--warning .app-toast__icon {
  color: var(--zpd-health-fair);
  background: var(--zpd-health-fair-bg);
}

.app-toast--error .app-toast__icon,
.app-toast--danger .app-toast__icon {
  color: var(--zpd-health-critical);
  background: var(--zpd-health-critical-bg);
}

.app-toast--info .app-toast__icon {
  color: var(--zpd-color-forest-700);
  background: var(--zpd-bg-surface);
}

.app-toast strong,
.app-toast span {
  display: block;
}

.app-toast strong {
  font-size: 13px;
}

.app-toast span {
  margin-top: 1px;
  color: var(--zpd-text-muted);
  font-size: 11px;
}

.app-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.leaflet-control-attribution {
  font-size: 9px;
}

.leaflet-control-zoom a {
  color: var(--zpd-action-default);
}

@keyframes app-toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* na desktopie (layout dwukolumnowy .app-care-layout, patrz breakpoint 767px niżej)
   aside „Kolejna inspekcja"/„Słownik pielęgnacji" zostaje przyklejony pod topbarem
   i przewija się niezależnie od głównej kolumny, zamiast uciekać poza widoczny obszar
   przy długiej historii opieki albo długim słowniku */
@media (min-width: 768px) {
  .app-care-aside {
    position: sticky;
    top: calc(var(--app-topbar) + 14px);
    max-height: calc(100vh - var(--app-topbar) - 28px);
    overflow-y: auto;
  }
}

@media (max-width: 1199px) {
  .app-map-layout {
    grid-template-columns: 268px minmax(0, 1fr);
  }

  .app-map-legend {
    max-width: 330px;
  }
}

@media (max-width: 1023px) {
  .app-shell {
    display: block;
  }

.app-content {
    padding-inline: 20px;
  }

  .app-overview-grid {
    grid-template-columns: 1fr;
  }

  .app-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-tree-hero {
    grid-template-columns: 1fr;
  }

  .app-tree-photo,
  .app-tree-photo > img,
  .app-tree-photo-placeholder {
    min-height: 520px;
  }

  .app-tree-environment-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .app-tree-eco-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-inspection-record,
  .app-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-inspection-record > div:nth-child(3n),
  .app-context-grid > div:nth-child(3n) {
    border-right: 1px solid var(--zpd-border-subtle);
  }

  .app-inspection-record > div:nth-child(2n),
  .app-context-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .app-care-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 767px) {
  :root {
    --app-topbar: 68px;
  }

  .app-topbar {
    padding-inline: 12px;
  }

  .app-account-name,
  .app-account-button > .lucide {
    display: none;
  }

  /* dropdown powiadomień jako arkusz na całą szerokość: `position: static` na
     wrapperze przenosi blok zawierający panel z dzwonka na sticky topbar, więc
     panel kotwiczy się do krawędzi ekranu zamiast uciekać poza nią w lewo
     (dzwonek stoi blisko prawej krawędzi, a 340px nie mieści się na telefonie) */
  .app-notification-dropdown {
    position: static;
  }

  .app-notification-panel {
    inset-inline: var(--zpd-space-3);
    top: calc(100% + 4px);
    width: auto;
    max-width: none;
    max-height: calc(100dvh - var(--app-topbar) - var(--zpd-space-6));
  }

  .app-notification-list__header {
    padding: var(--zpd-space-3);
  }

  .app-notification-list__mark-all {
    min-height: 40px;
    font-size: 13px;
  }

  .app-notification-item {
    min-height: 56px;
    padding: var(--zpd-space-3);
  }

  .app-notification-item__label {
    -webkit-line-clamp: 3;
  }

  /* palec zamiast kursora: pełny cel dotykowy 44px, ikona zostaje wizualnie mniejsza;
     tylko ostatni przycisk (usuń) dostaje ujemny margines po prawej, żeby wyrównać do krawędzi */
  .app-notification-item__mark,
  .app-notification-item__delete {
    width: 44px;
    height: 44px;
    margin-block: -6px;
  }

  .app-notification-item__delete {
    margin-right: -8px;
  }

  .app-notification-list__load-more {
    min-height: 48px;
    font-size: 13px;
  }

  .app-project-switcher {
    grid-template-columns: 30px minmax(0, 1fr) 14px;
    flex: 1;
    min-width: 0;
    padding-right: 8px;
  }

  .app-project-switcher__icon {
    width: 30px;
    height: 30px;
  }

  .app-project-switcher__value {
    font-size: 12px;
  }

.app-content {
    padding: 16px 14px 28px;
  }

  .app-page-header,
  .app-page-header--compact {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .app-page-header__actions {
    width: 100%;
  }

  .app-page-header__actions .zpd-btn {
    flex: 1;
  }

  .app-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .app-stat-card .zpd-card__body {
    padding: 12px;
  }

  .app-stat__head {
    gap: 7px;
  }

  .app-stat__head .zpd-stat__label {
    font-size: 11px;
  }

  .app-stat .zpd-stat__value {
    font-size: 24px;
  }

  .app-stat .zpd-stat__note,
  .app-stat .zpd-stat__trend,
  .app-stat__link {
    font-size: 10px;
  }

  .app-mini-map {
    height: 320px;
  }

  .app-map-toolbar,
  .app-list-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .app-filter-search,
  .app-filter-search--wide {
    flex: 1 1 100%;
    min-width: 0;
  }

  .app-compact-select,
  .app-filter-check {
    flex: 1 1 auto;
  }

  .app-compact-select select {
    flex: 1;
  }

  .app-document-filters {
    display: flex;
    width: 100%;
  }

  .app-document-filters .app-compact-select,
  .app-document-filters .app-compact-select select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-map-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .app-map-card {
    order: 1;
    height: 54dvh;
    min-height: 390px;
    overflow: hidden;
    border: 1px solid var(--zpd-border-default);
    border-radius: var(--zpd-radius-xl);
  }

  .app-map-list-panel {
    order: 2;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--zpd-border-default);
    border-radius: var(--zpd-radius-lg);
  }

  .app-map-list {
    height: auto;
    min-height: 0;
    max-height: 360px;
  }

  .app-map-legend {
    right: 8px;
    bottom: 18px;
    left: 8px;
    justify-content: center;
    max-width: none;
  }

  .app-basemap-switch {
    top: 8px;
    left: 8px;
  }

  .app-tree-hero,
  .app-tree-environment-layout {
    grid-template-columns: 1fr;
  }

  .app-tree-photo,
  .app-tree-photo > img,
  .app-tree-photo-placeholder {
    min-height: 440px;
  }

  .app-tree-summary {
    padding: var(--zpd-space-5);
  }

  .app-tree-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-tree-actions {
    width: 100%;
  }

  .app-tree-actions .zpd-btn {
    flex: 1;
  }

  .app-tree-heading-row {
    gap: var(--zpd-space-4);
  }

  .app-tree-params {
    margin-top: var(--zpd-space-6);
    padding-top: var(--zpd-space-6);
  }

  .app-tree-eco-grid {
    grid-template-columns: 1fr;
  }

  .app-tree-health-card .zpd-card__body {
    min-height: 250px;
  }

  .app-tree-detail-map {
    min-height: 210px;
  }

  .app-inspection-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-inspection-head .zpd-btn {
    width: 100%;
  }

  .app-inspection-card {
    padding: 15px;
  }

  .app-inspection-record,
  .app-context-grid,
  .app-inspection-split,
  .app-conclusion-grid,
  .app-care-layout {
    grid-template-columns: 1fr;
  }

  .app-inspection-record > div,
  .app-context-grid > div,
  .app-inspection-record > div:nth-child(2n),
  .app-context-grid > div:nth-child(2n),
  .app-inspection-record > div:nth-child(3n),
  .app-context-grid > div:nth-child(3n) {
    border-right: 0;
  }

  .app-inspection-section-head--between {
    flex-wrap: wrap;
  }

  .app-score-legend {
    flex-basis: 100%;
    margin: 2px 0 0 45px;
  }

  .app-assessment-table th,
  .app-assessment-table td,
  .app-care-table th,
  .app-care-table td {
    padding: 9px 10px;
  }

  .app-care-aside {
    grid-template-columns: 1fr;
  }

  .app-care-table {
    min-width: 620px;
  }

  .app-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-request-item {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
  }

  .app-request-item__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    grid-column: 2;
    text-align: left;
  }

  .app-request-item__flags {
    justify-content: flex-start;
  }

  .app-urgency-options,
  .app-request-form .zpd-form-grid--2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  .app-tree-photo,
  .app-tree-photo > img,
  .app-tree-photo-placeholder {
    min-height: 390px;
  }

  .app-tree-brand-tag,
  .app-tree-number-tag {
    left: var(--zpd-space-4);
  }

  .app-tree-brand-tag {
    top: var(--zpd-space-4);
    font-size: 10px;
  }

  .app-tree-number-tag {
    bottom: var(--zpd-space-4);
  }

  .app-tree-heading-row {
    display: grid;
  }

  .app-tree-health-summary {
    justify-items: start;
  }

  .app-tree-qr {
    grid-template-columns: 86px 1fr;
    align-items: center;
    justify-items: start;
    max-width: none;
    text-align: left;
  }

  .app-tree-qr .app-qr__code svg {
    width: 86px;
    height: 86px;
  }

  .app-tree-inspection-cards {
    grid-template-columns: 1fr;
  }

  .app-tree-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-header-badges .zpd-badge--outline {
    display: none;
  }

  .app-map-legend span {
    font-size: 0;
  }

  .app-map-legend i {
    width: 10px;
    height: 10px;
  }

}

/* Mobilny panel klienta: ten sam zwarty tryb pracy co w panelu arborysty. */
@media (max-width: 767px) {
  .app-shell--client .is-mobile-filters-ready .app-mobile-filters__toggle {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    margin-bottom: var(--zpd-space-3);
  }

  /* Zwinięcie chowa panel, otwarcie NIE ustawia `display` — każdy panel wraca do
     własnego układu (`flex` w toolbarach, `grid` w formularzach filtrów). Wcześniej
     stan otwarty wyliczał `display: flex` z listy nazw klas, więc każdy nowy panel
     albo nie otwierał się wcale, albo dostawał cudzy układ. */
  .app-shell--client .is-mobile-filters-ready:not(.is-mobile-filters-open) .app-mobile-filters__panel {
    display: none;
  }

  .app-shell--client .app-mobile-filters__toggle .lucide:last-child {
    transition: transform var(--zpd-duration-base) var(--zpd-ease);
  }

  .app-shell--client .is-mobile-filters-open .app-mobile-filters__toggle .lucide:last-child {
    transform: rotate(180deg);
  }

  /* Otwarty toolbar na telefonie jest kartą z jedną kolumną: kontrolki na pełną
     szerokość i cele dotykowe 44 px, zamiast ściśniętego paska z desktopu, w którym
     select i checkbox walczyły o resztki wiersza. Pigułki zgłoszeń mają własny układ
     (zawijany rząd) i celowo nie są tu ruszane. */
  .app-shell--client .is-mobile-filters-open .app-map-toolbar,
  .app-shell--client .is-mobile-filters-open .app-list-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: var(--zpd-space-3);
  }

  .app-shell--client .is-mobile-filters-open .app-map-toolbar > *,
  .app-shell--client .is-mobile-filters-open .app-list-toolbar > * {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .app-shell--client .is-mobile-filters-open .app-map-toolbar .zpd-spacer,
  .app-shell--client .is-mobile-filters-open .app-list-toolbar .zpd-spacer {
    display: none;
  }

  .app-shell--client .is-mobile-filters-open .app-filter-search,
  .app-shell--client .is-mobile-filters-open .app-filter-search input,
  .app-shell--client .is-mobile-filters-open .app-compact-select,
  .app-shell--client .is-mobile-filters-open .app-filter-check,
  .app-shell--client .is-mobile-filters-open .app-filter-check span {
    height: 44px;
  }

  /* Klikalny jest `span` w środku `<label>`, nie sama etykieta — bez tego przełącznik
     zostawał wąskim prostokątem w lewym rogu pełnowymiarowego wiersza. */
  .app-shell--client .is-mobile-filters-open .app-filter-check span {
    justify-content: center;
    width: 100%;
  }

  .app-shell--client .is-mobile-filters-open .app-compact-select select {
    flex: 1 1 auto;
    max-width: none;
  }

  .app-shell--client .app-request-filters {
    flex-wrap: wrap;
    padding: var(--zpd-space-3);
    border: 1px solid var(--zpd-border-subtle);
    border-radius: var(--zpd-radius-lg);
    background: var(--zpd-bg-page);
  }

  .app-shell--client .app-request-filters .app-filter-pill {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .app-shell--client .app-map-card:not(.is-fullscreen) {
    height: clamp(460px, 68dvh, 720px);
    min-height: 460px;
  }

  .app-shell--client .app-tree-table tbody {
    display: grid;
    gap: var(--zpd-space-3);
    padding: var(--zpd-space-3);
  }

  .app-shell--client .app-tree-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--zpd-space-2) var(--zpd-space-3);
    margin: 0;
    padding: var(--zpd-space-3);
    border-color: var(--zpd-border-default);
    border-radius: var(--zpd-radius-lg);
    background: var(--zpd-bg-page);
    box-shadow: var(--zpd-shadow-sm);
  }

  .app-shell--client .app-tree-table td {
    min-width: 0;
    border: 0;
  }

  .app-shell--client .app-tree-table td:nth-child(1),
  .app-shell--client .app-tree-table td:nth-child(2) {
    align-self: start;
    justify-content: flex-start;
    padding: 0;
    text-align: left;
  }

  .app-shell--client .app-tree-table td:nth-child(1)::before,
  .app-shell--client .app-tree-table td:nth-child(2)::before {
    display: none;
  }

  .app-shell--client .app-tree-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .app-shell--client .app-tree-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .app-shell--client .app-tree-table td:nth-child(n + 3):not(:last-child) {
    grid-column: 1 / -1;
    padding: var(--zpd-space-2) 0 0;
    text-align: right;
  }

  .app-shell--client .app-tree-table td:last-child {
    display: none;
  }

  .app-shell--client .app-tree-table__species strong {
    font-size: 14px;
  }

  .app-shell--client .app-tree-table__species em {
    display: none;
  }

  .app-shell--client .app-tree-table__detail-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--zpd-radius-lg);
  }

  .app-shell--client .app-tree-table__detail-link:focus-visible {
    outline: none;
  }

  .app-shell--client .app-tree-table__detail-link:focus-visible::after {
    outline: 2px solid var(--zpd-action-accent);
    outline-offset: 2px;
  }

  .app-shell--client .app-tree-table__params {
    white-space: normal;
  }

  .app-shell--client .app-tree-toolbar {
    position: sticky;
    z-index: 29;
    top: var(--app-topbar);
    flex-flow: row nowrap;
    align-items: center;
    gap: var(--zpd-space-2);
    margin-bottom: var(--zpd-space-4);
    padding: var(--zpd-space-2);
    background: color-mix(in srgb, var(--zpd-bg-raised) 92%, transparent);
    backdrop-filter: blur(8px);
  }

  .app-shell--client .app-tree-toolbar .app-back-link {
    align-self: center;
    flex: 0 0 44px;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--zpd-border-default);
    border-radius: var(--zpd-radius-md);
    background: var(--zpd-bg-page);
  }

  .app-shell--client .app-tree-toolbar .app-back-link span {
    display: none;
  }

  .app-shell--client .app-tree-toolbar .app-tree-actions--client {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--zpd-space-1);
    width: auto;
    min-width: 0;
  }

  .app-shell--client .app-tree-toolbar .app-tree-actions--with-menu {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .app-shell--client .app-tree-toolbar .app-tree-actions--menu-only {
    flex: 0 0 auto;
    grid-template-columns: auto;
    margin-left: auto;
  }

  .app-shell--client .app-tree-toolbar .app-tree-action-secondary {
    display: none;
  }

  .app-shell--client .app-tree-toolbar .app-tree-action-menu--client-mobile {
    display: inline-flex;
  }

  .app-shell--client .app-tree-toolbar .app-tree-actions--client > .zpd-btn,
  .app-shell--client .app-tree-toolbar .app-tree-action-menu--client-mobile > .zpd-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .app-shell--client .app-tree-toolbar .app-tree-action-menu--client-mobile > .zpd-btn .lucide:last-child {
    display: none;
  }
}


/* ==========================================================================
   Shared panel UX foundation
   Application-level layer over zpd-ui.min.css. Sidebar/topbar structure stays intact.
   ========================================================================== */

.app-content .zpd-card {
  --_pad: var(--app-card-padding);
  border-radius: var(--app-card-radius);
  box-shadow: none;
}

.app-content .zpd-card--surface,
.app-content .zpd-card--accent {
  box-shadow: none;
}

.app-content .zpd-card__footer {
  padding-inline: var(--app-card-padding);
}

.app-page-header {
  align-items: flex-start;
  gap: var(--zpd-space-4) var(--zpd-space-6);
  margin-bottom: var(--app-section-gap);
}

.app-page-header .zpd-page-header__titles {
  flex: 1 1 32rem;
}

.app-page-header .zpd-page-header__title {
  font-size: clamp(28px, 2.4vw, 32px);
  line-height: 1.15;
}

.app-page-header .zpd-page-header__desc,
.app-page-header__description {
  max-width: 68ch;
  color: var(--zpd-text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.app-page-header__description > * + * {
  margin-top: var(--zpd-space-2);
}

.app-page-header .zpd-page-header__actions {
  align-self: flex-start;
  justify-content: flex-end;
  max-width: min(100%, 42rem);
}

.app-section-title,
.app-content .zpd-card__title {
  font-size: 18px;
  line-height: 1.3;
}

.app-content .zpd-overline {
  font-size: 12px;
  line-height: 1.4;
}

.app-map-toolbar,
.app-list-toolbar {
  min-height: 56px;
  gap: var(--zpd-space-2);
  margin-bottom: var(--zpd-space-4);
  padding: var(--zpd-space-2);
  border-radius: var(--app-card-radius);
  box-shadow: none;
}

.app-filter-search,
.app-filter-search input,
.app-compact-select,
.app-filter-check {
  min-height: var(--app-control-height);
  height: var(--app-control-height);
}

.app-filter-check span {
  min-height: var(--app-control-height);
  padding-block: 0;
}

.app-filter-pill {
  min-height: var(--app-control-height);
}

.app-table-card,
.app-map-layout {
  border-radius: var(--app-card-radius);
  box-shadow: none;
}

.app-content .zpd-table th,
.app-content .zpd-table td {
  padding-block: 14px;
}

.app-content .zpd-table thead th {
  color: var(--zpd-text-secondary);
  font-size: 12px;
}

.app-table-action {
  width: var(--app-control-height);
  height: var(--app-control-height);
}

.app-empty-state {
  min-height: 220px;
  padding: var(--zpd-space-8) var(--zpd-space-6);
}

.app-request-list {
  gap: var(--zpd-space-3);
}

.app-request-item {
  padding: var(--zpd-space-4);
  border-radius: var(--app-card-radius);
}

.app-request-item__title {
  font-size: 16px;
  line-height: 1.35;
}

.app-request-item__facts {
  row-gap: var(--zpd-space-2);
}

.app-request-tabs,
.app-filter-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--zpd-border-subtle);
  border-radius: 10px;
  background: var(--zpd-bg-surface);
  scrollbar-width: thin;
}

.app-request-tabs .zpd-btn,
.app-filter-tabs .zpd-btn {
  min-height: var(--app-control-height);
  border-color: transparent;
  border-radius: 7px;
  box-shadow: none;
}

.app-request-tabs .zpd-btn--primary,
.app-filter-tabs .zpd-btn--primary {
  --_bg: var(--zpd-bg-accent-subtle);
  --_bg-hover: var(--zpd-bg-accent-subtle);
  --_fg: var(--zpd-action-default);
  border-color: var(--zpd-border-strong);
}

.app-tree-form,
.app-inspection-form {
  width: min(100%, 840px);
}

.app-arborist #request-edit-form {
  width: min(100%, 680px);
}

.app-tree-form .zpd-form-grid,
.app-inspection-form .zpd-form-grid {
  gap: var(--zpd-space-4);
}

/* skala 1-4 jako kafelki radio — jedno tapnięcie zamiast otwierania natywnego selecta */
.zpd-scale {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-content: start;
}

.zpd-scale .zpd-label {
  margin: 0;
}

.zpd-scale__options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.zpd-scale__option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--app-touch-target);
  border: 1px solid var(--zpd-border-default);
  border-radius: var(--zpd-radius-sm);
  background: var(--zpd-bg-raised);
  color: var(--zpd-text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

/* radio zostaje w drzewie dostępności i obsługuje klawiaturę, ale nie jest widoczne */
.zpd-scale__option input[type='radio'] {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.zpd-scale__option:hover {
  border-color: var(--zpd-border-strong);
  background: var(--zpd-bg-surface);
}

.zpd-scale__option:has(input:focus-visible) {
  outline: 2px solid var(--zpd-action-default);
  outline-offset: 2px;
}

.zpd-scale__option:has(input:checked) {
  border-color: var(--zpd-border-strong);
  background: var(--zpd-bg-accent-subtle);
  color: var(--zpd-text-accent);
  font-weight: 600;
}

.zpd-field--error .zpd-scale__option {
  border-color: var(--zpd-health-critical);
}

/* sekcje 04/05 — lista pól ze skalą, jedno pod drugim */
.app-scale-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--zpd-space-4);
}

/* sekcja 03 — macierz objaw × strefa */
.app-scale-matrix {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--zpd-space-6);
  margin-block-start: var(--zpd-space-5);
}

/*
  linia nad wierszem rozdziela kolejne objawy — bez niej sześć jednakowych bloków
  kafelków zlewa się w jedną ścianę; kreska idzie na wiersz, nie na sam nagłówek,
  żeby biegła przez całą szerokość macierzy także przy wyśrodkowanym tytule
*/
.app-scale-matrix__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--zpd-space-3);
  padding-block-start: var(--zpd-space-6);
  border-block-start: 1px solid var(--zpd-border-subtle);
}

.app-scale-matrix__row:first-child {
  padding-block-start: 0;
  border-block-start: 0;
}

.app-scale-matrix__symptom {
  margin: 0;
  color: var(--zpd-text-heading);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.app-scale-matrix__zones {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--zpd-space-3);
}

@media (min-width: 640px) {
  .app-scale-matrix__zones {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--zpd-space-4);
  }

  /* wyśrodkowany dopiero nad trzema kolumnami — w układzie jednokolumnowym
     rozjeżdżałby się z wyrównanymi do lewej etykietami stref */
  .app-scale-matrix__symptom {
    text-align: center;
  }

  .app-scale-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-tree-hero {
  border-radius: var(--app-card-radius);
}

.app-tree-photo,
.app-tree-photo > img,
.app-tree-photo-placeholder {
  min-height: 520px;
}

.app-tree-summary {
  padding: clamp(24px, 3vw, 32px);
}

.app-tree-eco-grid {
  gap: var(--app-grid-gap);
}

.app-tree-map-inline,
.app-tree-detail-map {
  border-radius: var(--app-card-radius);
}

.app-inspection-card {
  border-radius: var(--app-card-radius);
}

.app-arborist-actionbar {
  border-top-color: var(--zpd-border-subtle);
}

.app-project-card,
.app-project-metric {
  box-shadow: none;
}

.app-project-metric:hover,
.app-project-metric:focus-visible {
  border-color: var(--zpd-border-strong);
  box-shadow: none;
}

.app-project-section__title {
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 1099px) and (min-width: 768px) {
  .app-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .app-content {
    padding: 16px var(--app-content-gutter-mobile) 32px;
  }

  .app-content .zpd-card {
    --_pad: var(--app-card-padding-mobile);
  }

  .app-card-header {
    padding: var(--app-card-padding-mobile) var(--app-card-padding-mobile) 0;
  }

  .app-content .zpd-card__footer {
    padding-inline: var(--app-card-padding-mobile);
  }

  .app-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--zpd-space-3);
    margin-bottom: var(--zpd-space-5);
  }

  .app-page-header .zpd-page-header__titles,
  .app-page-header .zpd-page-header__actions {
    width: 100%;
    max-width: none;
    margin-inline-start: 0;
  }

  .app-page-header .zpd-page-header__title,
  .app-page-header--compact .zpd-page-header__title {
    font-size: clamp(24px, 8vw, 28px);
  }

  .app-page-header .zpd-page-header__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .app-page-header .zpd-page-header__actions > .zpd-btn,
  .app-page-header .zpd-page-header__actions > form,
  .app-page-header .zpd-page-header__actions > form > .zpd-btn {
    width: 100%;
  }

  .app-content .zpd-btn,
  .app-content button,
  .app-table-action,
  .app-filter-pill,
  .app-filter-search,
  .app-filter-search input,
  .app-compact-select,
  .app-filter-check,
  .app-filter-check span {
    min-height: var(--app-touch-target);
  }

  .app-content .zpd-btn--icon,
  .app-table-action {
    min-width: var(--app-touch-target);
    width: var(--app-touch-target);
    height: var(--app-touch-target);
  }

  .app-content input,
  .app-content select,
  .app-content textarea {
    font-size: 16px;
  }

  .app-map-toolbar,
  .app-list-toolbar {
    border-radius: var(--app-card-radius);
  }

  .app-request-item {
    padding: var(--zpd-space-3);
  }

  .app-request-tabs,
  .app-filter-tabs {
    width: 100%;
  }

  .app-request-tabs .zpd-btn,
  .app-filter-tabs .zpd-btn {
    flex: 1 0 auto;
    min-height: var(--app-touch-target);
  }

  .app-tree-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-tree-photo,
  .app-tree-photo > img,
  .app-tree-photo-placeholder {
    width: 100%;
    min-height: 0;
    max-height: 360px;
    aspect-ratio: 4 / 3;
  }

  .app-tree-photo > img {
    object-fit: cover;
  }

  .app-tree-summary {
    padding: var(--zpd-space-5) var(--app-card-padding-mobile);
  }

  .app-tree-environment-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-tree-map-inline {
    min-height: 240px;
  }

  .app-tree-map-inline .app-tree-detail-map {
    min-height: 240px;
  }

  .app-inspection-head .zpd-btn {
    width: 100%;
  }

  .app-header-badges .zpd-badge--outline {
    display: inline-flex;
  }
}

@media (max-width: 479px) {
  .app-content {
    padding-inline: 14px;
  }

  .app-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-tree-photo,
  .app-tree-photo > img,
  .app-tree-photo-placeholder {
    min-height: 0;
    max-height: 330px;
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

.zpd-cookie-consent {
  box-sizing: border-box;
  position: fixed;
  z-index: 60;
  right: var(--zpd-space-5);
  bottom: var(--zpd-space-5);
  width: min(360px, calc(100vw - 32px));
  border-radius: var(--app-card-radius);
  background: var(--zpd-bg-raised);
  box-shadow: var(--zpd-shadow-lg);
}

.zpd-cookie-consent__body {
  padding: var(--zpd-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--zpd-space-3);
}

.zpd-cookie-consent__title {
  margin: 0;
  font-family: var(--zpd-font-family-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--zpd-text-heading);
}

.zpd-cookie-consent__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--zpd-text-secondary);
}

.zpd-cookie-consent__link {
  color: var(--zpd-text-accent);
}

@media (max-width: 767px) {
  .zpd-cookie-consent {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: var(--app-card-radius) var(--app-card-radius) 0 0;
  }

  .zpd-cookie-consent__body {
    padding: var(--app-card-padding-mobile);
  }
}

/* Znak zdrowia drzewa — pulsujący pierścień (pogrubiony `box-shadow` z zpd-ui.min.css) i bicie serca. */
.zpd-health__mark {
  box-shadow:
    0 0 0 6px var(--_bg),
    0 0 0 8px color-mix(in srgb, var(--_fg) 45%, transparent);
  animation: app-health-ring 2.4s ease-in-out infinite;
}

.zpd-health--sm .zpd-health__mark {
  box-shadow:
    0 0 0 5px var(--_bg),
    0 0 0 7px color-mix(in srgb, var(--_fg) 45%, transparent);
  animation-name: app-health-ring-sm;
}

.zpd-health__mark .lucide {
  animation: app-health-beat 2.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes app-health-ring {
  0%,
  100% {
    box-shadow:
      0 0 0 6px var(--_bg),
      0 0 0 8px color-mix(in srgb, var(--_fg) 45%, transparent);
  }

  45% {
    box-shadow:
      0 0 0 8px var(--_bg),
      0 0 0 13px color-mix(in srgb, var(--_fg) 12%, transparent);
  }
}

@keyframes app-health-ring-sm {
  0%,
  100% {
    box-shadow:
      0 0 0 5px var(--_bg),
      0 0 0 7px color-mix(in srgb, var(--_fg) 45%, transparent);
  }

  45% {
    box-shadow:
      0 0 0 6px var(--_bg),
      0 0 0 10px color-mix(in srgb, var(--_fg) 12%, transparent);
  }
}

@keyframes app-health-beat {
  0%,
  100% {
    transform: scale(1);
  }

  20% {
    transform: scale(1.12);
  }

  32% {
    transform: scale(1.02);
  }

  46% {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zpd-health__mark,
  .zpd-health__mark .lucide {
    animation: none !important;
  }
}
