/* Forsaken Lands - Terminal Aesthetic Theme */

/* Berkeley Mono (self-hosted) */
@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/BerkeleyMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/BerkeleyMono-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/BerkeleyMono-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/BerkeleyMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-body: #050505;
    --bg-panel: rgba(10,10,10,0.88);
    --bg-secondary: rgba(18,18,18,0.9);
    --bg-hover: rgba(30,30,30,0.9);
    --border: rgba(255,255,255,0.08);
    --border-focus: rgba(95,175,95,0.4);
    --text: #c0c0c0;
    --text-bright: #e0e0e0;
    --text-dim: #606060;
    --accent: #5faf5f;
    --accent-hover: #87d787;
    --link: #87ceeb;
    --link-hover: #aee0f0;
    --highlight: #d7af5f;
    --error: #af5f5f;
    --error-bg: rgba(175,95,95,0.12);
    --success: #5faf5f;
    --font-mono: 'Berkeley Mono', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
    --font-prose: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --bg-input:    rgba(5,5,5,0.8);
    --bg-input-sm: rgba(5,5,5,0.4);
    --bg-nav:      rgba(8,8,8,0.95);
    --bg-header:   rgba(15,15,15,0.9);
    --bg-sidebar:  rgba(12,12,12,0.7);
    --bg-code:     rgba(15,15,15,0.8);
    --nav-sep:     rgba(255,255,255,0.05);
    --nav-hover:   rgba(255,255,255,0.04);
    --nav-active:  rgba(255,255,255,0.06);
}

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

/* ---- Background ---- */
body {
    font-family: var(--font-mono);
    background: var(--bg-body);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/static/img/bg.jpg') center/cover no-repeat;
    filter: blur(1px) brightness(0.15);
    z-index: -1;
}

@supports not (backdrop-filter: blur(1px)) {
    body::before { display: none; }
    body { background: #080808; }
}

/* ---- Links ---- */
a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); }

/* ---- Panels (frosted glass) ---- */
.panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 4px;
}

@supports not (backdrop-filter: blur(1px)) {
    .panel { background: #0a0a0a; }
}

/* ---- Navbar (tmux status bar) ---- */
.navbar {
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    display: flex;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 32px;
    font-size: 0.78rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-right: 1px solid var(--nav-sep);
}
.nav-brand:hover { color: var(--accent-hover); text-decoration: none; }

.nav-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1;
    min-width: 0;
}
.nav-tabs a {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    border-right: 1px solid var(--nav-sep);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    text-transform: lowercase;
}
.nav-tabs a:hover {
    color: var(--text);
    background: var(--nav-hover);
    text-decoration: none;
}
.nav-tabs a.active {
    color: var(--text-bright);
    background: var(--nav-active);
}

.nav-right {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-left: auto;
}
.nav-right a {
    display: flex;
    align-items: center;
    padding: 0 0.65rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    white-space: nowrap;
    border-left: 1px solid var(--nav-sep);
}
.nav-right a:hover { color: var(--text); background: var(--nav-hover); text-decoration: none; }
.nav-right .nav-user { color: var(--highlight); }
.inline-form { display: contents; }
.nav-logout {
    background: none; border: none; cursor: pointer; font: inherit;
    display: flex; align-items: center; padding: 0 0.65rem;
    font-size: 0.78rem; color: var(--text-dim); white-space: nowrap;
    border-left: 1px solid var(--nav-sep); height: 100%;
}
.nav-logout:hover { color: var(--text); background: var(--nav-hover); }

/* MUD status indicator */
.nav-status {
    display: flex;
    align-items: center;
    padding: 0 0.65rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
    border-left: 1px solid var(--nav-sep);
    gap: 0.35rem;
}
.nav-status.online { color: #5faf5f; }
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #666;
}
.status-dot.online {
    background: #5faf5f;
    box-shadow: 0 0 4px #5faf5f;
}
.mobile-nav .inline-form { display: block; }
.mobile-nav .nav-logout {
    display: block; width: 100%; text-align: left;
    padding: 0.65rem 1.2rem; border-left: none;
    color: var(--text-dim); font-size: 0.85rem;
}
.mobile-nav .nav-logout:hover { background: var(--bg-hover); }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 1rem;
    height: 32px;
}
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav panel */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    z-index: 2000;
    transition: right 0.3s ease;
    padding: 3.5rem 1.5rem 1.5rem;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}
