/* BeautyV · компактная live-лента историй */
.story-rail {
  position: fixed;
  left: 16px;
  bottom: 20px;
  z-index: 45;
  width: 156px;
  height: auto;
  border-radius: 16px;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
}
.story-rail__inner {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  background: #f1ece1;
  box-shadow: 0 18px 42px -20px rgba(10, 15, 14, .72);
  transition: box-shadow .3s;
}
.story-rail:hover .story-rail__inner { box-shadow: 0 22px 48px -18px rgba(10,15,14,.85); }
.story-rail__head {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.story-rail__live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(9,14,13,.72);
  color: #ffd9d5;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .14em;
}
.story-rail__live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff5a5f;
  animation: storyRailPulse 1.7s infinite;
}
.story-rail__brand {
  color: rgba(255,255,255,.82);
  font-family: Montserrat, sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .08em;
}
.story-rail__card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  text-decoration: none;
  background: #f1ece1;
}
.story-rail__img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity .22s ease;
}
.story-rail__card.is-switching .story-rail__img { opacity: .35; }
.story-rail__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,12,11,.22) 0%, rgba(5,12,11,0) 24%, rgba(5,12,11,0) 64%, rgba(5,12,11,.72) 100%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.story-rail:hover .story-rail__shade, .story-rail:focus-within .story-rail__shade { opacity: 1; }
.story-rail__timer {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 2px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255,255,255,.28);
  z-index: 3;
}
.story-rail__timer i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f3df9a, #d4af37);
}
.story-rail__copy {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 16px;
  z-index: 3;
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .22s, transform .28s;
}
.story-rail:hover .story-rail__copy,
.story-rail:focus-within .story-rail__copy { opacity: 1; transform: none; }
.story-rail__copy small {
  color: #8fe6e1;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-rail__copy strong {
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 9px;
  line-height: 1.25;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-rail__copy em { color: rgba(255,255,255,.66); font-size: 7px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-rail__vertical, .story-rail__hint { display: none; }
.story-rail__dots {
  position: absolute;
  right: 7px;
  top: 35px;
  z-index: 3;
  display: grid;
  gap: 4px;
  opacity: 0;
  transition: opacity .2s;
}
.story-rail:hover .story-rail__dots { opacity: 1; }
.story-rail__dot {
  width: 4px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.36);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.story-rail__dot.is-active { background: #f1df9b; transform: scale(1.3); }
@keyframes storyRailPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,90,95,.45); }
  50% { box-shadow: 0 0 0 4px rgba(255,90,95,0); }
}
@keyframes storyRailProgress { to { width: 100%; } }
body.is-story-open .story-rail { opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
@media (max-width: 1279px) { .story-rail { display: none; } }
@media (min-width: 1920px) {
  .story-rail { width: 170px; }
  .story-rail__copy strong { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-rail, .story-rail__inner, .story-rail__img, .story-rail__live i, .story-rail__dot { animation: none !important; transition: none !important; }
}

/* Мобильная live-лента */
.story-rail__collapse, .story-rail__open { display: none; }
@media (max-width: 767px) {
  .story-rail {
    display: block;
    left: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 128px;
    height: auto;
  }
  .story-rail__brand { display: none; }
  .story-rail__collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: rgba(9,14,13,.55);
    color: #fff;
    font: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
  }
  .story-rail.is-collapsed { width: 38px; }
  .story-rail.is-collapsed .story-rail__inner {
    height: 112px;
    background: #0d1514;
    border-color: rgba(255,255,255,.22);
  }
  .story-rail.is-collapsed .story-rail__head,
  .story-rail.is-collapsed .story-rail__card,
  .story-rail.is-collapsed .story-rail__dots,
  .story-rail.is-collapsed .story-rail__timer { display: none; }
  .story-rail.is-collapsed .story-rail__open {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 4;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
  }
  .story-rail__open i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff5a5f;
    box-shadow: 0 0 0 4px rgba(255,90,95,.14);
    animation: storyRailPulse 1.7s infinite;
  }
  .story-rail__open span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: rgba(255,255,255,.78);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .16em;
  }
  .story-rail__open b { color: #f1df9b; font-size: 18px; line-height: 1; font-weight: 400; }
}
@media (min-width: 768px) and (max-width: 1279px) { .story-rail { display: none; } }

