html,
body {
  background-color: #dff0dd;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #0f1a14;
}

#pwaBootSplash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  place-items: center;
  background: linear-gradient(150deg, #2f7f48, #87ba58);
  color: #f3fbf8;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  opacity: 1;
  transition: opacity 0.32s ease;
}

@media (display-mode: standalone) {
  #pwaBootSplash {
    display: grid;
  }
}

html.pwa-installed #pwaBootSplash {
  display: grid;
}

html.pwa-splash-skip #pwaBootSplash {
  display: none !important;
}

html.pwa-browser #pwaBootSplash {
  display: none !important;
}

html.pwa-launch-pending #pwaBootSplash {
  display: grid !important;
  opacity: 1 !important;
}

html.pwa-launch-pending body > :not(#pwaBootSplash) {
  visibility: hidden;
}

html.ios-webkit.pwa-launch-pending body > :not(#pwaBootSplash),
html.ios-webkit.pwa-launch-pending body > :not(#pwaBootSplash) * {
  animation: none !important;
  transition: none !important;
}

#pwaBootSplash.is-hide {
  opacity: 0;
  pointer-events: none;
}

.pwa-launch-splash__inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 18px;
}

.pwa-launch-splash__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26);
  background: rgba(255, 255, 255, 0.16);
  object-fit: cover;
  animation: pwaLogoPulse 1.4s ease-in-out infinite;
}

.pwa-launch-splash__title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.pwa-launch-splash__loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(243, 251, 248, 0.92);
}

.pwa-launch-splash__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  animation: pwaSpin 0.9s linear infinite;
}

@keyframes pwaSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pwaLogoPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.045);
  }
}

:root {
  --bg: #eef7ef;
  --bg2: #d9ecd8;
  --text: #173626;
  --muted: #607b69;
  --line-soft: rgba(23, 72, 44, 0.08);
  --line: rgba(23, 72, 44, 0.16);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09110d;
  --bg2: #0f1a14;
  --text: #e6f3ea;
  --muted: #9eb7a8;
  --line-soft: rgba(166, 209, 181, 0.13);
  --line: rgba(166, 209, 181, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(720px 360px at 15% -4%, rgba(66, 164, 85, 0.2), transparent 68%),
    radial-gradient(680px 420px at 100% 10%, rgba(158, 205, 103, 0.28), transparent 66%),
    linear-gradient(170deg, var(--bg), var(--bg2));
  transition: background 0.26s ease, color 0.2s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(235, 247, 233, 0.86);
  backdrop-filter: blur(18px);
  transition: background 0.26s ease, border-color 0.26s ease;
}

html[data-theme="dark"] .topbar {
  border-bottom-color: rgba(166, 209, 181, 0.16);
  background: rgba(12, 22, 16, 0.78);
}

.top-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.top-wrap__actions {
  flex: 0 0 auto;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  display: grid;
  place-items: center;
  text-decoration: none;
}

html[data-theme="dark"] .back-btn {
  border-color: rgba(166, 209, 181, 0.3);
  background: rgba(20, 34, 26, 0.92);
  color: #d9efdf;
}

.title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-menu {
  position: relative;
}

.profile-menu[open] {
  z-index: 25;
}

.profile-menu summary {
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu__trigger {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(101, 145, 108, 0.24);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(74, 115, 79, 0.12);
}

.profile-menu__icon {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-menu__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 156px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 253, 242, 0.92));
  box-shadow: 0 18px 34px rgba(47, 93, 59, 0.16);
}

.profile-menu__item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #244c35;
  font-size: 13px;
  font-weight: 700;
}

.profile-menu__item:hover,
.profile-menu__item:focus-visible,
.profile-menu__item.is-active {
  background: rgba(86, 160, 97, 0.12);
  color: #1f7a3e;
  outline: none;
}

html[data-theme="dark"] .profile-menu__trigger {
  border-color: rgba(157, 203, 173, 0.24);
  background: rgba(21, 33, 26, 0.88);
  color: #d6eadc;
}

