@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-dark:       #0d0d0d;
    --bg-panel:      #141414;
    --bg-card:       #1c1c1c;
    --border:        #2e2e2e;
    --border-bright: #4a4a4a;
    --gold:          #c9a84c;
    --gold-light:    #e8c97a;
    --gold-dim:      #6b5428;
    --text-primary:  #e8dcc8;
    --text-muted:    #7a6f60;
    --shadow:        0 8px 32px rgba(0,0,0,0.6);
    --radius:        12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px;
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 1080px;
    margin: 0 auto;
}

.header .logo {
    font-size: 1.4rem;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(201, 168, 76, 0.3);
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--gold-light);
}

/* Навигация SPA */
.nav-bar {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 66px; /* высота хедера примерно */
    z-index: 90;
}

.nav-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-link {
    flex: 1;
    text-align: center;
    padding: 14px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1200;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.btn:disabled {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold-light);
}

.btn-outline:hover {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold-light);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Карточки */
.card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

/* Лента */
.feed {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.post {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.post-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.post-author {
    font-weight: 600;
    color: var(--gold-light);
    font-size: 15px;
}

.post-date {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.post-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    background: #000;
    border-bottom: 1px solid var(--border);
}

.post-caption {
    padding: 20px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Формы */
.post-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    border: 1px dashed var(--gold-dim);
    border-radius: 8px;
    padding: 20px;
    color: var(--gold);
    cursor: pointer;
    transition: background 0.2s;
}

.file-input-wrapper:hover {
    background-color: #1f1a0e;
    border-color: var(--gold);
}

.file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
}

.text-input, textarea {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: border-color 0.2s;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.text-input:focus, textarea:focus {
    outline: none;
    border-color: var(--gold-dim);
}

.text-input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

/* Профиль */
.profile-card {
    text-align: center;
    padding: 40px 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dim), var(--bg-card));
    margin: 0 auto 16px auto;
    border: 2px solid var(--gold);
}

.profile-name {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.profile-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Утилиты */
.error-container {
    text-align: center;
    margin-top: 60px;
}

.login-card {
    text-align: center;
    margin-top: 60px;
    padding: 40px 24px;
}

.login-card h2 {
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 2px;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }
    
    .card {
        padding: 16px;
    }

    .header {
        padding: 16px 12px;
    }

    .nav-link {
        padding: 12px 8px;
        font-size: 13px;
    }

    .header .logo {
        font-size: 1.2rem;
    }

    .post-caption {
        padding: 16px;
        font-size: 14px;
    }
}
.video-container {
    width: 100%;
    max-width: 360px; /* Ограничиваем ширину для вертикальных видео */
    aspect-ratio: 9 / 16;
    margin: 15px auto;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.tiktok-container {
    width: 100%;
    max-width: 360px;
    margin: 15px auto;
    display: flex;
    justify-content: center;
}

/* Панель чипсов каналов над лентой */
.channels-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    flex: 1;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.chips-scroll::-webkit-scrollbar {
    display: none;
}

.channel-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.channel-chip:hover {
    border-color: var(--gold-dim);
    color: var(--gold-light);
    background-color: var(--bg-card);
}

.channel-chip.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1200;
    font-weight: 700;
    border-color: var(--gold);
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.25);
}

.search-channels-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--gold-light);
    text-decoration: none;
    font-size: 15px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.search-channels-btn:hover {
    border-color: var(--gold);
    background-color: #242017;
    transform: scale(1.05);
}

/* Баннер активного канала */
.channel-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1c180e, var(--bg-panel));
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    gap: 12px;
}

.channel-banner-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.channel-hash {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold);
    font-size: 22px;
    font-weight: 700;
    border: 1px solid var(--gold-dim);
    flex-shrink: 0;
}

.channel-banner-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

/* Шапка поста с аватаром и каналом */
.post-author-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dim), #2a2215);
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gold-light);
    font-size: 14px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.post-author-info {
    display: flex;
    flex-direction: column;
}

.post-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-channel-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: var(--gold-light);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.post-channel-badge:hover {
    background: rgba(201, 168, 76, 0.25);
    border-color: var(--gold);
    color: #fff;
}

