/* ============================================
   ПЕРЕМЕННЫЕ (ТЁМНАЯ ТЕМА)
   ============================================ */
:root {
    --bg-primary: #151518;
    --bg-secondary: #222224;
    --text-primary: #f5f5f5;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-inverse: #000000;
    --accent-primary: #0080FF;
    --accent-secondary: #3b82f6;
    --accent-hover: #93c5fd;
    --border-color: rgba(255, 255, 255, 0.1);
    --block-bg: #222224;
    --block-bg-secondary: #2a2a2c;
    --block-hover-bg: #2c2c2f;
    --bg-hover: rgba(255, 255, 255, 0.08);
    --bg-active: rgba(255, 255, 255, 0.12);
    --tab-active-bg: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(47, 47, 47, 0.5);
    --header-bg: rgba(21, 21, 24, 0.85);
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #000000;
    --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.2);
    --body-overlay: rgba(0, 0, 0, 0.45);
    --sidebar-width: 200px;
    --sidebar-gap: 220px;
    --content-max-width: 650px;
}

/* ============================================
   СВЕТЛАЯ ТЕМА
   ============================================ */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #e8e8ea;
    --text-primary: #111111;
    --text-secondary: rgba(0, 0, 0, 0.5);
    --text-inverse: #ffffff;
    --accent-primary: #0080FF;
    --accent-secondary: #3b82f6;
    --accent-hover: #60a5fa;
    --border-color: rgba(0, 0, 0, 0.1);
    --block-bg: #ffffff;
    --block-bg-secondary: #f0f0f2;
    --block-hover-bg: #f0f0f2;
    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-active: rgba(0, 0, 0, 0.08);
    --tab-active-bg: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --header-bg: rgba(255, 255, 255, 0.85);
    --btn-primary-bg: #000000;
    --btn-primary-text: #ffffff;
    --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.1);
    --body-overlay: transparent;
}

/* ---------- ПОЛУНОЧНАЯ ТЕМА ---------- */
[data-theme="midnight"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141a;
    --block-bg: #1a1a22;
    --block-bg-secondary: #22222a;
    --block-hover-bg: #282832;
    --border-color: rgba(255, 255, 255, 0.06);
    --accent-primary: #6366F1;
    --accent-secondary: #4F46E5;
    --accent-hover: #818CF8;
    --btn-primary-bg: #6366F1;
    --btn-primary-text: #ffffff;
    --header-bg: rgba(10, 10, 15, 0.9);
    --body-overlay: rgba(0, 0, 0, 0.55);
}

/* ============================================
   КИБЕРПАНК ТЕМА
   ============================================ */
[data-theme="cyberpunk"] {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --text-primary: #e0e0ff;
    --text-secondary: rgba(224, 224, 255, 0.6);
    --text-inverse: #000000;
    --accent-primary: #ff2d55;
    --accent-secondary: #7b61ff;
    --accent-hover: #ff6b8a;
    --border-color: rgba(255, 45, 85, 0.3);
    --block-bg: #16162b;
    --block-bg-secondary: #222244;
    --block-hover-bg: #2a2a4a;
    --bg-hover: rgba(255, 45, 85, 0.12);
    --bg-active: rgba(255, 45, 85, 0.2);
    --tab-active-bg: rgba(255, 45, 85, 0.15);
    --glass-bg: rgba(22, 22, 43, 0.8);
    --header-bg: rgba(13, 13, 26, 0.9);
    --btn-primary-bg: #ff2d55;
    --btn-primary-text: #ffffff;
    --shadow-elevated: 0 4px 16px rgba(255, 45, 85, 0.3);
    --body-overlay: rgba(13, 13, 26, 0.6);
}

* {
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ============================================
   БАЗОВЫЕ СБРОСЫ
   ============================================ */
*, *:before, *:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', Helvetica Neue, sans-serif;
    line-height: 1.5;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overscroll-behavior-y: none;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--body-overlay);
    z-index: -1;
    pointer-events: none;
}
a {
    color: inherit;
    text-decoration: none;
}
ul {
    list-style: none;
}
img, svg {
    display: block;
    max-width: 100%;
}
input, button {
    font: inherit;
    color: inherit;
}
button {
    cursor: pointer;
    background: none;
    border: none;
}

/* ============================================
   СКРОЛЛБАР
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-secondary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-primary); }
* { scrollbar-width: thin; scrollbar-color: var(--text-secondary) var(--bg-primary); }

/* ============================================
   ОБЩАЯ СЕТКА
   ============================================ */
.page-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
}

.content-wrapper {
    padding-top: calc(45px + env(safe-area-inset-top, 0px));
    position: relative;
    width: 100%;
    max-width: var(--content-max-width);
    display: flex;
    flex-direction: column;
}
@media (max-width: 1173px) {
    .content-wrapper {
        max-width: 100%;
        padding-top: calc(70px + env(safe-area-inset-top, 0px));
    }
}
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    min-height: 100dvh;
}
@media (min-width: 1174px) {
    .main-content {
        padding-top: calc(30px + env(safe-area-inset-top, 0px));
        padding-bottom: 48px;
    }
}

/* ============================================
   ЛЕВАЯ БОКОВАЯ ПАНЕЛЬ
   ============================================ */
.left-sidebar {
    position: fixed;
    top: 0;
    right: calc(50% + var(--content-max-width)/2 + var(--sidebar-gap));
    width: var(--sidebar-width);
    height: 100vh;
    padding: 48px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.main-nav {
    display: flex;
    flex-direction: column;
    margin-top: 32px;
}
.nav-item {
    display: flex;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    opacity: 0.5;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.nav-item:hover { background-color: var(--block-bg); }
.nav-item.active {
    background-color: var(--block-bg);
    opacity: 1;
}
.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.sidebar-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}
.sidebar-button:hover {
    background-color: var(--block-bg);
    color: var(--text-primary);
}
.sidebar-button.active {
    background-color: var(--block-bg);
    opacity: 1;
}
/* ============================================
   МОБИЛЬНАЯ НАВИГАЦИЯ
   ============================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 6px 4px env(safe-area-inset-bottom, 6px);
    padding-left: calc(4px + env(safe-area-inset-left, 0px));
    padding-right: calc(4px + env(safe-area-inset-right, 0px));
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(var(--bg-secondary-rgb), 0.92);
}

@media (max-width: 1173px) {
    .bottom-nav {
        display: flex;
    }
}

.left-sidebar,
.right-sidebar {
    height: 100vh;
    height: 100dvh;
}
@media all and (display-mode: standalone) {
    .global-header {
        padding-top: env(safe-area-inset-top, 0);
    }
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 6px);
    }
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    border-radius: 10px;
    flex: 1 1 0;        
    min-width: 0;          
    max-width: 80px;
    text-align: center;
}

.bottom-nav-item:hover {
    color: var(--text-primary);
}

.bottom-nav-item.active {
    color: var(--accent-primary);
}

.bottom-nav-icon {
    width: 24px;
    height: 24px;
    display: block;
    stroke: currentColor;
    flex-shrink: 0;
}

.bottom-nav-label {
    font-size: 9px;
    line-height: 1.2;
    white-space: nowrap;
}

.bottom-nav-center {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    margin-top: -8px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 128, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-nav-center:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 128, 255, 0.6);
}

.bottom-nav-center svg {
    stroke: #fff;
    stroke-width: 3;
    width: 28px;
    height: 28px;
}

/* ============================================
   ПРАВАЯ БОКОВАЯ ПАНЕЛЬ
   ============================================ */
.right-sidebar {
    position: fixed;
    top: 0;
    left: calc(50% + var(--content-max-width)/2 + var(--sidebar-gap));
    width: var(--sidebar-width);
    height: 100vh;
    padding: 48px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.right-sidebar-top { flex: 1; }
.right-sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.footer-links a:hover { color: var(--text-primary); }
.copyright { color: var(--text-secondary); }

@media (max-width: 1173px) {
    .left-sidebar,
    .right-sidebar {
        display: none;
    }
}

/* ============================================
   ПРОФИЛЬ
   ============================================ */
.profile-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (max-width: 1173px) {
    .profile-container { gap: 0; }
}
.profile-header {
    padding: 8px 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.verified-badge {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    margin-left: 0px;
    flex-shrink: 0;
}

.verified-badge-post {
    display: inline-block;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    margin-left: 0px;
    flex-shrink: 0;
}

.cover-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--block-bg);
    overflow: hidden;
    border-radius: 20px;
}
@media (max-width: 1173px) {
    .cover-container { height: 170px; }
}
.cover-image {
    width: 100%;
    height: 100%;
    background: var(--block-bg);
}
.cover-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}