.story-rail.is-collapsed .story-rail__collapse { display: none !important; }

/* Анимация вокруг live-блока */
.story-rail{overflow:visible}
.story-rail::before{
  content:"";
  position:absolute;
  inset:-1px;
  z-index:3;
  padding:1.5px;
  border-radius:17px;
  background:linear-gradient(110deg,transparent 18%,rgba(216,182,94,.2) 30%,#e8cd82 43%,#66d6cc 52%,#e8cd82 61%,rgba(216,182,94,.15) 74%,transparent 86%);
  background-size:270% 100%;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  mask-composite:exclude;
  animation:railBorderSweep 4.6s linear infinite;
  pointer-events:none;
  opacity:.85;
}
.story-rail::after{
  content:"";
  position:absolute;
  inset:-5px;
  z-index:0;
  border:1px solid rgba(216,182,94,.32);
  border-radius:20px;
  pointer-events:none;
  animation:railHalo 4s ease-out infinite;
}
.story-rail__inner{
  position:relative;
  z-index:2;
  animation:railFloat 7s ease-in-out infinite,railGlow 4.8s ease-in-out infinite;
}
.story-rail__spark{
  position:absolute;
  z-index:4;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#f4dfa0;
  box-shadow:0 0 10px rgba(216,182,94,.9);
  pointer-events:none;
  animation:railSpark 3.8s ease-in-out infinite;
}
.story-rail__spark--1{top:-2px;right:20px}
.story-rail__spark--2{bottom:34px;left:-2px;animation-delay:1.3s;width:4px;height:4px}
.story-rail__spark--3{top:42%;right:-2px;animation-delay:2.2s;width:3px;height:3px;background:#8be7de;box-shadow:0 0 10px rgba(94,199,194,.9)}
@keyframes railBorderSweep{to{background-position:-270% 0}}
@keyframes railHalo{0%{opacity:.55;transform:scale(.985)}70%{opacity:0;transform:scale(1.035)}100%{opacity:0;transform:scale(1.035)}}
@keyframes railSpark{0%,100%{opacity:.25;transform:scale(.7)}45%{opacity:1;transform:scale(1.25)}}
@keyframes railFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes railGlow{0%,100%{box-shadow:0 18px 42px -20px rgba(10,15,14,.72)}50%{box-shadow:0 18px 42px -20px rgba(10,15,14,.72),0 0 22px rgba(216,182,94,.18)}}
@media (prefers-reduced-motion: reduce){
  .story-rail::before,.story-rail::after,.story-rail__inner,.story-rail__spark{animation:none!important}
}

/* Усиленная анимация вокруг блока */
.story-rail{
  padding:2px;
  border-radius:18px;
  background:linear-gradient(120deg,#d8b65e 0%,#f3dfa0 22%,#63d6cc 48%,#d8b65e 72%,#b8892f 100%);
  background-size:280% 280%;
  animation:railBorderFlow 5.5s linear infinite;
  box-shadow:0 0 0 1px rgba(255,255,255,.08),0 0 26px rgba(216,182,94,.16);
}
.story-rail__inner{border:0;border-radius:16px;box-shadow:0 12px 34px -18px rgba(10,15,14,.7)}
.story-rail::after{
  inset:-6px;
  border:1.5px solid rgba(216,182,94,.55);
  box-shadow:0 0 24px rgba(216,182,94,.22);
}
.story-rail__card::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.26) 47%,rgba(255,255,255,.05) 56%,transparent 70%);
  transform:translateX(-140%);
  animation:railShine 5.5s ease-in-out infinite;
}
.story-rail__spark{width:6px;height:6px;box-shadow:0 0 12px rgba(216,182,94,1)}
.story-rail__spark--2{width:5px;height:5px}
.story-rail__spark--3{width:4px;height:4px}
@keyframes railBorderFlow{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes railShine{0%,55%{transform:translateX(-140%)}78%,100%{transform:translateX(140%)}}
@media (prefers-reduced-motion:reduce){.story-rail,.story-rail__card::after{animation:none!important}}
