/* ==========================================================================
   Šunų aikštelės — komponentai ir išdėstymas.
   Spalvos, spinduliai, šešėliai ir judesys — TIK tokenai iš tokens.css.
   ========================================================================== */

/* --- Bazė ----------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font: 400 15px/24px var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

img {
  max-width: 100%;
  background: var(--line); /* fonas kol kraunasi — be šuolių */
}

a {
  color: var(--pine-700);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.icon {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

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

/* --- Mygtukai ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-s);
  font: 500 15px/1 var(--font-ui);
  white-space: nowrap;
  text-decoration: none;
  background: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

/* Dydžių variantai — kortelėse ir CTA juostose (v3) */
.btn-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 9px;
}

.btn-lg {
  height: 52px;
  padding: 0 22px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-primary {
  background: var(--pine-700);
  color: #FFFFFF; /* balta ir tamsioje temoje — ne --surface */
}

.btn-primary:hover {
  background: var(--pine-600);
}

.btn-primary:active {
  background: var(--pine-800);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.btn-secondary:hover {
  border-color: var(--ink-faint);
}

.btn-ghost {
  color: var(--pine-700);
  padding: 0 var(--sp-2);
}

.btn-ghost:hover {
  background: var(--pine-100);
  color: var(--pine-700);
}

/* Tekstinis mygtukas — „Išvalyti" ir pan. */
.btn-link {
  font: 500 13px/1 var(--font-ui);
  color: var(--pine-700);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}

.icon-btn:hover {
  background: var(--pine-100);
}

/* Dalinimosi piliulė — balta su vos matomu gradientu, pakyla užvedus.
   Elgseną (share sheet / kopija + toast) tvarko app.js [data-action="share-park"]. */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 42px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F5F0 100%);
  color: var(--ink);
  font: 500 14px/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.share-btn .icon {
  color: var(--pine-700);
}

.share-btn:hover {
  border-color: var(--ink-faint);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.share-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-1);
}

/* Trumpa „nukopijuota" būsena (uždeda app.js 1,6 s) */
.share-btn.is-copied {
  border-color: var(--pine-600);
  background: var(--pine-100);
  color: var(--pine-700);
}

/* --- Antraštė ------------------------------------------------------------- */

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-header {
  flex: none;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--sp-5);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--pine-700);
  color: #FFFFFF;
}

.logo-word {
  font: 600 16px/1 var(--font-ui);
  color: var(--pine-700);
  white-space: nowrap;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 340px;
  height: 42px;
  padding: 0 var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.search-field .icon {
  color: var(--ink-faint);
}

/* Fokusas — švelnus žiedas vietoj kieto outline */
.search-field:focus-within {
  border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgb(42 106 80 / 0.15);
}

/* Letenos ženklas — mobiliojo logotipo vieta paieškos lauke */
.search-mark {
  display: none;
}

/* × mygtukas — matomumą (.is-visible) valdo app.js */
.search-clear {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  display: none;
}

.search-clear.is-visible {
  display: grid;
  place-items: center;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: 400 15px/24px var(--font-ui);
  color: var(--ink);
}

.search-field input::placeholder {
  color: var(--ink-faint);
}

.search-field input:focus {
  outline: none;
}

/* „Miestai" pradeda dešinįjį veiksmų bloką — „Siūlyti aikštelę" glaudžiasi šalia */
.header-cities {
  margin-left: auto;
}

/* --- Pagrindinis išdėstymas (desktop) ------------------------------------- */

.app-main {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.sidebar {
  flex: none;
  width: 380px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.sheet-grab {
  display: none;
}

/* Peek juosta — matoma tik mobiliame lape */
.peek-line {
  display: none;
}

.filter-bar {
  flex: none;
  padding: 14px 12px 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* --- Filtrų žetonai ------------------------------------------------------- */

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip-face {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink);
  font: 500 13.5px/1 var(--font-ui);
  box-shadow: var(--shadow-1);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}

/* Varnelė tipo žetone — sutraukta, kol nepažymėta (DESIGN v2 §4) */
.chip .chip-face > .icon,
.sheet-type-chip > .icon {
  width: 0;
  margin-right: -7px; /* kompensuoja gap */
  opacity: 0;
  transition: width var(--t-fast) var(--ease),
              margin var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}

.chip:hover .chip-face,
button.chip-face:hover {
  border-color: var(--ink-faint);
}

/* Paspaudimo atsakas */
.chip:active .chip-face,
button.chip-face:active {
  transform: scale(0.96);
}

.chip input:checked + .chip-face,
.sheet-type-chip.is-on {
  background: var(--pine-100);
  color: var(--pine-700);
  border-color: var(--pine-600);
}

.chip input:checked + .chip-face > .icon,
.sheet-type-chip.is-on > .icon {
  width: 14px;
  margin-right: 0;
  opacity: 1;
}

.chip input:focus-visible + .chip-face {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.chip-count {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--sp-1);
  border-radius: var(--r-full);
  background: var(--pine-700);
  color: #FFFFFF;
  font: 600 11px/18px var(--font-ui);
  text-align: center;
}

.chip-count.is-visible {
  display: inline-block;
}

/* „Daugiau filtrų" popover */

.filter-more {
  position: relative;
}

.filter-popover {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  z-index: 1150;
  width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease),
              visibility 0s linear var(--t-med);
}

.filter-popover.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}

.filter-popover-title {
  font: 600 11px/1.3 var(--font-ui);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 8px 10px 4px;
  margin: 0;
}

/* Antra popover sekcija (Pramogos) atskiriama tarpu nuo pirmosios. */
.check-row + .filter-popover-title {
  margin-top: var(--sp-3);
}

/* Tipo ir Dangos lustų eilutės filtrų lape */
.sheet-type-row,
.sheet-surface-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 10px 8px;
}

/* Filtrų lapo galvutė, poraštė, užsklandos ir Tipo sekcija — tik mobiliajame
   apatiniame lape (DESIGN v2 §1); darbalaukyje popover lieka kaip buvęs. */
.filter-sheet-head,
.filter-sheet-foot,
.filter-sheet-types,
.filter-scrim,
.sheet-scrim {
  display: none;
}

/* Slinkties užraktas po atidarytu lapu — klasę ant <html> deda app.js */
.sheet-lock,
.sheet-lock body {
  overflow: hidden;
}

.check-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  cursor: pointer;
  border-radius: var(--r-s);
}

