
.posts-section, .posts-list, .feed-container { 
    margin: 1rem 0; 
    
}

.posts-grid, .posts-list {
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 0.5rem; 
    max-width: 1000px; 
    margin: 0 auto; 
}

.post-card, article.post-card {
    position: relative;
    /*background: white;*/
    background: rgba(255, 255, 255, 0.85); 
    border-radius: 12px; 
    padding: 1.5rem; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    border: 1px solid #eee;
    transition: all 0.2s;
}

.post-card:hover, article.post-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.12); 
}

.author-avatar, .avatar-small {
    width: 48px !important; 
    height: 48px !important; 
    border-radius: 50px !important;
    object-fit: cover !important; 
    border: 1px solid #f0f0f0 !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.post-author, .post-header {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.post-author {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
    padding-bottom: 0;
}

.author-info {
    flex: 1; 
    min-width: 0; 
    margin-right: auto;
}

.author-info strong { 
    font-weight: 600; 
    color: #1c1e21; 
    font-size: 15px;
    display: block;
}


.id-badge {
    display: block;
    width: 100%;
    box-sizing: border-box;

    margin: 5px;
    padding: 0px 2px 2px;

    font-size: 0.7rem;
    line-height: 1.1;
    color: #65676b; 
    text-align: center;

    /*border-bottom: 1px solid #7bd396;*/
}

.group-tag { 
    font-size: 13px; 
    color: #65676b; 
    background: #e4e6ea; 
    padding: 2px 8px; 
    border-radius: 6px; 
    margin-top: 2px;
    display: inline-block;
}
.post-time { 
    font-size: 13px; 
    color: #65676b; 
    white-space: nowrap; 
    margin-left: auto;
}


.post-content { 
    margin-bottom: 1rem; 
    line-height: 1.5; 
    color: #333; 
}


.post-image {
    width: 100%; 
    height: 140px; 
    object-fit: cover; 
    border-radius: 12px; 
    cursor: zoom-in !important;
    transition: all 0.2s;
}


.post-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}


.more-images, .gallery-more {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    color: white;
    font-weight: bold;
    border-radius: 12px;
    height: 140px;
    font-size: 14px;
}

.protected-media {
    width: 100%; 
    height: 140px; 
    object-fit: cover; 
    border-radius: 12px; 
    cursor: zoom-in !important;
    transition: all 0.2s;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}


.posts-grid .post-card .post-author {
    min-height: 72px; 
}

.posts-grid .author-avatar {
    flex: 0 0 48px !important; 
    min-width: 48px !important;
    max-width: 48px !important;
}


.post-video, .post-video-iframe, .post-video-container video, .post-video-container iframe {
    width: 100%; 
    height: 200px; 
    border-radius: 12px; 
    display: block;
}


/* Вертикальное видео 9:16 */
.reels-video-wrapper,
.post-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 760px;
    overflow: hidden;
    background: #080808;
}

/* Самостоятельно загруженное видео */
.post-video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    object-position: center;
    background: #080808;
}

/* YouTube iframe */
.post-video-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Затемнение снизу в стиле Reels */
.video-gradient {
    position: absolute;
    inset: auto 0 0;
    height: 35%;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55),
        rgba(0, 0, 0, 0)
    );
}

/* Круглая кнопка воспроизведения */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    font-size: 25px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;
}

.video-play-button:hover {
    background: rgba(0, 0, 0, 0.78);
    transform: translate(-50%, -50%) scale(1.08);
}

.video-play-button.is-hidden {
    opacity: 0;
    pointer-events: none;
}

    .reels-video-wrapper,
    .post-video-frame {
        width: min(100%, 430px);
    }
}


.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.0rem;
    border-radius: 8px;
    transition: background 0.2s;
}
.action-btn:hover {
    background: #f0f2f5;
}
.visibility-badge {
    margin-left: auto;
    font-size: 0.8rem;
    color: #666;
}

.comment-form-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f2f5;
}
.comments-list {
    margin-top: 1rem;
}

.comment-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid #eee;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.comment-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.comment-nickname {
    font-weight: 600;
    color: #333;
}

.comment-time {
    color: #888;
}

.comment-content {
    margin-left: 2.2rem;
    word-break: break-word;
}

.comment-form-container {
    margin-top: 1rem;
}

.comment-form {
    display: flex;
    gap: 0.5rem;
}

