/* --- ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    /* Основные цвета фона */
    --bg-body: #030303;
    --bg-card: #1A1A1B;
    --bg-hover: #272729;
    --bg-input: #202021; /* Чуть темнее для полей ввода */
    
    /* Границы и текст */
    --border: #343536;
    --text-main: #D7DADC;
    --text-muted: #818384;
    
    /* Цвета Личностей */
    --color-work: #3b82f6;
    --color-life: #f97316;
    --color-anon: #a855f7;
    
    /* Дефолтный акцент */
    --active-color: var(--text-main);
}

/* --- СБРОС И БАЗА --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-y: scroll;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
button { font-family: inherit; }

/* --- НАВИГАЦИЯ --- */
.navbar {
    height: 56px;
    background: rgba(26, 26, 27, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- СЕТКА (LAYOUT) --- */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    max-width: 1280px;
    margin: 24px auto;
    gap: 24px;
    padding: 0 16px;
}

.sidebar, .sidebar-right {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.menu-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    margin-bottom: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: var(--bg-hover); }
.nav-item.active { color: var(--text-main); font-weight: 700; }


/* --- КРАСИВОЕ СОЗДАНИЕ ПОСТА --- */
.create-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px; /* Более скругленные углы */
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Группа полей ввода */
.input-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within {
    border-color: var(--text-muted);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}

.create-box input[type="text"] {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    width: 100%;
}
.create-box input[type="text"]:focus { background: transparent; outline: none; }

.create-box textarea {
    background: transparent;
    border: none;
    padding: 14px;
    font-size: 1rem;
    min-height: 90px;
    resize: vertical;
    width: 100%;
    color: var(--text-main);
    margin: 0;
}
.create-box textarea:focus { background: transparent; outline: none; }

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
}

.controls select {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
}

.file-btn {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    transition: 0.2s;
}
.file-btn:hover { background: var(--bg-hover); color: var(--text-main); }

.pub-btn {
    background: var(--text-main); 
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}
.pub-btn:hover { opacity: 0.9; transform: scale(1.02); }
.pub-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }


/* --- ПОСТЫ --- */
.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px; /* Мягкие углы */
    margin-bottom: 16px;
    padding: 12px 16px; /* Больше воздуха */
    transition: border-color 0.2s;
}
.post:hover { border-color: #555; }

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.post-meta { display: flex; align-items: center; gap: 6px; }
.comm-name { font-weight: 700; color: var(--text-main); }
.author-link { font-weight: 600; color: inherit; }

.post-options { display: flex; align-items: center; }

/* --- КРАСИВАЯ КНОПКА УДАЛЕНИЯ (КОРЗИНА) --- */
.post-options button {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Круглая кнопка */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}
.post-options button:hover {
    background: rgba(239, 68, 68, 0.15); /* Красный фон при наведении */
    color: #ef4444; /* Красная иконка */
}

.post h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-main);
}
.post p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #E2E2E2;
}

/* --- ОБНОВЛЕННЫЕ КНОПКИ РЕЙТИНГА И ДЕЙСТВИЙ --- */
.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

/* Виджет рейтинга (Нормальный размер) */
.vote-widget {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05); /* Чуть заметнее фон */
    border-radius: 24px;
    height: 36px; /* Увеличил высоту */
    padding: 0 4px;
    border: 1px solid transparent;
}
.vote-widget:hover { border-color: var(--border); }

.v-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; /* Увеличил ширину кнопки */
    height: 30px; /* Увеличил высоту кнопки */
    transition: 0.2s;
}
.v-btn svg { 
    width: 22px; /* Иконки крупнее */
    height: 22px; 
} 
.v-btn:hover { background: rgba(255, 255, 255, 0.1); }
.v-btn.up:hover { color: #22c55e; }
.v-btn.down:hover { color: #ef4444; }

.v-count {
    font-size: 15px; /* Шрифт крупнее */
    font-weight: 700;
    color: var(--text-main);
    min-width: 28px;
    text-align: center;
    margin: 0 4px;
}

/* Кнопка комментариев */
.btn-comment {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px; /* Высота как у рейтинга */
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
    border: 1px solid transparent;
}
.btn-comment svg { width: 18px; height: 18px; }
.btn-comment:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}


/* --- ГАЛОЧКИ --- */
.verified-icon {
    vertical-align: text-bottom;
    margin-left: 4px;
    width: 14px; /* Компактно, но видно */
    height: 14px;
}
.verified-icon.gold { color: #eab308; fill: rgba(234,179,8,0.2); }
.verified-icon.blue { color: #3b82f6; fill: rgba(59,130,246,0.2); }
.verified-icon.gray { color: #a1a1aa; fill: rgba(161,161,170,0.2); }


/* --- РЕЖИМ АККАУНТА (ПРАВАЯ ПАНЕЛЬ) --- */
.persona-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.persona-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.02); /* Легкий фон */
}

.persona-row:hover {
    background: var(--bg-hover);
    transform: translateX(4px); /* Эффект сдвига при наведении */
}

/* Активная личность */
.persona-row.active {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--active-color); /* Цветная обводка */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-card); /* Окантовка точки */
    box-shadow: 0 0 0 1px #555;
}
.dot.work { background: var(--color-work); box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); }
.dot.life { background: var(--color-life); box-shadow: 0 0 8px rgba(249, 115, 22, 0.6); }
.dot.anon { background: var(--color-anon); box-shadow: 0 0 8px rgba(168, 85, 247, 0.6); }

.p-data { flex: 1; }
.p-nick { font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.p-type { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }


/* --- ПРОФИЛЬ (КРАСИВЕЕ) --- */
.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}
.cover {
    height: 140px; /* Выше обложка */
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--active-color) 100%);
    opacity: 0.2;
}
.profile-info {
    padding: 0 24px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-top: -50px; /* Наложение аватара на обложку */
    position: relative;
}
.big-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid var(--bg-card); /* Толстая рамка */
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.profile-text { flex: 1; margin-bottom: 5px; }
.profile-text h1 { margin: 0; font-size: 1.8rem; font-weight: 800; display: flex; align-items: center; gap: 8px; line-height: 1; }
.profile-text h1 .verified-icon { width: 24px; height: 24px; }

.bio { color: var(--text-muted); margin-top: 8px; font-size: 0.95rem; max-width: 600px; }

/* Кнопка редактирования статуса (Таблетка) */
.edit-profile-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 16px;
    border-radius: 20px; /* Форма таблетки */
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s ease;
}
.edit-profile-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--text-main);
    color: white;
}

/* --- КОММЕНТАРИИ --- */
.comments-section {
    margin-top: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.comments-section h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.comment-form {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.comment-form textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: white;
    min-height: 70px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    transition: 0.2s;
}
.comment-form textarea:focus { border-color: var(--text-muted); outline: none; background: #000; }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment {
    background: transparent;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--border);
    padding-left: 16px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.85rem;
}
.comment-header .verified-icon { width: 12px; height: 12px; }
.c-author { font-weight: 700; font-size: 0.9rem; }
.c-time { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }

.c-body {
    font-size: 0.95rem;
    color: #E2E2E2;
    line-height: 1.5;
}

/* Кнопка Редактировать текст (внутри поста) */
.edit-area {
    background: var(--bg-hover);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px dashed var(--border);
}
.text-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    transition: 0.2s;
}
.text-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--text-muted); }