.profile-info-area {
    padding: 0 32px 8px;
}
@media (max-width: 1173px) {
    .profile-info-area { padding: 0 8px; }
}
.profile-top-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: -50px;
    position: relative;
}
.profile-top-row .avatar-large {
    background-color: var(--block-bg);
    border-color: var(--bg-primary);
}
@media (max-width: 1173px) {
    .profile-top-row {
        margin-top: -40px;
        justify-content: flex-start;
        padding-left: 16px;
    }
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 1173px) {
    .profile-actions .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .profile-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .profile-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.name-row {
    position: absolute; 
    top: 50px;
    left: 130px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
@media (max-width: 1173px) {
    .profile-top-row {
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding-left: 10px;
    }

    .name-row {
        position: static;
        flex: 1;
        min-width: 0;
        top: auto;
        left: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        margin-top: 35px;
    }
}

.display-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}
.username {
    color: var(--text-secondary);
}

.bio-text {
    color: var(--text-primary);
    margin-top: 8px;
    font-size: 15px;
}

.badge-icon {
    width: 20px;
    height: 20px;
    margin-left: 2px;
    vertical-align: middle;
    border-radius: 4px;
    display: inline-block;
}

.pinned-post {
    border-left: 4px solid #0080FF;
    background: rgba(0, 128, 255, 0.05);
}

.avatar-large::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 50%;
    background: none;
    pointer-events: none;
    z-index: 5;
}
.avatar-large .online-dot {
    z-index: 6;
}

/* ============================================
   АЛИАСЫ
   ============================================ */
.username-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 4px;
    margin-top: 2px;
}

.username-line .username {
    color: var(--text-secondary);
}

.username-line .aliases-separator {
    color: var(--text-secondary);
    margin: 0 2px;
}

.username-line .alias-secondary {
    color: var(--accent-primary);
    font-size: 14px;
    transition: opacity 0.2s;
}

.username-line .alias-secondary:hover {
    opacity: 0.8;
}
/* ============================================
   КАСТОМНЫЙ ТУЛТИП ДЛЯ АЛИАСОВ
   ============================================ */
.custom-tooltip {
    position: fixed;
    padding: 10px 16px;
    background: var(--block-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    max-width: 260px;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.custom-tooltip.visible {
    opacity: 1;
}

.custom-tooltip .tooltip-title {
    font-weight: 600;
    color: var(--accent-primary);
}

.custom-tooltip .tooltip-price {
    margin-top: 2px;
    color: var(--text-secondary);
}

.custom-tooltip .tooltip-owner {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 480px) {
    .custom-tooltip {
        font-size: 13px;
        padding: 8px 12px;
        max-width: 220px;
    }
}
/* ============================================
   УПОМИНАНИЯ
   ============================================ */
.mention-link {
    color: var(--accent-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}
.mention-link:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}
/* ============================================
   КНОПКА МЕНЮ В ПРОФИЛЕ
   ============================================ */
.profile-actions .post-menu-wrapper {
    display: flex;
    align-items: center;
}

.profile-actions .post-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}

.profile-actions .post-menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.profile-actions .post-menu-dropdown {
    right: 0;
    left: auto;
}

@media (max-width: 1173px) {
    .profile-actions .post-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .profile-actions .action-buttons {
        display: flex;
        flex-direction: row;
        gap: 8px;
    }

    .profile-actions .btn {
        width: auto;
        justify-content: center;
    }
}

/* ============================================
   АВАТАР
   ============================================ */
.avatar {
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--bg-primary);
}
@media (max-width: 1174px) {
    .avatar { background-color: var(--block-bg); }
}
.avatar-small {
    width: 36px;
    height: 36px;
}
.avatar-small .avatar-inner { font-size: 16px; }
@media (min-width: 1174px) {
    .avatar-small { width: 40px; height: 40px; }
}
.avatar-large {
    width: 100px;
    height: 100px;
    border: 6px solid var(--bg-primary);
    background: var(--bg-primary);
}

.avatar-large .avatar-inner { font-size: 40px; }
.avatar-large .online-dot {
    width: 22px;
    height: 22px;
    border-width: 4px;
    border-color: var(--bg-primary);
    bottom: 4px;
    right: 4px;
}

@media (min-width: 1174px) {
    .avatar-large { width: 120px; height: 120px; }
}
.avatar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.avatar-inner img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.online-dot {
    position: absolute;
    border-radius: 50%;
    background-color: #22c55e;
    border: 2px solid var(--block-bg);
}

.online-dot.offline {
    display: none;
}

.follow-btn.following {
    background: #cb3434;          
    color: #ffffff;               
    padding: 0 14px;              
    min-width: 100px;             
    transition: background 0.2s, transform 0.15s;
}

.follow-btn.following:hover {
    background: #dc2626; 
}

.edit-icon,
.edit-label { display: none; }

@media (max-width: 768px) {
  .edit-profile-btn {
    padding: 0.5rem 0.8rem;
    min-width: auto;
  }
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px 0;
    max-width: 600px;
    margin: 0 auto;
    justify-items: center;
}

.gift-item {
    background: var(--block-bg);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gift-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0;
}

.gift-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.gift-sender {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.gift-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
    background: var(--bg-hover);
    padding: 6px 10px;
    border-radius: 8px;
}
/* ============================================
   ТАБЫ
   ============================================ */
/* Модальное окно создания поста */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: var(--block-bg);
    border-radius: 24px;
    padding: 18px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.modal-close {
    font-size: 28px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 8px;
}
.modal-close:hover {
    color: var(--text-primary);
}
.modal-body .post-input-area {
    display: flex;
    flex-direction: column;
}
.modal-body .post-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body .post-image-preview {
    margin-top: 8px;
}
body.modal-open {
    overflow: hidden;
}
@media (max-width: 600px) {
    .modal-content {
        padding: 16px;
        border-radius: 16px;
        width: 95%;
    }
}
.editable-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: transparent;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    resize: none;
}
.editable-input:empty:before,
.editable-input.rJDb:before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    pointer-events: none;
    position: absolute;
}
.editable-input {
    position: relative;
}
.post-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.toolbar-left { display: flex; gap: 8px; }
.toolbar-btn {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: color 0.2s ease, background 0.2s ease;
}
.toolbar-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}
.toolbar-right { display: flex; align-items: center; gap: 24px; }
/* ============================================
   ЭМОДЗИ-ПИКЕР (исправление для модального окна)
   ============================================ */
/* Основные стили пикера (уже есть, но переопределим для надёжности) */
.emoji-picker {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 99999;
    width: 280px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 6px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
    visibility: hidden;
    pointer-events: none;
}

