/* aspaz.az — Story sistemi stilləri */

.story-bar-section { padding: 22px 0 6px; }

/* ---------- Premium panel ---------- */
.story-panel {
  position: relative; overflow: hidden;
  padding: 16px 18px 12px; border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px -34px rgba(36, 20, 23, .6);
}
.story-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background:
    radial-gradient(40% 70% at 0% 0%, rgba(244, 63, 94, .12), transparent 60%),
    radial-gradient(35% 70% at 100% 0%, rgba(245, 196, 81, .16), transparent 60%);
}
.story-panel-head { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.story-panel-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 10px 20px -12px rgba(216, 31, 61, .95);
}
.story-panel-icon svg { width: 21px; height: 21px; }
.story-panel-text { flex: 1; min-width: 0; }
.story-panel-text h2 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.01em; }
.story-panel-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--color-ink-faint); }
.story-panel-count {
  flex-shrink: 0; padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: var(--color-primary-dark); background: var(--color-primary-tint); border: 1px solid var(--color-primary-light, #fbd5da);
}

/* ---------- Sürüşən lent ---------- */
.story-scroller { position: relative; }
.story-bar {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.story-bar::-webkit-scrollbar { display: none; }
.story-bar.is-draggable { cursor: grab; }
.story-bar.is-dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }
.story-bar.is-dragging * { pointer-events: none; }

/* Davamı olan tərəfdə yumşaq solğunlaşma */
.story-scroller.has-prev .story-bar,
.story-scroller.has-next .story-bar {
  -webkit-mask-image: linear-gradient(90deg, var(--sb-l, #000) 0, #000 40px, #000 calc(100% - 40px), var(--sb-r, #000) 100%);
          mask-image: linear-gradient(90deg, var(--sb-l, #000) 0, #000 40px, #000 calc(100% - 40px), var(--sb-r, #000) 100%);
}
.story-scroller.has-prev { --sb-l: transparent; }
.story-scroller.has-next { --sb-r: transparent; }

.story-nav {
  position: absolute; top: 34px; z-index: 3; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: var(--color-ink);
  background: #fff; border: 1px solid var(--color-border);
  box-shadow: 0 6px 16px rgba(36, 20, 23, .14);
  opacity: 0; transition: opacity .18s ease, background .15s ease, color .15s ease;
}
.story-nav svg { width: 16px; height: 16px; }
.story-nav[hidden] { display: none; }
.story-nav-prev { left: -8px; }
.story-nav-next { right: -8px; }
.story-nav:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.story-scroller:hover .story-nav, .story-nav:focus-visible { opacity: 1; }
@media (hover: none) { .story-nav { display: none !important; } }

/* ---------- Element ---------- */
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 80px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  min-width: 0;
  scroll-snap-align: start;
}

.story-ring {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 210deg, var(--color-primary), #ffb199, #f5c451, var(--color-primary-dark), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.22,.85,.3,1), box-shadow .25s ease;
}
.story-ring::after {          /* incə daxili parıltı */
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .85) inset; pointer-events: none;
}
.story-item:hover .story-ring { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 22px -12px rgba(216, 31, 61, .85); }
.story-item:active .story-ring { transform: scale(.97); }
.story-item:focus-visible .story-ring { outline: 2px solid var(--color-primary); outline-offset: 3px; }

.story-ring-add {
  background: linear-gradient(140deg, #fff, var(--color-primary-tint) 60%, #ffe3c7);
  box-shadow: 0 0 0 1.5px var(--color-primary-light, #fbd5da) inset;
}

.story-avatar-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-avatar-wrap img, .story-avatar-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.story-item:hover .story-avatar-wrap img { transform: scale(1.06); }
.story-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  background: rgba(20,10,12,.28);
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.story-audio-badge {
  font-size: 20px;
  background: linear-gradient(160deg, rgba(216,31,61,.32), rgba(20,10,12,.42));
}
.story-avatar-fallback {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--color-primary-dark);
  background: linear-gradient(140deg, var(--color-primary-tint), #ffe9d6);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.story-add-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 10px -4px rgba(216, 31, 61, .9);
}

/* Ad yazısı HƏMİŞƏ dairənin (story-item) eninə sığmalıdır — en elementin özündən
   götürülür (100%), uzun ad avtomatik "…" ilə kəsilir. */
.story-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-soft);
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease;
}
.story-item:hover .story-item-label { color: var(--color-primary-dark); }
.story-item-add .story-item-label { color: var(--color-primary-dark); font-weight: 700; }

.story-item-add[data-has-pending="1"] .story-ring-add {
  background: linear-gradient(140deg, #fff, var(--color-warning-bg) 55%, #fde68a);
  box-shadow: 0 0 0 1.5px var(--color-warning) inset;
}
.story-item-add[data-has-pending="1"] .story-add-badge { background: linear-gradient(140deg, var(--color-warning), #d97706); }

.story-ring-cv-add {
  background: conic-gradient(from 210deg, var(--color-primary-dark), var(--color-primary), #f5c451, var(--color-primary-dark));
}
.story-avatar-fallback-cv {
  background: linear-gradient(140deg, var(--color-primary-tint), #fff3d6);
  font-size: 24px;
}
.story-item-cv-add .story-item-label { color: var(--color-primary-dark); font-weight: 700; }

@media (max-width: 760px) {
  .story-bar-section { padding: 14px 0 4px; }
  .story-panel { padding: 13px 12px 8px; border-radius: 20px; }
  .story-panel-head { gap: 10px; margin-bottom: 10px; }
  .story-panel-icon { width: 34px; height: 34px; border-radius: 12px; }
  .story-panel-icon svg { width: 18px; height: 18px; }
  .story-panel-text h2 { font-size: 15px; }
  .story-panel-text p { display: none; }
  .story-bar { gap: 12px; }
  .story-item { width: 70px; gap: 6px; }
  .story-ring { width: 64px; height: 64px; }
  .story-item-label { font-size: 11px; }
}
@media (max-width: 420px) {
  .story-item { width: 64px; }
  .story-ring { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-ring, .story-avatar-wrap img, .story-item-label { transition: none; }
  .story-item:hover .story-ring { transform: none; }
}

/* --- Story əlavə et modalı --- */
/* ---------- "Story əlavə et" pəncərəsi (premium) ---------- */
.story-add-modal { max-width: 430px; padding-top: 10px; }

/* DİQQƏT: burada `position: relative` VERİLMƏMƏLİDİR — o halda başlıq bloku
   mütləq yerləşdirilmiş "✕" düyməsinin üstünə düşür və kliklər düyməyə çatmır. */
.story-modal-head { text-align: center; }
.story-modal-icon {
  width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 20px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 14px 26px -14px rgba(216, 31, 61, .95);
}
.story-modal-icon svg { width: 28px; height: 28px; }
.story-modal-head h3 { margin: 0 0 4px; font-size: 21px; }
.story-modal-head p { margin: 0; font-size: 12.5px; color: var(--color-ink-faint); }

.story-upload-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 200px;
  border-radius: 18px;
  border: 2px dashed var(--color-border-strong);
  background: linear-gradient(160deg, #fffaf4, var(--color-primary-tint));
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.story-upload-box:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -22px rgba(216, 31, 61, .9);
}
.story-upload-box.is-over { border-color: var(--color-primary); background: var(--color-primary-tint); }

.story-upload-icon {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 10px 20px -12px rgba(216, 31, 61, .95);
}
.story-upload-icon svg { width: 22px; height: 22px; }
.story-upload-placeholder b { font-size: 13.5px; font-weight: 800; color: var(--color-primary-dark); }
.story-upload-placeholder small { font-size: 11.5px; color: var(--color-ink-faint); }

/* Format nişanları */
.story-format-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.story-chip {
  padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--color-primary-dark); background: var(--color-primary-tint);
  border: 1px solid var(--color-primary-light, #fbd5da);
}
.story-chip.is-soft { color: var(--color-ink-faint); background: var(--color-surface-alt); border-color: var(--color-border); }

/* Mətn sahəsi */
.story-text-field { position: relative; }
.story-text-field .vip-field-label span { font-weight: 500; color: var(--color-ink-faint); }
.story-text-count {
  position: absolute; right: 12px; bottom: 10px;
  font-size: 11px; font-weight: 700; color: var(--color-ink-faint);
  background: rgba(255, 255, 255, .9); padding: 1px 6px; border-radius: 999px; pointer-events: none;
}

/* İpucu və düymə */
.story-modal-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 12px; margin: 12px 0 14px;
  background: var(--color-surface-alt); border: 1px solid var(--color-border);
  font-size: 12.5px; line-height: 1.5; color: var(--color-ink-faint);
}
.story-modal-hint svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--color-primary); }

.story-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border: 0; box-shadow: 0 14px 26px -16px rgba(216, 31, 61, .95);
}
.story-submit svg { width: 18px; height: 18px; }
.story-submit:hover { filter: brightness(1.05); }
.story-submit:disabled { filter: grayscale(.4); opacity: .7; }

@media (max-width: 480px) {
  .story-add-modal { max-width: none; }
  .story-modal-icon { width: 50px; height: 50px; border-radius: 17px; }
  .story-modal-head h3 { font-size: 19px; }
  .story-upload-box { height: 168px; }
}

.story-upload-box.has-image { border-style: solid; border-color: var(--color-primary-light, #fbd5da); padding: 0; background: #fff; }
/* Fayl seçiləndə yükləmə mətni gizlənir (əks halda şəklin altında qalırdı) */
.story-upload-box.has-image .story-upload-placeholder { display: none; }
.story-upload-box.is-uploading { cursor: default; pointer-events: none; }

/* --- Story yüklənmə faizi göstəricisi --- */
.story-upload-progress {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(24, 12, 15, .74);
  backdrop-filter: blur(2px);
}
.story-upload-progress[hidden] { display: none; }
.story-upload-progress-circle { position: relative; width: 72px; height: 72px; }
.story-upload-progress-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.supc-track { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 5; }
.supc-bar {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 188.5;
  transition: stroke-dashoffset .25s ease;
}
.story-upload-progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.story-upload-progress-label { color: rgba(255,255,255,.9); font-size: 12.5px; font-weight: 600; }
.story-upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--color-ink-faint); font-size: 12px; font-weight: 600; text-align: center; padding: 0 16px; }
.story-upload-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-upload-preview[hidden] { display: none !important; }
video.story-upload-preview { background: #000; object-fit: contain; }
.story-upload-audio-preview {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 16px;
  background: linear-gradient(160deg, var(--color-primary-tint) 0%, #fff 70%);
}
.story-upload-audio-preview[hidden] { display: none !important; }
.story-upload-audio-icon {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: #fff; box-shadow: var(--shadow-sm);
}
.story-upload-audio-name {
  font-size: 12.5px; font-weight: 700; color: var(--color-ink); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px;
}
.story-upload-audio-preview audio { width: 100%; max-width: 260px; height: 34px; }
.story-upload-change {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary-dark);
  text-align: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  width: 100%;
}
.story-upload-change[hidden] { display: none; }

/* --- Story baxış pəncərəsi --- */
.story-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: storyFadeIn .2s ease both;
}
.story-view-overlay { padding: 24px; }
@supports (height: 100dvh) {
  .story-view-overlay { height: 100dvh; }
}
.story-view-overlay[hidden] { display: none; }
@keyframes storyFadeIn { from { opacity: 0; } to { opacity: 1; } }

.story-view-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: #111;
  border-radius: var(--radius-lg);
  overflow: visible;
  box-shadow: 0 12px 40px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.18);
  animation: storyPopIn .28s cubic-bezier(.2,.8,.2,1) both;
}
.story-view-card-inner {
  border-radius: inherit;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  max-height: inherit;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.story-view-card-inner::-webkit-scrollbar { display: none; width: 0; height: 0; }
@keyframes storyPopIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.story-view-media {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 62vh;
  max-height: 62dvh;
  flex-shrink: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.story-view-media img, .story-view-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-view-media img[hidden], .story-view-media video[hidden] { display: none !important; }

.story-view-audio {
  position: relative;
  width: 100%; height: 100%;
  flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 30px 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a1015, #1a0d12, #3a1608, #1a0d12);
  background-size: 300% 300%;
  animation: storyAudioBgShift 10s ease infinite;
}
.story-view-audio[hidden] { display: none !important; }
@keyframes storyAudioBgShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Mətbəx mövzulu üzən ikonlar (dekorativ arxa fon animasiyası) --- */
.story-audio-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.story-audio-float {
  position: absolute;
  bottom: -40px;
  font-size: 22px;
  opacity: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
  animation-name: storyAudioFloatUp;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
.story-audio-float-1 { left: 12%;  font-size: 26px; animation-duration: 9s;  animation-delay: 0s; }
.story-audio-float-2 { left: 78%;  font-size: 20px; animation-duration: 11s; animation-delay: 1.4s; }
.story-audio-float-3 { left: 30%;  font-size: 18px; animation-duration: 8s;  animation-delay: 2.6s; }
.story-audio-float-4 { left: 60%;  font-size: 24px; animation-duration: 12s; animation-delay: 0.8s; }
.story-audio-float-5 { left: 88%;  font-size: 20px; animation-duration: 10s; animation-delay: 3.5s; }
.story-audio-float-6 { left: 8%;   font-size: 18px; animation-duration: 9.5s; animation-delay: 5s; }
@keyframes storyAudioFloatUp {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  12%  { opacity: .55; }
  85%  { opacity: .35; }
  100% { transform: translateY(-340px) rotate(18deg); opacity: 0; }
}

/* --- Musiqi nişanı (pulsasiya + fırlanan halqalar) --- */
.story-audio-cover {
  position: relative;
  z-index: 1;
  width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--color-primary), var(--color-primary-darker));
  box-shadow: 0 12px 30px rgba(216,31,61,.4);
  animation: storyAudioPulse 2.2s ease-in-out infinite;
}
.story-audio-cover-icon { font-size: 40px; position: relative; z-index: 1; }
@keyframes storyAudioPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(216,31,61,.4), 0 0 0 0 rgba(216,31,61,.35); }
  50% { box-shadow: 0 12px 30px rgba(216,31,61,.4), 0 0 0 14px rgba(216,31,61,0); }
}
.story-audio-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,178,153,.4);
  animation: storyAudioRingSpin linear infinite;
}
.story-audio-ring-1 { animation-duration: 7s; }
.story-audio-ring-2 { inset: -26px; border-color: rgba(255,178,153,.2); animation-duration: 11s; animation-direction: reverse; }
@keyframes storyAudioRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- Ekvalayzer zolaqları (yalnız çalınarkən canlanır) --- */
.story-audio-eq {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 22px;
}
.story-audio-eq span {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffb199, var(--color-primary));
  opacity: .55;
  animation-name: storyAudioEqBar;
  animation-duration: 900ms;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  animation-play-state: paused;
}
.story-view-audio.is-playing .story-audio-eq span { animation-play-state: running; opacity: 1; }
.story-audio-eq span:nth-child(1) { animation-duration: 780ms; animation-delay: 0ms; }
.story-audio-eq span:nth-child(2) { animation-duration: 640ms; animation-delay: 90ms; }
.story-audio-eq span:nth-child(3) { animation-duration: 900ms; animation-delay: 180ms; }
.story-audio-eq span:nth-child(4) { animation-duration: 560ms; animation-delay: 60ms; }
.story-audio-eq span:nth-child(5) { animation-duration: 860ms; animation-delay: 220ms; }
.story-audio-eq span:nth-child(6) { animation-duration: 700ms; animation-delay: 130ms; }
.story-audio-eq span:nth-child(7) { animation-duration: 820ms; animation-delay: 40ms; }
@keyframes storyAudioEqBar {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

.story-view-audio audio { position: relative; z-index: 1; width: 100%; max-width: 300px; }

/* --- Custom mp3 pleyer paneli (native "audio controls" əvəzinə) --- */
.story-audio-player {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 8px 14px 8px 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}
.story-audio-playbtn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--color-primary), var(--color-primary-darker));
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease;
}
.story-audio-playbtn:hover { transform: scale(1.06); }
.story-audio-playbtn:active { transform: scale(0.94); }
.story-audio-icon-play { margin-left: 2px; }
.story-audio-icon-play[hidden], .story-audio-icon-pause[hidden] { display: none !important; }

