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

:root {
    --bg: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f0f0f0;
    --border: #e0e0e0;
    --text: #000000;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #000000;
    --accent-text: #ffffff;
    --accent-hover: #333333;
    --danger: #ff3b30;
    --online: #31a24c;
    --font-size: 14px;
    --font-weight: 400;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --border: #333333;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #ffffff;
    --accent-text: #000000;
    --accent-hover: #cccccc;
    --danger: #ff453a;
    --online: #31a24c;
}

html, body {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    font-weight: var(--font-weight);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background-color 0.3s, color 0.3s;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
    font-family: var(--font-family);
    font-size: var(--font-size);
}

.logo {
    font-weight: 300;
    letter-spacing: -1px;
}

.logo span {
    font-weight: 700;
}

/* ===== ЭКРАН АВТОРИЗАЦИИ ===== */
.auth-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    background: var(--bg);
}

.auth-container {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--border);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
    color: var(--text);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    background: var(--bg);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 10px;
    font-family: var(--font-family);
    transition: all 0.3s;
}

.auth-tabs button.active {
    background: var(--accent);
    color: var(--accent-text);
}

.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-container input {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s;
}

.auth-container input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-container button {
    padding: 14px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-family);
    transition: background 0.3s;
}

.auth-container button:hover {
    background: var(--accent-hover);
}

.guest-btn {
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    margin-top: 12px;
    width: 100%;
}

/* ===== ВЕРХНЯЯ ПАНЕЛЬ ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
}

.top-bar h1 {
    font-size: 20px;
    flex: 1;
    text-align: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--bg-secondary);
}

/* ===== КОНТЕНТ ===== */
.content {
    margin-top: 56px;
    padding: 12px;
    padding-bottom: 90px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px 0;
}

.page-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    text-align: center;
}

/* ===== НИЖНЯЯ ПАНЕЛЬ ===== */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
    height: 64px;
    align-items: stretch;
}

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 10px;
    padding: 6px 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
}

.bottom-nav-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.bottom-nav-btn.active {
    color: var(--text);
}

.bottom-nav-btn.active svg {
    stroke-width: 2.4;
}

.bottom-nav-btn.create-btn {
    flex: 0 0 auto;
    margin: 0 6px;
    background: transparent;
    padding: 0;
}

.bottom-nav-btn.create-btn svg {
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 50%;
    padding: 10px;
    width: 24px;
    height: 24px;
    box-sizing: content-box;
    display: block;
    flex-shrink: 0;
}

/* ===== ПОИСК ===== */
.search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    z-index: 400;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    overflow-y: auto;
}

.search-overlay.show { display: block; }

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 15px;
}

.search-box input:focus { outline: none; border-color: var(--accent); }

.search-results { display: flex; flex-direction: column; gap: 8px; }

.search-section { margin-bottom: 16px; }

.search-section h4 {
    font-size: 13px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.search-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; background: var(--bg-secondary);
    border-radius: 12px; cursor: pointer;
}

.search-item:hover { background: var(--bg-tertiary); }
.search-item img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.search-item-info { flex: 1; min-width: 0; }
.search-item-title { font-weight: 500; font-size: 14px; }
.search-item-sub { font-size: 12px; color: var(--text-muted); }
.search-empty { text-align: center; padding: 40px; color: var(--text-muted); }

/* ===== УПОМИНАНИЯ И ХЕШТЕГИ ===== */
.mention {
    color: #1DA1F2;
    font-weight: 500;
    cursor: pointer;
}

.mention:hover { text-decoration: underline; }

[data-theme="dark"] .mention { color: #4DB8FF; }

.hashtag {
    color: #1DA1F2;
    font-weight: 500;
    cursor: pointer;
}

.hashtag:hover { text-decoration: underline; }

[data-theme="dark"] .hashtag { color: #4DB8FF; }

.user-status {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

/* ===== ОНЛАЙН-ТОЧКА ===== */
.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: var(--online);
    border: 2px solid var(--bg);
    border-radius: 50%;
    display: block;
    z-index: 2;
    pointer-events: none;
}

.online-dot-profile {
    width: 18px;
    height: 18px;
    border-width: 3px;
    bottom: 8px;
    right: 8px;
}

/* ===== ГАЛОЧКИ ПРОЧИТАНО ===== */
.read-check {
    display: inline-block;
    margin-left: 3px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    letter-spacing: -2px;
}

.chat-message.received .read-check {
    color: var(--text-muted);
}

.read-check.read {
    color: #4DB8FF;
}

/* ===== ПОСТЫ ===== */
.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    gap: 8px;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
    flex: 1;
}

.post-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: block;
}