/* Показываем пикер */
.emoji-picker.visible {
    display: grid !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Стили для кнопок эмодзи внутри пикера */
.emoji-picker .emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    font-size: 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    color: var(--text-primary, #000);
    line-height: 1;
}

.emoji-picker .emoji-btn:hover {
    background: var(--bg-hover, #f0f2f5);
    transform: scale(1.15);
}

.emoji-picker .emoji-btn:active {
    transform: scale(0.9);
}

.emoji-picker::-webkit-scrollbar {
    width: 4px;
}
.emoji-picker::-webkit-scrollbar-track {
    background: transparent;
}
.emoji-picker::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #0080FF);
    border-radius: 6px;
}

/* Тёмная тема */
[data-theme="dark"] .emoji-picker {
    background: var(--bg-secondary, #1e1e1e);
    border-color: var(--border-color-dark, #444);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .emoji-picker .emoji-btn:hover {
    background: var(--hover-bg-dark, #2a2a2a);
}

/* Специфические настройки для пикера внутри модального окна */
#postModal .emoji-picker {
    position: absolute;
    top: calc(100% + 4px);
    left: 10px; /* чтобы не прилипал к краю */
    z-index: 999999;
}

/* Убедимся, что контейнер модалки имеет position: relative для позиционирования пикера */
#postModal .modal-content {
    position: relative;
    overflow: visible !important; /* чтобы пикер не обрезался */
}

/* В модалке пост-инпут область тоже должна быть relative, если пикер вложен в неё */
#postModal .post-input-area {
    position: relative;
}

/* Для кнопки эмодзи в модалке – она должна быть поверх */
#postModal .toolbar-btn#emojiToggleModal {
    position: relative;
    z-index: 10;
}

/* Если пикер всё равно перекрывается, можно дать ему position: fixed */
@media (max-width: 600px) {
    #postModal .emoji-picker {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        max-height: 60vh;
        z-index: 999999;
        display: none;
    }
    #postModal .emoji-picker.visible {
        display: grid !important;
        transform: translate(-50%, -50%) !important;
    }
}

/* ============================================
   КНОПКИ
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: opacity 0.2s ease, background 0.2s ease;
    touch-action: manipulation;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn:not(:disabled):hover { opacity: 0.9; }
.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.btn-icon {
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.btn {
    height: 40px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 20px;
}
@media (max-width: 1173px) {
    .btn {
        height: 36px;
        padding: 0 16px;
        font-size: 13px;
        border-radius: 18px;
    }
}
.btn-large {
    height: 48px;
    padding: 0 24px;
    font-size: 16px;
    border-radius: 24px;
}
@media (max-width: 1173px) {
    .btn-large {
        height: 40px;
        padding: 0 18px;
        font-size: 14px;
        border-radius: 20px;
    }
}

/* ============================================
   ПУСТОЕ СОСТОЯНИЕ
   ============================================ */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================
   СТРАНИЦЫ ВХОДА И РЕГИСТРАЦИИ
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 20px;
    margin: 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
}
.auth-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-header svg {
    color: var(--text-primary);
    margin-bottom: 12px;
    display: inline-block;
}
.auth-header h2 {
    font-weight: 600;
    font-size: 26px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin: 0;
}
.auth-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.auth-field {
    margin-bottom: 18px;
    position: relative;
}
.auth-field input {
    width: 100%;
    padding: 16px 18px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: border-color 0.25s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}
.auth-field input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.auth-field input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.auth-field .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 0.6;
}
.auth-field .input-icon + input {
    padding-left: 44px;
}

.auth-message {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}
.auth-message.error {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.auth-message.success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-btn {
    width: 100%;
    padding: 16px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    margin-top: 6px;
    letter-spacing: 0.3px;
}
.auth-btn:hover {
    opacity: 0.9;
    transform: scale(1.01);
}
.auth-btn:active {
    transform: scale(0.98);
}
.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.auth-footer a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0 18px;
    color: var(--text-secondary);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
        border-radius: 28px;
    }
    .auth-header h2 {
        font-size: 22px;
    }
    .auth-field input {
        padding: 14px 16px;
        font-size: 14px;
    }
    .auth-btn {
        padding: 14px;
        font-size: 15px;
    }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3)),
        url('../images/back.webp') center/cover no-repeat;
    padding: 20px;
}

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-weight: 600;
    font-size: 24px;
    margin-top: 12px;
    color: var(--text-primary);
}

.login-box input {
    width: 100%;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color 0.25s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.login-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.login-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.login-logo img {
    width: 64px;         
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.login-title {
    font-size: 25px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.error-msg {
    background: #ef44441a;
    color: #ef4444;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.success-msg {
    background: #22c55e1a;
    color: #22c55e;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 15px;
    color: var(--text-secondary);
}

.register-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.register-link a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

.login-box .forgot-link-row {
    display: flex;
    justify-content: flex-end;
    margin: -8px 4px 16px 0;
}

.login-box .forgot-link-row a {
    font-size: 14px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-box .forgot-link-row a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .login-box {
        padding: 28px 20px;
        border-radius: 28px;
    }
    .login-title {
        font-size: 24px;
    }
    .login-subtitle {
        font-size: 14px;
    }
    .login-box input {
        padding: 14px 16px;
        font-size: 14px;
    }
    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }
    .login-box .forgot-link-row {
        margin: -10px 4px 14px 0;
    }
    .login-box .forgot-link-row a {
        font-size: 13px;
    }
}
/* ============================================
   ГЛОБАЛЬНЫЙ ХЕДЕР
   ============================================ */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    min-height: 60px;
    display: flex;
    align-items: center;
}

.header-inner {
    max-width: none;
    width: 100%;
    margin: 0;
    height: 60px;
    padding-left: calc(50vw - var(--content-max-width)/2 - var(--sidebar-gap) - var(--sidebar-width));
    padding-right: calc(60vw - var(--content-max-width)/2 - var(--sidebar-gap) - var(--sidebar-width));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;

}

.header-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.header-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.header-search input:focus {
    border-color: var(--accent-primary);
}

.header-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    transition: color 0.2s;
}

.header-icon-btn:hover {
    color: var(--text-primary);
}

.header-icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s;
}

