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

body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    line-height: 1.5;
}

.layout {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    gap: 0;
}

.container {
    width: 700px;
    flex-shrink: 0;
    padding: 20px 24px;
}

header {
    padding: 30px 0 20px;
    border-bottom: 1px solid #2a2a4a;
    margin-bottom: 20px;
}

header h1 {
    font-size: 28px;
    color: #fff;
}

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

.subtitle {
    color: #888;
    font-size: 14px;
}

.lang-switcher {
    display: flex;
    gap: 4px;
}

.lang-btn {
    background: transparent;
    border: 1px solid #2a2a4a;
    color: #888;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.lang-btn.active {
    background: #7c8aff;
    color: #1a1a2e;
    border-color: #7c8aff;
    font-weight: 600;
}

.lang-btn:hover:not(.active) {
    border-color: #7c8aff;
    color: #7c8aff;
}

.empty {
    color: #888;
    padding: 40px 0;
    text-align: center;
}

.empty code {
    background: #2a2a4a;
    padding: 2px 6px;
    border-radius: 4px;
}

.post {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #2a2a4a;
    cursor: pointer;
}

.post:hover {
    background: #1e1e3a;
}

.post-score {
    min-width: 50px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: #7c8aff;
    padding-top: 2px;
}

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

.post-content h2 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.post-content h2 a {
    color: #e0e0e0;
    text-decoration: none;
}

.post-content h2 a:hover {
    color: #7c8aff;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.post-meta a {
    color: #888;
    text-decoration: none;
}

.post-meta a:hover {
    color: #aaa;
}

.subreddit {
    color: #7c8aff;
    font-weight: 500;
}

.flair {
    padding: 0 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #1a1a2e;
    font-weight: 500;
}

/* Preview panel */

.preview-panel {
    position: sticky;
    top: 0;
    width: 380px;
    height: 100vh;
    padding: 30px 24px;
    background: #16162a;
    border-left: 1px solid #2a2a4a;
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.preview-panel::-webkit-scrollbar {
    width: 6px;
}

.preview-panel::-webkit-scrollbar-track {
    background: transparent;
}

.preview-panel::-webkit-scrollbar-thumb {
    background: #2a2a4a;
    border-radius: 3px;
}

.preview-panel::-webkit-scrollbar-thumb:hover {
    background: #3a3a5a;
}

.preview-panel {
    scrollbar-width: thin;
    scrollbar-color: #2a2a4a transparent;
}

.preview-panel.active {
    opacity: 1;
}

.preview-panel h3 {
    font-size: 18px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
}

.preview-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

.post-score-inline {
    color: #7c8aff;
    font-weight: 600;
}

.preview-image {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 12px;
}

.preview-gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-text {
    font-size: 14px;
    color: #bbb;
    line-height: 1.7;
    word-break: break-word;
}

.preview-text pre {
    overflow-x: auto;
    white-space: pre-wrap;
}

.preview-text a {
    color: #7c8aff;
    text-decoration: none;
}

.preview-text a:hover {
    text-decoration: underline;
}

.preview-text p {
    margin-bottom: 8px;
}

.preview-text ul, .preview-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.preview-text blockquote {
    border-left: 3px solid #2a2a4a;
    padding-left: 12px;
    color: #888;
    margin: 8px 0;
}

.preview-title-link {
    color: #fff;
    text-decoration: none;
}

.preview-title-link:hover {
    color: #7c8aff;
}

@media (max-width: 768px) {
    body {
        font-size: 17px;
    }

    .layout {
        flex-direction: column;
    }

    .container {
        width: 100%;
        padding: 12px 16px;
    }

    .preview-panel {
        display: none;
    }

    header {
        padding: 20px 0 14px;
    }

    header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .lang-btn {
        font-size: 14px;
        padding: 4px 10px;
    }

    .post {
        gap: 12px;
        padding: 16px 0;
    }

    .post-score {
        min-width: 48px;
        font-size: 18px;
    }

    .post-content h2 {
        font-size: 19px;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .post-meta {
        font-size: 13px;
        gap: 8px;
    }

    .flair {
        font-size: 12px;
    }
}
