.sm-home-stories, .sm-home-story-dialog {
  --ink: #070708;
  --white: #f5f6f8;
  font-family: inherit;
  color: var(--white);
}

html:has(.sm-home-story-dialog[open]) { overflow: hidden; }
.sm-home-stories[hidden], .sm-home-story-dialog [hidden] { display: none !important; }

.sm-home-stories {
  border-block: 1px solid #282b34;
  padding-block: 15px 12px;
}

.sm-home-stories .story-trigger:focus-visible, .sm-home-story-dialog :focus-visible {
  outline: 2px solid #adc0ff;
  outline-offset: 4px;
}

.sm-home-story-dialog .story-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sm-home-stories .story-rail {
  display: flex;
  justify-content: safe center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 6px 7px 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 7px;
  scrollbar-width: thin;
  scrollbar-color: #444e69 transparent;
}

.sm-home-stories .story-rail li { flex: 0 0 96px; scroll-snap-align: start; }

.sm-home-stories .story-trigger {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 100%;
  color: inherit;
  padding: 0 0 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
}

.sm-home-stories .story-ring {
  display: block;
  width: 86px;
  height: 86px;
  overflow: hidden;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: linear-gradient(var(--ink), var(--ink)) padding-box,
    linear-gradient(138deg, #c6d2ff 2%, #5582ff 42%, #364ec5 70%, #83a5ff 100%) border-box;
}

.sm-home-stories .story-trigger:hover .story-ring {
  background: linear-gradient(var(--ink), var(--ink)) padding-box,
    linear-gradient(138deg, #edf1ff, #9eb9ff 46%, #6d91ff) border-box;
}

.sm-home-stories .story-ring img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sm-home-stories .story-ring .product-thumb { object-fit: contain; padding: 3px; background: #f5f5f6; }

.sm-home-story-dialog {
  width: min(430px, calc((100dvh - 36px) * 9 / 16), calc(100vw - 32px));
  aspect-ratio: 9 / 16;
  box-sizing: border-box;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #424956;
  border-radius: 13px;
  color: var(--white);
  background: #17191d;
  font: inherit;
  box-shadow: 0 24px 90px #000b;
}

.sm-home-story-dialog::backdrop { background: rgb(12 13 15 / 96%); }

.sm-home-story-dialog .story-panel {
  position: relative;
  isolation: isolate;
  height: 100%;
  text-align: left;
  touch-action: pan-y;
}

.sm-home-story-dialog .story-image, .sm-home-story-dialog .story-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sm-home-story-dialog .story-image { object-fit: cover; }

.sm-home-story-dialog .story-panel.is-product { background: radial-gradient(at 42% 42%, #f4f5f7 0%, #ccd4df 65%, #97a4b5 100%); }
.sm-home-story-dialog .story-panel.is-product .story-image {
  object-fit: contain;
  inset: 46% 0 auto;
  width: 100%;
  height: auto;
  max-height: 68%;
  transform: translateY(-50%);
  mask-image: linear-gradient(transparent, #000 11%, #000 89%, transparent);
  mix-blend-mode: multiply;
}

.sm-home-story-dialog .story-shade {
  pointer-events: none;
  background: linear-gradient(180deg, rgb(0 0 0 / 88%) 0%, rgb(0 0 0 / 52%) 11%, transparent 29%, transparent 56%, rgb(0 0 0 / 67%) 80%, rgb(0 0 0 / 94%) 100%);
}

.sm-home-story-dialog .story-progress {
  position: absolute;
  inset: 12px 12px auto;
  display: flex;
  gap: 4px;
}

.sm-home-story-dialog .story-progress span {
  flex: 1;
  height: 2px;
  overflow: hidden;
  border-radius: 3px;
  background: rgb(255 255 255 / 36%);
}

.sm-home-story-dialog .story-progress span::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--story-fill, 0%);
  background: #fff;
}

.sm-home-story-dialog .story-progress .is-past { --story-fill: 100%; }
.sm-home-story-dialog .story-progress .is-current::after { background: #c2d0ff; }

.sm-home-story-dialog .story-heading {
  position: absolute;
  inset: 18px 10px auto;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.sm-home-story-dialog .story-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  padding: 4px;
  border: 1px solid #7e9cff;
  border-radius: 50%;
  background: #0b0e17;
}

.sm-home-story-dialog .story-avatar img { width: 100%; }
.sm-home-story-dialog .story-identity { flex: 1; overflow-wrap: anywhere; }
.sm-home-story-dialog .story-brand, .sm-home-story-dialog .story-category { margin: 0; line-height: 1.2; }
.sm-home-story-dialog .story-brand { font-size: .875rem; font-weight: 700; }
.sm-home-story-dialog .story-category { color: #e2e6ee; font-size: .75rem; margin-top: 2px; }

.sm-home-story-dialog .story-playback, .sm-home-story-dialog .story-close {
  display: grid;
  place-items: center;
  min-block-size: 44px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: transparent;
  text-shadow: 0 1px 6px #000;
}

.sm-home-story-dialog .story-playback {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding-inline: 12px;
  background: #11151e;
  font-size: .85rem;
}
.sm-home-story-dialog .story-playback:not(:focus-visible) {
  width: 1px;
  height: 1px;
  min-block-size: 0;
  padding: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sm-home-story-dialog .story-close { width: 44px; margin-left: auto; pointer-events: auto; font: 400 28px/1 Arial, sans-serif; }
.sm-home-story-dialog .story-close:hover { background: rgb(0 0 0 / 35%); }

.sm-home-story-dialog .story-zone {
  position: absolute;
  top: 65px;
  bottom: 125px;
  width: 48%;
  border: 0;
  background: transparent;
}
.sm-home-story-dialog .story-zone:focus-visible { outline-offset: -6px; border-radius: 12px; }
.sm-home-story-dialog .story-zone:disabled { cursor: default; }
.sm-home-story-dialog .story-previous { left: 0; }
.sm-home-story-dialog .story-next { right: 0; }
.sm-home-story-dialog .story-panel:not(.is-product) .story-zone { bottom: 0; }
.sm-home-story-dialog .story-panel:not(.is-product) .story-shade {
  background: linear-gradient(180deg, rgb(0 0 0 / 75%), transparent 19%);
}

@media (hover: hover) {
  .sm-home-story-dialog .story-panel.is-product .story-zone:not(:disabled):hover::after {
    position: absolute;
    top: 50%;
    padding: 5px 9px;
    border-radius: 16px;
    color: #fff;
    background: #12151dde;
    font-size: .75rem;
  }
  .sm-home-story-dialog .story-panel.is-product .story-previous:hover::after { content: "Zurück"; left: 8px; }
  .sm-home-story-dialog .story-panel.is-product .story-next:hover::after { content: "Weiter"; right: 8px; }
}

.sm-home-story-dialog .story-copy {
  position: absolute;
  inset: auto 18px 20px;
  pointer-events: none;
}
.sm-home-story-dialog .story-copy h2 { color: #fff; max-width: 25ch; font-size: 1.85rem; line-height: 1.03; margin: 0 0 14px; text-shadow: 0 1px 8px #000; }
.sm-home-story-dialog .story-action { display: flex; align-items: center; justify-content: center; width: 100%; min-block-size: 44px; pointer-events: auto; border-radius: 24px; padding: 8px 18px; font-size: .9rem; font-weight: 700; color: #070b1a; background: #f6f7fb; text-decoration: none; }
.sm-home-story-dialog .story-action:hover { background: #cbd7ff; }

@media (max-width: 620px) and (orientation: portrait) {
  .sm-home-story-dialog {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .sm-home-story-dialog .story-progress { top: max(12px, env(safe-area-inset-top)); }
  .sm-home-story-dialog .story-heading { top: max(18px, calc(env(safe-area-inset-top) + 6px)); }
  .sm-home-story-dialog .story-playback { top: max(22px, calc(env(safe-area-inset-top) + 10px)); }
  .sm-home-story-dialog .story-copy { bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px)); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .sm-home-story-dialog { width: min(420px, calc(100vw - 24px)); height: calc(100dvh - 18px); aspect-ratio: auto; }
  .sm-home-story-dialog .story-copy h2 { font-size: 1.4rem; margin-bottom: 6px; }
  .sm-home-story-dialog .story-copy { bottom: 10px; }
}


@media (max-width: 790px) {
  .sm-home-stories { padding-block: 11px 7px; }
  .sm-home-stories .story-rail { gap: 10px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .sm-home-stories .story-rail li { flex-basis: 74px; }
  .sm-home-stories .story-trigger { font-size: .75rem; gap: 5px; }
  .sm-home-stories .story-ring { width: 66px; height: 66px; padding: 2px; }
  .sm-home-stories .story-ring .product-thumb { padding: 5px; }
}