.header-avatar-wrapper:hover .header-avatar {
    border-color: var(--accent-primary);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: var(--block-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 0;
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    list-style: none;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 18px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.dropdown-menu a:hover {
    background: var(--bg-hover);
}

.dropdown-menu hr {
    margin: 6px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .global-header {
        padding-left: calc(16px + env(safe-area-inset-left, 0px));
        padding-right: calc(16px + env(safe-area-inset-right, 0px));
        min-height: 56px;
    }

    .header-inner {
        height: 56px;
        padding-left: 0;
        padding-right: 0;
    }
    .header-search input {
        padding: 6px 12px 6px 32px;
        font-size: 13px;
    }
    .header-search .search-icon {
        left: 8px;
        width: 14px;
        height: 14px;
    }
    .header-logo span {
        font-size: 17px;
    }
    .header-actions {
        gap: 10px;
    }
    .header-icon-btn .badge {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .header-logo span {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header-logo span {
        display: none;
    }
}
/* ============================================
   БЕЙДЖ НА ИКОНКЕ НАВИГАЦИИ (уведомления, сообщения)
   ============================================ */
.nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.5);
    pointer-events: none;
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.nav-badge[hidden] {
    display: none;
}

@keyframes badgePop {
    0%   { transform: scale(0); }
    100% { transform: scale(1); }
}

.nav-badge.is-dot {
    padding: 0;
    min-width: 8px;
    height: 8px;
    font-size: 0;
    border-radius: 50%;
}

.bottom-nav-icon {
    position: relative;
}
.bottom-nav-item .nav-badge {
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 8px;
}

[data-theme="light"] .nav-badge {
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
}

/* ============================================
   ПОСТЫ В ЛЕНТЕ
   ============================================ */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.post-item {
    background: var(--block-bg);
    border-radius: 24px;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    position: relative;
    isolation: isolate;
}

.post-item.menu-open {
    z-index: 50;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.post-user-info {
    display: flex;
    flex-direction: column;
}

.post-username {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.post-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
    word-break: break-word;
    text-align: left;
}

.post-media {
    border-radius: 16px;
    overflow: hidden;
}

.post-media video {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 600px;
    border-radius: 8px;
}

.post-media img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

.avatar-link:hover img,
.post-username-link:hover,
.comment-author-link:hover {
    opacity: 0.9;
    filter: brightness(0.9);
}

.post-item,
.post-detail-item {
    position: relative;
}

.views-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: auto;
    flex-shrink: 0;
}

.views-number {
    line-height: 1;
}

@media (max-width: 768px) {
    .post-item {
        padding: 16px;
        border-radius: 18px;
    }
    .post-content {
        font-size: 14px;
    }
}

.post-media,
.repost-original .post-media,
.modal-post-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-media > img,
.repost-original .post-media > img {
    width: 100%;
    height: auto;
}

.post-media > .custom-video-player,
.repost-original .post-media > .custom-video-player {
    margin: 0 auto;
}

/* ============================================
   ФОН ПОСТА 
   ============================================ */
.post-item.post-has-bg {
    border-color: transparent;
}

.post-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.post-bg__img,
.post-bg__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-bg__video {
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}
.post-bg__video[src] {
    opacity: 1;
}

.post-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.478);
    pointer-events: none;
}

.post-item.post-has-bg .post-username,
.post-item.post-has-bg .post-content {
    color: #ffffff;
}
.post-item.post-has-bg .post-date,
.post-item.post-has-bg .views-count {
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.post-item.post-has-bg .gradient-text {
    -webkit-text-fill-color: transparent !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

@media (max-width: 1023px) {
    .post-bg__video { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .post-bg__video { display: none !important; }
}

.post-bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.post-bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.post-bg-option:hover { background: var(--bg-hover); }
.post-bg-option.selected { border-color: var(--accent-primary); }
.post-bg-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    overflow: hidden;
    isolation: isolate;
}

.post-bg-preview-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}
.post-bg-preview-video.is-ready {
    opacity: 1;
}
.post-bg-preview--none {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-bg-preview--none::before {
    content: "×";
    font-size: 24px;
    color: var(--text-secondary);
}
.post-bg-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.post-bg-picker { margin: 12px 0; }
.post-bg-picker-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.post-bg-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.post-bg-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
}
.post-bg-radio:hover { background: var(--bg-hover); }
.post-bg-radio input { display: none; }
.post-bg-radio:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(0, 128, 255, 0.08);
}
.radio-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
    transition: background 0.2s;
}
.post-bg-radio input:checked ~ .radio-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 128, 255, 0.15);
}
.post-bg-hint { color: var(--text-secondary); font-size: 13px; }
.post-bg-mini {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.post-bg-mini-option {
    cursor: pointer;
    border-radius: 10px;
    padding: 4px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    text-align: center;
}
.post-bg-mini-option.selected { border-color: var(--accent-primary); }
.post-bg-mini-preview {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}
.post-bg-mini-option span {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}

.post-bg-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin: 8px 0;
}
.post-bg-open-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}
.post-bg-open-btn.active {
    border-color: var(--accent-primary);
    background: rgba(0, 128, 255, 0.08);
}

.post-bg-open-text {
    color: var(--text-secondary);
}
.post-bg-open-text span {
    color: var(--text-primary);
    font-weight: 500;
}
.post-bg-open-arrow {
    transition: transform 0.2s;
    opacity: 0.6;
}
.post-bg-open-btn.active .post-bg-open-arrow {
    transform: rotate(180deg);
}

.post-bg-gallery {
    margin-top: 2px;
    padding: 10px;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    animation: postBgFade 0.2s ease;
}
@keyframes postBgFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.post-bg-gallery-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.post-bg-gallery-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.post-bg-gallery-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.post-bg-grid-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, 90px);
    gap: 10px;
    justify-content: center;
    max-height: 300px; 
    overflow-y: auto;    
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) transparent;
}

.post-bg-grid-options::-webkit-scrollbar {
    width: 6px;
}
.post-bg-grid-options::-webkit-scrollbar-track {
    background: transparent;
}
.post-bg-grid-options::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}
.post-bg-grid-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

.post-bg-mini-preview {
    width: 100%;
    aspect-ratio: 9 / 14;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-primary);
    overflow: hidden;
}

.post-bg-mini-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-bg-mini-preview--none {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
}
.post-bg-mini-empty {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    padding: 4px;
}

.post-bg-mini-option {
    cursor: pointer;
    border-radius: 10px;
    padding: 4px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}
.post-bg-mini-option:hover {
    background: var(--bg-hover);
}
.post-bg-mini-option.selected {
    border-color: var(--accent-primary);
    background: rgba(0, 128, 255, 0.08);
}
.post-bg-mini-option span {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}
.post-bg-mini-option.selected span {
    color: var(--accent-primary);
    font-weight: 600;
}
#commentModalBody {
    overscroll-behavior: contain;
}
/* ============================================
   ЛАЙТБОКС ДЛЯ ИЗОБРАЖЕНИЙ
   ============================================ */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}
.lightbox-overlay.active {
    display: flex;
}
.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: lightboxFade 0.3s ease;
}
@keyframes lightboxFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10;
    transition: transform 0.2s;
    line-height: 1;
}
.lightbox-close:hover {
    transform: scale(1.2);
}

/* ============================================
   ПРЕВЬЮ ИЗОБРАЖЕНИЯ В СОЗДАТЕЛЕ ПОСТА
   ============================================ */
.post-image-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.post-image-preview img {
    display: block;
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
}

.post-image-preview .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.post-image-preview .remove-image:hover {
    background: rgba(255,0,0,0.8);
}

.post-content-wrapper {
    position: relative;
    overflow: hidden;
}
.post-content-wrapper.collapsed {
    max-height: 300px;
}
.post-content-wrapper.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
}

.read-more-btn {
    display: block;
    margin-top: 8px;
    background: none;
    border: none;
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}
.read-more-btn:hover {
    color: var(--accent-hover);
}

/* ============================================
   СТРАНИЦА ПОИСКА
   ============================================ */
.search-page {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 16px 40px;
    width: 100%;
}

.search-title {
    font-size: 24px;
    font-weight: 600;
    margin: 24px 0 20px;
    color: var(--text-primary);
}

.search-placeholder,
.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.search-section {
    margin-bottom: 36px;
}

.search-section-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-item {
    background: var(--block-bg);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    transition: background 0.2s, border-color 0.2s;
}

.search-result-item:hover {
    background: var(--block-hover-bg);
    border-color: var(--accent-primary);
}

.search-user {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.search-user-info {
    display: flex;
    flex-direction: column;
}

.search-user-name {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-user-username {
    font-size: 14px;
    color: var(--text-secondary);
}

.search-post {
    padding: 16px 20px;
}

.search-post .post-header {
    margin-bottom: 8px;
}

.search-post .post-content {
    font-size: 15px;
    margin-bottom: 8px;
}

.search-post .post-media {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .search-page {
        padding: 0 12px 32px;
    }
    .search-title {
        font-size: 20px;
    }
    .search-result-item {
        padding: 12px 16px;
    }
}

/* ===== ЛАЙКИ ===== */
.post-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.like-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.like-icon {
    width: 24px;
    height: 24px;
    display: block;
    transition: transform 0.2s ease;
}

.like-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
}

.like-btn.liked .like-count {
    color: var(--text-primary);
}
/* ===== СОХРАНЕНИЕ (ИЗБРАННОЕ) ===== */
.save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.save-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.save-icon {
    width: 24px;
    height: 24px;
    display: block;
    transition: transform 0.2s ease;
}

.save-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
    transition: color 0.2s;
}

/* ============================================
   КОММЕНТАРИИ
   ============================================ */
.comments-section {
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: 16px;
    width: 100%;
}

