.up-next {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: min(22rem, calc(100% - 2 * var(--space-3)));
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.82);
  color: #fff;
  animation: up-next-in 0.18s ease-out;
  transition: bottom 0.18s ease;
}
[data-lovely-video-stage]:has(.bmpui-controls-shown) .up-next { bottom: calc(var(--space-3) + 3rem); }
.up-next__announce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.up-next[hidden] { display: none; }

@keyframes up-next-in { from { opacity: 0; } }

.up-next__link {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: var(--space-2);
  color: inherit;
  text-decoration: none;
}
.up-next__link:focus-visible,
.up-next__close:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.up-next__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.1);
}
.up-next__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.up-next__image[hidden] { display: none; }

.up-next__text { display: grid; gap: 0.125rem; min-width: 0; }
.up-next__label {
  color: rgb(255 255 255 / 0.75);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-variant-numeric: tabular-nums;
}
.up-next__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: var(--leading-sm);
}

.up-next__close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: var(--space-1);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: rgb(255 255 255 / 0.85);
  cursor: pointer;
}
.up-next__close svg { width: 1.25rem; height: 1.25rem; }
.up-next__close:hover { background: rgb(255 255 255 / 0.14); color: #fff; }

.up-next__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--brand);
}

@media (max-width: 767px) {
  .up-next { right: 0; bottom: 0; width: 100%; border-radius: 0; }
  [data-lovely-video-stage]:has(.bmpui-controls-shown) .up-next { bottom: 3rem; }
  .up-next__link { grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-2); padding: var(--space-1); }
}