.comment-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.comment-submit {
    padding: 0.5rem 1rem;
    background: #51cf66;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.comment-submit:hover {
    background: #40c057;
}

.comment-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: #666;
}

.comment-edit-btn,
.comment-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.1rem 0.3rem;
  opacity: 0.7;
}

.comment-edit-btn:hover,
.comment-delete-btn:hover {
  opacity: 1;
}

.comment-edit-form {
  margin-top: 0.5rem;
  margin-left: 2.2rem;
}

.comment-edit-text {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
}

.comment-edit-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.5rem;
}

.comment-save-btn,
.comment-cancel-btn {
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.comment-save-btn {
  background: #51cf66;
  color: #fff;
}

.comment-cancel-btn {
  background: #adb5bd;
  color: #fff;
}

.comments-empty {
  color: #888;
  font-size: 0.9rem;
}

.comment-input-area {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 40px;
}

.emoji-panel {
  margin-top: 0.5rem;
}

.emoji-toggle-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f9fa;
  cursor: pointer;
  font-size: 0.9rem;
}

.emoji-toggle-btn:hover {
  background: #e9ecef;
}

.emoji-list {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.emoji-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  line-height: 1;
}

.emoji-btn:hover {
  background: #f0f0f0;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9); 
    z-index: 10000;
    display: flex; 
    justify-content: center; 
    align-items: center;
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.3s ease;
}
.modal-overlay.show { 
    opacity: 1; 
    visibility: visible; 
}
.modal-content { 
    position: relative; 
    max-width: 90%; 
    max-height: 90%; 
}
.modal-image { 
    max-width: 100%; 
    max-height: 90vh; 
    width: auto; 
    height: auto; 
    border-radius: 8px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); 
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.show .modal-image {
    opacity: 1;
}
.modal-close {
    position: absolute; 
    top: -40px; 
    right: 0; 
    color: white;
    font-size: 2rem; 
    font-weight: bold; 
    cursor: pointer;
    z-index: 10001;
}
.modal-close:hover { 
    color: #ff6b35; 
}