.comment-body > div:last-child {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.comment-text {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
}

.comment-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-input-wrapper {
    display: flex;
    flex: 1;
    gap: 8px;
    align-items: center;
}

.comment-input-wrapper input[type="text"] {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-input-wrapper input[type="text"]:focus {
    border-color: var(--accent-primary);
}

.btn-sm {
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 20px;
}
.comment-item {
    animation: commentFadeIn 0.3s ease;
}

@keyframes commentFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Кнопка-иконка комментария */
.comment-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.comment-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.comment-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
}

.comments-section.hidden {
    display: none;
}

.comments-section.visible {
    display: block;
}

.btn-send {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-send svg {
    display: block;
    width: 18px;
    height: 18px;
}

.view-all-comments {
    margin: 8px 0 12px 0;
    text-align: center;
}

.view-all-link {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.view-all-link:hover {
    background: var(--bg-hover);
    color: var(--accent-hover);
}

.comment-emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.comment-emoji-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.comment-emoji-picker {
    position: absolute;
    z-index: 1000;
    width: 280px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 6px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    gap: 2px;
    transition: opacity 0.15s ease;
}

.comment-emoji-picker .emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    font-size: 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    color: var(--text-primary, #000);
    line-height: 1;
}

.comment-emoji-picker .emoji-btn:hover {
    background: var(--bg-hover, #f0f2f5);
    transform: scale(1.15);
}

.comment-emoji-picker .emoji-btn:active {
    transform: scale(0.9);
}

.comment-emoji-picker::-webkit-scrollbar {
    width: 4px;
}
.comment-emoji-picker::-webkit-scrollbar-track {
    background: transparent;
}
.comment-emoji-picker::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #0080FF);
    border-radius: 6px;
}

[data-theme="dark"] .comment-emoji-picker {
    background: var(--bg-secondary, #1e1e1e);
    border-color: var(--border-color-dark, #444);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .comment-emoji-picker .emoji-btn:hover {
    background: var(--hover-bg-dark, #2a2a2a);
}

/* ============================================
   СТРАНИЦА ПОСТА
   ============================================ */
.post-detail-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.post-detail-nav {
    margin: 16px 0 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s, transform 0.15s;
}

.back-link:hover {
    color: var(--text-primary);
    transform: translateX(-4px);
}

.post-detail-item {
    background: var(--block-bg);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}

.post-detail-item .post-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.post-detail-item .post-content {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-detail-item .post-media {
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: 16px;
}

.post-detail-item .post-media img,
.post-detail-item .post-media video {
    display: block;
    max-width: 100%;
    max-height: 600px;
    margin: 0 auto;
}

.post-detail-item .post-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.comment-count-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.comment-count-label img {
    vertical-align: middle;
}

.post-detail-item .comments-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.post-detail-item .comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.post-detail-item .comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.post-detail-item .comment-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}

.post-detail-item .comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-detail-item .comment-body {
    flex: 1;
    background: var(--bg-secondary);
    padding: 10px 16px;
    border-radius: 18px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.post-detail-item .comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.post-detail-item .comment-text {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
}

.post-detail-item .comment-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.post-detail-item .no-comments {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

@media (max-width: 768px) {
    .post-detail-container {
        padding: 0 12px;
    }
    .post-detail-item {
        padding: 16px;
        border-radius: 18px;
    }
    .post-detail-item .post-content {
        font-size: 15px;
    }
    .post-detail-item .comment-body {
        padding: 8px 12px;
    }
    .post-detail-item .comment-text {
        font-size: 14px;
    }
}
/* ============================================
   БОКОВАЯ ПАНЕЛЬ
   ============================================ */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.side-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary);
    z-index: 9999;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.5);
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    box-sizing: border-box;
}

.side-panel.active {
    right: 0;
}

.side-panel-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.side-panel-close {
    font-size: 28px;
    line-height: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0 12px 0 0;
    cursor: pointer;
    transition: color 0.2s;
}
.side-panel-close:hover {
    color: var(--text-primary);
}
.side-panel-title {
    font-size: 18px;
    font-weight: 600;
    margin-left: 8px;
    color: var(--text-primary);
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.side-panel-loading,
.side-panel-empty,
.side-panel-error {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
}

.side-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.side-panel-item {
    padding: 0;
    transition: background 0.15s;
}
.side-panel-item:hover {
    background: var(--bg-hover);
}
.side-panel-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
}
.side-panel-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.side-panel-name {
    font-weight: 600;
    font-size: 15px;
}
.side-panel-username {
    font-size: 14px;
    color: var(--text-secondary);
}
.side-panel-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.side-panel-name .verified-badge {
    width: 16px;
    height: 14px;
    margin-left: -1px;
    vertical-align: middle;
}

.side-panel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 24px;
    transition: background 0.15s;
}
.side-panel-row:hover {
    background: var(--bg-hover);
}
.side-panel-link {
    flex: 1 1 auto;
    min-width: 0;
}

.side-panel-follow-btn {
    flex-shrink: 0;
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 16px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s, transform 0.15s;
}
.side-panel-follow-btn:hover {
    opacity: 0.9;
}
.side-panel-follow-btn:active {
    transform: scale(0.96);
}
.side-panel-follow-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.side-panel-follow-btn.following {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.side-panel-follow-btn.following:hover {
    background: #cb3434;
    color: #fff;
    border-color: #cb3434;
    opacity: 1;
}

@media (max-width: 480px) {
    .side-panel {
        width: 100%;
        right: -100%;
    }
    .side-panel-header {
        padding: 16px 20px;
    }
    .side-panel-item {
        padding: 6px 16px;
    }
    .side-panel-row {
        padding: 6px 12px 6px 16px;
    }
    .side-panel-follow-btn {
        height: 30px;
        padding: 0 12px;
        font-size: 12px;
    }
}
/* ============================================
   Закрытый профиль
   ============================================ */
.private-profile-message {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}
.private-profile-message p:first-child {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.private-profile-message .btn {
    margin-top: 16px;
}
/* ============================================
   УВЕДОМЛЕНИЯ
   ============================================ */
.notifications-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 16px 40px;
    width: 100%;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.notifications-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.notifications-header .btn {
    flex-shrink: 0;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--block-bg);
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.notification-item.unread {
    background: var(--block-bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.notification-item.unread:hover {
    background: var(--block-hover-bg);
}

.notification-item.read {
    opacity: 0.75;
}

.notification-item.read:hover {
    opacity: 1;
    background: var(--block-hover-bg);
}

.notification-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-text {
    font-size: 15px;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
}

.notification-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.notification-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.mark-read-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}

.mark-read-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.mark-read-btn:active {
    transform: scale(0.92);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

@media (max-width: 768px) {
    .notifications-container {
        padding: 0 12px 32px;
    }
    .notifications-header h2 {
        font-size: 20px;
    }
    .notification-item {
        padding: 10px 12px;
        gap: 10px;
    }
    .notification-avatar {
        width: 36px;
        height: 36px;
    }
    .notification-text {
        font-size: 14px;
    }
    .notification-time {
        font-size: 12px;
    }
    .mark-read-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .notifications-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .notifications-header .btn {
        width: 100%;
        justify-content: center;
    }
}
/* ===== ВКЛАДКИ С ИНДИКАТОРОМ ===== */
.tabs {
    --padding: 0px;
    position: relative;
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-radius: 9999px;
    padding: var(--padding);
    overflow: hidden;
}

.tab-indicator {
    position: absolute;
    top: var(--padding);
    bottom: var(--padding);
    background: var(--tab-active-bg);
    border-radius: 9999px;
    transition: transform 0.25s cubic-bezier(0.5, 0, 0, 1), width 0.25s cubic-bezier(0.5, 0, 0, 1);
    will-change: transform, width;
    pointer-events: none;
    z-index: 0;
}

.tab-item {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: color 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    user-select: none;
}

.tab-item.active {
    color: var(--text-primary);
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item:visited,
.tab-item:link {
    color: inherit;
    text-decoration: none;
}
.tabs-container {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 8px 16px 4px;
}

.tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2px;
}

.tab-item {
    position: relative;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.25s ease, text-shadow 0.25s ease;
    text-decoration: none;
    display: inline-block;
    user-select: none;
    letter-spacing: 0.3px;
}

.tab-item::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

.tab-item:hover {
    color: var(--text-primary);
}
.tab-item:hover::after {
    left: 10%;
    width: 80%;
}

.tab-item.active {
    color: var(--accent-primary);
    text-shadow: 0 0 12px var(--accent-primary), 0 0 24px var(--accent-secondary);
}
.tab-item.active::after {
    left: 0;
    width: 100%;
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

[data-theme="dark"] .tab-item.active {
    text-shadow: 0 0 16px var(--accent-primary), 0 0 32px var(--accent-secondary);
}
[data-theme="cyberpunk"] .tab-item.active {
    text-shadow: 0 0 20px #ff2d55, 0 0 40px #7b61ff;
}

@media (max-width: 768px) {
    .tabs-container {
        padding: 8px 0 4px;
        overflow: hidden;
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        gap: 4px;
        padding: 0 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .tabs::-webkit-scrollbar {
        display: none; 
    }

    .tab-item {
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 14px;
        white-space: nowrap;
        border-bottom: none;
    }

    .profile-container .tabs-container {
        padding-left: 0;
        padding-right: 0;
    }
}
/* ============================================
   МЕНЮ ПОСТА (три точки)
   ============================================ */
.post-menu-wrapper {
    position: relative;
    flex-shrink: 0;
}
.post-menu-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.post-menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.post-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--block-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-elevated);
    min-width: 180px;
    padding: 6px 0;
    z-index: 10;
    transition: opacity 0.2s, transform 0.2s;
}
.post-menu-dropdown.hidden {
    display: none;
}
.post-menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 18px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.post-menu-dropdown button:hover {
    background: var(--bg-hover);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО РЕПОРТА
   ============================================ */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.report-modal:not(.hidden) {
    visibility: visible;
    opacity: 1;
}
.report-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.report-modal-content {
    position: relative;
    background: var(--block-bg);
    border-radius: 32px;
    padding: 32px 28px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.report-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    line-height: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}
.report-modal-close:hover {
    color: var(--text-primary);
}
.report-modal-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.report-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.report-form-group {
    margin-bottom: 18px;
}
.report-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.report-form-group select,
.report-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.report-form-group select:focus,
.report-form-group textarea:focus {
    border-color: var(--accent-primary);
}
.report-form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.report-error {
    color: #ef4444;
    font-size: 14px;
    margin: 12px 0;
}
.report-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.report-submit-btn:hover {
    opacity: 0.9;
}
.report-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ============================================
   ТОСТ-УВЕДОМЛЕНИЯ
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--block-bg);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
}

.toast-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.toast-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.toast-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toast-message {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

.toast-progress.success {
    background: #22c55e;
}
.toast-progress.error {
    background: #ef4444;
}
.toast-progress.info {
    background: #3b82f6;
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: 100%;
    }
    .toast {
        padding: 14px 16px;
        border-radius: 14px;
    }
    .toast-message {
        font-size: 14px;
    }
}

.guest-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}
.guest-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}
.guest-banner-content span {
    font-size: 14px;
    color: var(--text-primary);
}
.guest-banner-buttons {
    display: flex;
    gap: 10px;
}
@media (max-width: 768px) {
    .guest-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .guest-banner-buttons {
        justify-content: center;
    }
}
/* ============================================
   КНОПКА РЕПОСТА (share-btn)
   ============================================ */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}
.share-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.share-icon {
    width: 24px;
    height: 24px;
    display: block;
    transition: transform 0.2s ease;
}
.share-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
    transition: color 0.2s;
}
.share-btn.shared .share-count {
    color: var(--accent-primary);
}

/* ============================================
   БЛОК РЕПОСТА
   ============================================ */
.repost-block {
    border-radius: 12px;
    padding: 5px 10px;
    margin: 8px 0 12px 0;
}

.repost-header {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.repost-header .repost-icon {
    margin-right: 4px;
    font-size: 14px;
}

.repost-original {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid var(--border-color);
}

.repost-original .post-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.repost-original .post-media {
    margin-top: 6px;
}

.repost-deleted {
    color: var(--text-secondary);
    font-style: italic;
    padding: 8px;
    text-align: center;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ПОСТА
   ============================================ */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.post-modal:not(.hidden) {
    visibility: visible;
    opacity: 1;
}
.post-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}
.post-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    max-width: 95vw;
    max-height: 90vh;
    width: 1100px;
    height: 90vh;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.post-modal-content.no-media {
    width: 640px;
    max-width: 95vw;
}

.post-modal-content.no-media .modal-post-layout {
    display: block;
}

.post-modal-content.no-media .modal-post-info {
    flex: 1 1 100%;
    width: 100%;
    border-left: none;
}
.post-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 32px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}
.post-modal-close:hover {
    transform: scale(1.1);
}
#postModalBody {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

.modal-post-layout {
    display: flex;
    width: 100%;
    height: 100%;
}
.modal-post-media {
    flex: 1 1 60%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.modal-post-media img,
.modal-post-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.modal-post-info {
    flex: 1 1 50%;
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
}
.modal-post-info {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.modal-post-info .post-header,
.modal-post-info .post-content,
.modal-post-info .post-actions,
.modal-post-info .comment-form {
    flex-shrink: 0;
}

.modal-post-info .comments-section {
    flex: 1;
    overflow-y: auto;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

@media (max-width: 768px) {
    .modal-post-info {
        padding: 12px 16px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .modal-post-layout {
        flex-direction: column;
    }
    .modal-post-media {
        flex: 0 0 50%;
        max-height: 50vh;
    }
    .modal-post-info {
        flex: 1;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    .post-modal-content {
        width: 95vw;
        height: 95vh;
        max-height: 95vh;
    }
    .post-modal-close {
        top: 8px;
        right: 12px;
        font-size: 28px;
    }

    .post-modal-content.no-media {
        width: 95vw;
        height: auto;
        max-height: 95vh;
    }
    .post-modal-content.no-media .modal-post-info {
        border-top: none;
    }
}
/* Модалка создания поста – чтобы эмодзи-пикер не обрезался */
#createPostModal .modal-content {
    position: relative;
    overflow: visible !important;
}

/* Контейнер панели инструментов – для позиционирования пикера */
#createPostModal .post-toolbar {
    position: relative;
}

/* Пикер эмодзи в модалке создания – располагаем под кнопкой */
#createPostModal .emoji-picker {
    position: absolute;
    top: calc(100% + -30px);
    left: 0;
    z-index: 999999;
}
/* ===== Нижняя панель комментариев (bottom sheet) ===== */
.comment-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 99999;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.comment-bottom-sheet.active {
    visibility: visible;
    opacity: 1;
}

.comment-bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.comment-bottom-sheet-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    height: auto;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    padding-top: 8px;
}

.comment-bottom-sheet.active .comment-bottom-sheet-content {
    transform: translateY(0);
}

.comment-bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px 12px;
    position: relative;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.comment-bottom-sheet-handle {
    flex: 0 0 auto;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--text-secondary);
    opacity: 0.4;
    cursor: grab;
    margin: 0 auto 6px;
    display: block;
    order: -1;
}

.bottom-sheet-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin: 0 auto;
}

.comment-bottom-sheet-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* Тело — флекс-колонка, чтобы форма «прилипала» к низу */
.comment-bottom-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px 16px 0;
}

/* Секция комментариев — тоже flex-колонка, растягивается */
.comment-bottom-sheet-body > .comments-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    border-top: none;
    padding-top: 0;
}

