/* ── Theme ── */
:root {
    --bg: #ffffff;
    --bg2: #f5f5f5;
    --bg3: #ebebeb;
    --text: #111111;
    --text2: #555555;
    --text3: #999999;
    --border: #e0e0e0;
    --accent: #1a1a2e;
    --accent-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f0f;
        --bg2: #1a1a1a;
        --bg3: #252525;
        --text: #f0f0f0;
        --text2: #aaaaaa;
        --text3: #666666;
        --border: #2a2a2a;
        --accent: #f0f0f0;
        --accent-text: #111111;
    }
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text2);
    transition: background 0.15s, color 0.15s;
}

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

.btn-logout {
    padding: 0.4rem 0.75rem;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .btn-logout:hover {
        background: var(--bg2);
        color: var(--text);
    }

.btn-login {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text);
    transition: background 0.15s;
}

    .btn-login:hover {
        background: var(--bg2);
    }

.btn-signup {
    padding: 0.4rem 0.9rem;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: opacity 0.15s;
}

    .btn-signup:hover {
        opacity: 0.85;
    }

/* ── Main ── */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ── Home layout ── */
.home-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

@media (max-width: 700px) {
    .home-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* ── Sidebar ── */
.sidebar {
    position: sticky;
    top: 72px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-info strong {
    display: block;
    font-size: 0.9rem;
}

.sidebar-info span {
    font-size: 0.8rem;
    color: var(--text3);
}

.sidebar-stats {
    display: flex;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.stat {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
}

    .stat:first-child {
        border-right: 1px solid var(--border);
    }

    .stat strong {
        display: block;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .stat span {
        font-size: 0.75rem;
        color: var(--text3);
    }

.btn-sidebar {
    display: block;
    text-align: center;
    padding: 0.6rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text2);
    transition: background 0.15s;
}

    .btn-sidebar:hover {
        background: var(--bg3);
    }

/* ── Feed ── */
.feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-placeholder {
    color: var(--text3);
    text-align: center;
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* ── Landing ── */
.landing {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}

    .landing h1 {
        font-size: 5rem;
        font-weight: 900;
        letter-spacing: -0.05em;
        line-height: 1;
    }

    .landing p {
        font-size: 1.1rem;
        color: var(--text2);
    }

.landing-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-signup-large {
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    transition: opacity 0.15s;
}

    .btn-signup-large:hover {
        opacity: 0.85;
    }

.btn-login-outline {
    padding: 0.75rem 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 1rem;
    color: var(--text2);
    transition: background 0.15s;
}

    .btn-login-outline:hover {
        background: var(--bg2);
    }
/* ── Navbar center ── */
.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
}

/* ── Search ── */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.search-input {
    width: 100%;
    padding: 0.45rem 0.75rem 0.45rem 2.25rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

    .search-input:focus {
        border-color: var(--accent);
        background: var(--bg);
    }

.search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background 0.1s;
    cursor: pointer;
}

    .search-result-item:hover {
        background: var(--bg2);
    }

.search-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-info {
    display: flex;
    flex-direction: column;
}

.search-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.search-username {
    font-size: 0.78rem;
    color: var(--text3);
}

.search-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text3);
}

@media (max-width: 600px) {
    .navbar-center {
        display: none;
    }
}
.btn-compose {
    padding: 0.4rem 1rem;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

    .btn-compose:hover {
        opacity: 0.85;
    }

/* ── Composer modal ── */
.composer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.composer-modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
}

.composer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

    .composer-header h2 {
        font-size: 1rem;
        font-weight: 700;
    }

.composer-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text3);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

    .composer-close:hover {
        background: var(--bg2);
    }

.composer-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.composer-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

    .composer-input:focus {
        border-color: var(--accent);
    }

.composer-textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    min-height: 120px;
    transition: border-color 0.15s;
    font-family: inherit;
}

    .composer-textarea:focus {
        border-color: var(--accent);
    }

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text3);
    margin-top: -0.5rem;
}

    .char-count.warning {
        color: #e53e3e;
    }