/* Медиа-запрос для мобильных */
@media (max-width: 768px) {
    .posts-section, .posts-list, .feed-container { 
        margin: 1rem 0; 
        width: 100%;
    }

    .posts-grid, .posts-list { 
        grid-template-columns: 1fr; 
        width: 100%;
        gap: 2rem;  /* увеличивает расстояние между карточками */
    }
    
    .post-card, article.post-card {
        width: calc(100vw - 1rem); /* 0.5rem отступ слева и справа */
        margin-left: calc(50% - 50vw + 0.5rem);  /* компенсация + отступ слева */
        margin-right: calc(50% - 50vw + 0.5rem);  /* компенсация + отступ справа */
        padding: 0.5rem;  /* внутренние отступы карточки */
        margin-bottom: 0.5rem;  /* дополнительный отступ снизу каждой карточки */
    }

    /* Контент внутри карточки — уже самой карточки */
    .post-content, .post-body, .post-text {
        padding: 0 0.1rem;  /* отступы слева и справа внутри карточки */
    }

    /* Фото: сохраняем пропорции оригинала */
    .post-image {
        width: calc(100% - 1rem);  /* уже ширины карточки на 1rem */
        height: auto;              /* высота автоматически подстроится */
        object-fit: contain;       /* или cover — зависит от желаемого эффекта */
        display: block;
        margin: 0 auto;  /* центрирование */
    }

    /* Видео: сохраняем пропорции */
    .post-video, .post-video-iframe {
        width: calc(100% - 1rem);  /* уже ширины карточки на 1rem */
        height: auto;
        aspect-ratio: 16 / 9;   /* стандартное соотношение для видео */
        display: block;
        margin: 0 auto;  /* центрирование */
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-title {
    margin: 0;
    color: #333;
}
.post-count {
    color: #666;
    font-size: 0.9rem;
}
.btn-plus, .btn-load-more {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
}
.feed-footer {
    text-align: center;
    padding: 2rem;
}
.empty-posts {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}


.author-link {
    display: inline-block !important;
    line-height: 0 !important;
    text-decoration: none !important;
    pointer-events: auto !important;  
    z-index: 1;
}

.author-link img.author-avatar {
    pointer-events: none !important;  
}

.author-nickname {
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none !important;
    color: inherit !important;
    display: inline-block !important;
}

.author-link:hover .author-avatar,
.author-nickname:hover {
    background: rgba(81, 207, 102, 0.1) !important;
    border-radius: 8px !important;
    transform: scale(1.02) !important;
}

.post-author {
    pointer-events: auto !important;  
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    border: 4px solid #51cf66;
}
.profile-info h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    color: #1c1e21;
}
.profile-stats {
    display: flex;
    gap: 2rem;
    color: #65676b;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.profile-bio {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

.post-audio-container {
    margin: 20px 0;
    display: relative;
    flex-direction: column;
    gap: 12px;
    
}


   /* ✅ АУДИО В ПОСТАХ — РАБОТАЕТ! */
.post-audio-container {
    margin: 12px 0;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border-left: 4px solid #51cf66;
    box-shadow: 0 2px 8px rgba(81, 207, 102, 0.1);
}

.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    width: 100%;
}

.audio-play-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.audio-play-btn.playing {
    background: linear-gradient(135deg, #fa5252, #e03131);
}

.audio-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(81, 207, 102, 0.4);
}

.audio-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 6px;
    cursor: pointer;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-head {
    width: 12px;
    height: 12px;
    background: #51cf66;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.1s ease;
    box-shadow: 0 2px 6px rgba(81, 207, 102, 0.5);
}

.track-time {
    font-size: 0.8rem;
    color: #666;
    font-family: 'SF Mono', monospace;
    font-weight: 500;
    min-width: 85px;
    flex-shrink: 0;
}

.audio-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-add-playlist {
    padding: 6px 12px;
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-add-playlist:hover {
    background: linear-gradient(135deg, #40c057, #37b24d);
    transform: translateY(-1px);
}

.hidden-audio {
    display: none !important;
}


.post-audio-item {
    background: rgb(154, 220, 158); border-radius: 12px;  /* ← Меньше скругление */
    padding: 0.4rem;  /* ← Компактный padding */
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);  /* ← Легче тень */
    position: relative; border: 1px solid #eee; 
    transition: all 0.3s; overflow: visible !important;
}

.post-audio-player {
    flex: 1;
    height: 50px;
    border-radius: 12px;
    width: 100%
}

.audio-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.audio-name {
    font-weight: 600;
    color: white;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.audio-duration {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
}

.post-documents {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1rem 0;
    width: 100%;
}

.post-document {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;                    /* ← ВСЕГДА 100% ширины .post-documents */
    padding: 0.75rem 1.2rem;
    /*background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);*/
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 50%, #ec4899 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(17,153,142,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
    box-sizing: border-box;         /* ← Учитывает padding */
}

.post-document::before {
    content: '';
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3e%3cpath d='M6 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V10a2 2 0 0 0-.5-1.5L20.5 2.5A2 2 0 0 0 19 2H8a2 2 0 0 0-2 0Z' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M14 2v6a2 2 0 0 0 2 2h6' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M14 11h8v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V11h8Z' fill='%23f8fafc' stroke='%23fff' stroke-width='1.5'/%3e%3cpath d='m12 16 1 2 2-3 3 5h-6Z' fill='%2345d3a0'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.2);
}

.post-document span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-document:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17,153,142,0.4);
}

/* Мобильная — в столбик */
@media (max-width: 768px) {
    .post-documents {
        flex-direction: column;
        gap: 8px;
    }
}
    /*****************************************/

