.docs-screenshot-carousel {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.docs-screenshot-carousel figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  background: var(--md-default-bg-color);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.docs-screenshot-carousel img {
  display: block;
  width: 100%;
  height: auto;
}

.docs-screenshot-carousel figcaption {
  padding: 1rem 1.1rem 1.1rem;
  color: var(--md-default-fg-color);
  font-size: 0.72rem;
  line-height: 1.55;
}

.docs-screenshot-carousel figcaption strong {
  color: var(--md-primary-fg-color);
}

.docs-screenshot-carousel.is-enhanced {
  gap: 0.9rem;
}

.docs-screenshot-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.docs-screenshot-carousel__nav {
  display: flex;
  gap: 0.55rem;
}

.docs-screenshot-carousel__button,
.docs-screenshot-lightbox__close {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.75rem 0.9rem;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.docs-screenshot-carousel__button:hover:not(:disabled),
.docs-screenshot-carousel__button:focus-visible:not(:disabled),
.docs-screenshot-lightbox__close:hover,
.docs-screenshot-lightbox__close:focus-visible {
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-fg-color);
  outline: none;
  transform: translateY(-1px);
}

.docs-screenshot-carousel__button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.docs-screenshot-carousel__counter,
.docs-screenshot-lightbox__counter {
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-screenshot-carousel__viewport {
  min-width: 0;
}

.docs-screenshot-trigger,
.docs-screenshot-carousel__image-button {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.docs-screenshot-trigger img,
.docs-screenshot-carousel__image-button img {
  display: block;
  width: 100%;
  height: auto;
}

.docs-screenshot-trigger:focus-visible,
.docs-screenshot-carousel__image-button:focus-visible {
  outline: 2px solid var(--md-primary-fg-color);
  outline-offset: -2px;
}

.docs-screenshot-trigger::after,
.docs-screenshot-carousel__image-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.18) 100%);
  content: "";
  opacity: 0.92;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.docs-screenshot-trigger:hover::after,
.docs-screenshot-trigger:focus-visible::after,
.docs-screenshot-carousel__image-button:hover::after,
.docs-screenshot-carousel__image-button:focus-visible::after {
  opacity: 1;
}

.docs-screenshot-trigger__hint,
.docs-screenshot-carousel__image-hint {
  position: absolute;
  right: 0.95rem;
  bottom: 0.95rem;
  z-index: 1;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.docs-screenshot-trigger--standalone {
  margin: 0;
}

.docs-screenshot-carousel.is-enhanced .docs-screenshot-carousel__slide[hidden] {
  display: none;
}

.docs-screenshot-carousel__thumbnails {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.docs-screenshot-carousel__thumb,
.docs-screenshot-lightbox__thumb {
  display: grid;
  gap: 0.45rem;
  padding: 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.9rem;
  background: rgba(148, 163, 184, 0.08);
  color: var(--md-default-fg-color);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.docs-screenshot-carousel__thumb:hover,
.docs-screenshot-carousel__thumb:focus-visible,
.docs-screenshot-lightbox__thumb:hover,
.docs-screenshot-lightbox__thumb:focus-visible {
  border-color: var(--md-primary-fg-color);
  background: rgba(14, 165, 233, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.docs-screenshot-carousel__thumb.is-active,
.docs-screenshot-lightbox__thumb.is-active {
  border-color: var(--md-primary-fg-color);
  background: rgba(14, 165, 233, 0.14);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.22);
}

.docs-screenshot-carousel__thumb img,
.docs-screenshot-lightbox__thumb img {
  border-radius: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.docs-screenshot-carousel__thumb-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.docs-screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(10px);
}

.docs-screenshot-lightbox[hidden] {
  display: none;
}

.docs-screenshot-lightbox__dialog {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.6rem;
  width: min(98vw, 110rem);
  height: calc(100vh - 1rem);
  height: calc(100dvh - 1rem);
  padding: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.32);
}

.docs-screenshot-lightbox__dialog:focus {
  outline: none;
}

.docs-screenshot-lightbox__figure {
  position: relative;
  margin: 0;
  min-height: 0;
  height: 100%;
}

.docs-screenshot-lightbox__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: #020617;
  isolation: isolate;
}

.docs-screenshot-lightbox__topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem 3.5rem;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.74) 38%, rgba(2, 6, 23, 0) 100%);
  pointer-events: none;
}

.docs-screenshot-lightbox__meta {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  max-width: min(72rem, calc(100% - 7rem));
}

.docs-screenshot-lightbox__title {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.4);
}

.docs-screenshot-lightbox__counter {
  color: rgba(255, 255, 255, 0.78);
  text-shadow: none;
}

.docs-screenshot-lightbox__close {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding-inline: 1rem;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.docs-screenshot-lightbox__close:hover,
.docs-screenshot-lightbox__close:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
}

.docs-screenshot-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.docs-screenshot-lightbox__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 14%;
  min-width: 4rem;
  padding: 1rem 0.75rem;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.docs-screenshot-lightbox__nav--prev {
  left: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.52) 0%, rgba(15, 23, 42, 0) 100%);
}

