.lm-stories-overlay[hidden] {
  display: none !important;
}

.lm-stories-overlay {
  position: fixed;
  inset: 0;
  z-index: 100200;
  display: block;
  background: #000;
  color: #fff;
}

.lm-stories-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 12px 14px;
  background: linear-gradient(180deg, rgb(0 0 0 / .72), transparent);
  pointer-events: none;
}

.lm-stories-title,
.lm-stories-close {
  pointer-events: auto;
}

.lm-stories-title {
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 12px rgb(0 0 0 / .6);
}

.lm-stories-close {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgb(255 255 255 / .28);
  border-radius: 999px;
  padding: 0;
  background: rgb(0 0 0 / .42);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.lm-stories-close:focus-visible,
.lm-story-action:focus-visible {
  outline: 3px solid rgb(255 255 255 / .7);
  outline-offset: 2px;
}

.lm-stories-scroller {
  position: absolute;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.lm-stories-scroller::-webkit-scrollbar {
  display: none;
}

.lm-story-reel {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.lm-story-media {
  position: relative;
  width: min(100%, 560px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.lm-story-media img,
.lm-story-media video,
.lm-story-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: contain;
  background: #000;
}

.lm-story-play {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.lm-story-reel.is-paused .lm-story-play {
  opacity: 1;
}

.lm-story-play span {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgb(0 0 0 / .58);
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}

.lm-story-actions {
  position: absolute;
  right: max(10px, calc((100vw - 560px) / 2 + 10px));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lm-story-action {
  width: 58px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgb(255 255 255 / .24);
  border-radius: 16px;
  background: rgb(0 0 0 / .45);
  box-shadow: 0 14px 40px rgb(0 0 0 / .35);
  color: #fff;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.lm-story-action svg {
  width: 22px;
  height: 22px;
}

.lm-story-action span {
  font-size: 10px;
  font-weight: 800;
}

.lm-story-profile {
  width: auto;
  min-width: 108px;
  min-height: 46px;
  padding: 10px 12px;
  border-color: #d61653;
  background: linear-gradient(180deg, #d61653, #b50f44);
  box-shadow: 0 12px 30px rgb(214 22 83 / .38);
}

.lm-story-profile:hover,
.lm-story-profile:active {
  background: #b50f44;
}

.lm-story-profile span {
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.lm-story-sound .lm-story-waves {
  opacity: 0;
}

.lm-story-sound.is-on .lm-story-waves {
  opacity: 1;
}

.lm-story-sound.is-on .lm-story-muted {
  opacity: 0;
}

.lm-story-counter {
  position: absolute;
  left: 12px;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 14px));
  z-index: 7;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / .45);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgb(0 0 0 / .7);
}

@media (prefers-reduced-motion: reduce) {
  .lm-stories-scroller {
    scroll-behavior: auto;
  }

  .lm-story-play {
    transition: none;
  }
}