.story-audio-time {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}
.story-audio-time:last-of-type { text-align: right; }

.story-audio-seek {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) var(--story-audio-progress, 0%), rgba(255,255,255,.25) var(--story-audio-progress, 0%));
  outline: none;
  cursor: pointer;
}
.story-audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .12s ease;
}
.story-audio-seek::-webkit-slider-thumb:hover { transform: scale(1.15); }
.story-audio-seek::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: pointer;
}
.story-audio-seek::-moz-range-track {
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.25);
}
.story-audio-seek::-moz-range-progress {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.story-audio-volbtn {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.story-audio-volbtn:hover { background: rgba(255,255,255,.12); color: #fff; }
.story-audio-icon-vol-on[hidden], .story-audio-icon-vol-off[hidden] { display: none !important; }

@media (max-width: 420px) {
  .story-audio-player { max-width: 100%; padding: 7px 12px 7px 7px; gap: 8px; }
  .story-audio-playbtn { width: 30px; height: 30px; }
  .story-audio-time { font-size: 11px; min-width: 26px; }
}

.story-view-info {
  padding: 14px 20px 20px;
  background: #fff;
  flex-shrink: 0;
}
.story-view-info-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.story-view-who { display: flex; flex-direction: column; min-width: 0; }
.story-view-user { font-weight: 800; font-size: 15px; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-view-date { font-size: 12px; color: var(--color-ink-faint); margin-top: 2px; }

.story-view-stats { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.story-view-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-ink-faint);
  padding: 7px 10px;
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  white-space: nowrap;
}
.story-view-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-ink-soft);
  padding: 7px 11px;
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
  white-space: nowrap;
  font-family: inherit;
}
.story-view-like-btn:hover { border-color: var(--color-primary-light); color: var(--color-primary-dark); background: var(--color-primary-tint); }
.story-view-like-btn:active { transform: scale(0.94); }
.story-view-like-btn:disabled { opacity: .7; cursor: default; }
.story-view-like-btn svg { flex-shrink: 0; transition: transform .18s ease; }
.story-view-like-btn.is-liked {
  background: linear-gradient(150deg, var(--color-primary), var(--color-primary-darker));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.story-view-like-btn.is-liked svg { transform: scale(1.12); }

.story-view-text { margin: 12px 0 0; font-size: 14px; color: var(--color-ink-soft); line-height: 1.55; white-space: pre-line; }
.story-view-text:empty { display: none; margin: 0; }

/* --- Story-yə göndərilmiş hədiyyələr siyahısı --- */
.story-view-gifts { margin: 12px 0 0; }
.story-view-gifts[hidden] { display: none !important; }
.story-view-gifts-list { display: flex; flex-direction: column; gap: 6px; }
.story-view-gift-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--color-primary-tint);
  font-size: 13px;
  color: var(--color-ink);
  line-height: 1.4;
}
.story-view-gift-icon { font-size: 16px; flex-shrink: 0; }
.story-view-gift-row b { color: var(--color-primary-dark); }

