﻿﻿:root {
    --bg: #fff;
    --panel: #f7f9f9;
    --border: #e6ecf0;
    --muted: #536471;
    --text: #0f1419;
    --accent: #1d9bf0;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font: 14px/1.45 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
    color: var(--text);
    background: var(--bg)
}

/* LAYOUT */
.app {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 200px minmax(0,1fr) 200px;
    min-height: 100svh
}

@media (max-width:1200px) {
    .app {
        grid-template-columns: 90px minmax(0,1fr) 90px
    }

    .nav .label {
        display: none
    }
}

@media(max-width:980px) {
    .app {
        grid-template-columns: 90px minmax(0,1fr) 90px
    }

    /* .right {
        display: none
    }*/
}

@media(max-width:720px) {
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        background: #fff;
        border-top: 1px solid var(--border);
        z-index: 30;
        padding: 0;
        width: 90px;
        height: 100vh;
    }

        .nav .stack {
            flex-direction: row;
            justify-content: space-evenly;
            align-items: center;
            height: 100%;
            padding: 0
        }

        .nav .brand, .nav .compose {
            display: none
        }
    /* .nav {
        display: none
    }*/
}

/* NAV */
.nav {
    padding: 8px 12px;
    position: sticky;
    top: 0;
    height: 100svh
}

    .nav .stack {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 6px
    }

    .nav a, .nav button {
        appearance: none;
        border: 0;
        background: transparent;
        color: inherit;
        display: flex;
        gap: 14px;
        align-items: center;
        padding: 12px 14px;
        border-radius: 999px;
        text-decoration: none;
        font-size: 18px
    }

        .nav a:hover, .nav button:hover {
            background: #e8f5fe
        }

    .nav .brand {
        width: 50px;
        height: 50px;
        display: grid;
        place-items: center;
        border-radius: 999px
    }

.compose {
    margin-top: 8px;
    padding: 14px 18px !important;
    background: var(--accent);
    color: #fff !important;
    border-radius: 999px;
    font-weight: 700;
    justify-content: center
}

/* CENTER */
.center {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 0
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px
}

    .topbar h1 {
        font-size: 18px;
        margin: 0;
        font-weight: 800
    }

/* POST */
.post {
    display: grid;
    grid-template-columns: 56px 1fr 0px;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border)
}

    .post .head {
        display: flex;
        align-items: center;
        gap: 6px
    }

.name {
    font-weight: 800
}

.handle {
    color: var(--muted);
    font-size: 13px
}

.verified {
    color: var(--accent);
    display: inline-flex
}

.post .text {
    margin: 8px 0 10px 0
}

/* AVATARS (matches your CSS) */
.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--bg);
    background: #ddd;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 1/1;
    object-fit: cover
}

.post .avatar, .tweet .avatar, .reply .avatar {
    width: 44px;
    height: 44px;
    border-width: 0
}

/* MEDIA */
.media {
    border: 0px solid var(--border);
    border-radius: 0px;
    overflow: hidden;
    margin-left: -6px;
    margin-right: 0px;
}

    .media img, .media video, .media audio {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 0px;
        max-height: 500px;
        object-fit: cover;
    }

    .media.grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 6px
    }

        .media.grid img {
            border-radius: 0px;
        }

.post .meta {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border)
}

.post .counts {
    display: flex;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border)
}

    .post .counts b {
        font-weight: 800
    }

/* ACTION RAIL */
.rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 72px;
    height: fit-content
}

    .rail button {
        appearance: none;
        background: #fff;
        border: 1px solid var(--border);
        width: 40px;
        height: 40px;
        border-radius: 999px;
        display: grid;
        place-items: center;
        color: var(--muted)
    }

        .rail button:hover {
            background: #e8f5fe;
            color: #0f1419;
            border-color: #d0e6f9
        }

    .rail svg {
        width: 18px;
        height: 18px
    }

@media (max-width:980px) {
    .post {
        grid-template-columns: 56px 1fr 0px;
    }

    .rail {
        display: none
    }
}

/* REPLY */
.reply {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border)
}

    .reply textarea {
        resize: vertical;
        min-height: 70px;
        max-height: 220px;
        width: 100%;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: #f7f9f9;
        color: var(--text);
        font: inherit
    }

    .reply .row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px
    }

        .reply .row .tools {
            display: flex;
            gap: 8px;
            color: var(--muted)
        }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700
}

/* TWEETS */
.tweet {
    display: grid;
    grid-template-columns: 56px 1fr 0px;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border)
}

    .tweet .head {
        display: flex;
        align-items: center;
        gap: 6px
    }

    .tweet .text {
        margin: 6px 0 10px
    }

.bar {
    display: flex;
    gap: 16px;
    color: var(--muted)
}

    .bar button {
        appearance: none;
        background: transparent;
        border: 0;
        color: inherit;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 8px;
        border-radius: 999px
    }

        .bar button:hover {
            background: #e8f5fe
        }

    .bar svg {
        width: 18px;
        height: 18px
    }

/* RIGHT */
.right {
    padding: 8px 16px
}

.widget {
    background: #f5f8fa;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    margin: 10px 0
}

    .widget h3 {
        margin: 0 0 10px 0;
        font-size: 18px
    }

.trend {
    padding: 8px 0;
    border-bottom: 1px solid #e6ecf0
}

    .trend:last-child {
        border: 0
    }

.dot::before {
    content: "·";
    padding: 0 4px;
    color: var(--muted)
}

@media(max-width:980px) {
    .avatar {
        width: 100px;
        height: 100px;
    }
}
