:root {
    --forum-primary: #3157d5;
    --forum-primary-dark: #2444b0;
    --forum-bg: #f4f6fb;
    --forum-text: #1d2433;
}
html, body { min-height: 100%; }
body { background: var(--forum-bg); color: var(--forum-text); display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--forum-primary); }
.btn-primary { --bs-btn-bg: var(--forum-primary); --bs-btn-border-color: var(--forum-primary); --bs-btn-hover-bg: var(--forum-primary-dark); --bs-btn-hover-border-color: var(--forum-primary-dark); }
.forum-navbar { background: linear-gradient(115deg, #17223e, #2b3f70); box-shadow: 0 4px 18px rgba(18, 27, 51, .12); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: #243d93; background: #fff; }
.forum-hero { background: radial-gradient(circle at 85% 20%, rgba(49, 87, 213, .15), transparent 30%), linear-gradient(180deg, #fff, transparent); }
.eyebrow { color: var(--forum-primary); text-transform: uppercase; font-size: .76rem; letter-spacing: .14em; font-weight: 800; }
.forum-card { border-radius: 16px; }
.topic-row { border-color: #eef0f5; transition: background-color .18s ease, transform .18s ease; }
.topic-row:hover { background: #f9faff; transform: translateY(-1px); }
.topic-title { color: #18213a; }
.topic-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic-meta { width: 125px; }
.min-w-0 { min-width: 0; }
.avatar { object-fit: cover; border-radius: 50%; background: #e7eaf2; border: 1px solid rgba(0,0,0,.06); }
.avatar-sm { width: 38px; height: 38px; }
.avatar-md { width: 52px; height: 52px; }
.avatar-lg { width: 82px; height: 82px; }
.profile-avatar { width: 126px; height: 126px; box-shadow: 0 8px 25px rgba(30, 49, 94, .15); }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; color: white; text-decoration: none; font-size: .9rem; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.stat-row { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid #eef0f5; }
.stat-row:last-child { border-bottom: 0; }
.post-author { background: #fafbfe; border-right: 1px solid #eef0f5; }
.post-body { line-height: 1.72; overflow-wrap: anywhere; }
.auth-wrap { width: 100%; max-width: 520px; margin: 0 auto; }
.empty-icon { font-size: 3rem; }
.table > :not(caption) > * > * { padding: .9rem .75rem; }
@media (max-width: 767.98px) {
    .forum-hero .display-6 { font-size: 1.75rem; }
    .post-author { border-right: 0; border-bottom: 1px solid #eef0f5; }
    .avatar-lg { width: 64px; height: 64px; }
}

.bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    padding: .5rem;
    border: 1px solid var(--bs-border-color);
    border-bottom: 0;
    border-radius: .5rem .5rem 0 0;
    background: #f8f9fc;
}
.bbcode-toolbar + .bbcode-editor {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.bbcode-button {
    min-width: 2.15rem;
    border-color: #e3e6ee;
}
.bbcode-help {
    margin-left: auto;
    color: #7a8294;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
}
.post-quote {
    margin: 1rem 0;
    padding: .85rem 1rem;
    border-left: 4px solid var(--forum-primary);
    border-radius: 0 .55rem .55rem 0;
    background: #f4f6fc;
    color: #424b61;
}
.post-code {
    margin: 1rem 0;
    padding: 1rem;
    overflow-x: auto;
    border-radius: .65rem;
    background: #182033;
    color: #f4f7ff;
    white-space: pre-wrap;
    word-break: break-word;
}
.post-code code { color: inherit; }
.post-body a { overflow-wrap: anywhere; }