.story-gift-open-btn { font-weight: 700; }

/* Story baxış pəncərəsi (z-index:320) açıq ikən "Hədiyyə Göndər" modalı onun ÜSTÜNDƏ görünməlidir —
   .vip-modal-overlay-in ümumi z-index (200) buradan aşağıdır, ona görə xüsusi override lazımdır. */
#storyGiftModalOverlay { z-index: 340; }

/* "Story əlavə et" pəncərəsi ümumi .vip-modal-overlay qatındadır (z-index:200) —
   canlı söhbət düyməsi (250) onun üstündə qalırdı. */
#storyAddModalOverlay { z-index: 330; }

.story-view-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--color-ink);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease;
  z-index: 2;
}
.story-view-close:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.3); }

/* --- Toast --- */
.story-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(16px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  white-space: normal;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
}
.story-toast::before {
  content: "✓";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  margin-top: 1px;
}
.story-toast.is-error::before { content: "!"; }
.story-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.story-toast.is-error { background: var(--color-danger); }

@media (max-width: 480px) {
  .story-toast {
    left: 16px;
    right: 16px;
    bottom: 18px;
    width: auto;
    max-width: none;
    transform: translateY(16px);
    padding: 13px 16px;
    font-size: 13px;
    border-radius: 14px;
  }
  .story-toast.is-visible { transform: translateY(0); }
}