.check-row input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.check-face {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font: 500 14px/1.2 var(--font-ui);
  color: var(--ink);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

/* Savybės ikona lieka prigesusi */
.check-face > .icon {
  color: var(--ink-soft);
}

.check-row:hover .check-face {
  background: #F1EEE7;
}

/* Kvadratėlis — pažymėjimo signalas (vietoj pine-100 fono) */
.check-box {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid #C9C3B6;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: #FFFFFF;
  flex: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.check-row input:checked + .check-face .check-box {
  background: var(--pine-700);
  border-color: var(--pine-700);
}

.check-row input:focus-visible + .check-face {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* --- Sąrašas -------------------------------------------------------------- */

.list-area {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* HTMX sąrašo pakeitimo blyksnis — settle grąžina opacity (DESIGN v2 §10) */
#park-list {
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}

#park-list.htmx-swapping {
  opacity: 0;
  transform: translateY(4px);
}

.count-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

.count-text {
  font: 600 15px/1.3 var(--font-ui);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* „Išvalyti" — .btn-link stilius iš TPL; slepiamas per [hidden] */
.count-clear {
  margin-left: auto;
}

.park-cards {
  list-style: none;
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.park-card {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

/* Pakilimas tik su tikru žymekliu — ne lietimui (DESIGN v2 §5) */
@media (hover: hover) and (pointer: fine) {
  .park-card:hover {
    border-color: var(--ink-faint);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
  }
}

.park-card:active {
  transform: scale(0.98);
  transition: transform 90ms var(--ease);
}

/* Atidarytos aikštelės kortelė — klasę toggl'ina app.js */
.park-card.is-selected {
  border-color: var(--pine-600);
  box-shadow: 0 0 0 2px rgb(42 106 80 / 0.18), var(--shadow-2);
}

/* Sąraše rodomos tik tos aikštelės, kurios telpa žemėlapio srityje
   (slepia filterListToMapView; .park-card ir .park-cards yra flex,
   todėl vien [hidden] atributo neužtenka). */
.park-card[hidden],
.park-cards[hidden],
.count-line[hidden] {
  display: none;
}

.park-card.is-flash {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.park-card-thumb {
  flex: none;
  width: 104px;
  height: 82px;
  object-fit: cover;
  border-radius: 9px;
}

.park-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.park-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font: 600 15.5px/1.32 var(--font-ui);
}

.park-card-link {
  color: var(--ink);
  text-decoration: none;
}

/* Ištempta nuoroda — visa kortelė paspaudžiama */
.park-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.park-card-meta {
  font: 400 13px/20px var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.park-card-tags {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
}

.park-card-chars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}

.char-more {
  font: 600 11.5px/1 var(--font-ui);
  color: var(--ink-faint);
}

/* --- Ženkleliai ----------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font: 600 12px/16px var(--font-ui);
  white-space: nowrap;
}

/* Tekstas — tamsesni --type-*-text tonai, kad ant tonuoto fono būtų ≥ AA (DESIGN v2 §6) */
.badge-dog-park {
  background: var(--type-dog-park-bg);
  color: var(--type-dog-park-text);
}

.badge-walking {
  background: var(--type-walking-bg);
  color: var(--type-walking-text);
}

.badge-agility {
  background: var(--type-agility-bg);
  color: var(--type-agility-text);
}

/* „Patikrinta" — vienintelis pilno fono ženklelis */
.badge-verified {
  background: var(--pine-700);
  color: #FFFFFF;
}

/* „Nauja" — neseniai pridėta aikštelė (DESIGN v2 §6) */
.badge-new {
  background: #FBF3E2;
  color: #8A6A1F;
}

/* --- Tuščia būsena -------------------------------------------------------- */

/* display: flex nugalėtų naršyklės [hidden] taisyklę — grąžinama aiškiai. */
.empty-state[hidden] {
  display: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  max-width: 40ch;
  margin: var(--sp-7) auto;
  padding: 0 var(--sp-4);
  text-align: center;
  color: var(--ink-soft);
}

.empty-state .icon {
  color: var(--ink-faint);
}

/* Ikonos žiedas — 64 px pine-100 apskritimas (DESIGN v2 §9) */
.empty-state-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--pine-100);
}

.empty-state-ring .icon {
  color: var(--pine-700);
}

/* Antraštė — naudojama ir 404 puslapyje */
.empty-state-title {
  font: 600 16px/1.3 var(--font-ui);
  color: var(--ink);
}

/* --- Skeletas ir progreso juosta ------------------------------------------ */

/* Skeletas — absoliučiai virš #park-list (nekeičia layout'o);
   rodomas tik jei užklausa trunka ilgiau nei 300 ms. */
.skeleton {
  display: block;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: var(--sp-4);
  background: var(--paper);
}

.skeleton.htmx-request {
  visibility: visible;
  opacity: 1;
  transition: opacity 0s 300ms, visibility 0s 300ms;
}

.skeleton-card {
  display: flex;
  gap: 14px;
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: none;
}

/* Shimmer perbėgimas vietoj opacity pulso */
.skeleton-block {
  display: block;
  background: linear-gradient(100deg, var(--line) 40%, #F3F0EA 50%, var(--line) 60%);
  background-size: 220% 100%;
  border-radius: var(--r-s);
  animation: skeleton-sweep 1.2s linear infinite;
}

.skeleton-thumb {
  flex: none;
  width: 104px;
  height: 82px;
  border-radius: 9px;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-top: var(--sp-1);
}

/* Eilučių matmenys čia, ne inline (CSP style-src 'self' inline neleidžia). */
.skeleton-line:nth-child(1) { height: 13px; width: 82%; }
.skeleton-line:nth-child(2) { height: 11px; width: 46%; }
.skeleton-line:nth-child(3) { height: 18px; width: 62%; border-radius: var(--r-full); }

@keyframes skeleton-sweep {
  to { background-position: -120% 0; }
}

.progress-bar {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1300;
  overflow: hidden;
  background: var(--pine-100);
  opacity: 0;
  pointer-events: none;
}

.progress-bar::before {
  content: "";
  display: block;
  height: 100%;
  width: 38%;
  background: var(--pine-600);
  animation: progress-slide 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Rodoma tik po 300 ms — ta pati delay technika kaip skeletui */
.progress-bar.htmx-request {
  opacity: 1;
  transition: opacity 0s 300ms;
}

@keyframes progress-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(360%); }
}

/* --- Žemėlapis ------------------------------------------------------------ */

.map-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

#map {
  position: absolute;
  inset: 0;
}

.leaflet-container {
  background: var(--paper);
  font-family: var(--font-ui);
}

/* Prigesintos OSM plytelės — tik plytelių sluoksniui (DESIGN §8) */
.leaflet-tile-pane {
  filter: saturate(0.72) contrast(0.95) brightness(1.03);
}

/* Valdikliai — surface / r-s / shadow-1 vietoje standartinio Leaflet stiliaus */
.leaflet-touch .leaflet-bar,
.leaflet-bar {
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  width: 36px;
  height: 36px;
  line-height: 36px;
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.leaflet-bar a:last-child {
  border-bottom: 0;
}

.leaflet-bar a:hover {
  background: var(--pine-100);
  color: var(--pine-700);
}

.leaflet-control-attribution {
  background: var(--surface);
  color: var(--ink-faint);
  font: 400 11px/16px var(--font-ui);
}

.leaflet-control-attribution a {
  color: var(--ink-soft);
}

.locate-btn {
  position: absolute;
  right: 16px;
  bottom: 104px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-2);
  color: var(--ink);
}

/* Žymekliai */
.park-pin svg {
  display: block;
  /* drop-shadow pine-900 pagrindu (12 31 23) — DESIGN v2 §8 */
  filter: drop-shadow(0 3px 4px rgb(12 31 23 / 0.30));
}

/* Žemės elipsė po pasirinktu žymekliu */
.park-pin.is-selected::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%);
  width: 18px;
  height: 6px;
  border-radius: var(--r-full);
  background: rgb(12 31 23 / 0.18);
}