.composer-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.composer-field label {
    display: block;
    font-size: 0.78rem;
    color: var(--text3);
    margin-bottom: 0.3rem;
}

.composer-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
}

.composer-checkboxes {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.composer-anon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text2);
    cursor: pointer;
}

.btn-post {
    padding: 0.55rem 1.5rem;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.15s;
}

    .btn-post:hover {
        opacity: 0.85;
    }

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

.composer-error {
    padding: 0.6rem 0.75rem;
    background: #fff0f0;
    color: #e53e3e;
    border-radius: 8px;
    font-size: 0.85rem;
}
/* ── Post Card ── */
.post-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg3);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    font-size: 0.9rem;
}

    .post-author:hover {
        text-decoration: underline;
    }

.post-time {
    display: block;
    font-size: 0.78rem;
    color: var(--text3);
}

.post-mood {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg3);
    border-radius: 999px;
    color: var(--text2);
}

.post-title {
    font-size: 1rem;
    font-weight: 700;
}

.post-content {
    font-size: 0.95rem;
    color: var(--text);
}

.post-image {
    width: 100%;
    border-radius: 8px;
    max-height: 400px;
    object-fit: cover;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--text3);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: all 0.15s;
}

    .action-btn:hover {
        background: var(--bg3);
        color: var(--text);
    }

    .action-btn.liked {
        color: #e53e3e;
    }

/* ── Nested Comments (Reddit-style) ── */
.comments-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.comment-main {
    display: flex;
    gap: 0.75rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg3);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

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

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

.comment-author {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text3);
}

.comment-content {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.btn-reply-toggle, .btn-delete-comment {
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text3);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

    .btn-reply-toggle:hover {
        color: var(--accent);
    }

    .btn-delete-comment:hover {
        color: #e53e3e;
    }

.replies {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-left: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

@media (max-width: 500px) {
    .replies {
        margin-left: 0.4rem;
        padding-left: 0.6rem;
    }
}

.comment-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comment-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text);
    outline: none;
}

.comment-submit {
    padding: 0.4rem 1rem;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.reply-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-left: 2.5rem;
}

/* ── Feed empty ── */
.feed-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text3);
    font-size: 0.95rem;
    line-height: 2;
}
/* ── Post owner actions ── */
.post-owner-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.btn-edit-post {
    padding: 0.3rem 0.8rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-edit-post:hover {
        background: var(--bg3);
        color: var(--text);
    }

.btn-delete-post {
    padding: 0.3rem 0.8rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text3);
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-delete-post:hover {
        border-color: #e53e3e;
        color: #e53e3e;
    }

/* ── Profile stats ── */
.profile-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 1rem 0;
}

.stat-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    cursor: pointer;
    transition: opacity 0.15s;
}

    .stat-link:hover {
        opacity: 0.7;
    }

    .stat-link strong {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text);
    }

    .stat-link span {
        font-size: 0.78rem;
        color: var(--text3);
    }

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* ── Follow pages ── */
.follow-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.follow-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .follow-header h1 {
        font-size: 1.2rem;
        font-weight: 700;
        flex: 1;
    }

.follow-count {
    font-size: 0.875rem;
    color: var(--text3);
    background: var(--bg2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.back-link {
    font-size: 0.875rem;
    color: var(--text3);
    transition: color 0.15s;
}

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

.follow-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.follow-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: background 0.15s;
}

    .follow-item:hover {
        background: var(--bg2);
    }

.follow-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.follow-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

    .follow-info strong {
        font-size: 0.9rem;
    }

    .follow-info span {
        font-size: 0.78rem;
        color: var(--text3);
    }

.follow-date {
    font-size: 0.75rem;
    color: var(--text3);
}

.follow-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text3);
    font-size: 0.95rem;
}
/* ── Profile page ── */
.profile-page {
    max-width: 580px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 0 0.5rem;
}

.profile-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.profile-username {
    display: block;
    font-size: 0.875rem;
    color: var(--text3);
}

