.atom-story-widget,
.atom-story-widget * {
  box-sizing: border-box;
}

:root .atom-story-widget {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  direction: rtl;
  line-height: normal;
  letter-spacing: normal;
  text-transform: none;
  transform: none;
  filter: none;
  perspective: none;
  contain: none;
}

.atom-story-widget .atom-story-app {
    width: 100%;
    max-width: 100%;
    backdrop-filter: blur(14px);
    padding: 22px 35px 22px;
}

.atom-story-widget .atom-story-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (7 * 12px)) / 8);
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 10px;
  direction: rtl;
  touch-action: pan-y;
  user-select: none;
  scrollbar-width: none;
  cursor: grab;
  scroll-snap-type: x proximity;
}

.atom-story-widget .atom-story-list::-webkit-scrollbar {
  display: none;
}

.atom-story-widget .atom-story-list.is-dragging {
  cursor: grabbing;
}

.atom-story-widget .atom-story-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  font: inherit;
  line-height: normal;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  scroll-snap-align: start;
}

.atom-story-widget .atom-story-trigger:focus-visible {
  outline: 2px solid #e63946;
  outline-offset: 3px;
}

.atom-story-widget .atom-story-ring {
    display: grid;
    place-items: center;
    width: min(100%, 130px);
    height: auto;
    aspect-ratio: 1;
    overflow: hidden;
    border: 3px solid #e63946 !important;
    border-radius: 50%;
}

:root .atom-story-widget .atom-story-avatar {
  display: block !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 50% !important;
}

:root .atom-story-widget .atom-story-avatar img {
  display: block !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: scale(1.08) !important;
}

.atom-story-widget .atom-story-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #000;
  font-size: 17px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atom-story-widget .atom-story-viewer[hidden] {
  display: none !important;
}

.atom-story-widget .atom-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
}

.atom-story-widget .atom-story-card {
  position: relative;
  width: min(92vw, 440px);
  height: min(92vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.95);
}

.atom-story-widget .atom-story-modal-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.atom-story-widget .atom-story-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #020817;
}

:root .atom-story-widget .atom-story-media img,
:root .atom-story-widget .atom-story-media video {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}

.atom-story-widget .atom-story-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px 18px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.12) 22%, rgba(0, 0, 0, 0.48));
  pointer-events: none;
}

.atom-story-widget .atom-story-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.atom-story-widget .atom-story-progress span {
  position: relative;
  display: block;
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.atom-story-widget .atom-story-progress span i {
  position: absolute;
  inset: 0 0 0 auto;
  width: 0;
  background: #fff;
}

.atom-story-widget .atom-story-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atom-story-widget .atom-story-heading-avatar {
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.atom-story-widget .atom-story-heading-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atom-story-widget .atom-story-heading strong {
  color: #fff;
  font-size: 0.9rem;
}

:root .atom-story-widget .atom-story-card div.atom-story-close,
:root .atom-story-widget .atom-story-card div.atom-story-sound {
  all: unset !important;
  position: absolute !important;
  top: 28px !important;
  z-index: 3 !important;
  display: grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.7) !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 1.4rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

:root .atom-story-widget .atom-story-card div.atom-story-close {
  left: 18px !important;
}

:root .atom-story-widget .atom-story-card div.atom-story-sound {
  left: 64px !important;
  font-size: initial !important;
}

:root .atom-story-widget .atom-story-card div.atom-story-sound[hidden] {
  display: none !important;
}

:root .atom-story-widget .atom-story-sound svg {
  display: none !important;
  width: 21px !important;
  height: 21px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

:root .atom-story-widget .atom-story-sound .atom-story-sound-muted {
  display: block !important;
}

:root .atom-story-widget .atom-story-sound[aria-pressed="true"] .atom-story-sound-muted {
  display: none !important;
}

:root .atom-story-widget .atom-story-sound[aria-pressed="true"] .atom-story-sound-on {
  display: block !important;
}

:root .atom-story-widget .atom-story-card div.atom-story-play {
  all: unset !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 5 !important;
  display: none !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.45) !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 2rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
  cursor: pointer !important;
  backdrop-filter: blur(4px) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

:root .atom-story-widget .atom-story-card div.atom-story-play.is-visible {
  display: grid !important;
}

:root .atom-story-widget .atom-story-card div.atom-story-close:focus-visible,
:root .atom-story-widget .atom-story-card div.atom-story-sound:focus-visible,
:root .atom-story-widget .atom-story-card div.atom-story-play:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
}

@media (max-width: 560px) {
  .atom-story-widget .atom-story-app {
    padding: 18px 0 22px;
  }

  .atom-story-widget .atom-story-list {
    gap: 10px;
    grid-auto-columns: calc((100% - (-5 * 20px)) / 4);
  }
}