.group-gallery-section {
  margin-top: 10px;
}

.group-gallery-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.group-gallery-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
}

.group-gallery-section__head {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 10px;
  min-height: 2rem;
  padding-right: 72px;
}

.group-gallery-section__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.group-gallery-section__title a {
  color: inherit;
  text-decoration: none;
}

.group-gallery-section__title a:hover {
  text-decoration: underline;
}

/* Fallback + поверх doodle/заметки, чтобы «Создать» не терялась. */
.group-gallery-section__head .sp-create,
.group-news-section__head .sp-create {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  margin-left: auto;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #223757 !important;
  text-decoration: none !important;
  font-family: "Caveat", "Segoe Print", cursive !important;
  font-size: clamp(1.45rem, 2.3vw, 1.75rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.group-gallery-section__head .sp-create__arrow,
.group-news-section__head .sp-create__arrow {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.72em;
  font-weight: 500;
}

.group-gallery-tab-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.group-gallery-empty {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 8px;
}

.group-gallery-albums-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.group-gallery-albums-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.group-gallery-album-card {
  flex: 0 0 auto;
  width: 112px;
  text-decoration: none;
  color: inherit;
}

.group-gallery-album-cover {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid var(--border, #e2e8f0);
  position: relative;
}

.group-gallery-album-cover img,
.group-gallery-album-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.group-gallery-album-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  opacity: 0.55;
}

.group-gallery-album-play {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.group-gallery-album-heading {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  min-width: 0;
}

.group-gallery-album-author {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.group-gallery-album-author img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.group-gallery-album-title {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-gallery-album-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 721px) {
  .group-gallery-albums-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px;
    overflow: visible;
  }

  .group-gallery-albums-track--page {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }

  .group-gallery-album-card {
    width: auto;
  }
}

/* Карусель слева + альбомы справа (как на публичном профиле) */
.group-gallery-section .photo-gallery {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.group-gallery-section .photo-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(232, 235, 230, 0.95);
}

.group-gallery-section .photo-gallery-title {
  margin: 0;
  font-family: var(--rdx-serif, "Literata", serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rdx-ink, #1a1f1c);
}

.group-gallery-section .photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0 0;
  align-items: start;
}

.group-gallery-section .photo-gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  position: relative;
}

.group-gallery-section .photo-gallery-main .profile-gallery-hit {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.group-gallery-section .photo-gallery-main .profile-gallery-hit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.group-gallery-section .photo-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.group-gallery-section .photo-gallery-arrow--prev { left: 10px; }
.group-gallery-section .photo-gallery-arrow--next { right: 10px; }

.group-gallery-section .photo-gallery-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.group-gallery-section .photo-gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--rdx-line, #e8ebe6);
  position: relative;
}

.group-gallery-section .photo-gallery-thumb-hit {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  text-align: left;
  text-decoration: none;
  color: inherit;
}

.group-gallery-section .photo-gallery-thumb-hit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.group-gallery-section .photo-gallery-thumb-hit .photo-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px;
  color: #fff;
  background: linear-gradient(180deg, transparent 35%, rgba(15, 23, 42, 0.72));
  pointer-events: none;
}

.group-gallery-section .photo-gallery-thumb-title {
  position: static;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.56);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.group-gallery-section .photo-gallery-thumb-desc {
  position: static;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  line-height: 1.2;
}

.group-gallery-section .photo-gallery-empty {
  color: #64748b;
  font-weight: 800;
  padding: 8px 2px;
}

@media (max-width: 900px) {
  .group-gallery-section .photo-gallery-grid {
    grid-template-columns: 1fr;
  }

  .group-gallery-section .photo-gallery-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.group-gallery-privacy-badge,
.group-gallery-vis-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.group-gallery-vis-toggle {
  cursor: pointer;
  padding: 0;
}

.group-gallery-vis-toggle:hover {
  background: rgba(15, 23, 42, 0.88);
}

.group-gallery-album-cover,
.group-gallery-item-frame {
  position: relative;
}

.group-gallery-album-visibility-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.group-gallery-album-visibility-label .form-select {
  width: auto;
  min-width: 150px;
}

.group-gallery-upload__pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 560px;
}

.group-gallery-upload__hint {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
}

.group-gallery-upload__preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.group-gallery-upload__card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  aspect-ratio: 1 / 1;
}

.group-gallery-upload__thumb,
.group-gallery-upload__thumb img,
.group-gallery-upload__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.group-gallery-album-modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(94vw, 560px);
  max-height: min(92vh, 820px);
  overflow: auto;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.group-gallery-album-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.group-gallery-album-modal__form {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.group-gallery-album-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-gallery-album-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.group-gallery-album-modal__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.group-gallery-album-modal__label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.group-gallery-album-modal__hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.group-gallery-album-modal__preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.group-gallery-album-modal__card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  aspect-ratio: 1 / 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.group-gallery-album-modal__card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.group-gallery-album-modal__card.is-upload-pending::after,
.group-gallery-album-modal__card.is-upload-done::after,
.group-gallery-album-modal__card.is-upload-error::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.group-gallery-album-modal__card.is-upload-done::after {
  background: rgba(15, 107, 76, 0.35);
}

.group-gallery-album-modal__card.is-upload-error::after {
  background: rgba(185, 28, 28, 0.4);
}

.group-gallery-album-modal__card-status {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.group-gallery-album-modal__thumb,
.group-gallery-album-modal__thumb img,
.group-gallery-album-modal__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.group-gallery-album-modal__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.group-gallery-album-modal__status {
  margin: 0;
  font-size: 13px;
  color: #475569;
}

.group-gallery-privacy {
  display: grid;
  gap: 6px;
}

.group-gallery-privacy__option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.group-gallery-privacy__option:has(input:checked) {
  border-color: rgba(15, 107, 76, 0.35);
  background: #eef6f1;
}

.group-gallery-album-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