/* Каталог каналов и поиск */
.channels-top-card {
    padding: 16px 20px;
    margin-bottom: 20px;
}

.channels-search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 15px;
    pointer-events: none;
    opacity: 0.7;
}

.search-field {
    padding-left: 42px !important;
    padding-right: 36px !important;
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

.search-clear-btn:hover {
    color: var(--text-primary);
}

.slug-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.slug-prefix {
    position: absolute;
    left: 14px;
    color: var(--gold);
    font-weight: 700;
    pointer-events: none;
}

.slug-input-wrapper input {
    padding-left: 32px !important;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.select-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c9a84c'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 40px;
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.channel-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-card:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.channel-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.channel-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.channel-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-dim), #241c0f);
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-light);
    flex-shrink: 0;
}

.channel-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
}

.channel-card-slug {
    font-size: 13px;
    color: var(--gold);
    font-weight: 600;
}

.channel-card-desc {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.channel-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.channel-card-stats {
    font-size: 13px;
    color: var(--text-muted);
}

/* =========================================================
   TELEGRAM-STYLE LAYOUT
   ========================================================= */
.tg-app-wrapper {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
}

.tg-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

/* Левая колонка (Sidebar со списком каналов) */
.tg-sidebar {
    width: 320px;
    flex-shrink: 0;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 106px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tg-sidebar-header {
    padding: 12px 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-panel);
}

.tg-search-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.tg-search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    opacity: 0.6;
    pointer-events: none;
}

.tg-search-input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 18px;
    padding: 7px 28px 7px 30px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.tg-search-input:focus {
    border-color: var(--gold-dim);
}

.tg-create-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1200;
    font-size: 20px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tg-create-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3);
}

.tg-channels-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tg-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.tg-channel-item:hover {
    background: rgba(201, 168, 76, 0.06);
}

.tg-channel-item.active {
    background: rgba(201, 168, 76, 0.12);
    border-left: 3px solid var(--gold);
}

.tg-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-dim), #1f180d);
    border: 1px solid var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-light);
    flex-shrink: 0;
}

.tg-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tg-item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.tg-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-channel-item.active .tg-item-name {
    color: var(--gold-light);
}

.tg-item-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tg-badge-creator {
    background: rgba(201, 168, 76, 0.2);
    color: var(--gold-light);
    border: 1px solid var(--gold-dim);
}

.tg-badge-member {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.tg-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Правая колонка (Лента и чат) */
.tg-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tg-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    gap: 12px;
}

.tg-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tg-back-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--gold-light);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: -4px;
}

.tg-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-dim), #241c0f);
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-light);
    flex-shrink: 0;
}

.tg-header-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tg-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.badge-creator {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-light);
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid var(--gold-dim);
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Форма публикации */
.tg-compose-card {
    padding: 18px 20px;
    margin-bottom: 0;
}

.compose-media-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compose-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.compose-row .text-input {
    flex: 1;
}

.file-input-compact {
    padding: 10px 16px;
    white-space: nowrap;
    font-size: 13px;
    flex-shrink: 0;
}

.compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.compose-target-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Уведомление для подписчиков чужого канала */
.tg-subscriber-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-panel);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.notice-icon {
    font-size: 26px;
    flex-shrink: 0;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal-card {
    width: 100%;
    max-width: 480px;
    margin: 0;
    background-color: var(--bg-panel);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Контейнеры видов (чат / уведомления) */
.tg-view-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Разделитель категорий в сайдбаре */
.tg-sidebar-divider {
    padding: 12px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4px;
}

/* Бейдж непрочитанных */
.tg-badge-unread {
    background: #a93226;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px rgba(169, 50, 38, 0.6);
}

/* Упоминания (@username) в постах и шапках */
.mention-link {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
    border-radius: 4px;
    padding: 1px 3px;
    margin: -1px -3px;
}

.mention-link:hover {
    color: #ffffff;
    background: rgba(201, 168, 76, 0.25);
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}

/* Анимация подсветки поста при переходе из уведомлений */
@keyframes postHighlightGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.9);
        border-color: var(--gold-light);
        background-color: rgba(201, 168, 76, 0.15);
    }
    40% {
        box-shadow: 0 0 35px 8px rgba(201, 168, 76, 0.6);
        border-color: var(--gold);
        background-color: rgba(201, 168, 76, 0.08);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        border-color: var(--border);
        background-color: var(--bg-panel);
    }
}