.post-user {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    color: var(--text);
}

.post-time {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
    margin-left: 8px;
}

.post-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.post-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--danger);
}

.repost-label {
    padding: 0 14px 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.repost-content {
    padding: 0 14px 12px;
    font-size: 14px;
    color: var(--text);
    border-left: 3px solid var(--border);
    margin: 0 14px 12px;
    padding-left: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-media {
    width: 100%;
    background: var(--bg-secondary);
    position: relative;
}

.post-media img, .post-media video {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.post-media audio {
    padding: 10px;
}

.file-info {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.file-download {
    display: block;
    padding: 15px;
    color: var(--text);
    text-decoration: none;
    background: var(--bg-secondary);
    font-size: 14px;
    font-weight: 500;
}

.file-download:hover {
    background: var(--bg-tertiary);
}

.post-media-carousel {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.carousel-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.carousel-item img, .carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.carousel-item audio {
    width: 100%;
    padding: 20px;
}

.carousel-item a {
    padding: 20px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 10;
    pointer-events: none;
}

.carousel-prev, .carousel-next {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: #fff;
    width: 16px;
    border-radius: 3px;
}

.post-content {
    padding: 12px 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: var(--font-size);
    color: var(--text);
}

.post-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s;
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text);
    border-color: var(--text-secondary);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.liked,
.like-btn.liked {
    background: #fff0f0;
    color: var(--danger);
    border-color: var(--danger);
}

[data-theme="dark"] .action-btn.liked,
[data-theme="dark"] .like-btn.liked {
    background: #3a1010;
}

.action-btn.liked svg,
.like-btn.liked svg {
    fill: currentColor;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.heart-pop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    font-size: 80px;
    opacity: 1;
    pointer-events: none;
    z-index: 100;
    animation: heartPop 0.7s ease-out forwards;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

@keyframes heartPop {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

/* ===== СООБЩЕСТВА ===== */
.community-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.community-card:hover {
    background: var(--bg-secondary);
}

.comm-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
    overflow: hidden;
}

.comm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comm-avatar-large {
    width: 90px;
    height: 90px;
    font-size: 40px;
    border-radius: 24px;
    margin: 0 auto 14px;
}

.comm-info {
    flex: 1;
    min-width: 0;
}

.comm-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}

.comm-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.comm-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.comm-pending {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.community-header {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.comm-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.comm-type-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.comm-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comm-meta-big {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.comm-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comm-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
}

.comm-section h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 600;
}

.pending-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.pending-row:last-child {
    border-bottom: none;
}

.pending-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    min-width: 0;
}

.comm-posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.comm-posts-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* ===== МОДАЛКА СОЗДАНИЯ СООБЩЕСТВА ===== */
.create-community-modal {
    background: var(--bg);
    align-items: flex-start;
    padding: 0;
    z-index: 1500;
}

.create-community-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.create-community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    min-height: 56px;
    gap: 10px;
}

.create-community-header h3 {
    font-size: 16px;
    color: var(--text);
    flex: 1;
    text-align: center;
}

.create-community-header .publish-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
}

.create-community-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.comm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comm-type-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comm-type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.comm-type-option:has(input:checked) {
    border-color: var(--accent);
}

.comm-type-option input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.comm-type-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.comm-type-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== ПОДПИСКИ ===== */
.subscription-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.subscription-item:hover {
    background: var(--bg-secondary);
}

.sub-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    display: block;
}

.sub-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.sub-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
}

