:root {
    --bg: #070a0d;
    --bg-soft: #0b1015;
    --panel: #0e141a;
    --panel-2: #111920;
    --panel-3: #16212a;
    --border: #1d2b36;
    --border-soft: #16222b;
    --text: #d8e2ea;
    --muted: #7d8d9b;
    --muted-2: #566571;
    --accent: #4ade80;
    --accent-dim: #22a85a;
    --accent-glow: rgba(74, 222, 128, 0.14);
    --cyan: #38bdf8;
    --danger: #f87171;
    --warn: #fbbf24;
    --violet: #a78bfa;
    --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 10px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1000px 520px at 12% -10%, rgba(74, 222, 128, 0.09), transparent 62%),
        radial-gradient(900px 460px at 94% 0%, rgba(56, 189, 248, 0.07), transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        var(--bg);
    background-size: auto, auto, 42px 42px, 42px 42px, auto;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #8af0ae;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    line-height: 1.25;
    font-family: var(--mono);
    letter-spacing: -0.02em;
    color: #eef6f1;
}

p {
    margin: 0 0 1em;
}

ul, ol {
    margin: 0 0 1em;
    padding-left: 1.35em;
}

code, kbd, pre, .mono {
    font-family: var(--mono);
}

code {
    padding: 0.12em 0.38em;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #0a1116;
    color: #9ff0bd;
    font-size: 0.88em;
}

pre {
    overflow-x: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080d11;
    color: #b9e6c9;
    font-size: 13px;
}

::selection {
    background: rgba(74, 222, 128, 0.28);
    color: #fff;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12.5px;
}

.tiny {
    font-size: 11.5px;
}

.accent {
    color: var(--accent);
}

.cyan {
    color: var(--cyan);
}

.danger {
    color: var(--danger);
}

.warn {
    color: var(--warn);
}

.nowrap {
    white-space: nowrap;
}

.top-gap {
    margin-top: 22px;
}

/* ── Header ───────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 13, 0.86);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: #eafff2;
}

.brand:hover {
    color: #eafff2;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(74, 222, 128, 0.5);
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(74, 222, 128, 0.18), rgba(74, 222, 128, 0.03));
    color: var(--accent);
    box-shadow: 0 0 22px rgba(74, 222, 128, 0.12) inset;
}

.brand-text {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-text span {
    color: var(--accent);
}

.brand-sub {
    display: block;
    margin-top: -2px;
    color: var(--muted-2);
    font-size: 9.5px;
    font-family: var(--mono);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-link {
    padding: 8px 11px;
    border-radius: 7px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.nav-link.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
}

.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(14, 20, 26, 0.7);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.1);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.menu-toggle {
    display: none;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

/* ── Buttons ──────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    border-color: #2d4150;
    background: var(--panel-3);
    color: #fff;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    border-color: rgba(74, 222, 128, 0.55);
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.25), rgba(74, 222, 128, 0.12));
    color: #a9ffc4;
}

.btn-primary:hover {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.34), rgba(74, 222, 128, 0.16));
    color: #e2ffeb;
}

.btn-ghost {
    background: transparent;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11.5px;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Layout / panels ──────────────────────────────────── */

.page {
    padding: 28px 0 54px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(17, 25, 32, 0.9), rgba(11, 16, 21, 0.94));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.panel-title-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

.panel-body {
    padding: 18px;
}

.panel-body-flush {
    padding: 0;
}

.grid {
    display: grid;
    gap: 18px;
}

.layout-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.stack {
    display: grid;
    gap: 18px;
}

/* ── Hero ─────────────────────────────────────────────── */

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 26px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        radial-gradient(600px 220px at 0% 0%, rgba(74, 222, 128, 0.12), transparent 70%),
        linear-gradient(130deg, rgba(17, 25, 32, 0.96), rgba(9, 14, 18, 0.98));
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(74, 222, 128, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 5px 10px;
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.07);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 640px;
    margin-bottom: 12px;
    font-size: clamp(28px, 4vw, 46px);
    letter-spacing: -0.04em;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero p {
    max-width: 590px;
    color: var(--muted);
    font-size: 14.5px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-side {
    position: relative;
    z-index: 1;
    align-self: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(7, 11, 14, 0.68);
}

.terminal-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--border-soft);
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2a3945;
}