/* --- ГАЛЕРЕЯ --- */
.gallery {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
}
.gallery-item { background: #111; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-1 img { max-height: 500px; object-fit: contain; }
.gallery-2 { grid-template-columns: 1fr 1fr; height: 300px; }
.gallery-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-3 .gallery-item:first-child { grid-row: span 2; }
.gallery-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-5 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-5 .gallery-item:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.gallery-5 .gallery-item:nth-child(2) { grid-column: span 3; grid-row: span 2; }


/* --- СТРАНИЦА ВЕРИФИКАЦИИ --- */
.vere-container { max-width: 600px; margin: 0 auto; padding: 20px; }
.vere-header { text-align: center; margin-bottom: 30px; }
.badges-preview { display: flex; gap: 10px; margin-bottom: 20px; }
.badge-card { background: var(--bg-card); border: 1px solid var(--border); padding: 15px; flex: 1; border-radius: 12px; text-align: center; }
.vere-form input[type="text"], .vere-form select { width: 100%; padding: 12px; margin-bottom: 12px; background: var(--bg-input); border: 1px solid var(--border); color: white; border-radius: 8px; }

/* Загрузка файла */
.vere-form input[type="file"] {
    background: var(--bg-hover);
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 5px;
    transition: 0.2s;
}
.vere-form input[type="file"]:hover { border-color: var(--active-color); background: rgba(255,255,255,0.05); }

.vere-form input[type="file"]::file-selector-button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    margin-right: 15px;
    cursor: pointer;
    font-weight: 600;
}

.status-box { background: rgba(59,130,246,0.1); border: 1px solid #3b82f6; padding: 20px; border-radius: 12px; text-align: center; margin-bottom: 20px; }
.status-box.rejected { background: rgba(239,68,68,0.1); border-color: #ef4444; }

/* --- АДАПТИВ --- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .sidebar-right { order: -1; position: static; margin-bottom: 20px; }
    .navbar { padding: 0 16px; }
}

/* Утилиты */
.hidden { display: none !important; }

/* --- ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    /* Основные цвета фона */
    --bg-body: #030303;
    --bg-card: #1A1A1B;
    --bg-hover: #272729;
    --bg-input: #202021;
    
    /* Границы и текст */
    --border: #343536;
    --text-main: #D7DADC;
    --text-muted: #818384;
    
    /* Цвета Личностей */
    --color-work: #3b82f6;
    --color-life: #f97316;
    --color-anon: #a855f7;
    
    /* Дефолтный акцент */
    --active-color: var(--text-main);
}

/* --- СБРОС И БАЗА --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-y: scroll;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
button { font-family: inherit; }

/* --- НАВИГАЦИЯ --- */
.navbar {
    height: 56px;
    background: rgba(26, 26, 27, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; }
.user-info { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 12px; }

/* --- СЕТКА --- */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    max-width: 1280px;
    margin: 24px auto;
    gap: 24px;
    padding: 0 16px;
}
.sidebar, .sidebar-right { position: sticky; top: 80px; height: fit-content; }

.menu-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.nav-item {
    display: flex; align-items: center; padding: 10px 12px; border-radius: 8px;
    color: var(--text-main); margin-bottom: 4px; font-size: 0.95rem; cursor: pointer; font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: var(--bg-hover); }
.nav-item.active { color: var(--text-main); font-weight: 700; }

/* --- СОЗДАНИЕ ПОСТА --- */
.create-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.input-group {
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within { border-color: var(--text-muted); box-shadow: 0 0 0 2px rgba(255,255,255,0.05); }

.create-box input[type="text"] {
    background: transparent; border: none; border-bottom: 1px solid var(--border); border-radius: 0;
    padding: 14px; font-size: 1.05rem; font-weight: 600; color: white; width: 100%;
}
.create-box input[type="text"]:focus { outline: none; }
.create-box textarea {
    background: transparent; border: none; padding: 14px; font-size: 1rem; min-height: 90px;
    resize: vertical; width: 100%; color: var(--text-main); margin: 0;
}
.create-box textarea:focus { outline: none; }

.controls { display: flex; justify-content: space-between; align-items: center; padding-top: 5px; }
.controls select { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-main); padding: 8px 12px; border-radius: 20px; cursor: pointer; }
.file-btn { cursor: pointer; font-size: 0.9rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; transition: 0.2s; }
.file-btn:hover { background: var(--bg-hover); color: var(--text-main); }
.pub-btn { background: var(--text-main); color: #000; border: none; padding: 8px 20px; border-radius: 20px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: 0.2s; }
.pub-btn:hover { opacity: 0.9; transform: scale(1.02); }
.pub-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* --- ПОСТЫ --- */
.post {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 16px; padding: 12px 16px; transition: border-color 0.2s;
}
.post:hover { border-color: #555; }

.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.8rem; color: var(--text-muted); }
.post-meta { display: flex; align-items: center; gap: 6px; }
.comm-name { font-weight: 700; color: var(--text-main); }
.author-link { font-weight: 600; color: inherit; }

/* Кнопка удаления */
.post-options button {
    background: transparent; border: none; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s ease;
}
.post-options button:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.post h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; color: var(--text-main); }
.post p { font-size: 1rem; line-height: 1.5; margin-bottom: 12px; color: #E2E2E2; }

/* --- ДЕЙСТВИЯ (РЕЙТИНГ, КОММЕНТЫ, ШЕР) --- */
.post-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }

.vote-widget {
    display: flex; align-items: center; background: rgba(255, 255, 255, 0.05);
    border-radius: 24px; height: 36px; padding: 0 4px; border: 1px solid transparent;
}
.vote-widget:hover { border-color: var(--border); }
.v-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; transition: 0.2s;
}
.v-btn svg { width: 22px; height: 22px; }
.v-btn:hover { background: rgba(255, 255, 255, 0.1); }
.v-btn.up:hover { color: #22c55e; }
.v-btn.down:hover { color: #ef4444; }
.v-count { font-size: 15px; font-weight: 700; color: var(--text-main); min-width: 28px; text-align: center; margin: 0 4px; }

/* Кнопка комментариев */
.btn-comment {
    display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    background: rgba(255, 255, 255, 0.05); border-radius: 24px; color: var(--text-muted);
    font-size: 14px; font-weight: 600; transition: 0.2s; border: 1px solid transparent;
}
.btn-comment svg { width: 18px; height: 18px; }
.btn-comment:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }

/* Кнопка Поделиться (Share) */
.btn-share {
    display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    background: rgba(255, 255, 255, 0.05); border-radius: 24px; color: var(--text-muted);
    font-size: 14px; font-weight: 600; transition: 0.2s; border: 1px solid transparent;
    border: none; cursor: pointer; margin-left: auto; /* Прижимает вправо, если нужно */
}
.btn-share:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }
.btn-share.copied { color: #22c55e; background: rgba(34, 197, 94, 0.1); } /* Зеленая при успехе */

/* Кнопка Назад (в посте) */
.back-nav { margin-bottom: 20px; }
.back-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
    font-weight: 600; color: var(--text-muted); font-size: 0.9rem; transition: all 0.2s ease;
}
.back-btn:hover {
    border-color: var(--text-main); color: var(--text-main);
    transform: translateX(-4px); /* Сдвиг влево */
}