.sub-username {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.sub-posts {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== КОММЕНТАРИИ ===== */
.comments-section {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: none;
}

.comments-section.show {
    display: block;
}

.comment {
    margin-bottom: 8px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    display: flex;
    gap: 8px;
    position: relative;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

.comment-user {
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
}

.comment-content {
    font-size: 13px;
    margin-top: 2px;
    color: var(--text);
}

.comment-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-delete-btn:hover {
    color: var(--danger);
}

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

.comment-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.comment-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-input button {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 13px;
}

/* ===== ЧАТЫ ===== */
.chats-container {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.chats-list {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow-y: auto;
    padding: 14px;
}

.chats-list h3 {
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--text);
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.chat-item:hover {
    background: var(--bg-secondary);
}

.chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
}

.chat-item-last-message {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-unread {
    background: var(--bg-secondary);
}

.chat-window {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 500;
    flex-direction: column;
}

.chat-window.show {
    display: flex;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.chat-header h4 {
    color: var(--text);
    font-size: 16px;
}

.chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-message-wrapper {
    display: flex;
    width: 100%;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 4px;
}

.chat-message-wrapper.sent {
    justify-content: flex-end;
}

.chat-message {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 75%;
    font-size: 14px;
    word-wrap: break-word;
    color: var(--text);
}

.chat-message.sent {
    background: var(--accent);
    color: var(--accent-text);
    border-bottom-right-radius: 6px;
}

.chat-message.received {
    background: var(--bg-secondary);
    border-bottom-left-radius: 6px;
}

.chat-media-img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    display: block;
}

.chat-media-video {
    max-width: 240px;
    max-height: 240px;
    border-radius: 12px;
    margin-bottom: 6px;
    display: block;
}

.chat-file {
    display: block;
    padding: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 6px;
    word-break: break-all;
}

.chat-message.received .chat-file {
    background: var(--bg-tertiary);
}

.shared-post-card {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    margin-bottom: 6px;
    border-left: 3px solid rgba(255,255,255,0.4);
}

.chat-message.received .shared-post-card {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent);
}

.shared-post-label {
    font-size: 11px;
    opacity: 0.75;
    margin-bottom: 4px;
}

.shared-post-content {
    font-size: 13px;
    line-height: 1.4;
}

.msg-time {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 3px;
}

.message-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-message-wrapper:hover .message-delete-btn {
    opacity: 1;
}

.message-delete-btn:hover {
    color: var(--danger);
}

.chat-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    gap: 10px;
}

.chat-file-preview button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 6px;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    align-items: center;
}

.chat-input input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    min-width: 0;
}

.chat-input input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.attach-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.attach-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.send-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification-item {
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.notification-item.unread {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 13px;
    word-wrap: break-word;
    color: var(--text);
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== ПРОФИЛЬ ===== */
.profile-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 4px 4px 12px;
}

.notif-btn {
    position: relative;
}

.profile-header {
    text-align: center;
    margin-bottom: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.profile-avatar-container {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 14px;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: block;
}

.change-avatar-btn {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
    font-family: var(--font-family);
}

.profile-header h2 {
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 20px;
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.edit-bio-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.edit-bio-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text);
}

.follow-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 8px 22px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

.follow-btn:disabled {
    background: var(--text-muted);
    cursor: default;
}

#profile-achievements, #user-profile-achievements {
    margin-top: 12px;
}

.achievements-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.achievement-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: help;
    transition: transform 0.2s;
}

.achievement-badge:hover {
    transform: scale(1.15);
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.stat-item:hover {
    background: var(--bg);
}

.stat-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 11px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

.modal-content img, .modal-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
}

/* ===== SHARE MODAL ===== */
.share-modal {
    background: rgba(0,0,0,0.5);
    align-items: flex-end;
    padding: 0;
    z-index: 1700;
}

.share-container {
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.share-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}

.share-header h3 {
    color: var(--text);
    font-size: 16px;
}

.share-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.share-action {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    font-family: var(--font-family);
    color: var(--text);
    text-align: left;
    transition: background 0.2s;
}

.share-action:hover {
    background: var(--bg-tertiary);
}

.share-action svg {
    flex-shrink: 0;
}

.share-action-title {
    font-size: 14px;
    font-weight: 600;
}

.share-action-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.share-friends-list {
    margin-top: 16px;
}

/* ===== СОЗДАНИЕ ПОСТА ===== */
.create-modal {
    background: var(--bg);
    align-items: flex-start;
    padding: 0;
    z-index: 1500;
}

.create-post-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.create-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    min-height: 56px;
    gap: 10px;
}

.create-post-header h3 {
    font-size: 16px;
    color: var(--text);
    flex: 1;
    text-align: center;
}

.create-post-header .publish-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
}

.create-post-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.create-post-body textarea {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    resize: none;
    font-family: var(--font-family);
    min-height: 120px;
    outline: none;
}

.create-post-body textarea::placeholder {
    color: var(--text-muted);
}

.hashtag-counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 6px;
    transition: color 0.2s;
}

.hashtag-counter.over {
    color: var(--danger);
    font-weight: 600;
}

.new-post-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.preview-item img, .preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.create-post-actions {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    gap: 8px;
}

.create-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 8px;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 12px;
    transition: background 0.2s;
}

.create-action-btn:hover {
    background: var(--bg-tertiary);
}

/* ===== КАМЕРА ===== */
.camera-modal {
    padding: 0;
    background: #000;
    flex-direction: column;
    z-index: 2500;
}

#camera-video {
    flex: 1;
    width: 100%;
    object-fit: cover;
    background: #000;
}