html[data-theme="dark"] .profile-menu__dropdown {
  border-color: rgba(166, 209, 181, 0.18);
  background: linear-gradient(165deg, rgba(24, 39, 30, 0.98), rgba(16, 27, 21, 0.96));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .profile-menu__item {
  color: #d6eadc;
}

html[data-theme="dark"] .profile-menu__item:hover,
html[data-theme="dark"] .profile-menu__item:focus-visible,
html[data-theme="dark"] .profile-menu__item.is-active {
  background: rgba(122, 183, 77, 0.18);
  color: #f3ffef;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 10px 10px calc(100px + env(safe-area-inset-bottom));
  animation: pageFadeUp 0.45s ease both;
}

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

.gallery-skeleton-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  min-height: 110px;
}

.gallery-skeleton-item::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(
      110deg,
      rgba(255, 255, 255, 0) 18%,
      rgba(255, 255, 255, 0.46) 48%,
      rgba(255, 255, 255, 0) 78%
    ),
    rgba(118, 153, 118, 0.18);
  background-size: 220% 100%;
  animation: galleryShimmer 1.1s linear infinite;
}

html[data-theme="dark"] .gallery-skeleton-item {
  background: rgba(22, 38, 29, 0.86);
}

html[data-theme="dark"] .gallery-skeleton-item::before {
  background:
    linear-gradient(
      110deg,
      rgba(255, 255, 255, 0) 18%,
      rgba(189, 222, 197, 0.18) 48%,
      rgba(255, 255, 255, 0) 78%
    ),
    rgba(90, 126, 99, 0.24);
}

.gallery-item {
  padding: 0;
  margin: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 10px 18px rgba(63, 109, 73, 0.12);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(23, 72, 44, 0.08);
  border-radius: 14px;
  pointer-events: none;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(63, 109, 73, 0.2);
}

.gallery-item:active {
  transform: scale(0.98);
}

.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.load-more {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.load-more:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(63, 109, 73, 0.2);
}

.load-more.hidden {
  display: none;
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
  border-radius: 24px;
  padding: 10px 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(241, 250, 239, 0.8));
  border: 1px solid rgba(101, 145, 108, 0.18);
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 30px rgba(64, 107, 72, 0.16);
  transition: background 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

html[data-theme="dark"] .bottom-nav {
  background: linear-gradient(160deg, rgba(18, 31, 24, 0.9), rgba(13, 22, 17, 0.86));
  border-color: rgba(157, 203, 173, 0.2);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.bottom-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bottom-nav-item {
  display: flex;
  justify-content: center;
}

.bottom-nav-link {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: #5c7762;
  font-size: 10px;
  font-weight: 700;
  transition: color 0.2s ease;
}

html[data-theme="dark"] .bottom-nav-link {
  color: #9db6a7;
}

.bottom-nav-label {
  white-space: nowrap;
  line-height: 1.1;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.bottom-nav-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 145, 109, 0.24);
  background: rgba(229, 244, 226, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .bottom-nav-icon-wrap {
  border-color: rgba(157, 203, 173, 0.24);
  background: rgba(25, 43, 32, 0.85);
}

.bottom-nav-link.is-active {
  color: #2f7c4d;
}

.bottom-nav-link.is-active .bottom-nav-icon-wrap {
  border-color: rgba(61, 148, 84, 0.46);
  background: linear-gradient(140deg, rgba(77, 170, 95, 0.27), rgba(157, 211, 109, 0.25));
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 16px rgba(85, 148, 84, 0.22);
}

.preview {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(26, 48, 33, 0.5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.preview.is-open {
  display: flex;
}

.preview-card {
  width: min(460px, 100%);
  border-radius: 22px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(244, 255, 243, 0.92));
  box-shadow: 0 24px 40px rgba(36, 80, 49, 0.26);
  overflow: hidden;
  animation: pageFadeUp 0.32s ease both;
}

html[data-theme="dark"] .preview-card {
  background: linear-gradient(170deg, rgba(24, 39, 30, 0.96), rgba(17, 30, 23, 0.94));
}

.preview-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.preview-pad {
  padding: 12px;
}

.preview-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.preview-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.preview-desc {
  margin: 0;
  color: #2d5841;
  font-size: 13px;
}

.preview-close {
  margin-top: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(243, 255, 241, 0.95);
  color: var(--text);
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 700;
}

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

@keyframes pageFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