/* --- Admin panel: Story kartları --- */
.story-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.story-admin-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.story-admin-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.story-admin-card-media { width: 100%; aspect-ratio: 4 / 3; background: var(--color-surface-alt); overflow: hidden; }
.story-admin-card-media img, .story-admin-card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-admin-card-media-audio {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; background: linear-gradient(160deg, var(--color-primary-tint) 0%, #fff 75%);
}
.story-admin-audio-cover {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: #fff; box-shadow: var(--shadow-sm);
}
.story-admin-card-media-audio audio { width: 100%; max-width: 200px; height: 32px; }
.story-admin-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.story-admin-card-user { display: flex; align-items: center; gap: 8px; }
.story-admin-card-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--color-primary-tint); flex-shrink: 0; }
.story-admin-card-avatar-fallback { width: 30px; height: 30px; border-radius: 50%; background: var(--color-primary-tint); color: var(--color-primary-dark); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.story-admin-card-name { font-weight: 700; font-size: 13.5px; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-admin-card-text { font-size: 12.5px; color: var(--color-ink-soft); line-height: 1.5; margin: 0; max-height: 54px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.story-admin-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--color-ink-faint); gap: 6px 8px; flex-wrap: wrap; }
.story-admin-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.story-admin-card-actions form { display: flex; gap: 6px; flex: 1; }
.story-admin-card-actions select { padding: 8px 8px; font-size: 12.5px; flex: 1; min-width: 0; }
.story-admin-card-actions .btn { flex-shrink: 0; }

@media (max-width: 760px) {
  .story-ring { width: 64px; height: 64px; }
  .story-item { width: 70px; }
  .story-add-badge { width: 20px; height: 20px; font-size: 14px; }
  .story-view-overlay { padding: 16px; }
  .story-view-card { max-width: 440px; width: 100%; max-height: 92vh; max-height: 92dvh; }
  .story-view-media { aspect-ratio: 4 / 5; max-height: 50vh; max-height: 50dvh; }
  .story-upload-box { height: 170px; }
  .story-upload-placeholder svg { width: 18px; height: 18px; }
  .story-upload-placeholder { font-size: 11.5px; }
  .story-view-info { padding: 12px 16px 16px; }
  .story-view-stat, .story-view-like-btn { padding: 6px 9px; font-size: 12px; }

  /* Admin story cards: single column so there's always room for readable, full-width actions */
  .story-admin-grid { grid-template-columns: 1fr; gap: 12px; }
  .story-admin-card { flex-direction: row; }
  .story-admin-card-media { width: 120px; aspect-ratio: unset; flex-shrink: 0; }
  .story-admin-card-body { padding: 12px 14px 14px; gap: 6px; }

  .story-admin-card-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .story-admin-card-actions form {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .story-admin-card-actions select {
    width: 100%;
    flex: none;
    padding: 10px 10px;
  }
  .story-admin-card-actions .btn {
    width: 100%;
    flex-shrink: 0;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .story-bar { gap: 14px; }
  .story-ring { width: 58px; height: 58px; }
  .story-item { width: 64px; }
  .story-item-label { font-size: 11px; }
  .story-view-info-top { flex-wrap: wrap; }
  .story-view-stats { order: 3; width: 100%; justify-content: flex-start; margin-top: 4px; }
  .story-view-who { order: 1; }

  .story-admin-card { flex-direction: column; }
  .story-admin-card-media { width: 100%; aspect-ratio: 4 / 3; }
}
