.pulse-stories-strip { display: none !important; }

.shafx-stories-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 18px 4px 26px;
  margin: 18px 0 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.shafx-stories-strip::-webkit-scrollbar { height: 0; display: none; }

.shafx-story-card {
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  scroll-snap-align: start;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  background: transparent;
  padding: 3px;
  transition: transform .15s ease;
}

.shafx-story-card:hover { transform: scale(1.06); }
.shafx-story-card:active { transform: scale(0.97); }
.shafx-story-card:focus { outline: 2px solid #ffcc00; outline-offset: 4px; }
.shafx-story-card:focus:not(:focus-visible) { outline: none; }

.shafx-story-card.unviewed {
  background: conic-gradient(from 180deg at 50% 50%,
    #ffcc00 0deg,
    #ff8800 90deg,
    #ec4899 180deg,
    #a855f7 270deg,
    #ffcc00 360deg);
  animation: shafx-ring-spin 8s linear infinite;
}
@keyframes shafx-ring-spin {
  to { background: conic-gradient(from 540deg at 50% 50%,
    #ffcc00 0deg, #ff8800 90deg, #ec4899 180deg, #a855f7 270deg, #ffcc00 360deg); }
}

.shafx-story-card.viewed {
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
}
.shafx-story-card.viewed:hover {
  background: linear-gradient(135deg, rgba(255,255,255,.3), rgba(255,255,255,.12));
}

.shafx-story-card .inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--surface-2, #2a2f54);
  border: 3px solid var(--bg, #0b0e1c);
  box-sizing: border-box;
}

.shafx-story-card .bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.shafx-story-card .text-bg {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: .56rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

.story-count-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #ffcc00;
  color: #191d34;
  font-size: .56rem;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg, #0b0e1c);
  z-index: 2;
}
html[dir="rtl"] .story-count-badge { right: auto; left: -2px; }

.shafx-story-card .author-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .68rem;
  color: var(--text-2, #b9c0e4);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  letter-spacing: -.01em;
}
.shafx-story-card.unviewed .author-label { color: var(--text, #f4f6ff); font-weight: 700; }

.shafx-story-card.add {
  background: linear-gradient(135deg, rgba(255,204,0,.15), rgba(255,204,0,.05));
  border: 2px dashed rgba(255,204,0,.5);
  padding: 0;
}
.shafx-story-card.add .inner {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shafx-story-card.add .plus-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #ffcc00;
  color: #191d34;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(255,204,0,.4);
}
.shafx-story-card.add:hover .plus-icon { transform: scale(1.1); }
.shafx-story-card.add .author-label { color: #ffcc00; font-weight: 700; }

dialog.shafx-story-create {
  background: var(--surface, #1a1f44);
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 16px;
  padding: 0;
  max-width: 480px;
  width: 92vw;
  color: var(--text, #f4f6ff);
}
dialog.shafx-story-create::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(6px); }
.shafx-story-create form { padding: 24px; }

.shafx-story-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(0,0,0,.2);
  border-radius: 10px;
  padding: 4px;
}
.shafx-story-tab {
  padding: 10px;
  background: transparent;
  color: var(--text-2, #b9c0e4);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  transition: all .15s;
}
.shafx-story-tab.active {
  background: #ffcc00;
  color: #191d34;
}

.shafx-story-bg-picker {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.shafx-story-bg {
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .15s;
}
.shafx-story-bg:hover { transform: scale(1.1); }
.shafx-story-bg.selected {
  border-color: #ffcc00;
  box-shadow: 0 0 0 2px var(--bg, #0b0e1c);
}

.shafx-img-preview {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 280px;
  display: none;
  border: 1px solid var(--line);
}
.shafx-img-preview.show { display: block; }
.shafx-img-preview img { width: 100%; height: auto; display: block; }
.shafx-img-info {
  margin-top: 6px;
  font-size: .76rem;
  color: #22c55e;
  display: none;
  font-weight: 600;
}
.shafx-img-info.show { display: block; }

dialog.shafx-story-viewer {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: 480px;
  width: 95vw;
  max-height: 95vh;
}
dialog.shafx-story-viewer::backdrop {
  background: rgba(0,0,0,.96);
  backdrop-filter: blur(8px);
}

.shafx-story-view-card {
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.shafx-story-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 3px;
  display: flex;
  gap: 4px;
  z-index: 10;
}
.shafx-story-progress span {
  flex: 1;
  background: rgba(255,255,255,.3);
  border-radius: 99px;
  overflow: hidden;
}
.shafx-story-progress span.done { background: rgba(255,255,255,.95); }
.shafx-story-progress span.active::after {
  content: '';
  display: block;
  height: 100%;
  background: #fff;
  width: 0;
  animation: storyFill 6s linear forwards;
}
@keyframes storyFill { to { width: 100%; } }

.shafx-story-close {
  position: absolute;
  top: 28px;
  right: 14px;
  background: rgba(0,0,0,.5);
  border: 0;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 11;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.shafx-story-close:hover { background: rgba(0,0,0,.8); }
html[dir="rtl"] .shafx-story-close { right: auto; left: 14px; }

.shafx-story-view-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 28px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
}

.shafx-story-view-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shafx-story-view-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff;
  padding: 28px 20px 24px;
  font-size: .95rem;
  line-height: 1.4;
}

.shafx-story-view-author {
  position: absolute;
  top: 30px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  z-index: 11;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
html[dir="rtl"] .shafx-story-view-author { left: auto; right: 18px; }

.shafx-story-view-author .av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #ffcc00;
  color: #191d34;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .9rem;
  border: 2px solid rgba(255,255,255,.3);
}

.shafx-story-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
  margin-right: 4px;
  letter-spacing: .02em;
  backdrop-filter: blur(4px);
}
.shafx-story-meta-pill.long { background: rgba(34,197,94,.7); }
.shafx-story-meta-pill.short { background: rgba(239,68,68,.7); }
.shafx-story-meta-pill.watch { background: rgba(245,158,11,.7); }

.shafx-story-tap-zones {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 5;
}
.shafx-story-tap-zones .tap-left,
.shafx-story-tap-zones .tap-right {
  flex: 1;
  cursor: pointer;
}
.shafx-story-tap-zones .tap-left { flex: 0 0 30%; }
