* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1c1e21;
}

button,
input {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #4267b2;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    color: #4267b2;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 900;
}

.search-bar {
    flex: 1;
    max-width: 420px;
    margin: 0 24px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 999px;
    border: none;
    outline: none;
}

.top-actions {
    display: flex;
    gap: 10px;
}

.top-btn {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 999px;
    color: white;
    padding: 10px 16px;
    cursor: pointer;
}

.top-btn.active,
.top-btn:hover {
    background: rgba(255, 255, 255, 0.33);
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dfe3ee;
    color: #385898;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.page-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 280px;
    gap: 24px;
    padding: 24px;
}

.sidebar-left,
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-card,
.post-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    padding: 16px;
}

.sidebar-card h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.sidebar-item,
.contact-item,
.sponsored-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}

.sidebar-item:last-child,
.contact-item:last-child,
.sponsored-item:last-child {
    border-bottom: none;
}

.sidebar-item {
    color: #050505;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #bbb;
}

.status.online {
    background: #31a24c;
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dfe3ee;
    color: #385898;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.post-header div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-header strong {
    font-size: 0.95rem;
}

.post-header span {
    color: #606770;
    font-size: 0.85rem;
}

.story-strip {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.story-card {
    min-width: 110px;
    border-radius: 18px;
    background: white;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: pointer;
}

.story-card.active {
    border: 2px solid #1877f2;
}

.story-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #dfe3ee;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    font-weight: 700;
    color: #385898;
}

.create-post input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ccd0d5;
    border-radius: 999px;
    outline: none;
}

.post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-actions button {
    flex: 1;
    min-width: 96px;
    background: #f0f2f5;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    color: #050505;
}

.post-actions button:hover {
    background: #e4e6eb;
}

.post-image {
    width: 100%;
    height: 210px;
    border-radius: 16px;
    background: linear-gradient(135deg, #8ab4f8, #dce0ff);
}

.post-meta {
    display: flex;
    justify-content: space-between;
    color: #616770;
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-left,
    .sidebar-right {
        order: 2;
    }

    .feed {
        order: 1;
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .profile-menu {
        width: 100%;
        justify-content: space-between;
    }
}