/* Vienkartinis „pop" pridedant žymeklį — klasę .pin-pop deda app.js */
.park-pin.pin-pop svg {
  transform-origin: 50% 100%;
  animation: pin-pop 260ms var(--ease) both;
}

@keyframes pin-pop {
  from { transform: scale(0.6); }
  60% { transform: scale(1.06); }
  to { transform: scale(1); }
}

.leaflet-marker-icon:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

/* Popup — mini kortelė */
.park-popup .leaflet-popup-content-wrapper {
  padding: 0;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-3);
}

.park-popup .leaflet-popup-content {
  margin: 0;
  font: 400 15px/24px var(--font-ui);
}

.park-popup .leaflet-popup-tip {
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.park-popup .leaflet-popup-close-button {
  color: var(--ink-faint);
}

.popup-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  width: 240px;
  padding: var(--sp-3);
}

.popup-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-s);
}

.popup-title {
  font: 600 16px/24px var(--font-ui);
  color: var(--ink);
}

.popup-more {
  height: 36px;
}

/* --- Detalės skydelis ------------------------------------------------------ */

/* Plūduriuojanti panelė — 12 px tarpas nuo viršaus/dešinės/apačios */
.detail-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1100;
  width: 402px;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateX(24px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform var(--t-med) var(--ease),
              opacity var(--t-med) var(--ease),
              visibility 0s linear var(--t-med);
}

.detail-panel.is-open {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}

.detail {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Mygtukai ant nuotraukos — pusiau permatomas tamsus fonas */
.detail-back,
.detail-close,
.detail-share {
  position: absolute;
  top: var(--sp-3);
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--r-full);
  background: rgb(12 31 23 / 0.4);
  color: #FFFFFF;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: none;
}

.detail-back:hover,
.detail-close:hover,
.detail-share:hover {
  background: rgb(12 31 23 / 0.55);
  color: #FFFFFF;
}

.detail-back {
  left: var(--sp-3);
  display: none;
}

/* Darbalaukyje uždarymas — kairysis viršutinis kampas */
.detail-close {
  left: 14px;
  right: auto;
}

/* Dalinimasis — dešinysis viršutinis kampas ant nuotraukos */
.detail-share {
  right: var(--sp-3);
}

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Galerija */
.detail-gallery {
  position: relative;
}

/* Scrim gradientas po indikatoriais — viršuje mygtukams, apačioje taškeliams;
   mygtukai/indikatoriai lieka virš jo (z-index 2+). */
.detail-gallery::after,
.park-gallery::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(12 31 23 / 0.28), transparent 30%, transparent 62%, rgb(12 31 23 / 0.42));
}

.gallery-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-strip::-webkit-scrollbar {
  display: none;
}

.gallery-strip img {
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  scroll-snap-align: start;
}

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.gallery-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / 0.55);
  opacity: 1;
  cursor: pointer;
  transition: width var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

/* Aktyvusis — 16×6 piliulė, ne padidintas apskritimas */
.gallery-dot.is-active {
  width: 16px;
  background: #FFFFFF;
  transform: none;
}

/* Skaitliukas „1 / N" — viršuje dešinėje virš nuotraukos */
.gallery-counter {
  position: absolute;
  right: var(--sp-3);
  top: var(--sp-3);
  z-index: 2;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: rgb(12 31 23 / 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  font: 600 12px/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Detalės skydelyje dešinįjį kampą užima dalinimosi mygtukas (38 px + tarpas);
   top centruoja 22 px skaitliuką pagal 38 px mygtuką */
.detail .gallery-counter {
  top: calc(var(--sp-3) + 8px);
  right: 62px;
}

/* „N nuotraukos" ant koliažo — tik plačiame ekrane (≥900) */
.collage-count {
  display: none;
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: rgb(12 31 23 / 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  font: 600 12px/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Turinys */
.detail-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
}

.detail-title {
  font: 600 22px/28px var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.detail-location {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  align-items: flex-start;
}

.detail-place {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

.detail-place .icon {
  color: var(--ink-faint);
}

.detail-hint {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-faint);
}

.detail-directions {
  display: flex;
  align-items: center;
  align-self: stretch; /* .detail-location centruoja vaikus į kairę — juosta vis tiek per visą plotį */
  gap: var(--sp-3);
}

/* Google Maps / Waze — po lygiai per visą plotį */
.detail-directions .btn {
  flex: 1;
}

/* Lipni CTA juosta — tik mobiliajame apatiniame krašte (DESIGN v2 §3) */
.detail-cta-bar {
  display: none;
}

.detail-description {
  max-width: 65ch;
}

.detail-section h2 {
  font: 600 16px/1.3 var(--font-ui);
  color: var(--ink);
  margin-bottom: var(--sp-3);
}

/* Pramogos */
.amenity-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--sp-2);
}

.amenity-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: 500 12.5px/1.25 var(--font-ui);
  color: var(--ink);
  text-align: center;
}

.amenity-tile .icon {
  color: var(--pine-700);
}

/* Savybės — viena kolona, eilutės atskirtos linijomis */
.char-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
}

.char-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.char-row:last-child {
  border-bottom: 0;
}

