/**
 * Превью сторис: все дочерние узлы видны, но нажатия получает только корень карточки —
 * так мобильные браузеры не отдают касание элементу video/img/градиентному оверлею.
 */
[data-story-modal-open] {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto !important;
}

/* Кнопка-карточка вместо <a href="#"> — без прыжка на # в урле и прокрутки вверх */
button[data-story-modal-open],
a[data-story-modal-open] {
  font: inherit;
  color: inherit;
  text-decoration: none;
}

button[data-story-modal-open] {
  display: block;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

[data-story-modal-open] * {
  pointer-events: none !important;
}

button[data-story-delete],
[data-story-delete] {
  pointer-events: auto !important;
}

/* То же правило классики главной страницы, если здесь когда-нибудь появится .story-item */
.story-item[data-story-id] {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto !important;
}

.story-item[data-story-id] * {
  pointer-events: none !important;
}

.story-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.story-modal-content {
  width: min(92vw, 420px);
}

.story-viewer {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.story-viewer-avatars {
  position: absolute;
  top: 22px;
  left: 10px;
  z-index: 5;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.story-nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  background: #475569;
  text-decoration: none;
}

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

.story-nav-avatar--empty {
  background: linear-gradient(135deg, #64748b, #334155);
}

.story-nav-avatar--empty img {
  display: none;
}

.story-media-container {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-media-container video,
.story-media-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 6;
}

.story-container:hover .story-controls {
  opacity: 1;
  pointer-events: auto;
}

.story-control-btn {
  border: 0;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.story-menu-wrap { position: relative; }
.story-menu {
  position: absolute;
  right: 0;
  bottom: 42px;
  min-width: 170px;
  background: rgba(2, 6, 23, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  overflow: hidden;
}
.story-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}
.story-menu button:hover { background: rgba(148, 163, 184, 0.2); }

.story-move-panel {
  position: absolute;
  right: 0;
  bottom: 42px;
  width: 220px;
  background: rgba(2, 6, 23, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 10px;
}
.story-move-title {
  color: #fff;
  font-size: 12px;
  margin-bottom: 8px;
}
.story-move-select {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
}
.story-move-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.story-move-actions button {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
#storyMoveCancelBtn {
  background: rgba(148, 163, 184, 0.2);
  color: #fff;
}
#storyMoveConfirmBtn {
  background: #2563eb;
  color: #fff;
}

.story-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.78));
  color: #fff;
}

.story-caption h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 900;
}

.story-reactions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  position: relative;
}

.story-reactions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-height: 1.25em;
}

.story-reaction-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 700;
}

.story-reaction-chip--mine {
  background: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.story-reaction-pick-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-reaction-picker {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 8;
  max-width: min(100%, 280px);
}

.story-reaction-picker[hidden] {
  display: none !important;
}

.story-reaction-picker-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.story-reaction-picker-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.story-reactions-guest-hint {
  margin: 6px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.story-progress {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.story-progress-bar {
  width: 0%;
  height: 100%;
  background: #fff;
  transition: width 0.08s linear;
}

.story-close,
.story-prev,
.story-next {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.story-close { top: 12px; right: 10px; z-index: 12; }
.story-prev { top: 50%; left: 8px; transform: translateY(-50%); z-index: 3; }
.story-next { top: 50%; right: 8px; transform: translateY(-50%); z-index: 3; }