.terminal-dot.d1 { background: #f87171; }
.terminal-dot.d2 { background: #fbbf24; }
.terminal-dot.d3 { background: #4ade80; }

.terminal-title {
    margin-left: auto;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
}

.terminal-body {
    padding: 16px;
    font-family: var(--mono);
    font-size: 12px;
    color: #9db3a7;
}

.terminal-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(29, 43, 54, 0.7);
}

.terminal-line:last-child {
    border-bottom: 0;
}

.terminal-line span:first-child {
    color: var(--muted-2);
}

.terminal-line span:last-child {
    color: #c9f6d7;
}

.cursor {
    display: inline-block;
    width: 7px;
    height: 13px;
    margin-left: 2px;
    background: var(--accent);
    vertical-align: -2px;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ── Stats ────────────────────────────────────────────── */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.stat-card {
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(14, 20, 26, 0.72);
}

.stat-value {
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: #eafff2;
}

.stat-label {
    margin-top: 5px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ── Categories ───────────────────────────────────────── */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.category-card {
    position: relative;
    display: block;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(20, 29, 37, 0.85), rgba(10, 15, 19, 0.92));
    color: var(--text);
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.category-card:hover {
    border-color: rgba(74, 222, 128, 0.38);
    background: linear-gradient(160deg, rgba(24, 36, 45, 0.92), rgba(11, 17, 22, 0.96));
    color: var(--text);
    transform: translateY(-2px);
}

.category-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 2px;
    border-radius: 2px;
    background: var(--cat-color, var(--accent));
    opacity: 0.8;
}

.category-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.category-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(7, 11, 14, 0.6);
    color: var(--cat-color, var(--accent));
}

.category-name {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.category-desc {
    min-height: 38px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
}

/* ── Topic list / table ───────────────────────────────── */

.topic-list {
    display: grid;
}

.topic-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 92px 150px;
    gap: 14px;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
}

.topic-row:last-child {
    border-bottom: 0;
}

.topic-row:hover {
    background: rgba(255, 255, 255, 0.022);
    color: var(--text);
}

.topic-avatar,
.member-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(74, 222, 128, 0.14), rgba(56, 189, 248, 0.07));
    color: #b7f7cb;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.topic-title {
    display: block;
    overflow: hidden;
    margin-bottom: 3px;
    color: #e5eef5;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-row:hover .topic-title {
    color: var(--accent);
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
}

.topic-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9.5px;
}

.topic-counts {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.topic-counts span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 44px;
    justify-content: flex-end;
}

.topic-last {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.35;
    text-align: right;
}

.topic-last strong {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sidebar widgets ──────────────────────────────────── */

.widget-list {
    display: grid;
    gap: 0;
}

.widget-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px dashed var(--border-soft);
}

.widget-item:first-child {
    padding-top: 0;
}