/* Список комментариев — скроллится */
.comment-bottom-sheet-body .comments-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0;
    padding-bottom: 8px;
    overscroll-behavior: contain;
}

/* Форма — всегда прижата к низу, где бы ни лежала */
.comment-bottom-sheet-body .comment-form {
    flex-shrink: 0;
    margin: 0;
    margin-top: auto;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

/* input-wrapper внутри формы растягивается */
.comment-bottom-sheet-body .comment-form .comment-input-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}

/* «Нет комментариев» */
.comment-bottom-sheet-body .no-comments {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
}
@media (max-width: 480px) {
    .comment-bottom-sheet-body {
        padding: 4px 12px 0;
    }
    .comment-bottom-sheet-body .comment-form {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================================
   МЕНЮ КОММЕНТАРИЯ (три точки)
   ============================================ */
.comment-menu-wrapper {
    position: relative;
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
}
.comment-menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.comment-menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.comment-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--block-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-elevated);
    min-width: 120px;
    padding: 4px 0;
    z-index: 10;
}
.comment-menu-dropdown.hidden {
    display: none;
}
.comment-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 6px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.comment-menu-dropdown button:hover {
    background: var(--bg-hover);
}

.like-icon {
    stroke: var(--text-secondary);
    fill: none;
}

.like-btn.liked .like-icon {
    fill:  #ff4d4d;
    stroke: #ff4d4d;
}

