:root {
    color-scheme: dark;
    --bg: #1a1a1a;
    --panel: #202020;
    --panel-hover: #242424;
    --text: #c9c9c9;
    --heading: #e0e0e0;
    --muted: #707070;
    --border: #333333;
    --button: #d0d0d0;
    --button-text: #171717;
    --focus: #999999;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font: 15px/1.75 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--heading); }

.site-header {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 24px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.site-title {
    color: var(--heading);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: .02em;
}

.site-note, .back-link { color: var(--muted); font-size: 13px; }
.container { width: min(100% - 40px, 760px); margin: 42px auto 80px; }
.composer, .post-card, .reply-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.composer { padding: 18px; }
textarea {
    display: block;
    width: 100%;
    min-height: 112px;
    resize: vertical;
    padding: 12px;
    color: var(--text);
    background: #191919;
    border: 1px solid var(--border);
    border-radius: 3px;
    font: inherit;
    outline: none;
}
textarea:focus { border-color: var(--focus); }
textarea::placeholder { color: #626262; }

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

button {
    border: 1px solid var(--button);
    border-radius: 3px;
    padding: 6px 19px;
    color: var(--button-text);
    background: var(--button);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
button:hover { opacity: .86; }
button:disabled { opacity: .35; cursor: not-allowed; }
button.secondary {
    color: var(--text);
    background: transparent;
    border-color: var(--border);
}
button.secondary:hover:not(:disabled) { background: var(--panel-hover); }

.message { color: var(--muted); font-size: 13px; }
.message:empty { display: none; }
.muted { color: var(--muted); font-size: 13px; }

.feed, .replies-section { margin-top: 48px; }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
}
h1 { margin: 0; color: var(--heading); font-size: 16px; font-weight: 600; }
.post-list, .reply-list { display: grid; gap: 10px; }

.post-card { padding: 17px 19px; }
.post-card:hover { background: var(--panel-hover); }
.post-content {
    margin: 0;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--heading); }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 24px;
}
.reply-item { padding: 14px 17px; }
.reply-item .post-content { font-size: 14px; }
.reply-composer { margin-top: 22px; }
.site-footer {
    padding: 24px;
    color: #555;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--border);
}
.empty-state { padding: 28px 10px; color: var(--muted); text-align: center; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 560px) {
    .site-header { padding: 20px; }
    .container { width: min(100% - 28px, 760px); margin-top: 25px; }
    .composer { padding: 13px; }
    .post-card { padding: 14px; }
}
