body.is-kb-overlay {
  overflow: hidden;
}

body.is-kb-overlay #kb-chrome-top,
body.is-kb-overlay #kb-chrome-dock,
body.is-kb-overlay .guest-banner {
  visibility: hidden;
  pointer-events: none;
}

dialog.story-viewer:not([open]) {
  display: none !important;
}

#notice-story-viewer.story-viewer {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000;
  color: #f3ead8;
  z-index: 520;
}

#notice-story-viewer.story-viewer[open],
#notice-story-viewer.story-viewer.is-open {
  display: grid;
  place-items: stretch;
}

#notice-story-viewer .story-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: #000;
}

#notice-story-viewer .story-viewer__frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #05070a;
}

#notice-story-viewer .story-viewer__chrome {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  display: grid;
  gap: 0.45rem;
  padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.7rem 2.4rem;
  background: linear-gradient(rgba(0, 0, 0, 0.62), transparent);
  pointer-events: none;
}

#notice-story-viewer .story-viewer__chrome > * {
  pointer-events: auto;
}

#notice-story-viewer .story-viewer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

#notice-story-viewer .notice-story__close {
  flex: 0 0 auto;
  min-width: 2rem;
  height: 2rem;
}

#notice-story-viewer.is-required .notice-story__close {
  display: none;
}

#notice-story-viewer .story-viewer__user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: #fff;
  text-shadow: 0 1px 8px #000;
}

#notice-story-viewer .story-viewer__user img {
  width: 1.85rem;
  height: 1.85rem;
  object-fit: cover;
  border-radius: 50%;
}

#notice-story-viewer .story-viewer__user strong {
  max-width: 9rem;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#notice-story-viewer .story-viewer__bars {
  display: flex;
  gap: 0.2rem;
  direction: ltr;
}

#notice-story-viewer .story-viewer__bars span {
  flex: 1;
  height: 0.16rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
}

#notice-story-viewer .story-viewer__bars i {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

#notice-story-viewer .story-viewer__bars i.is-done {
  transform: scaleX(1);
}

#notice-story-viewer.is-paused .story-viewer__bars i {
  filter: brightness(0.72);
}

#notice-story-viewer .story-viewer__canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

#notice-story-viewer .story-viewer__stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  touch-action: none;
  user-select: none;
}

#notice-story-viewer .story-viewer__stage img,
#notice-story-viewer .story-viewer__stage video,
#notice-story-viewer .story-viewer__stage .kb-media__el {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#notice-story-viewer .story-viewer__caption {
  position: absolute;
  right: 1rem;
  left: 1rem;
  bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  pointer-events: none;
}

#notice-story-viewer .story-viewer__overlay {
  position: static !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto;
  max-width: 100%;
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: clamp(1rem, 3.6vw, 1.2rem);
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px #000;
}

#notice-story-viewer .story-viewer__overlay:empty {
  display: none !important;
}

#notice-story-viewer .kb-gif {
  display: block;
  flex: 0 0 auto;
  width: min(7.2rem, 42vw);
  height: min(7.2rem, 42vw);
  margin: 0;
  overflow: hidden;
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

#notice-story-viewer .kb-gif[hidden] {
  display: none !important;
}

#notice-story-viewer .kb-gif img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 900px) {
  #notice-story-viewer.story-viewer[open],
  #notice-story-viewer.story-viewer.is-open {
    place-items: center;
    background: #000;
  }

  #notice-story-viewer .story-viewer__frame {
    width: min(26.5rem, 100vw);
    height: min(100dvh, 56rem);
    max-height: 100dvh;
  }

  #notice-story-viewer .story-viewer__overlay {
    font-size: 1.15rem;
  }

  #notice-story-viewer .kb-gif {
    width: 7.2rem;
    height: 7.2rem;
  }
}

@media (max-width: 420px) {
  #notice-story-viewer .story-viewer__caption {
    right: 0.7rem;
    left: 0.7rem;
    gap: 0.55rem;
  }

  #notice-story-viewer .kb-gif {
    width: min(5.8rem, 38vw);
    height: min(5.8rem, 38vw);
  }
}