/* --- ГАЛОЧКИ --- */
.verified-icon { vertical-align: text-bottom; margin-left: 4px; width: 14px; height: 14px; }
.verified-icon.gold { color: #eab308; fill: rgba(234,179,8,0.2); }
.verified-icon.blue { color: #3b82f6; fill: rgba(59,130,246,0.2); }
.verified-icon.gray { color: #a1a1aa; fill: rgba(161,161,170,0.2); }

/* --- ПРАВАЯ ПАНЕЛЬ --- */
.persona-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.persona-row {
    display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; transition: all 0.2s ease; margin-bottom: 6px; background: rgba(255,255,255,0.02);
}
.persona-row:hover { background: var(--bg-hover); transform: translateX(4px); }
.persona-row.active { background: rgba(255, 255, 255, 0.07); border-color: var(--active-color); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg-card); box-shadow: 0 0 0 1px #555; }
.dot.work { background: var(--color-work); box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); }
.dot.life { background: var(--color-life); box-shadow: 0 0 8px rgba(249, 115, 22, 0.6); }
.dot.anon { background: var(--color-anon); box-shadow: 0 0 8px rgba(168, 85, 247, 0.6); }
.p-data { flex: 1; }
.p-nick { font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.p-type { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

/* --- ПРОФИЛЬ --- */
.profile-header { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; position: relative; margin-bottom: 20px; }
.cover { height: 140px; background: linear-gradient(135deg, var(--bg-card) 0%, var(--active-color) 100%); opacity: 0.2; }
.profile-info { padding: 0 24px 24px; display: flex; gap: 20px; align-items: flex-end; margin-top: -50px; position: relative; }
.big-avatar {
    width: 100px; height: 100px; border-radius: 50%; border: 5px solid var(--bg-card); background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; color: var(--text-main); box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.profile-text { flex: 1; margin-bottom: 5px; }
.profile-text h1 { margin: 0; font-size: 1.8rem; font-weight: 800; display: flex; align-items: center; gap: 8px; line-height: 1; }
.profile-text h1 .verified-icon { width: 24px; height: 24px; }
.bio { color: var(--text-muted); margin-top: 8px; font-size: 0.95rem; max-width: 600px; }
.edit-profile-btn {
    background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 6px 16px;
    border-radius: 20px; cursor: pointer; font-size: 0.85rem; font-weight: 600; margin-top: 10px; transition: all 0.2s ease;
}
.edit-profile-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--text-main); color: white; }

/* --- КОММЕНТАРИИ --- */
.comments-section { margin-top: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.comments-section h3 { font-size: 1.1rem; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.comment-form { margin-bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; }
.comment-form textarea {
    width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; color: white; min-height: 70px; margin-bottom: 10px; font-size: 0.95rem; transition: 0.2s;
}
.comment-form textarea:focus { border-color: var(--text-muted); outline: none; background: #000; }
.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment { background: transparent; padding: 0; margin: 0; border-left: 2px solid var(--border); padding-left: 16px; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 0.85rem; }
.comment-header .verified-icon { width: 12px; height: 12px; }
.c-author { font-weight: 700; font-size: 0.9rem; }
.c-time { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }
.c-body { font-size: 0.95rem; color: #E2E2E2; line-height: 1.5; }
.edit-area { background: var(--bg-hover); padding: 12px; border-radius: 8px; margin-bottom: 15px; border: 1px dashed var(--border); }
.text-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-main); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; margin-top: 8px; transition: 0.2s; }
.text-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--text-muted); }

/* --- ГАЛЕРЕЯ --- */
.gallery { display: grid; gap: 4px; margin-top: 12px; border-radius: 12px; overflow: hidden; }
.gallery-item { background: #111; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-1 img { max-height: 500px; object-fit: contain; }
.gallery-2 { grid-template-columns: 1fr 1fr; height: 300px; }
.gallery-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-3 .gallery-item:first-child { grid-row: span 2; }
.gallery-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-5 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-5 .gallery-item:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.gallery-5 .gallery-item:nth-child(2) { grid-column: span 3; grid-row: span 2; }

/* --- ВЕРИФИКАЦИЯ --- */
.vere-container { max-width: 600px; margin: 0 auto; padding: 20px; }
.vere-header { text-align: center; margin-bottom: 30px; }
.badges-preview { display: flex; gap: 10px; margin-bottom: 20px; }
.badge-card { background: var(--bg-card); border: 1px solid var(--border); padding: 15px; flex: 1; border-radius: 12px; text-align: center; }
.vere-form input[type="text"], .vere-form select { width: 100%; padding: 12px; margin-bottom: 12px; background: var(--bg-input); border: 1px solid var(--border); color: white; border-radius: 8px; }
.vere-form input[type="file"] { background: var(--bg-hover); border: 2px dashed var(--border); border-radius: 8px; padding: 15px; width: 100%; color: var(--text-muted); cursor: pointer; margin-top: 5px; transition: 0.2s; }
.vere-form input[type="file"]:hover { border-color: var(--active-color); background: rgba(255,255,255,0.05); }
.vere-form input[type="file"]::file-selector-button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); padding: 8px 16px; border-radius: 6px; margin-right: 15px; cursor: pointer; font-weight: 600; }
.status-box { background: rgba(59,130,246,0.1); border: 1px solid #3b82f6; padding: 20px; border-radius: 12px; text-align: center; margin-bottom: 20px; }
.status-box.rejected { background: rgba(239,68,68,0.1); border-color: #ef4444; }

@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { display: none; } .sidebar-right { order: -1; position: static; margin-bottom: 20px; } .navbar { padding: 0 16px; } }
.hidden { display: none !important; }

:root {
    --bg-dark: #0f0f10;
    --card-bg: #161618;
    --text-main: #ffffff;
    --text-dim: #a1a1a6;
    --accent-gold: #ffb800;
    --accent-glow: rgba(255, 184, 0, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --btn-bg: rgba(255, 255, 255, 0.05);
}

/* Основной контейнер */
.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    max-width: 850px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Декоративное свечение на фоне (опционально) */
.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

/* Аватар */
.p-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-ph {
    width: 140px;
    height: 140px;
    border-radius: 40px; /* Мягкий квадрат */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(145deg, #1c1c1e, #111112) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Информация */
.p-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

/* Имя и корона */
.p-name {
    margin: 0;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.verified-icon.gold {
    width: 28px;
    height: 28px;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 12px rgba(255, 184, 0, 0.5));
    animation: crown-float 3s ease-in-out infinite;
}

@keyframes crown-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Описание/Био */
.p-bio {
    margin: 0;
    font-size: 18px;
    color: var(--text-dim);
    font-weight: 400;
    max-width: 400px;
    line-height: 1.4;
}

/* Кнопка редактирования */
.edit-btn {
    margin-top: 15px;
    padding: 12px 24px;
    width: fit-content;
    background: var(--btn-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.edit-btn:hover {
    background: var(--text-main);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.edit-btn:active {
    transform: translateY(-1px);
}

/* Адаптивность для мобильных */
@media (max-width: 650px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 50px 20px;
        gap: 25px;
        margin: 20px;
    }

    .p-info {
        align-items: center;
    }

    .p-name {
        font-size: 30px;
    }

    .avatar-ph {
        width: 120px;
        height: 120px;
        border-radius: 35px;
    }
}

/* --- АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА (Смартфоны) --- */
@media (max-width: 600px) {
    /* 1. Общий макет */
    .layout {
        display: flex;
        flex-direction: column;
        margin: 0 auto;
        padding: 0; /* Убираем боковые отступы у контейнера */
        gap: 0;
    }

    /* Скрываем боковые панели, чтобы не мешали (их можно вынести в бургер-меню) */
    .sidebar, .sidebar-right {
        display: none;
    }

    /* 2. Навигация */
    .navbar {
        padding: 0 12px;
        height: 50px;
    }
    .brand { font-size: 1.1rem; }
    .user-info span:not(.p-nick) { display: none; } /* Скрываем статус/тип в шапке */

    /* 3. Создание поста (Компактнее) */
    .create-box {
        margin: 8px;
        border-radius: 8px;
        padding: 12px;
    }
    .create-box input[type="text"] { padding: 10px; font-size: 0.95rem; }
    .create-box textarea { min-height: 70px; padding: 10px; }

    /* 4. Посты (На весь экран) */
    .post {
        margin-bottom: 8px;
        border-radius: 0; /* Посты "в край" экрана смотрятся лучше на мобильных */
        border-left: none;
        border-right: none;
        padding: 12px;
    }
    .post h3 { font-size: 1.1rem; }
    .post p { font-size: 0.95rem; }

    /* 5. Кнопки действий (Увеличиваем область нажатия) */
    .post-actions {
        justify-content: space-between; /* Распределяем кнопки */
        gap: 5px;
    }
    .vote-widget, .btn-comment, .btn-share {
        height: 40px; /* Кнопки повыше для пальцев */
        background: rgba(255, 255, 255, 0.07);
    }
    .v-count { font-size: 14px; }
    .btn-share span { display: none; } /* Прячем текст "Поделиться", оставляем иконку */

    /* 6. Галерея (Ограничение высоты) */
    .gallery-2, .gallery-3, .gallery-4, .gallery-5 {
        height: 250px; /* Снижаем высоту сеток, чтобы пост не занимал 3 экрана */
    }

    /* 7. Обновленный Профиль (Ваш премиум стиль) */
    .profile-header {
        margin: 0;
        border-radius: 0;
        flex-direction: column;
        text-align: center;
        padding: 30px 15px;
        gap: 15px;
        border-top: none;
    }

    .p-avatar .avatar-ph {
        width: 100px;
        height: 100px;
        font-size: 40px;
        border-radius: 28px;
    }

    .p-name {
        font-size: 26px;
        justify-content: center;
    }

    .p-bio {
        font-size: 15px;
        max-width: 100%;
    }

    .edit-btn {
        width: 100%; /* Кнопка на всю ширину */
        justify-content: center;
        display: flex;
    }

    /* 8. Комментарии */
    .comments-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 15px;
    }
    .comment {
        padding-left: 12px;
    }
}

/* Дополнительно для совсем маленьких экранов (iPhone SE и т.д.) */
@media (max-width: 380px) {
    .v-count { min-width: 20px; margin: 0 2px; }
    .btn-comment { padding: 0 10px; }
}

/* --- 1. ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    --bg-body: #030303;
    --bg-card: #1A1A1B;
    --bg-hover: #272729;
    --bg-input: #202021;
    --border: #343536;
    --text-main: #D7DADC;
    --text-muted: #818384;
    
    /* Цвета Личностей */
    --color-work: #3b82f6;
    --color-life: #f97316;
    --color-anon: #a855f7;
    
    /* Акценты */
    --accent-gold: #ffb800;
    --accent-glow: rgba(255, 184, 0, 0.15);
    --active-color: var(--text-main);
}

/* --- 2. СБРОС И БАЗА --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-y: scroll;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
button { font-family: inherit; outline: none; }

/* --- 3. НАВИГАЦИЯ --- */
.navbar {
    height: 56px;
    background: rgba(26, 26, 27, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- 4. СЕТКА (LAYOUT) --- */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    max-width: 1280px;
    margin: 24px auto;
    gap: 24px;
    padding: 0 16px;
}

.sidebar, .sidebar-right {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.menu-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    margin-bottom: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: var(--bg-hover); }
.nav-item.active { color: var(--text-main); font-weight: 700; }

/* --- 5. СОЗДАНИЕ ПОСТА --- */
.create-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.input-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-input);
    transition: 0.2s;
}

.create-box input[type="text"] {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    width: 100%;
}

.create-box textarea {
    background: transparent;
    border: none;
    padding: 14px;
    font-size: 1rem;
    min-height: 90px;
    width: 100%;
    color: var(--text-main);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pub-btn {
    background: var(--text-main); 
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
}

/* --- 6. ПОСТЫ --- */
.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.post h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text-main); }
.post p { font-size: 1rem; color: #E2E2E2; margin-bottom: 12px; }

/* Кнопки действий */
.post-actions { display: flex; align-items: center; gap: 12px; }

.vote-widget {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    height: 36px;
    padding: 0 4px;
}

.v-btn {
    background: none; border: none; color: var(--text-muted);
    width: 30px; height: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.btn-comment, .btn-share {
    display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    background: rgba(255, 255, 255, 0.05); border-radius: 24px; color: var(--text-muted);
    font-size: 14px; font-weight: 600;
}

/* --- 7. ПРЕМИУМ ПРОФИЛЬ (ПК) --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    max-width: 850px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
}

.avatar-ph {
    width: 140px; height: 140px; border-radius: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 56px; font-weight: 800;
    background: linear-gradient(145deg, #1c1c1e, #111112);
    border: 1px solid var(--border);
}

.p-name {
    font-size: 38px; font-weight: 800; display: flex; align-items: center; gap: 12px;
}

.verified-icon.gold {
    width: 28px; height: 28px; color: var(--accent-gold);
    filter: drop-shadow(0 0 12px rgba(255, 184, 0, 0.5));
}

.edit-btn {
    margin-top: 15px; padding: 12px 24px;
    background: var(--bg-hover); border: 1px solid var(--border);
    border-radius: 14px; color: var(--text-main); cursor: pointer;
}

/* --- 8. ГАЛЕРЕЯ --- */
.gallery { display: grid; gap: 4px; margin-top: 12px; border-radius: 12px; overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-1 img { max-height: 500px; object-fit: contain; }
.gallery-2 { grid-template-columns: 1fr 1fr; height: 300px; }
.gallery-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 400px; }
.gallery-3 .gallery-item:first-child { grid-row: span 2; }

/* --- 9. ПРАВАЯ ПАНЕЛЬ (ЛИЧНОСТИ) --- */
.persona-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.persona-row {
    display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer;
    margin-bottom: 6px; background: rgba(255,255,255,0.02); transition: 0.2s;
}
.persona-row:hover { background: var(--bg-hover); transform: translateX(4px); }
.persona-row.active { border: 1px solid var(--active-color); background: rgba(255,255,255,0.07); }
.dot { width: 14px; height: 14px; border-radius: 50%; }
.dot.work { background: var(--color-work); }
.dot.life { background: var(--color-life); }
.dot.anon { background: var(--color-anon); }

/* --- 10. КОММЕНТАРИИ --- */
.comments-section { margin-top: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.comment { border-left: 2px solid var(--border); padding-left: 16px; margin-bottom: 16px; }
.c-author { font-weight: 700; font-size: 0.9rem; }
.c-body { font-size: 0.95rem; color: #E2E2E2; }


/* ============================================================
   --- АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА ---
   ============================================================ */

/* Планшеты (до 900px) */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr; /* В одну колонку */
        gap: 16px;
    }
    .sidebar {
        display: none; /* Скрываем левое меню */
    }
    .sidebar-right {
        order: -1; /* Личности будут сверху над лентой */
        position: static;
        margin-bottom: 0;
    }
}

/* Телефоны (до 600px) */
@media (max-width: 600px) {
    /* Общий контейнер */
    .layout {
        padding: 0;
        margin: 0;
    }

    /* Навигация */
    .navbar {
        padding: 0 12px;
        height: 50px;
    }
    .user-info span:not(.p-nick) {
        display: none; /* Прячем лишний текст в шапке */
    }

    /* Создание поста */
    .create-box {
        margin: 10px;
        border-radius: 10px;
    }

    /* Посты */
    .post {
        margin-bottom: 8px;
        border-radius: 0; /* На телефонах посты "в край" выглядят лучше */
        border-left: none;
        border-right: none;
        padding: 12px 16px;
    }

    .post h3 { font-size: 1.1rem; }
    .post p { font-size: 0.95rem; }

    /* Кнопки действий (увеличиваем для удобства нажатия пальцем) */
    .post-actions {
        justify-content: space-between;
    }
    .vote-widget, .btn-comment, .btn-share {
        height: 42px; /* Выше кнопка */
        background: rgba(255, 255, 255, 0.08);
        flex: 1; /* Кнопки поровну */
        justify-content: center;
    }
    .btn-share span { display: none; } /* Оставляем только иконку */

    /* Галерея */
    .gallery-2, .gallery-3, .gallery-4, .gallery-5 {
        height: 260px; /* Уменьшаем высоту сеток, чтобы не занимать весь экран */
    }

    /* Профиль (Мобильная версия) */
    .profile-header {
        flex-direction: column; /* Элементы друг под другом */
        text-align: center;
        padding: 30px 20px;
        margin: 0;
        border-radius: 0;
        border-top: none;
        gap: 20px;
    }

    .avatar-ph {
        width: 100px;
        height: 100px;
        font-size: 42px;
        border-radius: 30px;
    }

    .p-name {
        font-size: 28px;
        justify-content: center;
    }

    .p-bio {
        font-size: 15px;
        max-width: 100%;
    }

    .edit-btn {
        width: 100%; /* Кнопка на всю ширину */
        margin-top: 10px;
    }

    /* Комментарии */
    .comments-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    /* Правая панель (Личности на мобилке) */
    .persona-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        background: var(--bg-body); /* Чтобы сливалось с фоном */
    }
    .persona-row {
        padding: 14px; /* Крупнее область клика */
    }
}

/* Совсем мелкие экраны */
@media (max-width: 380px) {
    .v-count { min-width: 20px; margin: 0 2px; }
    .btn-comment { padding: 0 8px; font-size: 12px; }
}

.hidden { display: none !important; }

:root {
    --bg-dark: #0f0f10;
    --card-bg: #161618;
    --text-main: #ffffff;
    --text-dim: #a1a1a6;
    --accent-gold: #ffb800;
    --accent-glow: rgba(255, 184, 0, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --btn-bg: rgba(255, 255, 255, 0.05);
}

/* Основной контейнер */
.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    max-width: 850px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Декоративное свечение на фоне (опционально) */
.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

/* Аватар */
.p-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-ph {
    width: 140px;
    height: 140px;
    border-radius: 40px; /* Мягкий квадрат */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(145deg, #1c1c1e, #111112) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Информация */
.p-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

/* Имя и корона */
.p-name {
    margin: 0;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.verified-icon.gold {
    width: 28px;
    height: 28px;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 12px rgba(255, 184, 0, 0.5));
    animation: crown-float 3s ease-in-out infinite;
}

@keyframes crown-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Описание/Био */
.p-bio {
    margin: 0;
    font-size: 18px;
    color: var(--text-dim);
    font-weight: 400;
    max-width: 400px;
    line-height: 1.4;
}

/* Кнопка редактирования */
.edit-btn {
    margin-top: 15px;
    padding: 12px 24px;
    width: fit-content;
    background: var(--btn-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.edit-btn:hover {
    background: var(--text-main);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.edit-btn:active {
    transform: translateY(-1px);
}

/* Адаптивность для мобильных */
@media (max-width: 650px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 50px 20px;
        gap: 25px;
        margin: 20px;
    }

    .p-info {
        align-items: center;
    }

    .p-name {
        font-size: 30px;
    }

    .avatar-ph {
        width: 120px;
        height: 120px;
        border-radius: 35px;
    }
}

/* --- 1. ПЕРЕМЕННЫЕ И БАЗА --- */
:root {
    --bg-body: #030303;
    --bg-card: #121212;
    --bg-hover: #1e1e1e;
    --border: #262626;
    --text-main: #ffffff;
    --text-muted: #a8a8a8;
    
    /* Цвета типов */
    --color-work: #3b82f6;
    --color-life: #f97316;
    --color-anon: #a855f7;
    
    /* Бейджи */
    --badge-gold: #ffb800;
    --badge-blue: #3b82f6;
    --badge-gray: #8e8e8e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }

/* --- 2. НАВИГАЦИЯ (ШАПКА) --- */
.navbar {
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.brand {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.badge-gold { color: var(--badge-gold); filter: drop-shadow(0 0 5px rgba(255,184,0,0.3)); }
.badge-blue { color: var(--badge-blue); }
.badge-gray { color: var(--badge-gray); }

/* --- 3. СЕТКА (ПК) --- */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
    padding: 20px;
}

.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.menu-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 4px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--bg-hover); color: var(--active-color); }

/* --- 4. ПРАВАЯ ПАНЕЛЬ (ЛИЧНОСТИ) --- */
.sidebar-right {
    position: sticky;
    top: 80px;
}

.persona-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
}

.persona-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 4px;
}

.persona-row:hover { background: var(--bg-hover); }
.persona-row.active { border: 1px solid var(--border); background: rgba(255,255,255,0.03); }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot.work { background: var(--color-work); box-shadow: 0 0 10px var(--color-work); }
.dot.life { background: var(--color-life); box-shadow: 0 0 10px var(--color-life); }
.dot.anon { background: var(--color-anon); box-shadow: 0 0 10px var(--color-anon); }

.p-nick { font-size: 0.9rem; font-weight: 700; }
.p-type { font-size: 0.7rem; color: var(--text-muted); }

/* --- 5. АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ (ТЕЛЕФОНЫ) --- */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 10px 0 80px 0; /* Отступ снизу под меню */
    }

    /* Скрываем заголовки и сообщества на мобилках в боковом меню */
    .sidebar .menu-title, 
    .sidebar .nav-item:nth-child(n+5) { 
        display: none; 
    }

    /* --- НИЖНЯЯ ПАНЕЛЬ (MOBILE NAV) --- */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: space-around;
        padding: 10px 5px;
        z-index: 1000;
        height: 65px;
    }

    .nav-item {
        flex-direction: column;
        padding: 5px;
        margin-bottom: 0;
        font-size: 0.65rem; /* Маленький текст под иконкой */
        gap: 4px;
        flex: 1;
        border-radius: 0;
        background: none !important;
    }

    .nav-item i {
        margin-right: 0 !important;
        width: 24px !important;
        height: 24px !important;
    }

    .nav-item.active {
        color: var(--active-color);
    }

    /* Правую панель на мобилках можно либо скрыть, либо перенести в конец ленты */
    .sidebar-right {
        padding: 0 15px;
    }

    .persona-card {
        border-radius: 15px;
    }

    /* Фикс для шапки на мобилках */
    .navbar {
        padding: 0 15px;
    }
}

/* --- 6. ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ КОНТЕНТА (БЛОКОВ) --- */
/* Стиль для страниц, которые вставляются в {% block content %} */
.feed {
    width: 100%;
}

@media (max-width: 600px) {
    .brand span { display: none; } /* Скрываем текст логотипа на очень узких экранах */
}

/* --- АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА --- */

@media (max-width: 768px) {
    /* 1. Общие контейнеры */
    .create-box, .post {
        margin: 10px 0; /* Уменьшаем внешние отступы */
        padding: 15px;  /* Чуть меньше внутренние отступы */
        border-radius: 0; /* На телефонах лучше смотрятся посты во всю ширину без скруглений по бокам */
        border-left: none;
        border-right: none;
    }

    /* 2. Форма создания поста */
    .create-box .controls {
        flex-direction: column; /* Ставим элементы управления друг под друга */
        align-items: stretch;
        gap: 12px;
    }

    .create-box select, 
    .file-btn, 
    .pub-btn {
        width: 100%; /* Кнопки и выбор сообщества на всю ширину */
        justify-content: center;
        padding: 12px; /* Увеличиваем область нажатия */
    }

    .preview-grid {
        grid-template-columns: repeat(3, 1fr); /* Сетка превью фото по 3 в ряд */
    }

    /* 3. Заголовки и текст */
    .post h3 {
        font-size: 1.1rem; /* Чуть меньше шрифт заголовка */
        margin: 8px 0;
    }

    .post p {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* 4. Мета-данные (автор, дата) */
    .post-meta {
        font-size: 12px; /* Мелкий шрифт для служебной инфы */
        flex-wrap: wrap; /* Если инфа не влезает, переносим на вторую строку */
    }

    /* 5. Галерея изображений */
    .gallery {
        gap: 4px; /* Меньше зазоры между фото */
        margin: 10px -15px; /* "Вытягиваем" фото до краев экрана */
    }
    
    .gallery-item img {
        border-radius: 0; /* Убираем скругления у фото, если они в край */
    }

    /* 6. Кнопки действий (лайки, комменты) */
    .post-actions {
        justify-content: space-between; /* Распределяем кнопки по краям */
        gap: 8px;
    }

    .vote-widget {
        background: rgba(255,255,255,0.08); /* Делаем виднее на темном фоне */
    }

    .v-btn {
        padding: 10px 14px; /* Увеличиваем для удобства попадания пальцем */
    }

    .btn-comment {
        background: rgba(255,255,255,0.05);
        flex-grow: 1; /* Кнопка комментариев занимает свободное место */
        justify-content: center;
    }
}

/* Дополнительно для совсем маленьких экранов (iPhone SE и т.д.) */
@media (max-width: 400px) {
    .post-meta span.comm-name {
        display: block; /* Сообщество сверху, автор снизу */
        width: 100%;
        margin-bottom: 4px;
    }
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */

@media (max-width: 768px) {
    /* 1. Общий макет */
    body {
        padding-top: 60px;    /* Место под верхнюю панель */
        padding-bottom: 70px; /* Место под нижнюю навигацию */
        background-color: #000; /* Обычно в соцсетях на мобилках фон темнее */
    }

    .layout {
        display: block; /* Отменяем сетку (grid/flex) */
        padding: 0;
    }

    /* 2. Верхняя панель (фиксируем сверху) */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        z-index: 1000;
        background: rgba(15, 15, 15, 0.9);
        backdrop-filter: blur(10px); /* Эффект стекла */
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }

    .user-info a[href="/logout"] {
        display: none; /* Прячем "Выход" в главном меню, чтобы не загромождать */
    }

    /* 3. Левая колонка превращается в НИЖНЕЕ МЕНЮ */
    /*.sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        width: 100% !important;
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(255,255,255,0.1);
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around;
        align-items: center;
        padding: 0 !important;
        z-index: 1000;
        margin: 0;
    }

    /* Скрываем лишние элементы в нижнем меню */
    .sidebar .menu-title, 
    .sidebar .nav-item[style*="cursor:pointer"], /* Скрываем список сообществ */
    .sidebar br {
        display: none !important;
    }

    .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column; /* Иконка над текстом */
        align-items: center;
        justify-content: center;
        font-size: 10px !important; /* Очень мелкий текст под иконкой */
        gap: 4px;
        padding: 10px 0 !important;
        border-radius: 0 !important;
        background: none !important;
    }

    .nav-item i {
        width: 24px !important;
        height: 24px !important;
    }

    .nav-item.active {
        color: var(--active-color) !important;
    }

    /* Специальная кнопка админа в мобилке */
    .nav-item[href="/admin"] span {
        display: none; /* Прячем текст "Заявки" */
    }

    /* 4. Центральная лента */
    .feed {
        width: 100% !important;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
    }

    /* 5. Правая колонка (переключатель персон) */
    /* Так как мы её скрыли через display: none, можно добавить 
       вызов переключателя персон в профиль. 
       Если она НУЖНА на мобилке, лучше сделать её выезжающей. 
       Пока оставляем скрытой, как в вашем коде. */
    .sidebar-right {
        display: none;
    }

    /* 6. Адаптация контента внутри постов */
    .post {
        margin-bottom: 8px !important;
        border-radius: 0 !important; /* Посты на весь экран */
    }

    /* Исправляем модалки или алерты, если есть */
    input, textarea, select {
        font-size: 16px !important; /* Чтобы iOS не зумил при фокусе */
    }
}

/* Улучшение для очень маленьких экранов */
@media (max-width: 380px) {
    .nav-item {
        font-size: 0; /* Скрываем текст, оставляем только иконки */
    }
    .nav-item i {
        width: 28px !important;
        height: 28px !important;
    }
}

/* --- СЕКЦИЯ КОММЕНТАРИЕВ --- */
.comments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* --- ФОРМА ОТПРАВКИ --- */
.comment-form {
    background: rgba(255, 255, 255, 0.03); /* Едва заметный фон */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 30px;
    transition: border-color 0.2s;
}

.comment-form:focus-within {
    border-color: var(--primary); /* Подсветка при вводе */
    background: rgba(255, 255, 255, 0.05);
}

.comment-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    resize: none; /* Убираем уголок растягивания */
    outline: none;
    min-height: 40px;
}

/* Панель кнопок под формой */
.comm-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Кнопки иконок (скрепка, галерея) */
.icon-btn {
    color: #888;
    cursor: pointer;
    background: transparent;
    border-radius: 50%;
    padding: 6px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Кнопка отправки */
.send-btn {
    margin-left: auto;
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.send-btn:hover {
    opacity: 0.9;
}

.send-btn:disabled {
    background: #444;
    cursor: not-allowed;
}

/* Превью загруженного файла */
#media-preview {
    margin-top: 10px;
}
#media-preview img {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- СПИСОК КОММЕНТАРИЕВ --- */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Расстояние между комментами */
}

.comment {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

/* Шапка коммента (Ник + время) */
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.c-author {
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}
.c-author:hover { opacity: 0.8; }

.c-time {
    color: #666;
    font-size: 12px;
}

/* Тело комментария */
.c-body {
    color: #e0e0e0;
    font-size: 15px;
    line-height: 1.5;
    padding-left: 0; /* Можно добавить отступ, если хочешь лесенку */
    word-break: break-word;
}

/* Вложения в комментарии */
.c-attachment {
    margin-top: 10px;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

.c-attachment img, 
.c-attachment video {
    display: block;
    max-width: 100%;
    max-height: 300px; /* Ограничение высоты */
    object-fit: contain; /* Чтобы картинка не обрезалась */
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптив для мобилок */
@media (max-width: 600px) {
    .comment-form { padding: 10px; }
    .c-attachment img, .c-attachment video { max-height: 250px; }
}

/* --- ОСНОВНОЙ КОНТЕЙНЕР --- */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e6eb; /* Светлый текст */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.comments-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 700;
}

/* --- ФОРМА ОТПРАВКИ (КАПСУЛА) --- */
.comment-form {
    background: rgba(255, 255, 255, 0.05); /* Легкий фон */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 25px;
    transition: all 0.2s ease;
}

.comment-form:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: #3b82f6; /* Цвет подсветки (можно заменить на var(--primary)) */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 40px;
    line-height: 1.4;
}

.comment-form textarea::placeholder {
    color: #aaa;
}

/* ПАНЕЛЬ КНОПОК */
.comm-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ИКОНКИ (Скрепка, Галерея) */
.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* КНОПКА ОТПРАВИТЬ */
.send-btn {
    margin-left: auto; /* Прижимает кнопку вправо */
    background: #3b82f6; /* Замени на var(--primary) если есть */
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ПРЕВЬЮ ЗАГРУЗКИ */
#media-preview img {
    max-height: 80px;
    border-radius: 8px;
    margin-top: 5px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* --- СПИСОК КОММЕНТАРИЕВ --- */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease-out;
}

.comment:last-child {
    border-bottom: none;
}

/* ШАПКА КОММЕНТАРИЯ */
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.c-author {
    font-weight: 700;
    text-decoration: none;
    /* Цвет задается инлайново через style="color:var(--color-life)" */
}

.c-author:hover {
    text-decoration: underline;
}

.verified-icon {
    width: 14px;
    height: 14px;
    color: #a1a1aa; /* Цвет галочки */
}

.c-time {
    font-size: 12px;
    color: #6b7280; /* Серый для времени */
    margin-left: auto; /* Время справа или 0 если хочешь слева */
}

/* ТЕЛО КОММЕНТАРИЯ */
.c-body {
    padding-left: 0; /* Или можно добавить отступ, если хочешь древовидный вид */
}

.c-text {
    font-size: 15px;
    line-height: 1.5;
    color: #e4e6eb;
    white-space: pre-wrap; /* Сохраняет переносы строк */
    word-break: break-word; /* Переносит длинные слова */
    margin-bottom: 8px;
}

/* КОНТЕЙНЕР ВЛОЖЕНИЯ (Медиа) */
.c-attachment {
    display: block;
    width: fit-content;
    max-width: 400px; /* Ограничение ширины на десктопе */
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.c-attachment img,
.c-attachment video {
    display: block;
    width: 100%;
    max-height: 400px; /* Ограничение высоты */
    object-fit: contain; /* Картинка/видео целиком */
}

/* АНИМАЦИЯ ПОЯВЛЕНИЯ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* МОБИЛЬНЫЙ АДАПТИВ */
@media (max-width: 600px) {
    .c-attachment {
        max-width: 100%; /* На телефоне на всю ширину */
        border-radius: 8px;
    }
    
    .comment-form {
        padding: 10px;
    }
}

/* --- СТИЛИ MARKDOWN --- */

/* Общие настройки текста */
.md-content {
    font-size: 15px;
    line-height: 1.6;
    color: #e4e6eb;
    word-wrap: break-word;
}

/* Убираем лишние отступы у первого и последнего элемента */
.md-content > *:first-child { margin-top: 0; }
.md-content > *:last-child { margin-bottom: 0; }

/* Ссылки */
.md-content a {
    color: #3b82f6;
    text-decoration: none;
}
.md-content a:hover {
    text-decoration: underline;
}

/* Цитаты (> текст) */
.md-content blockquote {
    border-left: 4px solid var(--primary); /* Цветная полоска слева */
    background: rgba(255, 255, 255, 0.05);
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 0 8px 8px 0;
    color: #b0b3b8;
    font-style: italic;
}

/* Код в строке (`код`) */
.md-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #ff79c6; /* Розоватый цвет как в редакторах */
}

/* Блок кода (``` код ```) */
.md-content pre {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto; /* Прокрутка если длинная строка */
    margin: 10px 0;
    border: 1px solid #333;
}
.md-content pre code {
    background: none;
    padding: 0;
    color: #f8f8f2;
    font-size: 13px;
}

/* Заголовки (# Заголовок) */
.md-content h1, .md-content h2, .md-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #fff;
}
.md-content h1 { font-size: 1.4em; border-bottom: 1px solid #333; padding-bottom: 5px; }
.md-content h2 { font-size: 1.2em; }
.md-content h3 { font-size: 1.1em; }

/* Списки (- пункт) */
.md-content ul, .md-content ol {
    margin: 10px 0;
    padding-left: 25px;
}
.md-content li {
    margin-bottom: 5px;
}

/* Основной контейнер иконки */
.lucide-layers-animated {
    overflow: visible; /* Чтобы слои не обрезались при движении */
}

/* Настройки для каждого пути */
.l-top, .l-mid, .l-bot {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 1. ПОСТОЯННАЯ АНИМАЦИЯ (Эффект парения) */
@keyframes floatTop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes floatMid {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

.l-top { animation: floatTop 3s ease-in-out infinite; }
.l-mid { animation: floatMid 3s ease-in-out infinite; animation-delay: 0.2s; }

/* 2. ЭФФЕКТ ПРИ НАВЕДЕНИИ (Раздвигание) */
.brand:hover .l-top {
    transform: translateY(-5px); /* Верхний уходит сильно вверх */
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.brand:hover .l-mid {
    transform: translateY(-2px); /* Средний чуть приподнимается */
}

.brand:hover .l-bot {
    transform: translateY(1px); /* Нижний чуть опускается */
}

/* Если нужно, чтобы при наведении иконка становилась ярче */
.brand:hover .lucide-layers-animated {
    filter: brightness(1.2);
}

/* Стили для контейнера бренда */
.brand {
    display: flex;
    align-items: center;
    gap: 12px; /* Расстояние между иконкой и текстом */
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s var(--transition-bezier);
    user-select: none;
}

/* Эффект при наведении на весь логотип */
.brand:hover {
    transform: translateX(4px); /* Мягкое смещение вправо */
}

/* Контейнер иконки с эффектом свечения */
.brand-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--active-color);
    transition: all var(--transition-speed) var(--transition-bezier);
}

.brand-icon-box i {
    width: 24px;
    height: 24px;
    stroke-width: 2.5px; /* Делаем линии иконки чуть выразительнее */
    filter: drop-shadow(0 0 8px var(--active-color-transparent));
    transition: transform 0.5s var(--transition-bezier);
}

/* Анимация иконки при наведении */
.brand:hover .brand-icon-box i {
    transform: rotate(-15deg) scale(1.1); /* Иконка игриво наклоняется */
    filter: drop-shadow(0 0 15px var(--active-color));
}

/* Стильный шрифт для названия */
.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px; /* Плотное написание выглядит премиальнее */
    color: #ffffff; /* Или ваш основной цвет текста */
    background: linear-gradient(135deg, #fff 60%, var(--active-color) 150%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all var(--transition-speed) ease;
}

/* Легкое подсвечивание текста при наведении */
.brand:hover .brand-name {
    letter-spacing: 0px; /* Текст слегка "дышит" */
    opacity: 0.9;
}

/* Небольшой декоративный элемент (опционально) */
.brand::after {
    content: '';
    width: 0;
    height: 2px;
    background: var(--active-color);
    position: absolute;
    bottom: -4px;
    left: 40px;
    transition: width 0.3s var(--transition-bezier);
    border-radius: 2px;
}

.brand:hover::after {
    width: calc(100% - 40px);
}

/* --- Стили для превью загружаемых файлов --- */
.preview-grid {
    display: grid;
    /* Создает адаптивную сетку: квадратики минимум по 100px */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
    gap: 8px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1 / 1; /* Делает превью квадратным */
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Обрезает картинку, чтобы заполнить квадрат без искажений */
    display: block;
}

.preview-item-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    color: #aaa;
    font-size: 12px;
    flex-direction: column;
    text-align: center;
    padding: 5px;
}

/* --- СТИЛИ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ --- */
@media (max-width: 650px) {
    /* 1. Общие отступы контейнера */
    .create-box, .post {
        margin-left: 5px;
        margin-right: 5px;
        padding: 12px 10px; /* Немного компактнее */
        border-radius: 8px; /* Округляем для современного вида */
    }

    /* 2. Адаптация формы создания поста */
    .controls {
        display: flex;
        flex-direction: column; /* Элементы в колонку */
        gap: 12px;
    }

    .action-buttons-row {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Кнопки Архив и Медиа в ряд */
        gap: 8px;
    }

    .pub-btn {
        grid-column: span 2; /* Кнопка "Пост" на всю ширину под ними */
        width: 100%;
        padding: 12px; /* Увеличиваем зону клика */
        font-size: 16px;
    }

    .file-btn {
        justify-content: center;
        padding: 10px;
    }

    .file-btn .btn-text {
        font-size: 13px; /* Уменьшаем текст, чтобы влезло */
    }

    /* 3. Шапка поста (Мета-данные) */
    .post-header {
        flex-direction: column; /* Опции удаления под имя, если мало места */
        gap: 8px;
    }

    .post-meta {
        font-size: 13px;
        flex-wrap: wrap; /* Чтобы длинные ники не ломали верстку */
        line-height: 1.5;
    }

    .post-options {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    /* 4. Контент поста */
    .post-link h3 {
        font-size: 17px; /* Чуть меньше заголовок на мобилках */
        margin-top: 5px;
    }

    .md-content {
        font-size: 14px;
        line-height: 1.5;
    }

    /* 5. Галерея и видео */
    .gallery-2, .gallery-3, .gallery-4 {
        grid-template-columns: repeat(2, 1fr); /* Не больше 2 колонок */
    }

    .video-container video {
        max-height: 350px; /* Чтобы видео не занимало весь экран */
    }

    /* 6. Кнопки действий (Лайки/Комменты) */
    .post-actions {
        justify-content: space-between; /* Растягиваем по краям */
        gap: 0;
    }

    .vote-widget {
        scale: 1.1; /* Чуть увеличиваем для удобства попадания */
    }

    .btn-comment {
        padding: 10px 8px; /* Увеличиваем область касания */
    }

    .btn-comment span {
        font-size: 12px;
    }

    /* 7. Модальные окна */
    .modal-content {
        width: 96% !important;
        margin: 10px auto !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .report-modal-box {
        width: 96%;
    }

    .radio-item {
        padding: 14px 10px; /* Большие кнопки выбора для пальцев */
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки в архиве */
    }

    /* 8. RT-уведомления */
    #rt-notifications-container {
        top: 10px;
        width: 95%;
    }
    
    .rt-alert {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* Фикс для очень маленьких экранов (iPhone SE и т.д.) */
@media (max-width: 380px) {
    .action-buttons-row {
        grid-template-columns: 1fr; /* Все кнопки в столбик */
    }
    .pub-btn {
        grid-column: span 1;
    }
    .post-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ==================== ПРОФИЛЬ: ОБЩЕЕ ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.avatar-ph {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    border: 3px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.p-info {
    flex: 1;
}

.p-name {
    font-size: 28px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.p-bio {
    color: #bbb;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 600px;
}

.edit-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.edit-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ==================== СТАТИСТИКА И XP (WOW EFFECT) ==================== */
.profile-stats-container {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

/* Фоновый декоративный элемент */
.profile-stats-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    z-index: 1;
}

.stat-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 32px;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* --- РАНГ И АНИМАЦИИ --- */
.main-stat .stat-num {
    /* Тень для цифры кармы, цвет передается через inline style */
    filter: drop-shadow(0 0 10px currentColor);
}

.rank-pill {
    position: relative;
    margin-top: 12px;
    color: #fff;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
    
    /* Анимация появления */
    opacity: 0; 
    animation: popInBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.3s;
}

/* Свечение позади ранга */
.rank-pill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
    border-radius: 30px;
    filter: blur(15px);
    opacity: 0.6;
    z-index: -1;
    animation: pulseGlow 3s infinite ease-in-out;
}

/* --- XP BAR --- */
.xp-wrapper {
    position: relative;
    z-index: 1;
    padding: 0 10px;
}

.xp-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #ddd;
    font-weight: 600;
}

.xp-percent-text {
    font-family: 'Courier New', monospace; /* Моноширинный для цифр */
    font-weight: bold;
    color: white;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    width: 0%; /* JS изменит это */
    transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

/* Эффект блика (Shimmer) на полоске */
.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(
        90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.4) 50%, 
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-20deg) translateX(-150%);
    animation: shimmer 2.5s infinite;
}

.xp-limits {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #555;
    font-family: monospace;
    opacity: 0.7;
}

/* ==================== АНИМАЦИИ (Keyframes) ==================== */

@keyframes popInBounce {
    0% { transform: scale(0) translateY(20px); opacity: 0; }
    70% { transform: scale(1.1) translateY(-5px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes pulseGlow {
    0% { opacity: 0.4; filter: blur(15px); }
    50% { opacity: 0.7; filter: blur(20px); }
    100% { opacity: 0.4; filter: blur(15px); }
}

@keyframes shimmer {
    0% { transform: skewX(-20deg) translateX(-150%); }
    20% { transform: skewX(-20deg) translateX(150%); } /* Блик пробегает быстро */
    100% { transform: skewX(-20deg) translateX(150%); } /* Пауза */
}

/* ==================== ПОСТЫ И ЛЕНТА ==================== */
.mini-rank {
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid;
    border-radius: 4px;
    opacity: 0.9;
    font-weight: 800;
    margin-left: 4px;
    vertical-align: middle;
}

.verified-icon.gold { color: #eab308; filter: drop-shadow(0 0 5px rgba(234,179,8,0.5)); }
.verified-icon.blue { color: #3b82f6; filter: drop-shadow(0 0 5px rgba(59,130,246,0.5)); }
.verified-icon.gray { color: #a1a1aa; }

/* ==================== ДЕЙСТВИЯ (Кнопки) ==================== */
.post-actions { display: flex; gap: 15px; align-items: center; margin-top: 12px; }
.vote-widget { display: flex; align-items: center; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 20px; padding: 2px; }
.v-btn { background: none; border: none; color: #888; cursor: pointer; padding: 6px 10px; display: flex; align-items: center; border-radius: 50%; transition: 0.2s;}
.v-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.v-count { font-weight: bold; font-size: 14px; min-width: 25px; text-align: center; color: #fff; }
.btn-comment { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: #888; text-decoration: none; padding: 6px 12px; transition: 0.2s; border-radius: 8px;}
.btn-comment:hover { color: white; background: rgba(255,255,255,0.05); }

/* ==================== МОДАЛЬНОЕ ОКНО ЖАЛОБЫ ==================== */
.report-modal-overlay { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); backdrop-filter: blur(8px); }
.report-content { background-color: #1a1a1a; margin: 10% auto; padding: 0; width: 90%; max-width: 450px; border-radius: 16px; border: 1px solid #333; box-shadow: 0 25px 60px rgba(0,0,0,0.8); overflow: hidden; animation: slideInModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes slideInModal { from {transform: translateY(30px) scale(0.95); opacity: 0;} to {transform: translateY(0) scale(1); opacity: 1;} }

.report-header { padding: 20px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); }
.report-header h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; color: #e4e6eb; }
.close-btn { font-size: 28px; cursor: pointer; color: #888; line-height: 20px; transition: 0.2s; }
.close-btn:hover { color: white; transform: rotate(90deg); }

.report-body { padding: 25px; }
.radio-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.radio-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.03); cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.radio-item:hover { background: rgba(255,255,255,0.08); transform: translateX(5px); }
.radio-item input:checked + span { color: var(--primary, #e4e6eb); font-weight: bold; }
.radio-item:has(input:checked) { border-color: var(--primary, #555); background: rgba(255,255,255,0.08); }

#report-details { width: 100%; background: #0f0f0f; border: 1px solid #333; color: white; padding: 15px; border-radius: 10px; resize: none; font-family: inherit; margin-bottom: 25px; box-sizing: border-box; outline: none; transition: 0.2s; }
#report-details:focus { border-color: #666; background: #141414; }

.report-actions { display: flex; gap: 12px; justify-content: flex-end; }
.cancel-btn { background: transparent; border: none; color: #aaa; cursor: pointer; padding: 12px 20px; font-weight: 600; transition: 0.2s; }
.cancel-btn:hover { color: white; }
.submit-rep-btn { background: #ef4444; color: white; border: none; padding: 12px 24px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: 0.2s; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); }
.submit-rep-btn:hover { background: #dc2626; transform: scale(1.05); }