.forum-body { background: #0d0d0c; }
.forum-wrap { width: min(calc(100% - 40px), 1180px); margin: 0 auto; }
.forum-main { min-height: calc(100vh - 260px); padding: 38px 0 90px; }
.forum-bar { border-bottom: 1px solid var(--border); background: #11110f; }
.forum-bar-inner { min-height: 62px; display: flex; align-items: center; gap: 24px; }
.forum-wordmark { font: 26px Georgia, serif; }
.forum-search { width: min(370px, 40vw); margin-left: auto; }
.forum-search input { width: 100%; height: 38px; padding: 0 13px; border: 1px solid var(--border); outline: 0; color: var(--text); background: #0a0a09; }
.forum-search input:focus { border-color: var(--accent); }
.forum-account { display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 700; }
.btn-small { min-height: 36px; padding: 0 13px; }
.forum-alert { margin-top: 20px; padding: 14px 16px; border: 1px solid rgba(215,115,109,.4); color: #ef9a94; background: rgba(215,115,109,.07); font-size: 13px; }
.forum-alert.success { border-color: rgba(112,168,125,.4); color: #9bc9a6; background: rgba(112,168,125,.07); }
.forum-alert.neutral { border-color: var(--border); color: var(--muted); background: var(--surface); }
.forum-alert a { color: var(--accent); }
.forum-hero { min-height: 245px; padding: 44px 0 54px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--border); }
.forum-hero h1, .board-heading h1, .topic-heading h1, .editor-shell h1, .profile-head h1, .empty-page h1 { margin-bottom: 13px; font: 400 clamp(42px, 6vw, 66px)/1 Georgia, serif; letter-spacing: -.035em; }
.forum-hero p:last-child, .board-heading p:last-child { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.65; }
.forum-layout { padding-top: 38px; display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 28px; }
.forum-section { margin-bottom: 28px; border: 1px solid var(--border); background: var(--surface); }
.forum-section-title { padding: 20px 22px; border-bottom: 1px solid var(--border); background: #11110f; }
.forum-section-title h2 { margin: 0 0 5px; font: 400 22px Georgia, serif; }
.forum-section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.board-row { min-height: 104px; padding: 17px 20px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 120px 205px; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.board-row:last-child { border-bottom: 0; }
.board-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #514a3d; color: var(--accent); background: #1a1814; font: 20px Georgia, serif; }
.board-main h3 { margin: 0 0 7px; font: 400 19px Georgia, serif; }
.board-main h3 a:hover, .thread-main h2 a:hover { color: var(--accent); }
.board-main p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.board-counts { display: flex; gap: 13px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.board-counts strong, .board-counts span { display: block; }
.board-counts strong { margin-bottom: 4px; color: var(--text); font-size: 13px; }
.board-last { min-width: 0; padding-left: 16px; border-left: 1px solid var(--border); }
.board-last a, .board-last span { display: block; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.board-last small, .thread-last small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.forum-sidebar { display: flex; flex-direction: column; gap: 18px; }
.forum-card { padding: 24px; border: 1px solid var(--border); background: var(--surface); }
.forum-card h2, .forum-card h3 { margin-bottom: 13px; font: 400 23px Georgia, serif; }
.forum-card p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.stat-grid div { padding: 15px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-grid strong, .stat-grid span { display: block; }
.stat-grid strong { color: var(--accent); font: 25px Georgia, serif; }
.stat-grid span { margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.breadcrumbs { margin-bottom: 34px; display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 11px; }
.breadcrumbs a:hover { color: var(--accent); }
.board-heading, .topic-heading { padding: 25px 0 42px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.board-heading h1, .topic-heading h1 { font-size: clamp(38px, 5vw, 58px); }
.thread-list { border: 1px solid var(--border); background: var(--surface); }
.thread-row { min-height: 82px; padding: 15px 18px; display: grid; grid-template-columns: 35px minmax(0, 1fr) 75px 75px 150px; align-items: center; gap: 15px; border-bottom: 1px solid var(--border); }
.thread-row:last-child { border-bottom: 0; }
.thread-state { color: var(--accent); }
.thread-main h2 { margin: 0 0 5px; font: 400 18px Georgia, serif; }
.thread-main p { margin: 0; color: var(--muted); font-size: 10px; }
.thread-meta strong, .thread-meta span, .thread-last span { display: block; }
.thread-meta strong { font-size: 13px; }
.thread-meta span { margin-top: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.thread-last { min-width: 0; }
.thread-last span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pagination { margin-top: 24px; display: flex; gap: 6px; }
.pagination a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: 12px; }
.pagination a.active { border-color: var(--accent); color: #111; background: var(--accent); }
.mod-actions { display: flex; gap: 12px; }
.mod-actions form { margin: 0; }
.text-button { padding: 0; border: 0; color: var(--accent); background: none; font-size: 11px; font-weight: 700; cursor: pointer; }
.posts { display: flex; flex-direction: column; gap: 14px; }
.post { min-height: 230px; display: grid; grid-template-columns: 180px minmax(0, 1fr); border: 1px solid var(--border); background: var(--surface); }
.post-author { padding: 25px 20px; display: flex; align-items: center; flex-direction: column; border-right: 1px solid var(--border); text-align: center; }
.avatar { width: 62px; height: 62px; margin-bottom: 13px; display: grid; place-items: center; overflow: hidden; border: 1px solid #514a3d; color: var(--accent); background: #1a1814; font: 26px Georgia, serif; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author strong { font-size: 13px; }
.post-author small { margin-top: 7px; color: var(--muted); font-size: 9px; }
.role { margin: 7px 0 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.role-admin, .role-moderator { color: var(--accent); }
.post-content { min-width: 0; padding: 20px 25px 28px; }
.post-meta { padding-bottom: 15px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.post-body { padding-top: 25px; color: #d8d5cd; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.reply-card { margin-top: 28px; }
.reply-card textarea { margin-bottom: 12px; }
.auth-shell { min-height: 620px; display: grid; place-items: center; padding: 35px 0; }
.auth-card { width: min(100%, 480px); padding: 38px; }
.auth-card h1 { margin-bottom: 28px; font: 400 40px Georgia, serif; }
.auth-copy { margin-bottom: 22px; }
label { display: block; margin-bottom: 17px; color: #d7d4cb; font-size: 11px; font-weight: 700; }
input, textarea, select { width: 100%; margin-top: 8px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 2px; outline: 0; color: var(--text); background: #0b0b0a; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(198,164,95,.1); }
.auth-card .btn { width: 100%; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); line-height: 1.4; }
.check-row input { width: auto; margin: 0; }
.form-link { margin: 17px 0 0; text-align: center; }
.form-link a { color: var(--accent); }
.code-input { text-align: center; font-size: 24px; letter-spacing: 8px; }
.inline-api-form { margin-top: 17px; text-align: center; }
.form-message { display: none; margin-top: 18px; padding: 12px; font-size: 12px; }
.form-message.error, .form-message.success { display: block; }
.form-message.error { color: #ef9a94; background: rgba(215,115,109,.08); }
.form-message.success { color: #9bc9a6; background: rgba(112,168,125,.08); }
.editor-shell { max-width: 850px; margin: 35px auto; padding: 38px; }
.editor-shell form { margin-top: 30px; }
.search-results { border-top: 1px solid var(--border); }
.search-results article { padding: 27px 5px; border-bottom: 1px solid var(--border); }
.search-results h2 { margin: 0 0 10px; font: 400 24px Georgia, serif; }
.search-results p:not(.kicker) { max-width: 800px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.search-results small { color: #77736a; font-size: 10px; }
.empty-state { padding: 35px; color: var(--muted); text-align: center; }
.empty-page { min-height: 500px; display: grid; place-content: center; justify-items: center; text-align: center; }
.profile-head { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 28px; }
.avatar-large { width: 100px; height: 100px; margin: 0; font-size: 42px; }
.profile-head h1 { font-size: 46px; }
.profile-head p { margin: 0; }
.profile-head dl { display: flex; margin: 0; }
.profile-head dl div { padding: 0 18px; border-left: 1px solid var(--border); }
.profile-head dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.profile-head dd { margin: 6px 0 0; font: 20px Georgia, serif; }
.profile-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.profile-topic { padding: 12px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); font-size: 12px; }
.profile-topic small, .muted { color: var(--muted); }
.admin-grid { margin-bottom: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-users { overflow-x: auto; }
.admin-roles { margin-bottom: 22px; }
.admin-roles > p { margin-top: -4px; }
.role-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.role-editor { padding: 20px; border: 1px solid var(--border); background: #11110f; }
.role-editor h3 { display: flex; align-items: center; gap: 9px; }
.role-editor.new-role { border-color: #514a3d; }
.role-color-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; }
.permission-list { margin: 15px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.permission-list .check-row { margin: 0; font-size: 10px; }
.admin-user-row { min-width: 680px; padding: 13px 0; display: grid; grid-template-columns: minmax(220px, 1fr) 160px 130px 80px; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.admin-user-row:last-child { border-bottom: 0; }
.admin-user-row strong, .admin-user-row small { display: block; }
.admin-user-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.admin-user-row select, .admin-user-row label { margin: 0; }

@media (max-width: 900px) {
    .forum-layout { grid-template-columns: 1fr; }
    .forum-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
    .board-row { grid-template-columns: 48px minmax(0, 1fr) 180px; }
    .board-counts { display: none; }
    .thread-row { grid-template-columns: 35px minmax(0, 1fr) 75px 150px; }
    .thread-row .thread-meta:nth-of-type(4) { display: none; }
}
@media (max-width: 650px) {
    .forum-wrap { width: min(calc(100% - 26px), 1180px); }
    .forum-main { padding-top: 24px; }
    .forum-bar-inner { padding: 12px 0; flex-wrap: wrap; }
    .forum-search { width: 100%; order: 3; }
    .forum-account { margin-left: auto; }
    .forum-hero, .board-heading, .topic-heading { align-items: flex-start; flex-direction: column; }
    .forum-sidebar { grid-template-columns: 1fr; }
    .board-row { grid-template-columns: 42px minmax(0, 1fr); }
    .board-last { display: none; }
    .thread-row { grid-template-columns: 25px minmax(0, 1fr) 55px; }
    .thread-last, .thread-row .thread-meta:nth-of-type(3) { display: none; }
    .post { grid-template-columns: 1fr; }
    .post-author { padding: 14px 18px; align-items: center; flex-direction: row; gap: 10px; border-right: 0; border-bottom: 1px solid var(--border); text-align: left; }
    .post-author .avatar { width: 42px; height: 42px; margin: 0; font-size: 18px; }
    .post-author small { display: none; }
    .post-author .role { margin-left: auto; }
    .post-content { padding: 17px; }
    .auth-card, .editor-shell { padding: 27px 20px; }
    .profile-head { grid-template-columns: 75px 1fr; }
    .avatar-large { width: 70px; height: 70px; }
    .profile-head dl { grid-column: 1 / -1; }
    .profile-head dl div { flex: 1; padding: 0 10px; }
    .profile-grid { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
    .role-editor-grid, .permission-list { grid-template-columns: 1fr; }
}