/* --- Иконка сохранения (bookmark) --- */
.save-icon {
    transition: fill 0.3s ease, transform 0.2s ease;
    stroke: var(--text-secondary, #888);
    fill: none;
}

.save-btn.saved .save-icon {
    fill: var(--accent-primary, #0080FF);
    stroke: var(--accent-primary, #0080FF);
    transform: scale(1.05);
}

.save-btn.saved .save-icon {
    animation: savePop 0.4s ease;
}

@keyframes savePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.05); }
}
/* --- Скрываем старую кнопку сохранения в основном блоке действий (если она ещё есть) --- */
.save-btn {
    display: none !important;
}

/* ===== Кнопка сохранения в меню (три точки) ===== */
.save-menu-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.save-menu-btn:hover {
    background: var(--bg-hover);
}

/* Иконка по умолчанию – только контур */
.save-menu-btn .save-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    fill: none;
    transition: fill 0.3s ease, stroke 0.3s ease, transform 0.2s ease;
}

/* Состояние "сохранено" – заливка цветом акцента */
.save-menu-btn.saved .save-icon {
    fill: var(--accent-primary, #0080FF);
    stroke: var(--accent-primary, #0080FF);
    transform: scale(1.05);
}

/* (Опционально) меняем цвет текста при сохранении */
.save-menu-btn.saved .save-menu-text {
    color: var(--accent-primary, #0080FF);
}

/* ===== Иконка репоста ===== */
.share-icon {
    fill: var(--text-secondary); /* серый в неактивном состоянии */
}

/* Активное состояние – заливка акцентным цветом */
.share-btn.shared .share-icon {
    fill: var(--accent-primary, #0080FF);
}

.hashtag-link {
    color: #0080FF;
    text-decoration: none;
}
.hashtag-link:hover {
    text-decoration: underline;
}
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}
.comment-like-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.comment-like-btn .comment-like-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s;
}
/* Заливка сердечка при лайке */
.comment-like-btn.liked .comment-like-icon {
    fill: #ff4d4d;
    stroke: #ff4d4d;
}

.comment-like-btn .comment-like-count {
    min-width: 14px;
    text-align: center;
}
.comment-like-btn.processing {
    opacity: 0.6;
    pointer-events: none;
}
/* Перемещаем кнопку лайка комментария в правый нижний угол */
.comment-item {
    position: relative; /* для позиционирования дочернего элемента */
}

.comment-like-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--bg-secondary); /* полупрозрачный фон для читаемости */
    border-radius: 50%;
    padding: 4px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

/* ============================================
   СТАТИСТИКА (ПОДПИСЧИКИ / ПОДПИСКИ)
   ============================================ */
.stats-card {
    display: flex;
    justify-content: left;
    padding: 8px 0;
}

.stats-row {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.2s ease;
}

.stat-number {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.stat-label {
    font-size: 15px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.stat-item:hover .stat-label {
    color: var(--text-primary);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .stats-row {
        gap: 20px;
    }
    .stat-number {
        font-size: 16px;
    }
    .stat-label {
        font-size: 14px;
    }
}
/* ============================================
   МЕТА-ИНФОРМАЦИЯ ПРОФИЛЯ (онлайн + дата)
   ============================================ */
.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}

.online-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.online-dot-small {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.joined-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.joined-date svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.meta-separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .profile-meta {
        font-size: 14px;
        gap: 4px 8px;
    }
    .joined-date svg {
        width: 16px;
        height: 16px;
    }
}
/* ============================================
   ПРОФИЛЬ: НОВОЕ РАСПОЛОЖЕНИЕ КНОПОК
   ============================================ */
.profile-details-content {
    display: flex;
    align-items: flex-start;
    gap: 16px 20px;
}

.profile-info-left {
    flex: 1;
    min-width: 0;
}

.profile-actions {
    flex-shrink: 0;
    margin-left: auto;
    align-self: flex-start;
}

@media (max-width: 768px) {
    .profile-details-content {
        flex-direction: column;
        align-items: stretch;
    }
    .profile-info-left {
        flex: 1 1 auto;
    }
    .profile-actions {
        margin-left: 0;
        align-self: stretch;
        width: 100%;
    }
    .profile-actions .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    .profile-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}
/* ============================================
   ИНФОРМАЦИОННОЕ МОДАЛЬНОЕ ОКНО (алиасы и подарки)
   ============================================ */
.info-modal .modal-content {
    max-width: 500px;
}
.info-modal .alias-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.info-modal .alias-item {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.info-modal .alias-item .alias-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--accent-primary);
}
.info-modal .alias-item .alias-detail {
    font-size: 14px;
    color: var(--text-secondary);
}
.info-modal .gift-detail {
    text-align: center;
}

.info-modal .gift-detail .gift-sender {
    font-weight: 500;
}
.info-modal .gift-detail .gift-message {
    margin-top: 8px;
    font-style: italic;
    color: var(--text-secondary);
}
.info-modal .gift-detail .gift-date {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.alias-more {
    cursor: pointer;
    color: var(--accent-primary);
    font-weight: 500;
    transition: opacity 0.2s;
}
.alias-more:hover {
    opacity: 0.8;
}
/* ===== Детали подарка в модалке ===== */
.gift-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.gift-image-wrapper {
    text-align: center;
}

.gift-modal-image {
    max-width: 150px;
    display: block;
    margin: 0 auto 16px;
}

.gift-coin-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;  
    vertical-align: middle;
    margin: 0;
    padding: 0;
}

.gift-info-table {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gift-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.gift-info-row:last-child {
    border-bottom: none;
}
.gift-info-label {
    font-weight: 500;
    color: var(--text-secondary);
}
.gift-info-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    color: var(--text-primary);
    text-align: right;
}
.gift-price-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}
.gift-sender-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}
.gift-sender-link:hover {
    text-decoration: underline;
}
.gift-message-text {
    font-style: italic;
    color: var(--text-secondary);
}

.global-bg-video {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}
.global-bg-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(5, 5, 10, 0.70) 0%,
            rgba(5, 5, 10, 0.45) 35%,
            rgba(5, 5, 10, 0.55) 100%
        ),
        linear-gradient(
            180deg,
            rgba(5, 5, 10, 0.25) 0%,
            rgba(5, 5, 10, 0.75) 100%
        );
    pointer-events: none;
    z-index: -1;
}
/* ============================================
   Пикер с табами снизу
   ============================================ */
