.gallery-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.gallery-preview-heading h2 {
  margin: 0;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
}

.gallery-preview-controls:not([hidden]) {
  display: flex;
  gap: 6px;
}

.gallery-preview-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

.gallery-preview-controls button:disabled {
  opacity: .4;
}

.gallery-preview-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(92px, 20vw, 128px);
  gap: 8px;
  margin: 0;
  padding: 3px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 3px;
  list-style: none;
}

.gallery-preview-track li {
  scroll-snap-align: start;
}

.gallery-preview-track a {
  display: block;
}

.gallery-preview-track img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9e9df;
}

.gallery-upload-selection {
  display: grid;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.gallery-upload-selection[hidden], [data-upload-refresh][hidden] {
  display: none !important;
}

.gallery-upload-selection li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid #d4d4ca;
}

.gallery-upload-selection img {
  width: 52px;
  height: 42px;
  object-fit: cover;
  background: #e9e9df;
}

.gallery-upload-selection span {
  overflow-wrap: anywhere;
  font-size: .8rem;
}

.gallery-admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  border-bottom: 1px solid #d4d4ca;
}

.gallery-admin-filters a {
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.gallery-admin-filters a[aria-current="page"] {
  border-color: currentColor;
  font-weight: 700;
}

.gallery-admin-filter-count {
  margin-inline-start: 3px;
  color: #535349;
  font-size: .85em;
}

.gallery-admin-ride {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
  padding: 16px 18px;
}

.gallery-admin-ride-title {
  margin-bottom: 8px;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gallery-admin-ride-title a {
  color: inherit;
  text-decoration: none;
}

.gallery-admin-ride-title a:hover {
  text-decoration: underline;
}

.gallery-admin-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-admin-counts li {
  padding: 3px 8px;
  background: #efefe8;
  font-size: .78rem;
}

.gallery-admin-counts .gallery-count-needs-review {
  background: #f5edb3;
}

.gallery-admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.gallery-admin-media {
  min-width: 0;
  border: 1px solid #d4d4ca;
  background: #fff;
}

.gallery-admin-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9e9df;
}

.gallery-admin-media-body {
  padding: 12px;
}

.gallery-admin-media-body h3 {
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