.profile-joined {
    display: block;
    font-size: 0.8rem;
    color: var(--text3);
    margin-top: 0.15rem;
}


.profile-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.25rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stat-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    transition: opacity 0.15s;
}

    .stat-link:hover {
        opacity: 0.7;
    }

    .stat-link strong {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--text);
    }

    .stat-link span {
        font-size: 0.75rem;
        color: var(--text3);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ── Profile card ── */
.profile-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

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

.profile-label {
    color: var(--text3);
    font-weight: 500;
}

.profile-value {
    color: var(--text);
}

/* ── Badges ── */
.badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 0.4rem;
}

.badge-green {
    background: #dcfce7;
    color: #15803d;
}

.badge-yellow {
    background: #fef9c3;
    color: #854d0e;
}


.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text2);
}

.field-input {
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

    .field-input:focus {
        border-color: var(--accent);
    }

.field-error {
    font-size: 0.8rem;
    color: #e53e3e;
}

.field-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

    .field-check input[type="checkbox"] {
        margin-top: 0.2rem;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        cursor: pointer;
    }

    .field-check label {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text);
        cursor: pointer;
    }

.field-hint {
    font-size: 0.78rem;
    color: var(--text3);
    margin-top: 0.15rem;
}


.btn-primary {
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

    .btn-primary:hover {
        opacity: 0.85;
    }


.alert-success {
    padding: 0.75rem 1rem;
    background: #dcfce7;
    color: #15803d;
    border-radius: 8px;
    font-size: 0.875rem;
}

.alert-error {
    padding: 0.75rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

/* ── Chat layout ── */
.chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 56px);
    margin: -2rem -1rem 0;
    overflow: hidden;
}

@media (max-width: 700px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Chat sidebar ── */
.chat-sidebar {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

    .chat-sidebar-header h2 {
        font-size: 1rem;
        font-weight: 700;
    }

.btn-icon {
    background: none;
    border: none;
    padding: 0.35rem;
    border-radius: 8px;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.15s;
}

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

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}

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

    .chat-item.active {
        background: var(--bg2);
    }

.chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.chat-item-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-item-meta {
    font-size: 0.78rem;
    color: var(--text3);
}

.chat-empty-list {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text3);
    font-size: 0.875rem;
}

/* ── Chat main ── */
.chat-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 0.95rem;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Dropdown ── */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0.4rem;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 0.8rem;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.1s;
}

    .dropdown-item:hover {
        background: var(--bg2);
    }

.text-error {
    color: #e53e3e !important;
}

.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.chat-header-info strong {
    display: block;
    font-size: 0.9rem;
}