.docs-screenshot-lightbox__nav--next {
  right: 0;
  background: linear-gradient(270deg, rgba(15, 23, 42, 0.52) 0%, rgba(15, 23, 42, 0) 100%);
}

.docs-screenshot-lightbox__nav:disabled {
  cursor: not-allowed;
}

.docs-screenshot-lightbox__nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  font-size: 2rem;
  line-height: 1;
  transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.docs-screenshot-lightbox__nav--prev .docs-screenshot-lightbox__nav-icon {
  margin-right: auto;
}

.docs-screenshot-lightbox__nav--next .docs-screenshot-lightbox__nav-icon {
  margin-left: auto;
}

.docs-screenshot-lightbox__nav:hover .docs-screenshot-lightbox__nav-icon,
.docs-screenshot-lightbox__nav:focus-visible .docs-screenshot-lightbox__nav-icon {
  background: rgba(14, 165, 233, 0.42);
  transform: scale(1.03);
}

.docs-screenshot-lightbox__nav:focus-visible {
  outline: none;
}

.docs-screenshot-lightbox__nav:disabled .docs-screenshot-lightbox__nav-icon {
  opacity: 0.42;
}

.docs-screenshot-lightbox__caption-wrap {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  padding: 4rem 1rem 1rem;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.82) 42%, rgba(2, 6, 23, 0) 100%);
  pointer-events: none;
}

.docs-screenshot-lightbox__caption {
  max-width: min(80rem, 100%);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.55;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.48);
}

.docs-screenshot-lightbox__caption strong {
  color: var(--md-primary-fg-color);
}

.docs-screenshot-lightbox__footer {
  min-height: 0;
  padding: 0 0.05rem 0.05rem;
}

.docs-screenshot-lightbox__thumbnails {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.05rem;
  scrollbar-width: thin;
}

.docs-screenshot-lightbox__thumb {
  flex: 0 0 clamp(5.75rem, 8vw, 7.5rem);
  gap: 0;
  padding: 0.25rem;
  border-radius: 0.75rem;
}

.docs-screenshot-lightbox__thumb img {
  width: 100%;
  height: 3.8rem;
  object-fit: cover;
}

.docs-screenshot-lightbox__thumb-label {
  display: none;
}

html[data-md-color-scheme="slate"] .docs-screenshot-carousel figure,
html[data-md-color-scheme="slate"] .docs-screenshot-carousel__button,
html[data-md-color-scheme="slate"] .docs-screenshot-carousel__thumb,
html[data-md-color-scheme="slate"] .docs-screenshot-lightbox__close,
html[data-md-color-scheme="slate"] .docs-screenshot-lightbox__thumb,
html[data-md-color-scheme="slate"] .docs-screenshot-lightbox__dialog {
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

html[data-md-color-scheme="slate"] .docs-screenshot-carousel__thumb,
html[data-md-color-scheme="slate"] .docs-screenshot-lightbox__thumb {
  background: rgba(30, 41, 59, 0.56);
}

html[data-md-color-scheme="slate"] .docs-screenshot-carousel__thumb.is-active,
html[data-md-color-scheme="slate"] .docs-screenshot-lightbox__thumb.is-active {
  background: rgba(14, 165, 233, 0.18);
}

html[data-md-color-scheme="slate"] .docs-screenshot-lightbox__dialog {
  background: rgba(15, 23, 42, 0.98);
}

@media (max-width: 48rem) {
  .docs-screenshot-carousel__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-screenshot-carousel__nav {
    justify-content: space-between;
  }

  .docs-screenshot-carousel__button {
    flex: 1 1 0;
    justify-content: center;
  }

  .docs-screenshot-carousel__thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  }

  .docs-screenshot-lightbox {
    padding: 0.3rem;
  }

  .docs-screenshot-lightbox__dialog {
    width: 100%;
    height: calc(100vh - 0.6rem);
    height: calc(100dvh - 0.6rem);
    padding: 0.35rem;
    gap: 0.4rem;
    border-radius: 1rem;
  }

  .docs-screenshot-lightbox__topbar {
    gap: 0.75rem;
    padding: 0.75rem 0.75rem 2.8rem;
  }

  .docs-screenshot-lightbox__meta {
    max-width: calc(100% - 5rem);
    gap: 0.25rem;
  }

  .docs-screenshot-lightbox__title {
    font-size: 0.9rem;
  }

  .docs-screenshot-lightbox__close {
    padding: 0.65rem 0.85rem;
    font-size: 0.68rem;
  }

  .docs-screenshot-lightbox__nav {
    width: 18%;
    min-width: 0;
    padding: 0.7rem 0.35rem;
  }

  .docs-screenshot-lightbox__nav-icon {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.45rem;
  }

  .docs-screenshot-lightbox__caption-wrap {
    padding: 3rem 0.75rem 0.75rem;
  }

  .docs-screenshot-lightbox__caption {
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .docs-screenshot-lightbox__thumb {
    flex-basis: 5.5rem;
    padding: 0.22rem;
  }

  .docs-screenshot-lightbox__thumb img {
    height: 3.15rem;
  }
}