.mobile-nav.open { right: 0; }
.mobile-nav a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--text);
    font-size: 0.85rem;
    border-radius: 3px;
}
.mobile-nav a:hover { background: var(--bg-hover); text-decoration: none; }
.mobile-nav a.active { color: var(--accent); }
.mobile-nav .nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}
.mobile-overlay.open { display: block; }

/* ---- Container ---- */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ---- Breadcrumb (terminal-style) ---- */
.breadcrumb {
    color: var(--text-dim);
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--link); }

/* ---- Headings ---- */
h1 {
    color: var(--highlight);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
h2 {
    color: var(--highlight);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
h3 {
    color: var(--text-bright);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ---- Category headers ---- */
.category-section { margin-bottom: 1.5rem; }
.category-header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 0.5rem 0.75rem;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--highlight);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Tables (forum list, topic list) ---- */
.forum-list, .topic-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}
.forum-list th, .topic-list th {
    background: var(--bg-header);
    color: var(--text-dim);
    text-align: left;
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.forum-list td, .topic-list td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 0.85rem;
}
.forum-list tr:hover td, .topic-list tr:hover td {
    background: var(--bg-hover);
}
.count { text-align: center; width: 70px; }
.meta { width: 140px; font-size: 0.8rem; }
.forum-name { font-weight: 600; }
.forum-desc { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.15rem; font-family: var(--font-prose); }
.topic-title { font-weight: 600; color: var(--link); }
.topic-title:hover { color: var(--link-hover); }
.topic-author { color: var(--text-dim); font-size: 0.75rem; }

/* Unread topics */
tr.unread .topic-title { color: var(--text-bright); }
tr.unread .topic-title::before { content: "[NEW] "; color: var(--accent); font-size: 0.7rem; font-weight: 700; }

/* Unread count badges */
.unread-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-body);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 8px;
    min-width: 1rem;
    text-align: center;
    vertical-align: middle;
    line-height: 1.3;
}
.nav-unread {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-body);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0 0.3rem;
    border-radius: 6px;
    min-width: 0.85rem;
    text-align: center;
    line-height: 1.3;
    margin-left: 0.3rem;
}

/* Forum header with button */
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.forum-header h1 { margin-bottom: 0; }

/* Forum header actions */
.forum-header-actions { display: flex; gap: 0.4rem; align-items: center; }