.widget-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.widget-num {
    flex: 0 0 auto;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.widget-main {
    min-width: 0;
    flex: 1;
}

.widget-title {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.widget-title:hover {
    color: var(--accent);
}

.widget-sub {
    margin-top: 2px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.announce {
    padding: 13px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.05);
    color: #d8c69a;
    font-size: 12.5px;
    line-height: 1.55;
}

.announce strong {
    display: block;
    margin-bottom: 4px;
    color: var(--warn);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Page header ──────────────────────────────────────── */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    margin-bottom: 7px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.page-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    font-size: clamp(22px, 3vw, 32px);
}

.page-title svg {
    color: var(--accent);
}

.page-desc {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.page-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

/* ── Topic detail ─────────────────────────────────────── */

.topic-head {
    padding: 22px;
    border-bottom: 1px solid var(--border-soft);
}

.topic-head h1 {
    margin-bottom: 9px;
    font-size: clamp(21px, 3vw, 30px);
}

.topic-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 15px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
}

.topic-head-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post {
    display: grid;
    grid-template-columns: 158px minmax(0, 1fr);
    border-bottom: 1px solid var(--border-soft);
}

.post:last-child {
    border-bottom: 0;
}

.post-author {
    padding: 18px 15px;
    border-right: 1px solid var(--border-soft);
    background: rgba(7, 11, 14, 0.38);
}

.post-author .member-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    font-size: 15px;
}

.post-author-name {
    display: block;
    color: #dff8e7;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.post-author-name:hover,
.meta-link:hover {
    color: var(--accent);
}

.meta-link {
    color: inherit;
}

.post-author-role {
    display: inline-block;
    margin-top: 3px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-author-stats {
    margin-top: 9px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.7;
}

.post-body {
    min-width: 0;
    padding: 18px 20px;
}

.post-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-soft);
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.post-content {
    color: #c9d6df;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.post-content blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 2px solid var(--accent-dim);
    background: rgba(74, 222, 128, 0.04);
    color: var(--muted);
}

.reply-box {
    padding: 18px;
}

.reply-box h3 {
    font-size: 13px;
}

/* ── Forms / auth ─────────────────────────────────────── */

.auth-wrap {
    display: grid;
    place-items: center;
    padding: 34px 0 10px;
}

.auth-card {
    width: min(440px, 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(170deg, rgba(17, 25, 32, 0.97), rgba(9, 14, 18, 0.98));
    box-shadow: var(--shadow);
}

.auth-card-body {
    padding: 28px;
}

.auth-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 16px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 10px;
    background: rgba(74, 222, 128, 0.08);
    color: var(--accent);
}

.auth-card h1 {
    margin-bottom: 5px;
    font-size: 23px;
}

.auth-sub {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 12.5px;
}

.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
    background: #080d11;
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: rgba(74, 222, 128, 0.55);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.08);
}