.char-name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  font: 500 15px/1.3 var(--font-ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-name .icon {
  color: var(--ink-soft);
}

.char-value {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font: 500 13.5px/1.3 var(--font-ui);
  color: var(--ink);
  white-space: nowrap;
}

.char-yes {
  color: var(--ok);
}

.char-no {
  color: var(--absent);
}

/* „Nežinoma" būsena */
.char-unknown {
  color: var(--ink-faint);
  font-style: italic;
}

/* Meta poraštė */
.detail-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-faint);
}

.detail-meta a {
  color: var(--ink-soft);
}

.detail-report {
  height: 36px;
  padding: 0;
  font-size: 13px;
}

.detail-report.btn-ghost,
a.detail-report {
  color: var(--pine-700);
}

/* --- 404 ------------------------------------------------------------------- */

.page-404 {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.page-404-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Planšetė (640–1023 px) ------------------------------------------------ */

@media (max-width: 1023px) and (min-width: 640px) {
  .sidebar {
    width: 340px;
  }

  .detail-panel {
    width: min(402px, 80vw);
  }
}

/* --- Mobilus (<640 px) ------------------------------------------------------ */

@media (max-width: 639px) {
  /* Antraštė virsta plūduriuojančia paieškos juosta virš žemėlapio */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1085;
    height: auto;
    padding: var(--sp-3);
    gap: var(--sp-2);
    background: none;
    border-bottom: 0;
    pointer-events: none;
  }

  .site-header > * {
    pointer-events: auto;
  }

  .site-header-plain {
    position: static;
    pointer-events: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--sp-3) var(--sp-4);
  }

  /* Vidinio puslapio paieška spraudžiasi tarp logotipo ir krašto */
  .site-header-plain .search-field {
    flex: 1;
    min-width: 0;
  }

  /* Plūduriuojantis logotipas nebereikalingas — jį pakeičia letena paieškos lauke */
  .site-header:not(.site-header-plain) .logo,
  .site-header:not(.site-header-plain) .btn,
  .suggest-link {
    display: none;
  }

  .search-field {
    max-width: none;
    height: 46px;
    border: 0;
    box-shadow: var(--shadow-2);
  }

  /* Letena kairėje, lupa dešinėje; × — pačiame gale */
  .search-mark {
    display: flex;
    color: var(--pine-700);
    order: 0;
  }

  .search-field .search-mark .icon {
    color: inherit;
  }

  .search-field input {
    order: 1;
  }

  .search-field > .icon {
    order: 2;
  }

  .search-clear {
    order: 3;
  }

  .app-main {
    display: block;
  }

  .map-wrap {
    position: fixed;
    inset: 0;
  }

  /* Pagrindiniame žemėlapyje mastelį keičia gestai; mini žemėlapiuose zoom
     mygtukai lieka — 44 px lietimo taikiniai (žr. .leaflet-bar žemiau) */
  .map-wrap .leaflet-control-zoom {
    display: none;
  }

  .leaflet-bar a,
  .leaflet-touch .leaflet-bar a {
    width: 44px;
    height: 44px;
    line-height: 44px;
  }

  .map-wrap .leaflet-bottom.leaflet-right {
    bottom: calc(148px + env(safe-area-inset-bottom));
  }

  .locate-btn {
    position: fixed;
    right: var(--sp-4);
    bottom: calc(148px + 24px + env(safe-area-inset-bottom));
    z-index: 1080;
  }

  /* Filtrų žetonai — lapo viduje, slenka horizontaliai */
  .filter-bar {
    padding: 0;
  }

  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px var(--sp-4) var(--sp-3);
    gap: 8px;
    scrollbar-width: none;
  }

  .chip-row::-webkit-scrollbar {
    display: none;
  }

  /* „Daugiau filtrų" — apatinis lapas (DESIGN v2 §1) */
  .filter-popover {
    position: fixed;
    inset: auto 0 0 0;
    width: auto;
    max-height: 88dvh;
    padding: 0;
    border: 0;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    box-shadow: var(--shadow-sheet);
    opacity: 1;
    transform: translateY(102%);
    transition: transform var(--t-sheet) var(--ease-sheet),
                visibility 0s linear var(--t-sheet);
  }

  .filter-popover.is-open {
    transform: translateY(0);
    transition: transform var(--t-sheet) var(--ease-sheet);
  }

  /* Lapo turinys atitraukiamas nuo kraštų — patį padding perima galvutė/poraštė */
  .filter-popover .filter-popover-title,
  .filter-popover .check-row,
  .filter-popover .sheet-type-row,
  .filter-popover .sheet-surface-row {
    margin-inline: var(--sp-4);
  }

  /* Tipo sekcija matoma tik lape */
  p.filter-sheet-types {
    display: block;
  }

  .sheet-type-row.filter-sheet-types {
    display: flex;
  }

  .filter-sheet-head + .filter-popover-title {
    margin-top: var(--sp-3);
  }

  /* Lipni galvutė: tempimo juostelė per visą plotį, po ja — pavadinimas ir uždarymas */
  .filter-sheet-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4);
    background: var(--surface);
  }

  .filter-sheet-head .sheet-grab-bar {
    grid-column: 1 / -1;
    justify-self: center;
    margin-bottom: var(--sp-2);
  }

  .filter-sheet-title {
    font: 600 17px/1.3 var(--font-ui);
  }

  .filter-sheet-close {
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    background: #F1EEE7;
    color: var(--ink-soft);
  }

  /* Lipni poraštė su saugia zona; „Rodyti" tekstą atnaujina app.js */
  .filter-sheet-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
  }

  .filter-sheet-foot .btn-primary {
    flex: 1;
    height: 44px;
  }

  /* Užsklanda po lapu — [hidden] atributą valdo app.js */
  .filter-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1140; /* iškart po lapu (1150) */
    background: var(--scrim);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity var(--t-sheet) var(--ease-sheet);
  }

  .filter-scrim[hidden] {
    display: none;
  }

  .check-row {
    min-height: 44px;
  }

  /* Šoninė juosta — apatinis lapas */
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    height: calc(148px + env(safe-area-inset-bottom));
    z-index: 1086;
    border-right: 0;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-sheet);
    overflow: hidden;
    transition: height var(--t-sheet) var(--ease-sheet);
  }

  .sidebar.is-expanded {
    height: calc(100dvh - 88px);
  }

  /* Snap taškai — data-snap valdo app.js; „peek" = numatytasis 148 px aukštis.
     ID selektorius nusveria .is-expanded, kurią JS laiko sinchronizuotą (DESIGN v2 §2). */
  #sidebar[data-snap="half"] {
    height: 55dvh;
  }

  #sidebar[data-snap="full"] {
    height: 90dvh;
  }

  /* Užsklanda virš žemėlapio, kai lapas pilnas — dengia juostą virš lapo;
     matomumą (.is-visible) valdo app.js */
  .sheet-scrim {
    display: block;
    position: fixed;
    inset: 0 0 90dvh 0;
    background: var(--scrim);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease);
  }

  .sheet-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .sheet-grab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: var(--sp-3) 0 var(--sp-2);
    border: 0;
    background: none;
    cursor: pointer;
  }

  .sheet-grab-bar {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: var(--r-full);
    background: #D8D3C8;
  }

  /* Peek juosta — skaičius ir „Siūlyti naują" po tempimo juostele */
  .peek-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 2px var(--sp-4) 4px;
  }

  .peek-count {
    font: 600 16px/1.3 var(--font-ui);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  .peek-suggest {
    font: 500 13px/1 var(--font-ui);
    color: var(--pine-700);
    text-decoration: none;
    /* Dabar tai mygtukas (atidaro pasiūlymo modalą) — nuimama numatytoji išvaizda */
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  /* Skaičių mobiliajame rodo peek juosta — sąrašo count-line dubliuotų */
  #park-list .count-line {
    display: none;
  }

  /* Sąrašas slenkasi tik pilname lape */
  .list-area {
    overflow-y: hidden;
  }

  #sidebar[data-snap="full"] .list-area {
    overflow-y: auto;
  }

  .count-line {
    padding-top: 0;
  }

  /* Detalė — pilno ekrano lapas */
  .detail-panel {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 1200;
    border-radius: 0;
    transform: translateY(24px);
  }

  .detail-back {
    display: inline-flex;
  }

  .detail-close {
    display: none;
  }

  .detail-body {
    padding: var(--sp-4);
  }

  /* Lipni CTA juosta nykščio zonoje — permatoma balta + blur (DESIGN v2 §3) */
  .detail-cta-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }

  /* Aukštį duoda .btn-lg (52 px) */
  .detail-cta-bar .btn {
    flex: 1;
  }

  /* Galerijos „peek" — kita nuotrauka kyšo 12 px iš dešinės (20 − 8 gap) */
  .detail-gallery .gallery-strip {
    gap: var(--sp-2);
  }

  .detail-gallery .gallery-strip img:not(:only-child) {
    width: calc(100% - 20px);
  }

  .amenity-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .progress-bar {
    top: 0;
  }

  .park-card-link::after {
    /* 44 px lietimo taikiniai — kortelė ir taip visa paspaudžiama */
    min-height: 44px;
  }
}