/* Forum search (index page) */
.forum-search-form { display: flex; gap: 0.4rem; align-items: center; }
.forum-search-input {
    padding: 0.3rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    width: 200px;
    transition: border-color 0.15s;
}
.forum-search-input:focus { outline: none; border-color: var(--border-focus); }
.forum-search-input::placeholder { color: var(--text-dim); }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-pin { border-color: var(--highlight); color: var(--highlight); }
.badge-lock { border-color: #c08060; color: #c08060; }
.badge-bug { border-color: var(--highlight); color: var(--highlight); }
.badge-prayer { border-color: var(--accent); color: var(--accent); }
.badge-category { border-color: var(--text-dim); color: var(--text-dim); }
.badge-hidden { border-color: var(--error); color: var(--error); }

/* Bug status badges */
.status-open { border-color: #80b080; color: #80b080; }
.status-confirmed { border-color: #b0b080; color: #b0b080; }
.status-progress { border-color: #80a0c0; color: #80a0c0; }
.status-fixed { border-color: #80c0a0; color: #80c0a0; }
.status-wontfix { border-color: #c08080; color: #c08080; }
.status-duplicate { border-color: #808080; color: #808080; }
.status-pending { border-color: var(--highlight); color: var(--highlight); }
.status-closed { border-color: #909090; color: #909090; }
.status-moreinfo { border-color: #80a0c0; color: #80a0c0; }

/* Bug priority badges */
.priority-low { border-color: #708090; color: #708090; }
.priority-normal { border-color: #80a880; color: #80a880; }
.priority-high { border-color: var(--highlight); color: var(--highlight); }
.priority-critical { border-color: #c06050; color: #c06050; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--text-dim); color: var(--text-bright); text-decoration: none; background: var(--bg-hover); }
.btn-primary { border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { background: rgba(95,175,95,0.1); color: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: rgba(175,95,95,0.1); color: #cf7070; }
.btn-small { padding: 0.2rem 0.5rem; font-size: 0.7rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: lowercase;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
}
.form-group textarea { resize: vertical; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* Auth form */
.auth-form { max-width: 400px; margin: 2rem auto; }

/* Error page */
.error-page { text-align: center; padding: 3rem 1rem; max-width: 500px; margin: 0 auto; }
.error-code { font-size: 5rem; font-weight: 700; color: var(--text-dim); line-height: 1; margin-bottom: 0.5rem; font-family: var(--font-mono, monospace); }
.error-page h1 { font-size: 1.4rem; margin-bottom: 0.75rem; }
.error-message { color: var(--text-dim); margin-bottom: 1.5rem; }
.error-actions { display: flex; gap: 0.75rem; justify-content: center; }
.error-actions .btn-secondary { border-color: var(--border); color: var(--text-dim); }
.error-actions .btn-secondary:hover { border-color: var(--text-dim); color: var(--text-bright); background: var(--bg-hover); }

/* Alert */
.alert { padding: 0.6rem 0.85rem; border-radius: 3px; margin-bottom: 1rem; font-size: 0.85rem; }
.alert-error { background: var(--error-bg); border: 1px solid var(--error); color: #c08080; }

/* ---- Posts (2-column layout) ---- */
.posts { margin-bottom: 1.5rem; }
.post {
    display: grid;
    grid-template-columns: minmax(100px, 200px) 1fr;
    grid-template-rows: auto auto;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.post-sidebar {
    grid-row: 1 / -1;
    background: var(--bg-sidebar);
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.post-author { font-weight: 600; font-size: 0.85rem; overflow-wrap: break-word; }
.post-author a { color: var(--highlight); }
.post-author a:hover { color: var(--text-bright); }
.char-post-name { color: var(--highlight); }
.char-post-reveal { display: none; font-size: 0.7rem; color: var(--text-dim); }
.char-post-reveal.show { display: block; }
.char-post-reveal-inline { font-size: 0.7rem; color: var(--text-dim); }
.post-date { color: var(--text-dim); font-size: 0.7rem; }
.post-body {
    padding: 0.75rem;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    font-size: 0.85rem;
    font-family: var(--font-prose);
}
.post-body ul, .post-body ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.post-body ul li, .post-body ol li { margin-bottom: 0.2rem; line-height: 1.6; }
.post-body p { margin-bottom: 0.75rem; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 3px; }
.post-body blockquote {
    border-left: 2px solid var(--accent);
    margin: 0.5rem 0;
    padding: 0.4rem 0.65rem;
    color: var(--text-dim);
    background: var(--bg-input-sm);
    border-radius: 0 3px 3px 0;
}
.post-body code {
    background: var(--bg-code);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    font-size: 0.85em;
    color: var(--highlight);
    font-family: var(--font-mono);
}
.post-body pre {
    background: var(--bg-input);
    padding: 0.65rem;
    border-radius: 3px;
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 0.5rem 0;
}
.post-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.85em;
    color: var(--text);
    display: block;
    line-height: 1.5;
}
/* MUD log blocks — terminal-style rendering with game colors */
.post-body pre.mudlog,
.wiki-content pre.mudlog {
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0.65rem;
    line-height: 1.45;
}
.post-body pre.mudlog code,
.wiki-content pre.mudlog code {
    color: #aaaaaa;
    white-space: pre-wrap;
    word-wrap: break-word;
}
/* Syntax highlighted code blocks get slightly more padding */
.post-body pre[style],
.wiki-content pre[style] {
    padding: 0.65rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    margin: 0.5rem 0;
    overflow-x: auto;
}
/* Tables in posts and preview */
.post-body table, .mde-preview-content table {
    border-collapse: collapse;
    margin: 0.75rem 0;
    width: 100%;
}
.post-body table td, .post-body table th,
.mde-preview-content table td, .mde-preview-content table th {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    line-height: 1.5;
    font-size: 0.85rem;
}
.post-body table th, .mde-preview-content table th {
    color: var(--text-bright);
    font-weight: 600;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}
.post-body table tr:nth-child(even) td, .mde-preview-content table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.post-body table tr:hover td, .mde-preview-content table tr:hover td { background: rgba(255,255,255,0.04); }
.post-edited { color: var(--text-dim); font-size: 0.7rem; font-style: italic; margin-top: 0.5rem; }
.post-actions {
    grid-column: 2;
    padding: 0.4rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
}
.post-reactions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}
.react-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.react-btn:hover { border-color: var(--accent); color: var(--text); }
.react-btn.reacted { border-color: var(--accent); color: var(--accent); }
.react-btn.react-add { opacity: 0.5; }
.react-btn.react-add:hover { opacity: 1; }
.post-buttons { display: flex; gap: 0.4rem; }

/* Subscribe button */
.subscribe-form { display: inline; }
.btn-subscribed { border-color: var(--accent); color: var(--accent); }

/* Topic header with subscribe */
.topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Reply form */
.reply-form {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
}
.reply-form h3 { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text-bright); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.pagination a, .pagination .current {
    padding: 0.25rem 0.55rem;
    border-radius: 2px;
    font-size: 0.8rem;
}
.pagination a { border: 1px solid var(--border); color: var(--text-dim); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); color: var(--bg-body); font-weight: 600; }
.pagination .ellipsis { color: var(--text-dim); padding: 0.25rem 0.3rem; }

/* ---- Mod panel ---- */
.mod-panel { margin-bottom: 1rem; }
.mod-panel summary { cursor: pointer; font-size: 0.8rem; }
.mod-panel.inline { display: inline-block; margin-left: 0.5rem; }
.mod-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; padding: 0.65rem; background: var(--bg-secondary); border-radius: 3px; }
.inline-form { display: inline-flex; gap: 0.25rem; align-items: center; }
.inline-form select {
    padding: 0.2rem 0.35rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

/* ---- Bug / Prayer info bars ---- */
.bug-info, .prayer-info {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.65rem;
    margin-bottom: 1rem;
}
.bug-badges { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.bug-update-form {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.bug-update-form select {
    padding: 0.2rem 0.35rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}
.prayer-info { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* Bug filters */
.bug-filters { margin-bottom: 1rem; }
.filter-form { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.filter-form select {
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* ---- Forum Row Layout ---- */
.forum-row {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    transition: background 0.15s;
}
.forum-row:hover { background: var(--bg-hover); }

.forum-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}
.forum-icon svg { width: 22px; height: 22px; fill: currentColor; }

.forum-info { flex: 1; min-width: 0; }
.forum-info .forum-name { display: block; color: var(--link); font-size: 0.9rem; }
.forum-info .forum-name:hover { color: var(--link-hover); }
.forum-info .forum-badges { margin-top: 0.1rem; }

.forum-stats {
    display: flex;
    gap: 1.25rem;
    flex-shrink: 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.75rem;
}
.forum-stats .stat-group { min-width: 45px; }
.forum-stats .stat-count { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.forum-stats .stat-label { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; }

.forum-lastpost {
    flex-shrink: 0;
    width: 170px;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.4;
}
.forum-lastpost a { color: var(--link); font-weight: 600; font-size: 0.75rem; }
.forum-lastpost .lastpost-by { color: var(--text-dim); }
.forum-lastpost .no-posts { font-style: italic; }

.forum-rows {
    border: 1px solid var(--border);
    border-top: none;
    margin-bottom: 0;
}

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-dim);
    font-size: 0.7rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Topic form */
.topic-form { max-width: 700px; }

/* ---- Profile page ---- */
.profile-header { margin-bottom: 1.5rem; }
.profile-info { display: flex; gap: 1rem; color: var(--text-dim); font-size: 0.8rem; }
.character-list { margin-bottom: 1.5rem; }
.character-list h2, .recent-posts h2 { margin-bottom: 0.75rem; }
.recent-posts { margin-bottom: 1.5rem; }
tr.current-char td { background: rgba(95,175,95,0.06); }

/* Auth divider */
.auth-divider { text-align: center; color: var(--text-dim); margin: 1.5rem 0; font-size: 0.8rem; }

/* ---- Item search ---- */
.item-search-form { margin-bottom: 1.5rem; }
.item-search-form .form-row { margin-bottom: 0; }
.item-search-form .btn { margin-top: 0.5rem; }
.item-count { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 0.75rem; }
.item-table .num { text-align: center; width: 60px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
.item-flags { font-size: 0.75rem; color: var(--text-dim); }
.item-affects { font-size: 0.75rem; color: var(--accent); }
.item-area { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.empty-message { color: var(--text-dim); padding: 2rem 0; text-align: center; font-size: 0.85rem; }

/* ---- Item detail ---- */
.item-detail { display: flex; flex-direction: column; gap: 1.25rem; }
.item-section {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.85rem;
}
.item-section h2 { color: var(--highlight); font-size: 0.8rem; margin-bottom: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; }
.item-props { width: 100%; border-collapse: collapse; }
.item-props th { text-align: left; padding: 0.2rem 0.65rem 0.2rem 0; color: var(--text-dim); font-weight: 400; width: 120px; font-size: 0.8rem; }
.item-props td { padding: 0.2rem 0; color: var(--text); font-size: 0.8rem; }
.identify-label { color: var(--text-dim); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.4rem; }
pre.identify-output {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.85rem;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}
.item-meta { display: flex; gap: 1rem; background: none; border: none; padding: 0; backdrop-filter: none; }
.meta-tag { color: var(--text-dim); font-size: 0.75rem; }
.flag-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* ---- Wiki layout ---- */
.container:has(.wiki-layout),
.container:has(.posts) { max-width: 1200px; }
.wiki-layout {
    display: flex;
    gap: 0;
    margin: -1.5rem;
    min-height: calc(100vh - 120px);
}
.wiki-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 44px;
    align-self: flex-start;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    scrollbar-width: none;
}
.wiki-sidebar::-webkit-scrollbar { display: none; }
.sidebar-group { margin-bottom: 1rem; }
.sidebar-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 0.25rem 1rem;
    font-weight: 600;
}
.wiki-sidebar ul { list-style: none; margin: 0; padding: 0; }
.wiki-sidebar li a {
    display: block;
    padding: 0.2rem 1rem;
    font-size: 0.8rem;
    color: var(--text);
    border-left: 2px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.wiki-sidebar li a:hover {
    background: var(--bg-hover);
    color: var(--accent);
    text-decoration: none;
}
.wiki-sidebar li a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(95,175,95,0.06);
}
.wiki-main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 2rem;
}
.wiki-page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.wiki-page-header h1 { margin-bottom: 0; }
.wiki-page-actions { display: flex; gap: 0.4rem; }

/* Wiki content area */
.wiki-content { overflow-x: auto; font-family: var(--font-prose); }
.wiki-content h1, .wiki-content h2, .wiki-content h3,
.wiki-content h4, .wiki-content h5, .wiki-content h6 {
    color: var(--highlight);
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0) 100%);
    padding: 0.2rem 0.5rem;
}
.wiki-content h1 { font-size: 1.3rem; border-bottom: none; }
.wiki-content h2 { font-size: 1.15rem; border-bottom: none; }
.wiki-content h3 { font-size: 1.05rem; }
.wiki-content h4 { font-size: 0.95rem; }
.wiki-content h5 { font-size: 0.9rem; }
.wiki-content h6 { font-size: 0.85rem; color: var(--text); }
.wiki-content p { margin-bottom: 0.75rem; line-height: 1.7; }
.wiki-content .drop-cap {
    float: left;
    font-size: 4.5em;
    line-height: 0.7;
    padding: 0.05em 0.15em 0 0;
    color: var(--highlight);
    font-weight: 700;
    font-family: Georgia, 'Times New Roman', serif;
}
.wiki-content ul, .wiki-content ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.wiki-content ul li, .wiki-content ol li { margin-bottom: 0.2rem; line-height: 1.6; }
.wiki-content table { border-collapse: collapse; margin: 0.75rem 0; width: 100%; }
.wiki-content table td, .wiki-content table th {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    line-height: 1.5;
    font-size: 0.85rem;
}
.wiki-content table th {
    color: var(--text-bright);
    font-weight: 600;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}
.wiki-content table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.wiki-content table tr:hover td { background: rgba(255,255,255,0.04); }
.wiki-content pre {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.65rem;
    overflow-x: auto;
    font-size: 0.82em;
    color: var(--text);
    margin: 0.5rem 0;
}
.wiki-content pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }
.wiki-content code {
    background: var(--bg-code);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    font-size: 0.85em;
    color: var(--highlight);
    font-family: var(--font-mono);
}
.wiki-content pre.file { border-left: 2px solid var(--accent); }
.wiki-content hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.wiki-content blockquote {
    border-left: 2px solid var(--accent);
    margin: 0.5rem 0;
    padding: 0.4rem 0.65rem;
    color: var(--text-dim);
    background: var(--bg-input-sm);
    border-radius: 0 3px 3px 0;
}
.wiki-content blockquote blockquote { margin: 0.25rem 0; }
.wiki-content u { text-decoration: underline; }
.wiki-content del { text-decoration: line-through; color: var(--text-dim); }

/* TOC */
.wiki-content nav.toc {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    display: inline-block;
    min-width: 180px;
}
.wiki-content .toc-title { font-weight: 600; color: var(--text-bright); margin-bottom: 0.4rem; font-size: 0.8rem; }
.wiki-content nav.toc ul { margin: 0; padding-left: 1.1rem; list-style: decimal; }
.wiki-content nav.toc ul ul { list-style: decimal; }
.wiki-content nav.toc li { margin-bottom: 0.1rem; font-size: 0.75rem; }

/* Footnotes */
.wiki-content .footnotes {
    margin-top: 1.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
}
.wiki-content .footnote { margin-bottom: 0.25rem; }
.wiki-content sup.footnote a { color: var(--accent); font-weight: 600; }
.wiki-page-meta {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}
.wiki-not-found { padding: 2rem 0; text-align: center; }
.wiki-not-found p { margin-bottom: 1rem; }

/* Wiki links */
a.wiki-link { color: var(--link); }
a.wiki-link-missing { color: var(--error); }
a.wiki-link-missing:hover { color: #cf7070; }

/* Wiki edit form */
.wiki-edit-form textarea {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-input);
}
.wiki-edit-actions { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.wiki-markup-help { margin-top: 1rem; color: var(--text-dim); }
.wiki-markup-help summary { cursor: pointer; font-size: 0.8rem; }
.wiki-help-table { margin-top: 0.4rem; font-size: 0.75rem; }
.wiki-help-table td { padding: 0.15rem 0.65rem 0.15rem 0; }
.wiki-help-table code { background: var(--bg-code); padding: 0.1rem 0.25rem; border-radius: 2px; font-size: 0.82em; color: var(--highlight); }

/* Wiki pending banner */
.alert-pending {
    background: rgba(215,175,95,0.1);
    border: 1px solid var(--highlight);
    color: var(--highlight);
    padding: 0.6rem 0.85rem;
    border-radius: 3px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Wiki search */
.wiki-search-form .form-row { display: flex; gap: 0.4rem; align-items: flex-end; }
.wiki-search-form .form-group { flex: 1; margin-bottom: 0; }
.wiki-search-form .btn { margin-bottom: 0; }

/* Wiki pending actions */
.wiki-pending-actions { white-space: nowrap; }

/* ---- Diff view ---- */
.diff-meta { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 1rem; }
.diff-view {
    font-size: 0.8rem;
    line-height: 1.5;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow-x: auto;
}
.diff-line { padding: 0.05rem 0.65rem; white-space: pre-wrap; word-break: break-all; }
.diff-add { background: rgba(95,175,95,0.12); color: #80c080; }
.diff-del { background: rgba(175,95,95,0.12); color: #c08080; }
.diff-eq { color: var(--text-dim); }
.diff-prefix { display: inline-block; width: 1.5em; color: inherit; user-select: none; }

/* Text dim helper */
.text-dim { color: var(--text-dim); }

/* ---- Changes page ---- */
.changes-date {
    color: var(--highlight);
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.changes-date:first-child { margin-top: 0; }
.changes-list { margin: 0 0 1rem 1.5rem; font-size: 0.85rem; font-family: var(--font-prose); }
.changes-list li { margin-bottom: 0.35rem; line-height: 1.5; }

/* ---- Markdown Editor ---- */
.mde-wrapper {
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.mde-toolbar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.25rem 0.4rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.mde-toolbar button {
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.mde-toolbar button:hover { color: var(--text); border-color: var(--border); }
.mde-toolbar button.active { color: var(--accent); border-color: var(--accent); }
.mde-sep { width: 1px; height: 16px; background: var(--border); margin: 0 0.3rem; }
.mde-body { position: relative; }
.mde-editor-pane textarea {
    width: 100%;
    min-height: 180px;
    padding: 0.65rem;
    background: var(--bg-input);
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}
.mde-editor-pane textarea:focus { outline: none; }
.mde-preview-pane {
    min-height: 180px;
    padding: 0.65rem;
    background: rgba(5,5,5,0.6);
}
.mde-preview-content { font-size: 0.85rem; font-family: var(--font-prose); }
.mde-loading { color: var(--text-dim); font-size: 0.8rem; padding: 0.5rem; }

/* ---- Theme toggle button ---- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-left: 1px solid var(--nav-sep);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.75rem;
    height: 100%;
    transition: color 0.15s;
}
.theme-toggle:hover { color: var(--text); }
.mobile-nav .theme-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-left: none;
    border-radius: 3px;
    font-size: 0.85rem;
    height: auto;
}
.mobile-nav .theme-toggle:hover { background: var(--bg-hover); }

/* ---- Light mode ---- */
[data-theme="light"] {
    /* Warm parchment surface scale */
    --bg-body:      #F5F3EE;
    --bg-panel:     #FFFFFF;
    --bg-secondary: #F0EFEB;
    --bg-hover:     #ECEAE5;
    --bg-input:     #F8F7F4;
    --bg-input-sm:  #F3F2EE;
    --bg-nav:       rgba(255,255,255,0.92);
    --bg-header:    #EDECEA;
    --bg-sidebar:   #F8F7F4;
    --bg-code:      #EFEEE9;

    /* Borders */
    --border:       rgba(0,0,0,0.10);
    --border-focus: rgba(45,125,45,0.5);
    --nav-sep:      rgba(0,0,0,0.06);
    --nav-hover:    rgba(0,0,0,0.04);
    --nav-active:   rgba(0,0,0,0.07);

    /* Text — dark warm gray, never pure black */
    --text:         #1A1A1A;
    --text-bright:  #0D0D0D;
    --text-dim:     #6B7280;

    /* Accents — darkened for contrast on light surfaces */
    --accent:       #2D7D2D;
    --accent-hover: #1E5E1E;
    --link:         #2563EB;
    --link-hover:   #1D4ED8;
    --highlight:    #8B5E14;
    --error:        #B91C1C;
    --error-bg:     rgba(185,28,28,0.06);
    --success:      #2D7D2D;
}

/* Light: background image — wash to subtle warm texture */
[data-theme="light"] body::before {
    filter: blur(2px) brightness(1.8) saturate(0.2);
    opacity: 0.5;
}

/* Light: @supports fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    [data-theme="light"] body { background: #F5F3EE; }
    [data-theme="light"] .panel { background: #FFFFFF; }
}

/* Light: depth via soft shadows (replacing dark mode glow/transparency) */
[data-theme="light"] .panel,
[data-theme="light"] .post,
[data-theme="light"] .reply-form,
[data-theme="light"] .bug-info,
[data-theme="light"] .prayer-info,
[data-theme="light"] .item-section,
[data-theme="light"] .diff-view {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}

/* Light: heading weight reduction — light mode can rely on weight contrast */
[data-theme="light"] h1,
[data-theme="light"] h2 { font-weight: 600; }

/* Light: wiki heading gradient — warm gold tint instead of dark overlay */
[data-theme="light"] .wiki-content h1,
[data-theme="light"] .wiki-content h2,
[data-theme="light"] .wiki-content h3,
[data-theme="light"] .wiki-content h4,
[data-theme="light"] .wiki-content h5,
[data-theme="light"] .wiki-content h6 {
    background: linear-gradient(90deg, rgba(139,94,20,0.07) 0%, rgba(139,94,20,0.03) 50%, rgba(139,94,20,0) 100%);
    font-weight: 600;
}

/* Light: table striping */
[data-theme="light"] .post-body table tr:nth-child(even) td,
[data-theme="light"] .mde-preview-content table tr:nth-child(even) td,
[data-theme="light"] .wiki-content table tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
[data-theme="light"] .post-body table tr:hover td,
[data-theme="light"] .mde-preview-content table tr:hover td,
[data-theme="light"] .wiki-content table tr:hover td { background: rgba(0,0,0,0.04); }

/* Light: button hover tints using light-mode accent values */
[data-theme="light"] .btn-primary:hover { background: rgba(45,125,45,0.08); }
[data-theme="light"] .btn-danger:hover { background: rgba(185,28,28,0.06); color: #991B1B; }

/* Light: badge colors — darkened for contrast on light backgrounds */
[data-theme="light"] .badge-lock { border-color: #92600A; color: #92600A; }
[data-theme="light"] .status-open { border-color: #2D7D2D; color: #2D7D2D; }
[data-theme="light"] .status-confirmed { border-color: #7D7D1A; color: #7D7D1A; }
[data-theme="light"] .status-progress { border-color: #2D5F8A; color: #2D5F8A; }
[data-theme="light"] .status-fixed { border-color: #2D7D5F; color: #2D7D5F; }
[data-theme="light"] .status-wontfix { border-color: #8A4040; color: #8A4040; }
[data-theme="light"] .status-duplicate { border-color: #6B7280; color: #6B7280; }
[data-theme="light"] .status-closed { border-color: #6B7280; color: #6B7280; }
[data-theme="light"] .status-moreinfo { border-color: #2D5F8A; color: #2D5F8A; }
[data-theme="light"] .priority-low { border-color: #4B5563; color: #4B5563; }
[data-theme="light"] .priority-normal { border-color: #2D7D2D; color: #2D7D2D; }
[data-theme="light"] .priority-critical { border-color: #B91C1C; color: #B91C1C; }

/* Light: alert text */
[data-theme="light"] .alert-error { color: #991B1B; }
[data-theme="light"] .alert-pending { background: rgba(139,94,20,0.06); }

/* Light: badges on accent backgrounds need white text */
[data-theme="light"] .unread-badge,
[data-theme="light"] .nav-unread,
[data-theme="light"] .pagination .current { color: #FFFFFF; }

/* Light: status indicator */
[data-theme="light"] .status-dot { background: #9CA3AF; }
[data-theme="light"] .status-dot.online {
    background: #2D7D2D;
    box-shadow: 0 0 4px rgba(45,125,45,0.4);
}
[data-theme="light"] .nav-status.online { color: #2D7D2D; }

/* Light: wiki sidebar active */
[data-theme="light"] .wiki-sidebar li a.active { background: rgba(45,125,45,0.06); }

/* Light: current character row */
[data-theme="light"] tr.current-char td { background: rgba(45,125,45,0.05); }

/* Light: wiki missing link hover */
[data-theme="light"] a.wiki-link-missing:hover { color: #991B1B; }

/* Light: diff colors */
[data-theme="light"] .diff-add { background: rgba(45,125,45,0.08); color: #166534; }
[data-theme="light"] .diff-del { background: rgba(185,28,28,0.08); color: #991B1B; }

/* Light: markdown editor preview */
[data-theme="light"] .mde-preview-pane { background: rgba(0,0,0,0.015); }

/* Light: MUD log blocks stay dark (terminal content) */
[data-theme="light"] .post-body pre.mudlog,
[data-theme="light"] .wiki-content pre.mudlog {
    background: #0A0A0A;
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
[data-theme="light"] .post-body pre.mudlog code,
[data-theme="light"] .wiki-content pre.mudlog code { color: #AAAAAA; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .forum-stats { gap: 0.75rem; }
    .forum-lastpost { width: 140px; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .mobile-nav { display: flex; }
    .nav-tabs, .nav-right { display: none; }

    .container { padding: 1rem; }
    .forum-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .count, .meta { display: none; }
    .form-row { flex-direction: column; gap: 0; }
    .mod-actions { flex-direction: column; }
    .bug-filters .filter-form { flex-direction: column; }
    .forum-stats, .forum-lastpost, .forum-icon { display: none; }
    .forum-row { padding: 0.5rem 0.75rem; }

    /* Touch-friendly targets (min 44px) */
    .btn, button, .nav-tabs a, .mobile-nav a, .pagination a, .pagination span {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .topic-list td { padding: 0.6rem 0.5rem; }
    .topic-title { min-height: 44px; display: inline-flex; align-items: center; }

    /* Posts go single-column on mobile */
    .post { grid-template-columns: 1fr; }
    .post-sidebar {
        grid-row: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
    }
    .post-actions { grid-column: 1; flex-wrap: wrap; }
    .post-reactions { flex-wrap: wrap; }

    /* Topic header */
    .topic-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

    .wiki-layout { flex-direction: column; }
    .wiki-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0 1.25rem;
        top: auto;
    }
    .sidebar-group { margin-bottom: 0.15rem; }
    .wiki-sidebar li a { padding: 0.3rem 0.85rem; min-height: 44px; display: flex; align-items: center; }
    .wiki-main { padding: 1rem; }
    .wiki-page-header { flex-direction: column; gap: 0.4rem; }
}

@media (max-width: 480px) {
    body { font-size: 13px; }
    .navbar { height: 40px; }
    .nav-brand { font-size: 0.8rem; padding: 0 0.85rem; }
    .post-actions { flex-direction: column; }
    .post-buttons { flex-wrap: wrap; }
}