.chat-header-info span {
    font-size: 0.78rem;
    color: var(--text3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.msg-content-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
}

.own .msg-content-wrap {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-bottom: 4px;
    overflow: hidden;
}

.avatar-letter-sm {
    width: 100%;
    height: 100%;
    background: var(--bg3);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.chat-message.own {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.other {
    align-self: flex-start;
    align-items: flex-start;
}

.msg-sender {
    font-size: 0.75rem;
    color: var(--text3);
    margin-bottom: 0.2rem;
}

.msg-bubble {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.9rem;
    border-radius: 16px;
    position: relative;
}

.own .msg-bubble {
    background: var(--accent);
    color: var(--accent-text);
    border-bottom-right-radius: 4px;
}

.other .msg-bubble {
    background: var(--bg2);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg-text {
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.msg-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.msg-time {
    font-size: 0.65rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.msg-status {
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.msg-status.seen {
    opacity: 1;
    color: #38bdf8; /* Lighter blue for dark/accent backgrounds */
}

@media (prefers-color-scheme: light) {
    .msg-status.seen {
        color: #007aff;
    }
}

.msg-delete {
    background: none;
    border: none;
    color: inherit;
    opacity: 0;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    transition: opacity 0.15s;
}

.msg-bubble:hover .msg-delete {
    opacity: 0.6;
}

.msg-delete:hover {
    opacity: 1 !important;
}

/* ── Chat input ── */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

    .chat-input:focus {
        border-color: var(--accent);
    }

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

    .chat-send-btn:hover {
        opacity: 0.85;
    }

/* ── Tabs ── */
.tab-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
}

    .tab-btn.active {
        background: var(--accent);
        color: var(--accent-text);
        border-color: var(--accent);
    }
/* ── Sessions page ── */
.sessions-page {
    max-width: 580px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sessions-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
}

    .sessions-header h1 {
        font-size: 1.2rem;
        font-weight: 700;
    }

.sessions-desc {
    font-size: 0.875rem;
    color: var(--text3);
    line-height: 1.6;
}

.btn-revoke-all {
    width: 100%;
    padding: 0.65rem;
    background: none;
    border: 1px solid #e53e3e;
    border-radius: 8px;
    color: #e53e3e;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-revoke-all:hover {
        background: #fff0f0;
    }

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

    .session-card.current {
        border-color: var(--accent);
    }

.session-icon {
    color: var(--text2);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.session-info {
    flex: 1;
}

.session-device {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--text3);
    line-height: 1.7;
}

.btn-revoke {
    padding: 0.4rem 0.9rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text3);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}

    .btn-revoke:hover {
        border-color: #e53e3e;
        color: #e53e3e;
    }

.btn-sessions {
    display: inline-block;
    padding: 0.6rem 1rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text2);
    transition: background 0.15s;
    margin-top: 0.5rem;
}

    .btn-sessions:hover {
        background: var(--bg3);
    }

/* ── Notification bell ── */
.notif-wrapper {
    position: relative;
}

.btn-notif {
    position: relative;
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

    .btn-notif:hover {
        background: var(--bg2);
    }

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: #e53e3e;
    color: white;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

/* ── Notification panel ── */
.notif-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 320px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    overflow: hidden;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
}

.notif-mark-read {
    background: none;
    border: none;
    font-size: 0.78rem;
    color: var(--text3);
    cursor: pointer;
}

    .notif-mark-read:hover {
        color: var(--text);
    }

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

    .notif-item:last-child {
        border-bottom: none;
    }

    .notif-item:hover {
        background: var(--bg2);
    }

    .notif-item.unread {
        background: var(--bg2);
    }

.notif-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.notif-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.notif-message {
    font-size: 0.875rem;
    color: var(--text);
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text3);
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text3);
    font-size: 0.875rem;
}

.notif-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text3);
    font-size: 0.875rem;
}
/* ── Profile picture ── */
.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.pfp-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--bg);
}
.messages-badge {
    min-width: 16px;
    height: 16px;
    background: #e53e3e;
    color: white;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    vertical-align: middle;
    padding: 0 4px;
}
.nav-link.has-messages {
    color: var(--text);
}

/* ── Post Image Preview ── */
.post-image-preview {
    position: relative;
    margin-top: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    border: 1px solid var(--border);
}

#preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-img {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.remove-img:hover {
    background: rgba(0,0,0,0.8);
}
    background: var(--bg2);
}

/* ── Post detail ── */
.post-detail-wrap {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Avatar images ── */
.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-img-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg3);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

/* ── Online indicator ── */
.chat-item-avatar, .chat-header-avatar {
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 11px;
    height: 11px;
    background: #22c55e; /* Green-500 */
    border: 2.5px solid var(--bg);
    border-radius: 50%;
    z-index: 5;
}

.chat-header-avatar .online-indicator {
    width: 12px;
    height: 12px;
}

/* ── Unread highlight ── */
.notif-item.unread {
    background: #eef6ff;
}

.chat-item.unread-chat {
    background: #eef6ff;
}

@media (prefers-color-scheme: dark) {
    .notif-item.unread,
    .chat-item.unread-chat {
        background: #1e293b;
    }
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: #2563eb;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-item.unread-chat .chat-item-name {
    font-weight: 700;
}

.chat-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.15rem;
}