/* --- Vidiniai puslapiai (miestai) ------------------------------------------ */

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.page-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-8);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

.breadcrumb .icon {
  color: var(--ink-faint);
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--pine-700);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

.page-title {
  margin-top: var(--sp-4);
  font: 600 34px/40px var(--font-display);
  letter-spacing: -0.015em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.page-lead {
  margin-top: var(--sp-3);
  max-width: 65ch;
  color: var(--ink-soft);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* „Rodyti žemėlapyje" — dešinėje filtrų eilutės pusėje (miesto psl.) */
.page-actions-map {
  margin-left: auto;
}

.page-section {
  margin-top: var(--sp-7);
}

.page-section h2 {
  font: 600 18px/1.3 var(--font-ui);
  color: var(--ink);
  margin-bottom: var(--sp-4);
}

/* Aikštelių tinklelis miesto puslapyje */
.park-grid {
  list-style: none;
  padding: 0;
  margin-top: var(--sp-6);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.park-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow var(--t-fast) var(--ease);
}

.park-tile:hover {
  box-shadow: var(--shadow-2);
}

/* Nuotraukos wrapper — tipo ženklelis dedamas ant nuotraukos */
.park-tile-photo {
  position: relative;
  overflow: hidden;
}

.park-tile-photo .badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
}

.park-tile-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0, 0, 1);
}

@media (hover: hover) and (pointer: fine) {
  .park-tile:hover .park-tile-photo img {
    transform: scale(1.045);
  }
}

.park-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

.park-tile-title {
  font: 600 16px/24px var(--font-ui);
}

.park-tile-link {
  color: var(--ink);
  text-decoration: none;
}

/* Ištempta nuoroda — visa plytelė paspaudžiama */
.park-tile-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.park-tile-meta {
  font: 400 13px/20px var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.park-tile-tags {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}

.park-tile-chars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}

/* Miestų tinklelis /miestai puslapyje */
.city-grid {
  list-style: none;
  padding: 0;
  margin-top: var(--sp-6);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}

.city-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 44px;
  padding: var(--sp-4);
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: box-shadow var(--t-fast) var(--ease);
}

.city-card:hover {
  box-shadow: var(--shadow-2);
}

.city-card-name {
  font: 600 16px/24px var(--font-ui);
  color: var(--ink);
}

.city-card-count {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Kitų miestų nuorodos miesto puslapio apačioje */
.city-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.city-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 32px;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  font: 500 13px/20px var(--font-ui);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.city-links a:hover {
  border-color: var(--pine-600);
  color: var(--pine-700);
}

.city-links-count {
  font-weight: 400;
  color: var(--ink-soft);
}

/* Poraštė */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-5);
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: 600 16px/24px var(--font-display);
  color: var(--ink);
}