.emoji-picker,
.comment-emoji-picker {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    padding: 8px 6px 6px;
    width: 300px;
    max-height: 350px;
    display: none;
    grid-template-columns: 1fr !important;  
    grid-template-rows: 1fr auto !important;
    overflow: hidden;
    transition: opacity 0.15s ease;
}

.emoji-picker.visible,
.comment-emoji-picker.visible {
    display: grid !important;
}

.picker-panels {
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.emoji-panel {
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    overflow-y: auto;
    padding: 4px 2px;
    max-height: 280px;
    height: 100%;
}

.sticker-panel {
    display: none;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px;
    overflow-y: auto;
    padding: 6px 4px;
    max-height: 280px;
    height: 100%;
}

.picker-panel.active {
    display: grid;
}

.picker-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 4px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    flex-shrink: 0;
}

.picker-tab {
    flex: 1;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
}
.picker-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.picker-tab.active {
    background: var(--bg-active);
    color: var(--accent-primary);
}

.emoji-btn {
    font-size: 24px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 0;
    transition: background 0.15s, transform 0.1s;
    line-height: 1.2;
}
.emoji-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

.sticker-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sticker-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}
.sticker-btn img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.sticker-inline {
    display: inline-block;
    vertical-align: middle;
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 2px;
    border-radius: 4px;
    background: transparent;
}

/* ===== Install Banner ===== */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #4a6cf7, #6a3ff7);
    color: #fff;
    transform: translateY(-100%);
    transition: transform .35s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    will-change: transform;
}

.install-banner.is-visible {
    transform: translateY(0);
}

.install-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.install-banner__icon {
    border-radius: 10px;
    background: rgba(255, 255, 255, .15);
    padding: 4px;
    flex-shrink: 0;
}

.install-banner__text {
    flex: 1;
    min-width: 0;
}

.install-banner__title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.install-banner__subtitle {
    font-size: 13px;
    opacity: .85;
    margin-top: 2px;
    line-height: 1.3;
}

.install-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-banner__btn {
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    padding: 8px 16px;
    transition: background .2s, opacity .2s;
    font-family: inherit;
}

.install-banner__btn--primary {
    background: #fff;
    color: #4a6cf7;
}
.install-banner__btn--primary:hover {
    background: #f0f3ff;
}

.install-banner__btn--ghost {
    background: transparent;
    color: #fff;
    padding: 8px 10px;
    font-size: 16px;
    opacity: .8;
}
.install-banner__btn--ghost:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .install-banner__subtitle {
        display: none;
    }
    .install-banner__inner {
        padding: 8px 12px;
        gap: 10px;
    }
    .install-banner__btn {
        padding: 7px 12px;
        font-size: 13px;
    }
}
/* ===== iOS Install Modal ===== */
.ios-install-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.ios-install-modal.visible {
    opacity: 1;
    pointer-events: auto;
}
.ios-install-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ios-install-content {
    position: relative;
    background: var(--block-bg);
    border-radius: 24px;
    padding: 32px 24px 24px;
    max-width: 360px;
    width: calc(100% - 32px);
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
    transform: translateY(20px);
    transition: transform .3s ease;
}
.ios-install-modal.visible .ios-install-content {
    transform: translateY(0);
}
.ios-install-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.ios-install-icon {
    margin: 0 auto 12px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ios-install-icon img {
    border-radius: 12px;
}
.ios-install-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.ios-install-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.ios-install-steps {
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    padding: 0;
}
.ios-install-steps li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}
.ios-install-step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ios-share-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    margin: 0 2px;
    color: var(--accent-primary);
}
.ios-install-got-it {
    width: 100%;
    padding: 14px;
    border-radius: 9999px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.ios-install-got-it:hover {
    opacity: .9;
}

.avatar.avatar-with-frame {
    position: relative;
    overflow: visible;
}

.avatar-frame-img {
    position: absolute;
    inset: -4px;
    pointer-events: none;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
}

.avatar-small.avatar-with-frame .avatar-frame-img { inset: -3px; }
.avatar-medium.avatar-with-frame .avatar-frame-img { inset: -5px; }
.avatar-large.avatar-with-frame .avatar-frame-img { inset: -8px; }


.side-panel-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.side-panel-avatar-wrap .side-panel-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.side-panel-frame {
    position: absolute;
    inset: -3px;
    pointer-events: none;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
}

.custom-video-player {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    line-height: 0;
    outline: none;
    vertical-align: top;
}

.custom-video-player video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 600px;
    background: #000;
    cursor: pointer;
    border-radius: 8px;
}

.cvp-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.2s, background 0.2s, opacity 0.25s;
    z-index: 3;
    padding: 0;
    line-height: 1;
}
.cvp-big-play svg { margin-left: 4px; }
.cvp-big-play:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translate(-50%, -50%) scale(1.08);
}
.custom-video-player.cvp-playing .cvp-big-play {
    opacity: 0;
    pointer-events: none;
}

.cvp-controls {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    color: #fff;
    z-index: 4;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    line-height: 1;
    pointer-events: none;
}
.custom-video-player.cvp-active .cvp-controls,
.custom-video-player:hover .cvp-controls,
.custom-video-player:focus-within .cvp-controls {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.custom-video-player.cvp-playing:not(.cvp-active):not(:hover):not(:focus-within) .cvp-controls {
    opacity: 0;
    pointer-events: none;
}

.cvp-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, transform 0.1s;
    padding: 0;
}
.cvp-btn:hover  { background: rgba(255,255,255,0.15); }
.cvp-btn:active { transform: scale(0.92); }
.cvp-btn svg { pointer-events: none; }

.cvp-progress {
    position: relative;
    flex: 1;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.cvp-progress::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.25);
    transition: height 0.15s;
}
.cvp-progress:hover::before { height: 6px; }

.cvp-progress-buffered,
.cvp-progress-played {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    border-radius: 4px;
    transition: height 0.15s;
    pointer-events: none;
}
.cvp-progress-buffered { background: rgba(255,255,255,0.4); width: 0; }
.cvp-progress-played   { background: var(--accent-primary, #0080FF); width: 0; }
.cvp-progress:hover .cvp-progress-buffered,
.cvp-progress:hover .cvp-progress-played { height: 6px; }

.cvp-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s;
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.3);
    z-index: 2;
}
.cvp-progress:hover .cvp-progress-thumb { transform: translate(-50%, -50%) scale(1); }

.cvp-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #fff;
    flex-shrink: 0;
    padding: 0 4px;
    white-space: nowrap;
}
.cvp-time-sep { opacity: 0.5; }

.cvp-volume {
    position: absolute;
    bottom: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 36px;
    height: 110px;
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0.25s;
    z-index: 6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cvp-volume::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    height: 12px;
}

.cvp-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cvp-volume-wrap:hover .cvp-volume,
.cvp-volume:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0s linear 0s;
}

.cvp-volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transform: rotate(-90deg);
    transform-origin: center;
    margin: 0;
}

.cvp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.cvp-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

.cvp-volume-slider {
    width: 66px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    margin: 0 2px;
}
.cvp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.3);
}
.cvp-volume-slider::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

.custom-video-player:fullscreen {
    border-radius: 0;
    width: 100vw; height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-video-player:fullscreen video {
    width: 100%; height: 100%;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
}
.custom-video-player:-webkit-full-screen {
    border-radius: 0;
    width: 100vw; height: 100vh;
}
.custom-video-player:-webkit-full-screen video {
    width: 100%; height: 100%;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
}

@media (max-width: 768px) {
    .cvp-big-play { width: 60px; height: 60px; }
    .cvp-btn { width: 30px; height: 30px; }
    .cvp-time { font-size: 11px; }
    .cvp-volume { display: none; }
    .cvp-controls { gap: 4px; padding: 8px 10px; }
}