/* MyMappi v739 — every added memory photo stays available in one swipeable rail. */
html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  padding: 4px 2px 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-padding-inline: 2px !important;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 114, 133, 0.34) transparent;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media > :is(
  .memory-media-thumb,
  .memory-media-video
),
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media > :is(
  .memory-media-thumb,
  .memory-media-video
) {
  flex: 0 0 72px !important;
  width: 72px !important;
  height: 72px !important;
  scroll-snap-align: start;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media > .memory-media-thumb,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media > .memory-media-thumb {
  position: relative !important;
  display: block !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-image,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-image {
  width: 72px !important;
  height: 72px !important;
  opacity: 1 !important;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls {
  position: absolute !important;
  inset: 0 !important;
  z-index: 4;
  display: block !important;
  pointer-events: none;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls button:not(:last-child),
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls button:not(:last-child) {
  display: none !important;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls button:last-child,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls button:last-child {
  position: absolute !important;
  top: 5px !important;
  right: 5px !important;
  display: grid !important;
  width: 23px !important;
  min-width: 23px !important;
  height: 23px !important;
  min-height: 23px !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  background: rgba(7, 37, 46, 0.82) !important;
  box-shadow: 0 4px 10px rgba(3, 30, 38, 0.2);
  font-size: 0.9rem !important;
  line-height: 1 !important;
  pointer-events: auto;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media::-webkit-scrollbar,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media::-webkit-scrollbar {
  height: 4px;
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media::-webkit-scrollbar-thumb,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(11, 114, 133, 0.34);
}

html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media:focus-visible,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media:focus-visible {
  border-radius: 12px;
  outline: 3px solid rgba(24, 169, 120, 0.3);
  outline-offset: 2px;
}

/* The full-size theater follows the same left/right gesture shown in the editor. */
html body.photo-lightbox-open .app-shell .photo-lightbox:not(.video-mode) .photo-lightbox-gallery,
html body.photo-lightbox-open main.app-shell .photo-lightbox:not(.video-mode) .photo-lightbox-gallery {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  overscroll-behavior-x: contain !important;
  touch-action: pan-x pinch-zoom !important;
  -webkit-overflow-scrolling: touch !important;
}

html body.photo-lightbox-open .app-shell .photo-lightbox:not(.video-mode) .photo-lightbox-gallery-item,
html body.photo-lightbox-open main.app-shell .photo-lightbox:not(.video-mode) .photo-lightbox-gallery-item {
  flex: 0 0 100% !important;
  min-width: 100% !important;
  margin: 0 !important;
}

html body.photo-lightbox-open .app-shell .photo-lightbox:not(.video-mode) .photo-lightbox-gallery-item > img,
html body.photo-lightbox-open main.app-shell .photo-lightbox:not(.video-mode) .photo-lightbox-gallery-item > img {
  touch-action: pan-x pinch-zoom !important;
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell #memoryForm .memory-media-preview.has-scrollable-media,
  html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media {
    scroll-behavior: auto !important;
  }
}

html body .app-shell #memoryForm .memory-media-thumb > img[data-mymappi-smart-cover="true"] {
  object-fit: cover !important;
  object-position: var(--home-photo-position, center center) !important;
}

html body .app-shell #memoryForm .memory-editor-cover-focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(11, 114, 133, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #075b6e;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

html body .app-shell #memoryForm .memory-editor-cover-focus[hidden] {
  display: none !important;
}

html body .app-shell #memoryForm .memory-editor-cover-focus:focus-visible {
  outline: 3px solid rgba(24, 169, 120, 0.32);
  outline-offset: 2px;
}

/* A selected photo explains itself visually. Keep only one quiet cover mark;
   status and retry copy live in the dedicated progress area below the picker. */
html body .app-shell #memoryForm .memory-media-cover-icon,
html body main.app-shell #memoryForm#memoryForm .memory-media-cover-icon {
  position: absolute !important;
  bottom: 6px !important;
  left: 6px !important;
  z-index: 3;
  display: grid !important;
  width: 24px !important;
  height: 24px !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px !important;
  color: #ffffff;
  background: rgba(4, 48, 60, 0.76) !important;
  box-shadow: 0 5px 12px rgba(2, 31, 40, 0.2);
  pointer-events: none;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

html body .app-shell #memoryForm .memory-media-cover-icon :is(svg, [data-icon]),
html body main.app-shell #memoryForm#memoryForm .memory-media-cover-icon :is(svg, [data-icon]) {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 2.2;
}

html body .app-shell #memoryForm .memory-media-preview .memory-media-video.is-pending > small,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview .memory-media-video.is-pending > small {
  display: none !important;
}

html body .app-shell #memoryForm .memory-media-preview .memory-media-video.is-cover,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview .memory-media-video.is-cover {
  border-color: rgba(24, 169, 120, 0.88) !important;
  box-shadow: 0 0 0 2px rgba(24, 169, 120, 0.16), 0 9px 18px rgba(8, 54, 62, 0.1) !important;
}

html body .app-shell #memoryForm .memory-editor-cover-preview-copy,
html body main.app-shell #memoryForm#memoryForm .memory-editor-cover-preview-copy {
  right: auto !important;
  bottom: 13px !important;
  left: 13px !important;
  display: grid !important;
  width: 32px !important;
  height: 32px !important;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  color: #ffffff;
  background: rgba(4, 48, 60, 0.72);
  box-shadow: 0 6px 14px rgba(2, 31, 40, 0.2);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

html body .app-shell #memoryForm .memory-editor-cover-preview-copy > :is(svg, [data-icon]),
html body main.app-shell #memoryForm#memoryForm .memory-editor-cover-preview-copy > :is(svg, [data-icon]) {
  width: 17px !important;
  height: 17px !important;
}

html body .app-shell #memoryForm .memory-editor-cover-preview-copy > strong,
html body main.app-shell #memoryForm#memoryForm .memory-editor-cover-preview-copy > strong {
  display: none !important;
}