.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.camera-btn {
    color: #fff;
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font-family);
}

.camera-shutter {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    border: 5px solid rgba(255,255,255,0.5);
    cursor: pointer;
}

.camera-shutter.recording {
    background: #ff0000;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== НАСТРОЙКИ ===== */
.settings-modal {
    background: rgba(0,0,0,0.5);
    align-items: flex-start;
    padding: 0;
    z-index: 1600;
}

.settings-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}

.settings-header h3 {
    color: var(--text);
    font-size: 16px;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.theme-options {
    display: flex;
    gap: 8px;
}

.theme-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 12px;
    color: var(--text);
    transition: border-color 0.2s;
}

.theme-btn.active {
    border-color: var(--accent);
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.light-preview {
    background: linear-gradient(135deg, #fff 50%, #f0f0f0 50%);
}

.dark-preview {
    background: linear-gradient(135deg, #000 50%, #1a1a1a 50%);
}

.auto-preview {
    background: linear-gradient(135deg, #fff 25%, #000 75%);
}

.settings-section select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-family);
    font-size: 14px;
}

.upload-font-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
    margin-top: 8px;
}

.upload-font-btn:hover {
    background: var(--bg-tertiary);
}

#font-size-range {
    width: 100%;
    margin-top: 8px;
    accent-color: var(--accent);
}

.settings-action-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    text-align: left;
    transition: background 0.2s;
}

.settings-action-btn:hover {
    background: var(--bg-tertiary);
}

.settings-action-btn.danger {
    color: var(--danger);
}

/* ===== РЕЖИМ ЛЕНТЫ ===== */
.feed-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.feed-mode-option:has(input:checked) {
    border-color: var(--accent);
}

.feed-mode-option input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.feed-mode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.feed-mode-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--accent-text);
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 3000;
    animation: slideUp 0.3s ease-out;
    max-width: 90%;
    word-wrap: break-word;
    font-family: var(--font-family);
    font-size: 14px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.badge {
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 18px;
    text-align: center;
}

.verified-badge {
    width: 15px;
    height: 15px;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ===== СКЕЛЕТОНЫ ===== */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton-card {
    pointer-events: none;
    padding: 12px;
}

.sk-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s infinite linear;
    flex-shrink: 0;
}

.sk-lines {
    flex: 1;
    margin-left: 10px;
}

.sk-line {
    height: 12px;
    border-radius: 6px;
    margin: 6px 0;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s infinite linear;
}

.sk-short { width: 40%; }
.sk-tiny { width: 25%; height: 10px; }
.sk-full { width: 90%; margin: 8px auto; }

.sk-media {
    height: 200px;
    margin-top: 12px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s infinite linear;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .post-media img, .post-media video {
        max-height: 400px;
    }
    .carousel-container {
        height: 320px;
    }
    .profile-avatar, .profile-avatar-container {
        width: 100px;
        height: 100px;
    }
    .action-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    .bottom-nav-btn span {
        font-size: 9px;
    }
    .action-btn span {
        font-size: 11px;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== КРАСНАЯ МЕТКА НА ВКЛАДКЕ ЧАТЫ ===== */
.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(14px);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    border: 2px solid var(--bg);
    box-sizing: content-box;
}

.bottom-nav-btn {
    position: relative;
}

/* ===== ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ ===== */
.inapp-notif-container {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 24px);
    max-width: 460px;
    pointer-events: none;
}

.inapp-notif {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    cursor: pointer;
    pointer-events: auto;
    animation: notifIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

[data-theme="dark"] .inapp-notif {
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.inapp-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.inapp-notif-content {
    flex: 1;
    min-width: 0;
}

.inapp-notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.inapp-notif-text {
    font-size: 13px;
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.inapp-notif-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
}

@keyframes notifIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Печатает... */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Подсветка поста при переходе из чата */
.post-card.highlight {
    animation: postHighlight 2s ease;
}

@keyframes postHighlight {
    0% { box-shadow: 0 0 0 3px #FFD54F; }
    100% { box-shadow: 0 0 0 3px transparent; }
}

/* Вкладки в профиле */
.profile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 12px;
}

.profile-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 14px;
    border-radius: 10px;
    transition: all 0.2s;
}

.profile-tab.active {
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 500;
}

/* Ответы на комментарии */
.comment-replies {
    margin-left: 24px;
    margin-top: 4px;
}

.comment-reply {
    background: var(--bg-tertiary);
}

.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    margin-top: 4px;
    font-family: var(--font-family);
}

.comment-reply-btn:hover {
    color: var(--text);
}