/* assets/css/reels.css */
*{box-sizing:border-box}

html,
body{
  margin:0;
  padding:0;
  height:100%;
  overflow:hidden;
}

html{
  background:#000;
}

body.reels-body{
  font-family:Arial,Helvetica,sans-serif;
  background:#000;
  color:#fff;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overscroll-behavior:none;
}

body.modal-open{
  overflow:hidden;
  touch-action:none;
}

a{
  color:inherit;
}

.page.reels-page{
  position:relative;
  width:100%;
  max-width:430px;
  margin:0 auto;
  height:100vh;
  height:100dvh;
  padding:0;
  background:#000;
  overflow:hidden;
}

.msg{
  display:none;
  position:fixed;
  top:max(12px,env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  z-index:60;
  width:calc(100% - 24px);
  max-width:406px;
  padding:12px 14px;
  border-radius:16px;
  font-size:14px;
  white-space:pre-line;
}

.msg.show{
  display:block;
}

.msg.error{
  background:rgba(160,32,32,.22);
  color:#ffdada;
  border:1px solid rgba(255,120,120,.28);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.msg.success{
  background:rgba(24,112,64,.24);
  color:#dcffe8;
  border:1px solid rgba(120,255,170,.24);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.feed-new-notice{
  position:fixed;
  top:max(12px,env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  z-index:55;
  width:calc(100% - 24px);
  max-width:406px;
  min-height:44px;
  border:none;
  border-radius:16px;
  background:rgba(17,17,17,.56);
  color:#fff;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.feed-new-notice[hidden]{
  display:none !important;
}

.feed.reels-feed{
  position:relative;
  width:100%;
  height:100vh;
  height:100dvh;
  overflow-y:auto;
  overflow-x:hidden;
  scroll-snap-type:y mandatory;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  scrollbar-width:none;
}

.feed.reels-feed::-webkit-scrollbar{
  display:none;
}

.feed-card.reels-card{
  position:relative;
  width:100%;
  height:100vh;
  height:100dvh;
  min-height:100vh;
  min-height:100dvh;
  overflow:hidden;
  background:#000;
  scroll-snap-align:start;
  scroll-snap-stop:always;
}

.feed-card.reels-card + .feed-card.reels-card{
  margin-top:0;
}

.feed-head{
  display:none;
}

.feed-media-wrap{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background:#000;
  border-radius:0;
  overflow:hidden;
}

.media-track{
  display:flex;
  width:100%;
  height:100%;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.media-track::-webkit-scrollbar{
  display:none;
}

.media-slide{
  position:relative;
  flex:0 0 100%;
  width:100%;
  height:100%;
  scroll-snap-align:start;
  background:#000;
}

.media-slide-btn{
  display:block;
  width:100%;
  height:100%;
  padding:0;
  margin:0;
  border:none;
  background:transparent;
  cursor:pointer;
}

.media-img,
.media-video,
.reel-video{
  display:block;
  width:100%;
  height:100%;
  background:#000;
  object-fit:cover;
}

.media-counter,
.media-nav,
.media-dots{
  display:none !important;
}

.reel-slide-box{
  position:relative;
  width:100%;
  height:100%;
  background:#000;
}

.reels-video-hit{
  position:absolute;
  inset:0;
  z-index:2;
  border:none;
  background:transparent;
  padding:0;
  margin:0;
  cursor:pointer;
}

.reel-video{
  width:100%;
  height:100%;
  object-fit:cover;
}

.reel-play-center{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:5;
  pointer-events:none;
}

.reel-play-center .icon{
  width:62px;
  height:62px;
  border-radius:999px;
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:22px;
  opacity:0;
  transform:scale(.92);
  transition:opacity .16s ease,transform .16s ease;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.reel-play-center.show .icon{
  opacity:.92;
  transform:scale(1);
}

.reel-overlay-top{
  position:absolute;
  left:0;
  right:0;
  top:0;
  z-index:6;
  padding:calc(env(safe-area-inset-top) + 12px) 14px 10px;
  background:linear-gradient(180deg,rgba(0,0,0,.44) 0%, rgba(0,0,0,.16) 58%, rgba(0,0,0,0) 100%);
}

.reel-author-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.feed-author-link{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  text-decoration:none;
  color:inherit;
  max-width:100%;
}

.avatar{
  width:38px;
  height:38px;
  border-radius:999px;
  object-fit:cover;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  flex:0 0 auto;
}

.avatar-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(255,255,255,.62);
  font-size:14px;
}

.feed-author-meta{
  display:flex;
  align-items:center;
  gap:8px;
}

.feed-author-name{
  font-size:14px;
  font-weight:800;
  color:#fff;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:180px;
}

.feed-time{
  font-size:12px;
  color:rgba(255,255,255,.55);
  white-space:nowrap;
}

.reel-gradient-bottom{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:44%;
  z-index:4;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(0,0,0,0) 0%, rgba(0,0,0,.12) 20%, rgba(0,0,0,.44) 62%, rgba(0,0,0,.76) 100%);
}

.feed-body{
  position:absolute;
  left:14px;
  right:78px;
  bottom:calc(env(safe-area-inset-bottom) + 34px);
  z-index:6;
  padding:0;
}

.feed-text-wrap{
  position:relative;
  margin-top:0;
  min-height:20px;
}

.feed-text{
  font-size:14px;
  line-height:1.45;
  color:#fff;
  white-space:pre-wrap;
  word-break:break-word;
}

.feed-text.clamped{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:1;
  line-clamp:1;
  overflow:hidden;
  padding-right:58px;
}

.feed-text-toggle-inline{
  position:absolute;
  right:0;
  bottom:0;
  display:none;
  align-items:center;
  border:none;
  background:none;
  color:rgba(255,255,255,.82);
  font-size:12px;
  font-weight:700;
  line-height:1.45;
  padding:0 0 0 6px;
  cursor:pointer;
}

.feed-text-wrap.expanded .feed-text-toggle-inline{
  display:none !important;
}

.feed-actions{
  position:absolute;
  right:10px;
  top:56%;
  transform:translateY(-50%);
  z-index:6;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:0;
}

.feed-actions-left{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:24px; /* вот это и даст воздух между лайком, комментом и шейром */
}

.feed-actions.has-text,
.feed-actions.no-text{
  padding-top:0;
}

.action-stack{
  display:flex;
  flex-direction:column;
  align-items:center;
}

.action-inline{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:54px;
  min-height:auto;
  height:auto;
  padding:8px 0 0;
  border:none;
  border-radius:0;
  background:transparent;
  color:rgba(255,255,255,.96);
  cursor:pointer;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

.action-inline .fa-regular,
.action-inline .fa-solid{
  font-size:22px;
}

.action-inline .count{
  font-size:12px;
  line-height:1;
  color:#fff;
  font-weight:800;
  text-shadow:0 1px 2px rgba(0,0,0,.35);
}

.like-btn.liked{
  color:#ff7e97;
}

.reel-control-btn{
  position:absolute;
  right:12px;
  bottom:calc(env(safe-area-inset-bottom) + 126px);
  z-index:6;
  width:42px;
  height:42px;
  border:none;
  border-radius:999px;
  background:rgba(17,17,17,.34);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.reel-progress{
  position:absolute;
  left:12px;
  right:12px;
  bottom:calc(env(safe-area-inset-bottom) + 10px);
  height:3px;
  border-radius:999px;
  background:rgba(255,255,255,.20);
  overflow:hidden;
  z-index:6;
  pointer-events:none;
}

.reel-progress-loaded{
  position:absolute;
  left:0;
  top:0;
  height:100%;
  width:0%;
  background:rgba(255,255,255,.26);
  border-radius:999px;
  transition:width .18s ease-out;
}

.reel-progress-played{
  position:absolute;
  left:0;
  top:0;
  height:100%;
  width:0%;
  background:#fff;
  border-radius:999px;
  box-shadow:0 0 8px rgba(255,255,255,.35);
  transition:none;
}

.feed-loading{
  position:absolute;
  left:0;
  right:0;
  bottom:calc(env(safe-area-inset-bottom) + 8px);
  z-index:8;
  padding:8px 12px;
  text-align:center;
  color:rgba(255,255,255,.72);
  font-size:13px;
  pointer-events:none;
}

.feed-sentinel{
  height:1px;
}

/* Sheet */
.sheet-overlay{
  position:fixed;
  inset:0;
  z-index:2147483646;
  background:rgba(0,0,0,.58);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}

.sheet-overlay.show{
  opacity:1;
  pointer-events:auto;
}

.sheet{
  position:fixed;
  left:50%;
  bottom:0;
  transform:translateX(-50%) translateY(104%);
  width:100%;
  max-width:430px;
  height:min(88dvh,820px);
  z-index:2147483647;
  border-radius:28px 28px 0 0;
  background:#12141b;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 -20px 60px rgba(0,0,0,.58);
  transition:transform .26s cubic-bezier(.22,.9,.22,1);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

.sheet.show{
  transform:translateX(-50%) translateY(0);
}

.sheet-handle-wrap{
  padding:10px 0 4px;
  display:flex;
  justify-content:center;
  flex:0 0 auto;
}

.sheet-handle{
  width:44px;
  height:5px;
  border-radius:999px;
  background:rgba(255,255,255,.26);
}

.sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:4px 14px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  flex:0 0 auto;
}

.sheet-title{
  font-size:18px;
  font-weight:800;
}

.sheet-meta{
  font-size:12px;
  color:rgba(255,255,255,.58);
}

.sheet-close{
  width:34px;
  height:34px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
}

.sheet-publication{
  display:none !important;
}

.sheet-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:12px 14px 140px;
  -webkit-overflow-scrolling:touch;
}

.sheet-form{
  position:relative;
  z-index:3;
  flex:0 0 auto;
  border-top:1px solid rgba(255,255,255,.08);
  padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg,rgba(18,20,27,.96) 0%,rgba(18,20,27,1) 40%);
}

.reply-hint{
  display:none;
  font-size:12px;
  color:rgba(255,255,255,.64);
  margin-bottom:8px;
}

.sheet-form-row{
  position:relative;
  display:block;
}

.sheet-textarea{
  display:block;
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:14px 46px 14px 14px;
  font-size:14px;
  background:rgba(255,255,255,.055);
  color:#fff;
  outline:none;
  min-height:80px;
  max-height:180px;
  resize:none;
}

.sheet-send{
  position:absolute;
  right:10px;
  bottom:10px;
  width:34px;
  height:34px;
  border:none;
  border-radius:999px;
  background:#fff;
  color:#111;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sheet-login-note{
  font-size:13px;
  color:rgba(255,255,255,.68);
}

.sheet-login-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:10px;
  min-height:40px;
  padding:10px 14px;
  border-radius:14px;
  text-decoration:none;
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:14px;
  font-weight:800;
}

/* Comments */
.comment{
  position:relative;
  padding:8px 0;
  margin-bottom:10px;
  border:none;
  background:transparent;
  border-radius:0;
}

.comment.hidden-comment{
  background:rgba(255,255,255,.03);
}

.comment.reply-comment{
  margin-left:22px;
}

.comment-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.comment-avatar{
  width:32px;
  height:32px;
  border-radius:999px;
  flex:0 0 32px;
}

.comment-content{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.comment-name-line{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  margin-bottom:2px;
}

.comment-name{
  font-size:13px;
  font-weight:700;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:180px;
}

.comment-reply-to{
  font-size:11px;
  color:rgba(255,255,255,.42);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:120px;
}

.comment-text{
  font-size:14px;
  line-height:1.45;
  color:#fff;
  white-space:pre-wrap;
  word-break:break-word;
  margin:0;
}

.comment-text.hidden-text{
  color:rgba(255,255,255,.54);
  font-style:italic;
}

.comment-bottom{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:5px;
}

.comment-date{
  font-size:11px;
  color:rgba(255,255,255,.42);
  white-space:nowrap;
}

.comment-action{
  border:none;
  background:none;
  padding:0;
  margin:0;
  font-size:11px;
  line-height:1.2;
  color:rgba(255,255,255,.48);
  cursor:pointer;
}

.comment-inline-editor{
  margin-top:10px;
}

.comment-inline-textarea{
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:12px;
  font-size:14px;
  background:rgba(255,255,255,.04);
  color:#fff;
  outline:none;
  min-height:88px;
  resize:vertical;
}

.comment-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.comment-btn{
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  min-height:34px;
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

/* Viewer */
.viewer{
  position:fixed;
  inset:0;
  z-index:2147483645;
  background:rgba(0,0,0,.96);
  display:none;
}

.viewer.show{
  display:block;
}

.viewer-close{
  position:absolute;
  top:max(14px,env(safe-area-inset-top));
  right:14px;
  z-index:4;
  width:38px;
  height:38px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
}

.viewer-counter{
  position:absolute;
  top:max(16px,env(safe-area-inset-top));
  left:14px;
  z-index:4;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:12px;
  font-weight:800;
}

.viewer-track{
  height:100%;
  display:flex;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.viewer-track::-webkit-scrollbar{
  display:none;
}

.viewer-slide{
  flex:0 0 100%;
  height:100%;
  scroll-snap-align:start;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:64px 10px 28px;
}

.viewer-slide img,
.viewer-slide video{
  max-width:100%;
  max-height:100%;
  border-radius:14px;
  background:#000;
}

footer,
.bottom-bar,
nav.bottom-bar,
.page-footer{
  display:none !important;
}

@media (max-width:380px){
  .feed-author-name{max-width:150px}
  .feed-body{right:72px}
}

/* ===== FIX: отступ под футер ===== */
.feed.reels-feed{
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* чтобы нижние элементы не залезали под футер */
.feed-body{
  bottom: calc(env(safe-area-inset-bottom) + 90px);
}

.reel-progress{
  bottom: calc(env(safe-area-inset-bottom) + 70px);
}

.reel-author-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  width:100%;
}

.reel-author-row .feed-author-link{
  flex:1 1 auto;
  min-width:0;
}

.feed-author-side{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  position:relative;
  z-index:8;
}

.feed-follow-btn{
  min-height:30px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.36);
  color:#fff;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
  cursor:pointer;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.feed-follow-btn.is-idle{
  background:#fff;
  color:#111;
  border-color:#fff;
}

.feed-follow-btn.is-following{
  background:rgba(255,255,255,.10);
  color:#fff;
  border-color:rgba(255,255,255,.18);
}

.feed-follow-btn.is-requested{
  background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.9);
  border-color:rgba(255,255,255,.14);
}

.feed-actions .share-btn{
  color:rgba(255,255,255,.96);
}

.feed-actions .share-btn i{
  display:inline-block;
  color:rgba(255,255,255,.96);
  -webkit-text-fill-color:transparent;
  -webkit-text-stroke:1.5px currentColor;
}

.feed-actions .share-btn .count{
  color:#fff;
}