.post-highlighted {
    animation: postHighlightGlow 3s ease-out forwards;
}

/* Список уведомлений */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    display: flex;
    gap: 14px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.notification-card:hover {
    border-color: var(--gold-dim);
    background-color: #1a1814;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(201, 168, 76, 0.15);
}

.notification-card.is-unread {
    border-left: 4px solid var(--gold);
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.08) 0%, var(--bg-panel) 100%);
}

.notif-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-dim), #1f180d);
    border: 1px solid var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-light);
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notif-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.notif-sender {
    font-weight: 700;
    font-size: 14px;
    color: var(--gold-light);
}

.notif-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.notif-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.notif-channel-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-jump-hint {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
}

.notifications-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    background-color: var(--bg-panel);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.notifications-empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.8;
}

/* Модальное окно профиля пользователя */
.profile-modal-card {
    max-width: 440px;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #1a1200;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
    flex-shrink: 0;
}

.profile-meta-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-username {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
}

.profile-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-stat-box {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.profile-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-light);
}

.profile-stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.profile-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.profile-channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.profile-channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.profile-channel-item:hover {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
}

.profile-channel-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gold-light);
}

.profile-channel-stats {
    font-size: 12px;
    color: var(--text-muted);
}

/* Бейджи статусов пользователей (Супер Админ - синий, Админ - зеленый) */
.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    vertical-align: middle;
}

.role-superadmin {
    background: rgba(21, 101, 192, 0.22);
    color: #64b5f6;
    border: 1px solid #1976d2;
    box-shadow: 0 0 10px rgba(25, 118, 210, 0.4);
}

.role-admin {
    background: rgba(46, 125, 50, 0.22);
    color: #81c784;
    border: 1px solid #2e7d32;
    box-shadow: 0 0 10px rgba(46, 125, 50, 0.4);
}

/* Действия над постом (кнопка удаления) */
.post-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-delete-post {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s, transform 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-post:hover {
    color: #ff5252;
    background-color: rgba(255, 82, 82, 0.15);
    transform: scale(1.1);
}

.post-deleting {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Управление ролями в модальном окне профиля */
.profile-role-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.profile-admin-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-grant-admin {
    background: rgba(46, 125, 50, 0.25);
    border: 1px solid #2e7d32;
    color: #81c784;
}
.btn-grant-admin:hover {
    background: rgba(46, 125, 50, 0.4);
    color: #a5d6a7;
    box-shadow: 0 0 14px rgba(46, 125, 50, 0.4);
}

.btn-revoke-admin {
    background: rgba(198, 40, 40, 0.2);
    border: 1px solid #c62828;
    color: #ef9a9a;
}
.btn-revoke-admin:hover {
    background: rgba(198, 40, 40, 0.35);
    color: #ffcdd2;
    box-shadow: 0 0 14px rgba(198, 40, 40, 0.4);
}

/* Мобильная адаптация Telegram (max-width: 768px) */
@media (max-width: 768px) {
    .tg-layout {
        gap: 0;
    }

    .tg-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        box-shadow: none;
    }

    .tg-main-content {
        width: 100%;
    }

    /* Когда открыт список каналов на мобилке */
    .mobile-view-channels .tg-sidebar {
        display: flex;
    }
    .mobile-view-channels .tg-main-content {
        display: none !important;
    }

    /* Когда открыт чат/лента на мобилке */
    .mobile-view-chat .tg-sidebar {
        display: none !important;
    }
    .mobile-view-chat .tg-main-content {
        display: flex !important;
    }
    .mobile-view-chat .tg-back-btn {
        display: inline-flex !important;
    }

    .compose-row {
        flex-direction: column;
        align-items: stretch;
    }
}