/* ✅ ПЛЕЙЛИСТЫ */
.audio-actions {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.btn-add-playlist {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-add-playlist:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-add-playlist:disabled {
    background: #4caf50;
    cursor: default;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    /*width: 60px;*/
    gap: 6px;
    padding: 4px 8px;
    border: none;
    border-radius: 25px;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.like-btn.liked {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.like-btn:hover:not(.liking) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.like-btn.liking {
    opacity: 0.7;
    transform: scale(0.95);
}

.likes-count {
    font-weight: 600;
    font-size: 14px;
}

.repost-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #666;
  transition: background 0.2s;
}

.repost-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.repost-count {
  font-size: 0.85rem;
  color: #888;
}

.repost-indicator {
  padding: 0.4rem 0.6rem;
  background: #f8f9fa;
  border-left: 3px solid #51cf66;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

/* ✅ СТИЛИ ДЛЯ РЕПОСТА С АВАТАРКАМИ */
.repost-header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.repost-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-user-info {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 10px; /* Отступ, чтобы было видно, что это ниже */
}

.repost-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.original-user-avatar {
    width: 32px;
    height: 32px; /* Меньше, чем у репостера */
    border-radius: 50%;
    object-fit: cover;
}

.repost-user-nickname,
.original-user-nickname {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.repost-user-nickname {
    color: #1c1e21;
    font-size: 15px; /* Чуть больше шрифт */
}

.original-post-link {
    color: #333;
    text-decoration: none;
}

.original-post-link:hover {
    color: #51cf66;
    text-decoration: underline;
}

.repost-time {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

/* Комментарий репостера */
.repost-comment-display {
    margin-bottom: 12px;
    font-style: italic;
    color: #555;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
}

.reels-video-wrapper,
.post-video-frame {
    max-height: calc(100svh - 100px);
    border-radius: 0;
}




/* =========================================
   ВЕРТИКАЛЬНЫЕ ВИДЕО 9:16
   ========================================= */

.post-video-container {
    position: relative;
    width: 100%;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 22px;
    background: #080808;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

/* Одинаковая вертикальная область для MP4 и YouTube */
.reels-video-wrapper,
.post-video-frame {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #080808;
}


/* Обычный режим — вертикальная карточка */
.reels-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #080808;
}

.reels-video-wrapper .post-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}



/* YouTube */
.post-video-frame .post-video-iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

/* Десктоп */
@media (min-width: 769px) {
    .post-video-container {
        display: flex;
        justify-content: center;
        background: radial-gradient(
            circle at center,
            #313131 0%,
            #080808 72%
        );
    }

    .reels-video-wrapper,
    .post-video-frame {
        width: min(100%, 430px);
        max-height: 760px;
    }
}

/* Телефон */
@media (max-width: 768px) {
    .post-video-container {
        width: 100%;
        margin: 1rem 0;
        border-radius: 18px;
    }

    .reels-video-wrapper,
    .post-video-frame {
        width: 100%;
        height: auto;
        aspect-ratio: 9 / 16;
        max-height: calc(100svh - 120px);
        border-radius: 18px;
    }

    .reels-video-wrapper .post-video,
    .post-video-frame .post-video-iframe {
        width: 100%;
        height: 100%;
    }
}

/* При повороте телефона в горизонтальное положение */
@media (orientation: landscape) and (max-width: 900px) {
    .post-video-container:has(.horizontal-video) {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100vw;
        height: 100dvh;
        max-width: none;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: #000;
    }

    .post-video-container:has(.horizontal-video)
    .reels-video-wrapper {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        aspect-ratio: auto;
        border-radius: 0;
        background: #000;
    }

    .post-video-container:has(.horizontal-video)
    .post-video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 0;
    }

    .post-video-container:has(.horizontal-video)
    .video-gradient {
        display: none;
    }

    .post-video-container:has(.horizontal-video)
    .video-play-button {
        z-index: 10001;
    }

    /* Скрываем остальные элементы карточки */
    body:has(.post-video-container:has(.horizontal-video)) {
        overflow: hidden;
    }
}


/* =========================================
   КНОПКИ ДЕЙСТВИЙ ПОСТА
   ========================================= */

.post-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid #f0f2f5;
    overflow-x: auto;
    scrollbar-width: none;
}

.post-actions::-webkit-scrollbar {
    display: none;
}

/* Лайк, суперлайк, комментарий и репост */
.post-actions > button {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center;
    width: auto !important;
    min-width: max-content;
    min-height: 28px;
    margin: 0 !important;
    padding: 7px 10px;
    white-space: nowrap;
    line-height: 1;
}


.feed-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    width: 100%;
}

.feed-loading {
    padding: 20px;
    color: #777;
    font-size: 14px;
    text-align: center;
}

.feed-end {
    padding: 24px;
    color: #fdfafa;
    font-size: 14px;
    text-align: center;
}

/* Общий стиль для кнопок */
.post-actions .like-btn,
.post-actions .superlike-btn,
.post-actions .action-btn,
.post-actions .repost-btn {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px;
}

/* Счётчики не должны переноситься под эмодзи */
.post-actions .likes-count,
.post-actions .superlikes-count,
.post-actions .count,
.post-actions .repost-count {
    display: inline-block;
    white-space: nowrap;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .post-actions {
        gap: 5px;
        padding-top: 0.6rem;
    }

    .post-actions > button {
        min-height: 36px;
        padding: 7px 8px;
        font-size: 14px;
    }
}