.site-footer-brand .icon {
  color: var(--pine-700);
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.site-footer-nav a {
  color: var(--pine-700);
  text-decoration: none;
}

.site-footer-nav a:hover {
  text-decoration: underline;
}

/* „Siūlyti aikštelę" poraštėje — mygtukas (atidaro modalą), atrodo kaip nuoroda */
.footer-suggest {
  font: inherit;
  color: var(--pine-700);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.footer-suggest:hover {
  text-decoration: underline;
}

/* Tipo nuorodos miesto puslapyje — kaip įprasti lustai */
a.chip-link {
  text-decoration: none;
  color: var(--ink);
}

/* „Miestai" su chevron pradžios puslapyje — punktyrinis kraštas */
a.chip-link.chip-cities {
  border-style: dashed;
  color: var(--ink-soft);
}

a.chip-link:hover {
  border-color: var(--ink-faint);
  color: var(--pine-700);
}

a.chip-link .icon {
  color: var(--ink-faint);
}

/* Aktyvus tipo filtras miesto puslapyje (nuorodos, ne checkbox'ai) */
a.chip-link.is-selected {
  background: var(--pine-100);
  border-color: var(--pine-600);
  color: var(--pine-700);
}

.detail-city-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-city-link:hover {
  color: var(--pine-700);
}

@media (max-width: 639px) {
  .page-main {
    padding: var(--sp-5) var(--sp-4) var(--sp-7);
  }

  .page-title {
    font: 600 28px/34px var(--font-display);
  }

  .park-grid,
  .city-grid {
    grid-template-columns: 1fr;
  }

  .page-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Bendruomenės pasiūlymų modalas
   Užsklanda + dialogas swap'inami į #modal-root; mobiliajame (<768 px) —
   apatinis lapas. Visos spalvos, atstumai ir judesys — tik tokenai.
   ========================================================================== */

/* Kvietimo kortelė detalės rodinyje */
.detail-contribute {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 18px 20px;
  background: var(--pine-100);
  border: 0;
  border-radius: 16px;
}

.detail-contribute-title {
  font: 600 16px/24px var(--font-ui);
  color: var(--ink);
}

.detail-contribute-text {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

.detail-contribute-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.detail-contribute-actions .btn {
  height: 36px;
}

/* Užsklanda ir dialogas. Slinktis rakinama ir šakniniame elemente,
   kad besisukantis puslapis po modalu nejudėtų. */
body.modal-open {
  overflow: hidden;
}

html:has(body.modal-open) {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400; /* virš detalės skydelio (1200) ir progreso juostos (1300) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: rgb(12 31 23 / 0.34); /* atsarginė --scrim */
  background: var(--scrim); /* tokenas prisitaiko tamsiai temai */
  animation: modal-fade var(--t-med) var(--ease);
}

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: min(720px, calc(100dvh - 2 * var(--sp-6)));
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-3);
  animation: modal-rise var(--t-med) var(--ease);
}

@keyframes modal-fade {
  from { opacity: 0; }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Tempimo juostelė — tik apatiniame lape */
.modal-grab {
  display: none;
}

.modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}

.modal-title {
  flex: 1;
  min-width: 0;
  font: 600 22px/28px var(--font-display);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.modal-close {
  flex: none;
  color: var(--ink-soft);
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
}

.contribute-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Klaidų blokas formos viršuje */
.form-alert {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid rgb(179 66 58 / 0.3); /* atsarginė --danger @ 30 % */
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--surface));
  border-radius: var(--r-m);
  background: rgb(179 66 58 / 0.06); /* atsarginė --danger @ 6 % */
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.form-alert .icon {
  color: var(--danger);
  margin-top: 2px;
}

.form-alert ul {
  margin: 0;
  padding-left: var(--sp-4);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink);
}

/* Segmentinės kortelės */
.modal-tabs {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-1);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}

.modal-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 36px;
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: var(--r-s);
  background: none;
  color: var(--ink-soft);
  font: 500 13px/20px var(--font-ui);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.modal-tab:hover {
  color: var(--ink);
}

.modal-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--pine-700);
  box-shadow: var(--shadow-1);
}

.modal-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.modal-panel[hidden] {
  display: none;
}

.modal-intro {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
  max-width: 65ch;
}

.form-subtitle {
  font: 600 16px/24px var(--font-ui);
  color: var(--ink);
}

/* Tipo pasirinkimo fieldset (fragments/suggest-park) — naršyklės rėmelis
   nuimamas kaip .char-field, legend elgiasi kaip paprastas laukelio pavadinimas */
.suggest-type {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.suggest-type legend {
  padding: 0;
  margin-bottom: var(--sp-1);
}

/* Naujos aikštelės pasiūlymo modalas — vietos parinkiklis (žr. fragments/suggest-park) */
.pin-picker {
  height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--paper);
  isolation: isolate; /* Leaflet z-index lieka modalo viduje */
  cursor: crosshair;
}

/* Laukai */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.field-label {
  font: 600 13.5px/1.4 var(--font-ui);
  color: var(--ink);
}

.field-hint {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-faint);
}

/* Klaidos žinutė po lauku */
.field-hint.is-error {
  color: var(--danger);
}

.field-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  font: 400 15px/24px var(--font-ui);
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.field-input::placeholder {
  color: var(--ink-faint);
}

.field-input:focus {
  border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgb(42 106 80 / 0.15);
  outline: none;
}

/* Klaidingas laukas — aria-invalid deda serveris */
.field-input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(179 66 58 / 0.12);
}

