.record-media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.record-media-button {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #e5e7eb;
}

.record-media-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-media-button .video-badge,
.record-media-button .more-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: rgba(15, 23, 42, 0.38);
  font-size: 16px;
  font-weight: 700;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.media-viewer.hidden {
  display: none;
}

.media-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(15, 23, 42, 0.82);
}

.media-viewer-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, 100%);
  height: min(780px, 92vh);
  overflow: hidden;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.media-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 8px 12px 8px 18px;
  color: white;
  background: #111827;
}

.media-viewer-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-viewer-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.media-viewer-action.icon-only {
  width: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.media-viewer-stage {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.media-viewer-stage img,
.media-viewer-stage video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-viewer-stage img {
  cursor: zoom-in;
}

.media-viewer-stage img.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

@media (max-width: 640px) {
  .media-viewer {
    padding: 0;
  }

  .media-viewer-shell {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .media-viewer-action.icon-only span {
    display: none;
  }
}