.form-field textarea {
    min-height: 110px;
    resize: vertical;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 18px;
    color: var(--muted);
    font-size: 12px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.form-note {
    margin-top: 16px;
    color: var(--muted-2);
    font-size: 11.5px;
    text-align: center;
}

.form-alert {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 7px;
    background: rgba(248, 113, 113, 0.08);
    color: #fca5a5;
    font-size: 12.5px;
}

.form-alert.show {
    display: block;
}

.form-alert.ok {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.07);
    color: #9ff0bd;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ── Tables (members) ────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 11, 14, 0.5);
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 12.5px;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.member-cell .member-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

.profile-avatar-lg {
    width: 42px;
    height: 42px;
    font-size: 13px;
}

.member-name {
    display: block;
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
}

.member-role {
    color: var(--muted-2);
    font-size: 10.5px;
}

.role-badge {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.role-badge.admin {
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

.role-badge.mod {
    border-color: rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.role-badge.veteran {
    border-color: rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
}

/* ── Rules / content ──────────────────────────────────── */

.prose {
    color: #c4d1da;
    font-size: 14px;
    line-height: 1.75;
}

.prose h2 {
    margin-top: 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 17px;
}

.prose h2:first-child {
    margin-top: 0;
}

.prose li {
    margin-bottom: 7px;
}

.rule-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border-soft);
}

.rule-item:last-child {
    border-bottom: 0;
}

.rule-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
}

.rule-item h3 {
    margin: 0 0 3px;
    font-size: 13px;
}

.rule-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

/* ── 404 ──────────────────────────────────────────────── */

.error-page {
    display: grid;
    place-items: center;
    min-height: 62vh;
    text-align: center;
}

.error-code {
    margin-bottom: 8px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: clamp(64px, 12vw, 132px);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
    text-shadow: 0 0 40px rgba(74, 222, 128, 0.2);
}

.error-page h1 {
    font-size: 22px;
}

.error-page p {
    max-width: 480px;
    margin: 0 auto 20px;
    color: var(--muted);
}

/* ── Footer ───────────────────────────────────────────── */

.site-footer {
    margin-top: 44px;
    border-top: 1px solid var(--border);
    background: rgba(7, 10, 13, 0.65);
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px;
    padding: 28px 0;
}

.footer-brand {
    max-width: 380px;
}

.footer-brand .brand-text {
    font-size: 15px;
}

.footer-brand p {
    margin: 10px 0 0;
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-links a {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    padding: 14px 0 22px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.04em;
}

/* ── Tablo ────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
}

.table-wrap .data-table {
    min-width: 760px;
}

.table-empty {
    padding: 30px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 12px;
    text-align: center;
}

/* ── Utility / responsive ─────────────────────────────── */

.hide {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .layout-main {
        grid-template-columns: 1fr;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-side {
        max-width: 460px;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 20px 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(7, 10, 13, 0.98);
        backdrop-filter: blur(12px);
    }

    .main-nav.open {
        display: flex;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .online-pill {
        display: none;
    }

    .post {
        grid-template-columns: 120px minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .container {
        width: calc(100% - 24px);
    }

    .header-inner {
        height: 60px;
        gap: 10px;
    }

    .brand-sub {
        display: none;
    }

    .header-actions .btn-ghost {
        display: none;
    }

    .main-nav {
        top: 60px;
    }

    .hero {
        padding: 22px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .topic-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        padding: 12px 14px;
    }

    .topic-counts,
    .topic-last {
        display: none;
    }

    .topic-meta .tag {
        display: none;
    }

    .post {
        grid-template-columns: 1fr;
    }

    .post-author {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .post-author .member-avatar {
        width: 34px;
        height: 34px;
        margin: 0;
        font-size: 11px;
    }

    .post-author-stats {
        display: none;
    }

    .post-body {
        padding: 15px 16px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-inner {
        flex-direction: column;
    }

    .data-table .hide-sm {
        display: none;
    }
}

.locked-panel {
    padding: 42px 24px;
    text-align: center;
}

.locked-panel h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 18px;
}

.locked-panel p {
    margin: 0 auto 8px;
    max-width: 520px;
}

.locked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* --- Post author & Profile enhancements --- */
.author-avatar-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}
.author-avatar-link .member-avatar {
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.author-avatar-link:hover .member-avatar {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.35);
    transform: scale(1.05);
}
.post-author-name {
    display: block;
    color: #dff8e7;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}
.post-author-name:hover,
.meta-link:hover,
.author-chip:hover {
    color: var(--accent);
    text-decoration: underline;
}
.author-chip {
    font-weight: 600;
    cursor: pointer;
}
.post-author-stats span {
    display: block;
    font-size: 10px;
    line-height: 1.5;
}
.mention-link {
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 600;
    text-decoration: none;
    background: rgba(74, 222, 128, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(74, 222, 128, 0.25);
    transition: all 0.15s ease;
    display: inline-block;
    margin: 1px 2px;
}
.mention-link:hover {
    background: rgba(74, 222, 128, 0.22);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.2);
}
.custom-term-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.custom-term-line a.mention-link {
    padding: 0 4px;
    margin: 0;
}

/* --- Profile Messages Enhancements --- */
.profile-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-msg-card {
    padding: 12px 14px;
    background: rgba(14, 21, 28, 0.7);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    transition: all 0.15s ease;
}
.profile-msg-card:hover {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(18, 28, 38, 0.85);
}
.pm-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.pm-badge {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}
.pm-badge.starter {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.pm-badge.reply {
    background: rgba(74, 222, 128, 0.12);
    color: #86efac;
    border: 1px solid rgba(74, 222, 128, 0.25);
}
.pm-date {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}
.pm-topic-link {
    display: block;
    color: #e2e8f0;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    margin-bottom: 5px;
    word-break: break-word;
}
.pm-topic-link:hover {
    color: var(--accent);
    text-decoration: underline;
}
.pm-snippet {
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