textarea.field-input {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

/* Trijų būsenų segmentiniai radijo valdikliai (Yra / Nėra / Nežinoma) */
.char-fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.char-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.char-field-legend {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0;
  margin-bottom: var(--sp-1);
  font: 500 13px/20px var(--font-ui);
  color: var(--ink);
}

.char-field-legend .icon {
  color: var(--ink-faint);
}

.segmented {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.segment {
  position: relative;
  display: inline-flex;
}

.segment input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segment-face {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  font: 500 13.5px/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.segment:hover .segment-face {
  color: var(--ink);
}

.segment input:checked + .segment-face {
  background: var(--surface);
  color: var(--pine-700);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

.segment input:focus-visible + .segment-face {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Pramogų žetonai */
.amenity-picker {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.amenity-chip {
  position: relative;
  display: inline-flex;
}

.amenity-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.amenity-chip-face {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 36px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink-soft);
  font: 500 13px/20px var(--font-ui);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.amenity-chip:hover .amenity-chip-face {
  border-color: var(--ink-faint);
}

.amenity-chip input:checked + .amenity-chip-face {
  background: var(--pine-100);
  color: var(--pine-700);
  border-color: var(--pine-600);
}

.amenity-chip input:focus-visible + .amenity-chip-face {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Nuotraukos įkėlimo zona */
.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.drop-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4);
  border: 1.5px dashed var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink-soft);
  font: 400 13px/20px var(--font-ui);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.drop-face[hidden] {
  display: none;
}

.drop-face .icon {
  color: var(--pine-700);
}

.drop-face:hover,
.drop-zone.is-dragover .drop-face {
  border-color: var(--pine-600);
  background: var(--pine-100);
  color: var(--pine-700);
}

.drop-zone.is-dragover .drop-face .icon,
.drop-face:hover .icon {
  color: var(--pine-700);
}

.drop-browse {
  font-weight: 600;
  color: var(--pine-700);
  text-decoration: none;
}

.drop-hint {
  color: var(--ink-faint);
}

.drop-input:focus-visible + .drop-face {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.drop-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}

.drop-preview[hidden] {
  display: none;
}

.drop-thumb {
  flex: none;
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.drop-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.drop-name {
  font: 600 13.5px/20px var(--font-ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-size {
  font: 400 12px/18px var(--font-ui);
  color: var(--ink-faint);
}

/* Plikas × — be icon-btn apvalkalo; padding išlaiko 44 px lietimo plotą */
.drop-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  border: 0;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.drop-remove:hover {
  color: var(--ink-soft);
}

.drop-error {
  font: 400 13px/20px var(--font-ui);
  color: var(--danger);
}

.drop-error[hidden] {
  display: none;
}

/* Poraštė: moderavimo pastaba ir siuntimo mygtukas */
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

.modal-note {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-faint);
}

/* Siuntimo būsena: htmx prideda .htmx-request formai, hx-disabled-elt išjungia mygtuką */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgb(255 255 255 / 0.4);
  border-top-color: #FFFFFF; /* ant pine-700 mygtuko — balta abiejose temose */
  border-radius: var(--r-full);
  animation: spinner-turn 0.8s linear infinite;
}

.contribute-form.htmx-request .modal-submit,
.modal-submit:disabled {
  opacity: 0.75;
  pointer-events: none;
}

.contribute-form.htmx-request .btn-spinner {
  display: inline-block;
}

.contribute-form.htmx-request .modal-submit > .icon {
  display: none;
}

@keyframes spinner-turn {
  to { transform: rotate(1turn); }
}

/* Sėkmės būsena */
.modal-success {
  max-width: 420px;
}

.modal-success .modal-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
}

.success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-5) var(--sp-6);
  text-align: center;
}

.success-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--pine-100);
  color: var(--ok);
  animation: success-pop calc(var(--t-med) + 100ms) var(--ease) both;
}

/* Varnelės „nusipiešimas" — brūkšnio poslinkis paveldimas use šešėliniame medyje */
.success-ring svg {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: success-draw 320ms var(--ease) 120ms both;
}

.success-title {
  font: 600 26px/32px var(--font-display);
  color: var(--ink);
}

.success-line {
  max-width: 36ch;
  color: var(--ink);
}

.success-sub {
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

@keyframes success-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.06);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes success-draw {
  to { stroke-dashoffset: 0; }
}

/* Mobilus (<768 px): apatinis lapas */
@media (max-width: 767px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: none;
    max-height: calc(100dvh - var(--sp-7));
    border-radius: var(--r-l) var(--r-l) 0 0;
    animation: modal-slide-up var(--t-med) var(--ease);
  }

  .modal-grab {
    display: block;
    flex: none;
    width: 40px;
    height: 4px;
    margin: var(--sp-3) auto 0;
    border-radius: var(--r-full);
    background: var(--line);
  }

  .modal-head {
    padding: var(--sp-2) var(--sp-4) var(--sp-3);
  }

  .modal-body {
    padding: var(--sp-4) var(--sp-4) var(--sp-5);
  }

  .modal-tab,
  .amenity-chip-face {
    min-height: 44px; /* lietimo taikiniai */
  }

  .modal-foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  @keyframes modal-slide-up {
    from { transform: translateY(100%); }
  }
}

/* --- Pranešimai (toast) ----------------------------------------------------- */

/* Šaknį #toast-root sukuria ir pranešimus prideda app.js showToast() (DESIGN v2 §9) */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1500; /* virš modalo (1400) */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  background: #182420;
  color: #FFFFFF;
  font: 500 14px/1.4 var(--font-ui);
  box-shadow: var(--shadow-3);
  pointer-events: auto; /* #toast-root pats nepraleidžia paspaudimų */
  animation: toast-in var(--t-med) var(--ease);
}

.toast-icon {
  color: #7FC9A4;
  flex: none;
}

/* Veiksmo mygtukas — kaip .btn-link, tik šviesus */
.toast-action {
  font: 500 13px/1 var(--font-ui);
  color: #7FC9A4;
  background: none;
  border: 0;
  padding: 4px 0;
  margin-left: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.toast-action:hover {
  text-decoration: underline;
}

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

/* Sumažintas judesys — be transformacijų; globali taisyklė žemiau nunulina trukmes */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal,
  .success-ring {
    animation: none;
  }

  .success-ring svg {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}

/* --- Sumažintas judesys ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .gallery-strip {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Aikštelės vidinis puslapis (/aikstele/…)
   Galerija: telefone — slenkama juosta su taškeliais (bendri .gallery-* stiliai),
   plačiame ekrane — koliažas (1 didelė + 2 mažos, likusios lightbox'e).
   ========================================================================== */

.park-head {
  margin-top: var(--sp-4);
}

/* Antraštės eilutė: pavadinimas kairėje, dalinimosi piliulė dešinėje */
.park-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.park-head-top .page-title {
  margin-top: 0;
}

.park-head-top .share-btn {
  flex: none;
  margin-top: -1px; /* centras pagal 40 px antraštės eilutę */
}

/* Telefone — tik ikona, kad ilgas pavadinimas nesispaustų į siaurą stulpelį */
@media (max-width: 639px) {
  .park-head-top .share-btn {
    width: 42px;
    padding: 0;
  }

  .park-head-top .share-btn span {
    display: none;
  }
}

.park-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.park-place {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font: 400 15px/22px var(--font-ui);
  color: var(--ink-soft);
}

.park-place .icon {
  color: var(--ink-faint);
}

.park-hint {
  margin-top: var(--sp-1);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-faint);
}

/* Galerija */
.park-gallery {
  position: relative;
  margin-top: var(--sp-5);
  border-radius: var(--r-l);
  overflow: hidden;
}

.park-photo {
  position: relative;
  display: block;
  flex: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--pine-100);
  cursor: zoom-in;
  scroll-snap-align: start;
}

.park-photo:focus-visible {
  outline-offset: -3px;
}

.park-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.park-photo-empty {
  cursor: default;
}

/* „+N" — likusių nuotraukų skaičius ant trečios koliažo nuotraukos (tik desktop) */
.park-photo-more {
  display: none;
}

/* Kvietimo kortelė aikštelei be nuotraukų: rodoma po tuščia galerija vietoje
   mažo „Įkelti nuotrauką" mygtuko, atidaro pasiūlymų modalą nuotraukos kortelėje */
.photo-callout {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  margin-top: var(--sp-3);
  padding: 14px 18px;
  background: var(--pine-100);
  border: 1px dashed var(--pine-600);
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
  transition: border-color var(--t-fast) var(--ease);
}

.photo-callout:hover {
  border-color: var(--pine-700);
}

.photo-callout:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.photo-callout-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--pine-700);
}

.photo-callout-text {
  flex: 1;
  min-width: 0;
}

.photo-callout-title {
  display: block;
  font: 600 14px/22px var(--font-ui);
  color: var(--ink);
}

.photo-callout-go {
  display: flex;
  flex: none;
  color: var(--pine-700);
}

