/* Unified channel media grid — Profile + Settings + media browser */
.channel-media {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.channel-media__day {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-media__date {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  color: rgba(154, 171, 197, 0.88);
  letter-spacing: 0.01em;
}

.channel-media__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.channel-media__card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 180ms ease,
    filter 160ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(15, 23, 42, 0.18);
}

.channel-media__card:hover {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 28px rgba(15, 23, 42, 0.34);
  filter: brightness(1.05);
}

.channel-media__thumb {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.channel-media__thumb img,
.channel-media__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.channel-media__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
  color: rgba(255, 255, 255, 0.94);
}

.channel-media__play svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
  opacity: 0.92;
}

.channel-media__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 55%, rgba(2, 8, 23, 0.28));
  pointer-events: none;
  z-index: 1;
}

.channel-media--browser .channel-media__grid {
  gap: 12px;
}

.channel-media--browser .channel-media__card {
  border-radius: 12px;
}

.channel-profile-media .channel-media-host.hidden,
.channel-profile-media__grid.hidden {
  display: none !important;
}

.channel-profile-media__empty.hidden {
  display: none !important;
}

#channelProfileModal .channel-profile-media__grid,
#channelSettingsV2Modal .channel-profile-media__grid {
  margin-top: 6px;
}

/* Channel Profile overview — compact single-row media preview (4 across) */
#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media {
  gap: 0;
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media--overview-row {
  width: 100%;
  min-width: 0;
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__grid--overview-row,
#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__grid {
  gap: 8px;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__day + .channel-media__day {
  display: none;
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__date {
  display: none;
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__card {
  aspect-ratio: unset;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  border-radius: 11px;
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__card:nth-child(n + 5) {
  display: none;
}

#channelProfileModal [data-channel-profile-sheet="overview"] .channel-profile-media .channel-media__play svg {
  width: 22px;
  height: 22px;
}

#mediaBrowserModal .media-browser-grid.media-browser-grid--channel,
#mediaBrowserModal .media-browser-grid:has(.channel-media--browser) {
  display: block;
  width: 100%;
  min-width: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

#mediaBrowserModal .channel-media--browser {
  margin-top: 12px;
  width: 100%;
  min-width: 0;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 4px;
  box-sizing: border-box;
}

#mediaBrowserModal .channel-media--browser .channel-media__day {
  width: 100%;
  min-width: 0;
}

#mediaBrowserModal .channel-media--browser .channel-media__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#mediaBrowserModal .channel-media--browser .channel-media__card {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 12px;
}

@media (max-width: 767px) {
  #mediaBrowserModal .channel-media--browser .channel-media__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .channel-media__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .channel-media__play svg {
    width: 28px;
    height: 28px;
  }
}