.chat-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.chat-item-time {
    font-size: 0.75rem;
    color: var(--text3);
    flex-shrink: 0;
}

.chat-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chat-item-preview {
    font-size: 0.82rem;
    color: var(--text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Stories Bar on Web */
.web-stories-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}
.web-stories-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}
.stories-track {
    display: flex;
    gap: 1.25rem;
}
.story-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    width: 76px;
    user-select: none;
}
.story-avatar-wrapper {
    position: relative;
    padding: 3px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-avatar-wrapper.unviewed {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.story-avatar-wrapper.viewed {
    background: var(--border);
}
.story-avatar-inner {
    padding: 2px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
}
.story-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text);
    font-size: 1.25rem;
}
.story-badge-add {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #0095f6;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid var(--bg);
}
.story-username {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text2);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.story-username.unviewed {
    font-weight: 600;
    color: var(--text);
}

/* Web Story Viewer Modal */
.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-viewer-card {
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 750px;
    background: #000;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (max-width: 480px) {
    .story-viewer-card {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
.story-viewer-progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.story-viewer-progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.35);
    border-radius: 1px;
    overflow: hidden;
    position: relative;
}
.story-viewer-progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.1s linear;
}
.story-viewer-header {
    position: absolute;
    top: 20px;
    left: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    z-index: 10;
    color: #fff;
}
.story-viewer-user-pfp {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}
.story-viewer-user-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    margin-right: 10px;
}
.story-viewer-meta {
    display: flex;
    flex-direction: column;
}
.story-viewer-username {
    font-size: 0.85rem;
    font-weight: 700;
}
.story-viewer-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}
.story-viewer-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.story-viewer-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-viewer-btn:hover {
    color: #ccc;
}
.story-viewer-media-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.story-viewer-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.story-viewer-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}
.story-viewer-nav-btn:hover {
    background: rgba(255,255,255,0.3);
}
.story-viewer-nav-btn.prev {
    left: 10px;
}
.story-viewer-nav-btn.next {
    right: 10px;
}
.story-viewer-caption-container {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    text-align: center;
    z-index: 10;
}
.story-viewer-caption {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 18px;
    font-size: 0.9rem;
    max-width: 100%;
    word-wrap: break-word;
}

/* Story replies on web */
.story-viewer-reply-row {
    padding: 12px 16px;
    background: #000;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #222;
}
.story-viewer-reply-row input {
    flex: 1;
    background: #111;
    border: 1px solid #333;
    border-radius: 999px;
    padding: 8px 16px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
}
.story-viewer-reply-row input::placeholder {
    color: #555;
}
.story-viewer-reply-row input:focus {
    border-color: #555;
}
.story-reply-send-btn {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}
.story-reply-send-btn:hover {
    color: #1877f2;
}
.story-viewer-comments-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 15;
    display: flex;
    flex-direction: column;
    padding: 50px 20px 20px 20px;
}
.story-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    margin-bottom: 15px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}
.story-comments-header h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}
.story-comments-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.story-comments-list::-webkit-scrollbar {
    width: 4px;
}
.story-comments-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}
.story-comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
}
.story-comment-pfp {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.story-comment-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}
.story-comment-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.story-comment-user-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.story-comment-username {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ccc;
}
.story-comment-time {
    font-size: 0.65rem;
    color: #666;
}
.story-comment-content {
    font-size: 0.8rem;
    color: #fff;
    word-break: break-word;
}
.story-mention {
    color: #0095f6;
    font-weight: 700;
}

/* ── Realtime Update Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0px rgba(0, 149, 246, 0.4);
        background-color: rgba(0, 149, 246, 0.08);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 149, 246, 0);
        background-color: rgba(0, 149, 246, 0.04);
    }
    100% {
        box-shadow: 0 0 0 0px rgba(0, 149, 246, 0);
        background-color: transparent;
    }
}

.realtime-new {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards,
               highlightPulse 1.5s ease-out;
}

.realtime-update {
    animation: highlightPulse 1.5s ease-out;
}