@media (min-width: 900px) {
  .park-gallery {
    border-radius: 18px;
  }

  .park-gallery .gallery-strip {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 200px 200px;
    gap: 10px;
    overflow: visible;
  }

  .park-photo {
    width: auto;
    height: 100%;
  }

  .park-photo img {
    max-height: none;
    aspect-ratio: auto;
  }

  .park-photo:first-child {
    grid-row: 1 / 3;
  }

  .park-photo:nth-child(n + 4) {
    display: none;
  }

  .park-gallery[data-count="0"] .gallery-strip,
  .park-gallery[data-count="1"] .gallery-strip {
    grid-template-columns: 1fr;
    grid-template-rows: 440px;
  }

  .park-gallery[data-count="0"] .gallery-strip {
    grid-template-rows: 300px;
  }

  .park-gallery[data-count="0"] .park-photo:first-child,
  .park-gallery[data-count="1"] .park-photo:first-child,
  .park-gallery[data-count="2"] .park-photo:first-child {
    grid-row: auto;
  }

  .park-gallery[data-count="2"] .gallery-strip {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 360px;
  }

  .park-gallery .gallery-dots {
    display: none;
  }

  /* Koliaže nėra slinkties — skaitliukas ir scrim nereikalingi */
  .park-gallery .gallery-counter {
    display: none;
  }

  .park-gallery::after {
    content: none;
  }

  /* „N nuotraukos" — ant pirmos koliažo nuotraukos */
  .collage-count {
    display: inline-block;
  }

  .park-photo-more {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(12 31 23 / 0.45);
    color: #FFFFFF;
    font: 600 20px/1 var(--font-ui);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .park-photo img {
    transition: transform var(--t-med) var(--ease);
  }

  .park-photo:hover img,
  .park-photo:focus-visible img {
    transform: scale(1.03);
  }
}

/* Turinys + šoninė kortelė */
.park-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-6);
  align-items: start;
  margin-top: var(--sp-6);
}

.park-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  min-width: 0;
}

.park-description {
  max-width: 70ch;
  font: 400 16px/26px var(--font-ui);
  color: var(--ink);
  white-space: pre-line;
}

/* Platesniame stulpelyje pramogų tinklelis prisitaiko pats (bazinis auto-fill) */

.park-aside {
  position: sticky;
  top: var(--sp-5);
}

.park-visit-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}

.park-visit-title {
  font: 600 20px/26px var(--font-display);
  color: var(--ink);
}

.park-mini-map {
  height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--paper);
  isolation: isolate; /* Leaflet z-index lieka kortelės viduje */
}

.park-visit-address {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-soft);
}

.park-visit-address .icon {
  margin-top: 2px;
  color: var(--ink-faint);
}

.park-visit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.park-visit-map-link {
  justify-content: flex-start;
  height: 36px;
  padding: 0;
}

.park-facts {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

.park-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font: 400 13px/20px var(--font-ui);
}

.park-facts dt {
  color: var(--ink-soft);
}

.park-facts dd {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

.park-facts dd a {
  color: var(--pine-700);
}

/* Meta poraštė (atnaujinta, šaltiniai, pranešti klaidą) */
.park-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-7);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font: 400 13px/20px var(--font-ui);
  color: var(--ink-faint);
}

.park-meta a {
  color: var(--ink-soft);
}

/* Detalės skydelio nuorodos į pilną puslapį */
.detail-title-link {
  color: inherit;
  text-decoration: none;
}

.detail-title-link:hover {
  color: var(--pine-700);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.detail-meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

/* Nuotraukų peržiūra — <dialog> top-layer */
.lightbox {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  overflow: visible;
}

.lightbox::backdrop {
  /* pine-900 pagrindas (DESIGN v2 §7); rgb atsarginė — ::backdrop tokenų
     paveldėjimas senesnėse naršyklėse nepatikimas */
  background: rgb(12 31 23 / 0.94);
  background: color-mix(in srgb, var(--pine-900) 94%, transparent);
}

.lightbox-body {
  margin: 0;
}

.lightbox-img {
  display: block;
  max-width: min(1100px, 92vw);
  max-height: 82vh;
  border-radius: var(--r-m);
  box-shadow: var(--shadow-3);
  background: var(--pine-100);
}

.lightbox-counter {
  margin-top: var(--sp-3);
  text-align: center;
  font: 500 13px/20px var(--font-ui);
  color: rgb(255 255 255 / 0.75);
}

/* Permatomi balti valdikliai ant tamsaus fono */
.lightbox-close,
.lightbox-nav {
  border: 0;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / 0.12);
  color: #FFFFFF;
  box-shadow: none;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgb(255 255 255 / 0.2);
  color: #FFFFFF;
}

.lightbox-close {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

@media (max-width: 899px) {
  /* Viena kolona; „Kaip nuvykti" kortelė — iškart po aprašymo (order) */
  .park-layout {
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
    align-items: stretch; /* perrašo bazinį `start` — kitaip vaikai susitraukia iki turinio pločio */
  }

  /* Sekcijos tampa .park-layout flex vaikais — order gali jas perrikiuoti */
  .park-content {
    display: contents;
  }

  .park-content > * {
    order: 2;
  }

  .park-content > .detail-section:first-child {
    order: 0;
  }

  .park-aside {
    position: static;
    order: 1;
  }
}

@media (max-width: 639px) {
  /* Galerija lieka kortelė su 16 px spinduliu (be edge-to-edge) */
  .park-visit-card {
    padding: var(--sp-4);
  }

  /* Rodyklės apačioje, kad neuždengtų nuotraukos siaurame ekrane */
  .lightbox-nav {
    top: auto;
    bottom: var(--sp-4);
    transform: none;
  }
}

/* --- Įvertinimas — 1–5 letenėlės (fragments/rating.php) -------------------- */

.rating-paws {
  display: flex;
  gap: var(--sp-1);
}

.rating-paw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-s);
  background: none;
  color: var(--ink-faint); /* neužpildyta letenėlė */
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.rating-paw:hover {
  background: var(--pine-100);
  color: var(--pine-600);
}

/* Užpildyta letenėlė pagal vidurkį — spalvą ikonai perduoda currentColor */
.rating-paw.is-filled {
  color: var(--pine-700);
}

/* Lankytojo pasirinkimas iš localStorage — tik paryškinimas (app.js) */
.rating-paw.is-mine {
  background: var(--pine-100);
  color: var(--pine-700);
}

.rating-summary {
  margin-top: var(--sp-2);
  font-size: 14px;
  color: var(--ink-soft);
}

.rating-avg {
  color: var(--ink);
}

.rating-error {
  margin-top: var(--sp-1);
  font-size: 14px;
  color: var(--danger);
}
