/* ============================================
   GrandRP Forum - Complete Stylesheet
   Minimal, Fast, Dark/Light Theme Support
   ============================================ */

/* CSS Variables */
:root {
    --bg1: #181a1f;
    --bg2: #1e2127;
    --bg3: #262a33;
    --bg4: #2e333d;
    --br: #363b47;
    --t1: #eef0f4;
    --t2: #9ca3b0;
    --t3: #6b7280;
    --acc: #22c55e;
    --acc2: #16a34a;
    --red: #ef4444;
    --org: #f59e0b;
    --blu: #3b82f6;
    --pur: #8b5cf6;
}

/* ============================================
   PRIVACY CONSENT
   ============================================ */
.consent-banner {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    margin: 0 auto;
    max-width: 960px;
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-md, 0 12px 30px rgba(0, 0, 0, 0.35));
    z-index: 200;
}

.consent-banner[hidden] {
    display: none;
}

.consent-banner__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.consent-banner__text {
    margin: 0;
    color: var(--t2);
    font-size: 13px;
    line-height: 1.4;
}

.consent-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.consent-banner__link {
    color: var(--t2);
    font-size: 13px;
    text-decoration: underline;
}

@media (max-width: 720px) {
    .consent-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .consent-banner__actions {
        width: 100%;
    }
}

[data-theme="light"] {
    --bg1: #f1f5f9;
    --bg2: #fff;
    --bg3: #f8fafc;
    --bg4: #fff;
    --br: #e2e8f0;
    --t1: #0f172a;
    --t2: #475569;
    --t3: #94a3b8;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg1);
    color: var(--t1);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--acc);
}

img {
    max-width: 100%;
    height: auto;
}

button, input, textarea, select {
    font: inherit;
}

/* ============================================
   HEADER
   ============================================ */
.hdr {
    background: var(--bg2);
    border-bottom: 2px solid var(--acc);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hdr-in {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
}

.logo-text {
    color: var(--t1);
}

.logo-text span {
    color: var(--acc);
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.hdr-search {
    flex: 1;
    max-width: 320px;
    margin: 0 16px;
    display: none;
    position: relative;
}

@media (min-width: 700px) {
    .hdr-search {
        display: block;
    }
}

.hdr-search input {
    width: 100%;
    padding: 8px 14px;
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 8px;
    color: var(--t1);
    font-size: 13px;
}

.hdr-search input::placeholder {
    color: var(--t3);
}

.hdr-search input:focus {
    outline: none;
    border-color: var(--acc);
}

.search-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--bg2) 0%, var(--bg3) 100%);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.28);
    backdrop-filter: blur(6px);
    z-index: 40;
    padding: 6px;
}

.search-suggest[hidden] {
    display: none;
}

.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--t1);
    text-decoration: none;
    position: relative;
    transition: transform 0.15s ease, background 0.15s ease;
}

.search-suggest-item:hover {
    background: var(--bg3);
    transform: translateX(2px);
}

.search-suggest-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--acc);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.search-suggest-item:hover::before {
    opacity: 1;
    transform: translateY(-50%) scale(1.3);
}

.search-suggest-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--t3);
    flex-shrink: 0;
}

.search-suggest-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-suggest-body {
    min-width: 0;
}

.search-suggest-title {
    font-weight: 600;
    font-size: 13px;
}

.search-suggest-meta {
    font-size: 12px;
    color: var(--t3);
}

.search-suggest-empty {
    padding: 12px;
    font-size: 12px;
    color: var(--t3);
}

.hdr-r {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hdr-nav {
    border-top: 1px solid var(--br);
    background: var(--bg2);
}

.hdr-nav-in {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hdr-nav a {
    color: var(--t2);
    font-weight: 600;
    transition: color 0.15s ease;
}

.hdr-nav a:hover {
    color: var(--acc);
}

.ibtn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--t2);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.ibtn:hover {
    color: var(--t1);
}

.ibtn-flag .flag-emoji {
    font-size: 18px;
    line-height: 1;
}

.ibtn-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--acc);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg2);
}

.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 14, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.page-loader-spinner {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,0.15);
    border-top-color: var(--acc);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Theme toggle icons */
[data-theme="dark"] .fa-sun { display: block; }
[data-theme="dark"] .fa-moon { display: none; }
[data-theme="light"] .fa-sun { display: none; }
[data-theme="light"] .fa-moon { display: block; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    background: var(--bg2);
    border-bottom: 2px solid var(--acc);
    overflow-x: auto;
}

.nav::-webkit-scrollbar {
    height: 0;
}

.nav-in {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    gap: 4px;
}

.nav a {
    padding: 14px 16px;
    color: var(--t2);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav a:hover {
    color: var(--t1);
}

.nav a.on {
    color: var(--acc);
    border-color: var(--acc);
}

.nav-badge {
    background: var(--red);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    flex: 1 0 auto;
    width: 100%;
}

.main.main-hero {
    padding-top: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--br);
    background: var(--bg3);
    color: var(--t2);
    transition: all 0.15s;
}

.btn-create-thread {
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    background: linear-gradient(135deg, var(--acc), var(--acc2));
    border: none;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-create-thread i {
    color: #fff !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transform: translateY(0);
    font-size: 14px;
}

.btn-create-thread:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.24);
    opacity: 0.95;
}

.btn:hover {
    background: var(--bg4);
    color: var(--t1);
}

.btn.btn-create-thread:hover {
    background: linear-gradient(135deg, var(--acc), var(--acc2));
    color: #fff;
}

.btn-p {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
}

.btn-p:hover {
    background: var(--acc2);
    color: #fff;
}

.btn-d {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.btn-d:hover {
    background: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--acc);
    color: var(--acc);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--org);
    color: var(--org);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--blu);
    color: var(--blu);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.bc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    color: var(--t3);
    margin-bottom: 16px;
}

.bc i,
.breadcrumb i {
    line-height: 1;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--t3);
    margin-bottom: 16px;
}

.bc a:hover {
    color: var(--acc);
}

.bc span {
    color: var(--t1);
}

/* ============================================
   SECTIONS (Category/Forum containers)
   ============================================ */
.sec {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.sec-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg3);
    border-bottom: 1px solid var(--br);
}

.sec-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-actions .btn {
    white-space: nowrap;
}

.sec-t {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-t i {
    color: var(--acc);
}

.sec-c {
    padding: 0;
}

.sec-c.hid {
    display: none;
}

/* ============================================
   FORUM ROW
   ============================================ */
.frow {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--br);
    transition: background 0.15s;
}

.frow:last-child {
    border-bottom: none;
}

.frow:hover {
    background: var(--bg3);
}

.ficon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg3);
    border: 1px solid var(--br);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t3);
    font-size: 14px;
}

.ficon.new {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--acc);
    color: var(--acc);
}

.finfo {
    min-width: 0;
}

.finfo h3 {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.finfo h3 a {
    overflow-wrap: anywhere;
}

.finfo h3 a:hover {
    color: var(--acc);
}

.finfo p {
    font-size: 11px;
    color: var(--t3);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.finfo p a {
    color: var(--t2);
}

.finfo p a:hover {
    color: var(--acc);
}

.fstat {
    text-align: center;
    display: none;
}

.fstat-v {
    font-size: 15px;
    font-weight: 700;
}

.fstat-l {
    font-size: 10px;
    color: var(--t3);
    text-transform: uppercase;
}

.flatest {
    display: none;
    padding-left: 12px;
    border-left: 1px solid var(--br);
}

.flatest-ava {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t3);
    font-size: 12px;
    flex-shrink: 0;
}

.flatest-info {
    overflow: hidden;
}

.flatest-t {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.flatest-t a {
    min-width: 0;
    max-width: 40ch;
    display: inline-block;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lpost-t .tag-badge {
    font-size: 9px;
    padding: 2px 6px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    white-space: nowrap;
}

.lpost-t .pinned-badge {
    flex-shrink: 0;
    line-height: 1;
}

.flatest-t .tag-badge {
    font-size: 7px;
    padding: 4px 6px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.flatest-t a:hover {
    color: var(--acc);
}

.flatest-m {
    font-size: 11px;
    color: var(--t3);
    margin-top: 2px;
}

.flatest-m a {
    color: var(--acc);
}

@media (min-width: 700px) {
    .frow {
        grid-template-columns: 34px minmax(0, 1fr) 60px 60px;
    }

    .fstat {
        display: block;
    }

    .flatest {
        display: none;
    }
}

@media (min-width: 1000px) {
    .frow {
        grid-template-columns: 34px minmax(0, 1fr) 60px 60px minmax(220px, 280px);
    }

    .flatest {
        display: flex;
        align-items: center;
        gap: 10px;
    }
}

.srow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--br);
}

.srow:hover {
    background: var(--bg3);
}

.srow:last-child {
    border-bottom: none;
}

.srow-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.srow-icon.disc {
    background: #5865f2;
}

.srow-icon.rules {
    background: var(--org);
}

.srow-t {
    font-size: 14px;
    font-weight: 600;
}

.srow i.fa-chevron-right {
    margin-left: auto;
    color: var(--t3);
}

/* ============================================
   THREAD ROW
   ============================================ */
.trow {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(90px, 130px) minmax(220px, 280px);
    gap: 10px 16px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--br);
    transition: background 0.15s;
}

.trow:last-child {
    border-bottom: none;
}

.trow:hover {
    background: var(--bg3);
}

.trow.pinned {
    background: rgba(245, 158, 11, 0.05);
}

.trow-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t3);
    font-size: 14px;
}

.trow-main {
    min-width: 0;
}

.trow-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 12px;
    min-width: 0;
}

.trow-title .badge {
    font-size: 7px;
    padding: 4px 6px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.trow-title .tag-badge {
    font-size: 9px;
    padding: 4px 8px;
}

.trow-title a {
    min-width: 0;
    max-width: 60ch;
    display: inline-block;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trow-meta {
    font-size: 11px;
    color: var(--t3);
}

.trow-meta > span + span {
    margin-left: 12px;
}

.trow-meta--search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.trow-meta-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.trow-meta-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--t3);
    flex-shrink: 0;
}

.trow-meta-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trow-meta-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.trow-meta-date,
.trow-meta-forum {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.trow-stats {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
    flex-wrap: wrap;
}

.trow-stat {
    text-align: center;
}

.trow-stat-v {
    font-size: 12px;
    font-weight: 600;
    display: block;
}

.trow-stat-l {
    font-size: 10px;
    color: var(--t3);
    text-transform: uppercase;
}

.trow-latest {
    font-size: 12px;
}

.trow-latest-time {
    margin-left: 6px;
}

.trow-latest-user {
    color: var(--t2);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.trow-latest-user a {
    color: var(--acc);
}

@media (max-width: 900px) {
    .trow {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px 12px;
    }

    .trow-stats,
    .trow-latest {
        display: none;
    }
}

@media (max-width: 768px) {
    .trow {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .trow-icon {
        display: none;
    }
    
    .trow-stats,
    .trow-latest {
        display: none;
    }
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: transparent;
    color: var(--t2);
    line-height: 1;
    text-align: center;
}

.badge.red { color: var(--red); }
.badge.org { color: var(--org); }
.badge.grn { color: var(--acc); }
.badge.blu { color: var(--blu); }
.badge.pur { color: var(--pur); }

.badge.pinned-badge i {
    font-size: 11px;
    line-height: 1;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    padding: 6px;
    line-height: 1;
}

/* ============================================
   THREAD HEADER
   ============================================ */
.th {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.th-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.th-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.th-title .badge {
    font-size: 8px;
    padding: 6px;
}

.th h1 {
    font-size: clamp(16px, 3.2vw, 21px);
    font-weight: 700;
    line-height: 1.25;
}

.th-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--t3);
}

.th-meta a {
    color: var(--acc);
}

.th-meta i {
    margin-right: 4px;
}

/* ============================================
   NOTICE
   ============================================ */
.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--t2);
}

.notice i {
    color: var(--org);
}

.notice.discord-mention {
    flex-wrap: wrap;
}

.notice.discord-mention .discord-mention-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notice.discord-mention .discord-mention-label {
    font-weight: 600;
}

.notice.discord-mention .discord-mention-name {
    color: var(--t1);
    font-weight: 600;
}

.notice.discord-mention .discord-mention-btn {
    margin-left: auto;
}

.discord-mention-list {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px dashed var(--br);
    border-radius: 10px;
    background: var(--bg3);
}

.discord-mention-list-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--t3);
    margin-bottom: 8px;
}

.discord-mention-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.discord-mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   POST
   ============================================ */
.post {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.post-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
}

@media (max-width: 700px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
}

/* Author sidebar */
.author {
    padding: 16px;
    background: var(--bg3);
    border-right: 1px solid var(--br);
    text-align: center;
}

@media (max-width: 700px) {
    .author {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid var(--br);
    }
}

.ava {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: var(--bg4);
    margin: 0 auto 12px;
    overflow: hidden;
}

@media (max-width: 700px) {
    .ava {
        width: 50px;
        height: 50px;
        margin: 0;
        flex-shrink: 0;
    }
}

.ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: var(--t1);
    margin-bottom: 2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.author-role {
    font-size: 12px;
    color: var(--t2);
    margin-bottom: 8px;
}

.author-badge {
    display: inline-block;
    padding: 4px 12px;
    background: transparent;
    color: var(--t2);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    max-width: 160px;
    white-space: normal;
    margin-bottom: 6px;
}

@media (max-width: 700px) {
    .author-badge {
        display: none;
    }
}

.author-stats {
    margin-top: 12px;
    font-size: 12px;
    color: var(--t3);
}

@media (max-width: 700px) {
    .author-stats {
        display: none;
    }
}

.author-stats div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-top: 1px solid var(--br);
}

/* Post content */
.post-wrap {
    display: flex;
    flex-direction: column;
}

.post-hd {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--br);
    font-size: 12px;
    color: var(--t3);
}

.post-hd a:hover {
    color: var(--acc);
}

.post-body {
    padding: 16px;
    flex: 1;
    min-height: 100px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-body p {
    margin-bottom: 1em;
}

.post-body p:last-child {
    margin-bottom: 0;
}

.post-body a {
    color: var(--acc);
}

.post-body .discord-mention,
.markup-preview .discord-mention {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.9em;
}

.post-body .discord-mention-name,
.markup-preview .discord-mention-name {
    color: var(--acc);
    font-weight: 600;
}

.post-body .discord-mention-code,
.markup-preview .discord-mention-code {
    display: none;
}

.post-body blockquote {
    border-left: 3px solid var(--acc);
    padding: 12px 16px;
    background: var(--bg3);
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.post-body code {
    background: var(--bg3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.post-body pre {
    background: var(--bg3);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.post-body pre code {
    background: none;
    padding: 0;
}

.post-body img {
    border-radius: 8px;
    max-width: 100%;
}

.post-body ul, .post-body ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.post-body li {
    margin: 0.5em 0;
}

/* Post footer */
.post-ft {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg3);
    border-top: 1px solid var(--br);
    flex-wrap: wrap;
    gap: 8px;
}

.post-ft-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.lbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg4);
    border: 1px solid var(--br);
    border-radius: 8px;
    font-size: 13px;
    color: var(--t2);
    cursor: pointer;
    transition: all 0.15s;
}

.lbtn:hover {
    color: var(--t1);
}

.lbtn.liked {
    color: var(--red);
    border-color: var(--red);
}

.like-count {
    font-weight: 600;
}

.like-users {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--t3);
    min-width: 0;
}

.like-users-label {
    color: var(--t3);
}

.like-users a,
.like-users span {
    color: var(--t2);
    font-weight: 600;
}

.like-users a:hover {
    color: var(--acc);
}

.sbtn {
    display: flex;
    gap: 6px;
}

.sbtn button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg4);
    border: 1px solid var(--br);
    color: var(--t3);
    cursor: pointer;
    transition: all 0.15s;
}

.sbtn button:hover {
    color: var(--t1);
}

.sbtn .report-form {
    display: inline-flex;
}

/* Post signature */
.post-sig {
    border-top: 1px solid var(--br);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--t3);
}

/* Deleted post */
.post.deleted .post-body {
    color: var(--t3);
    font-style: italic;
}

/* ============================================
   REPLY FORM
   ============================================ */
.reply-form {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.reply-form h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.reply-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 8px;
    color: var(--t1);
    resize: vertical;
    font-family: inherit;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--acc);
}

.reply-form .btn {
    margin-top: 12px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--t2);
}

.form-group input:not(.markup-color-input),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 8px;
    color: var(--t1);
    font-size: 14px;
}

.form-group input:not(.markup-color-input):focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--acc);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--t3);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--t3);
}

.forum-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 24px 24px;
    border: 1px solid var(--br);
    border-radius: 8px;
    background: var(--bg2);
    max-height: 320px;
    overflow-y: auto;
    box-sizing: border-box;
}

.forum-picker-search {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg3);
    padding: 6px 14px 8px;
    margin: 0 -24px 10px -24px;
    border-bottom: 1px solid var(--br);
}

.forum-picker-search input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--br);
    background: var(--bg3);
    color: var(--t1);
    font-size: 12px;
}

.forum-picker-search input:focus {
    outline: none;
    border-color: var(--acc);
}

.forum-picker-cat {
    position: relative;
    padding: 12px 14px 14px 16px;
    border: 1px solid var(--br);
    border-radius: 8px;
    background: var(--bg3);
}

.forum-picker-cat:first-of-type {
    margin-top: 12px;
}

.forum-picker-cat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--br);
}

.forum-picker-cat-h {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--t3);
    margin-bottom: 6px;
}

.forum-picker-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 6px;
}

.forum-picker-group {
    border: 0;
    background: transparent;
}

.forum-picker-group summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 12px 2px 0;
}

.forum-picker-group summary::marker {
    display: none;
}

.forum-picker-group summary::-webkit-details-marker {
    display: none;
}

.forum-picker-group summary::after {
    content: '▸';
    font-size: 11px;
    color: var(--t3);
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--bg2);
    border: 1px solid var(--br);
    margin-left: 10px;
    margin-right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.forum-picker-group[open] summary::after {
    content: '▾';
}

.forum-picker-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 18px;
    border-radius: 6px;
    border: 1px solid transparent;
    color: var(--t1);
    background: transparent;
    font-size: 12px;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.forum-picker-item input {
    position: absolute;
    opacity: 0;
}

.forum-picker-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--br);
    background: var(--bg2);
}

.forum-picker-item.is-selected::before {
    border-color: var(--acc);
    background: var(--acc);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.forum-picker-item:hover {
    background: var(--bg2);
}

.forum-picker-item.is-selected {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.06);
}

.forum-picker-subforums {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 6px 10px;
    padding-left: 8px;
    border-left: 1px solid var(--br);
}

.forum-picker-sub {
    position: relative;
    margin-left: 4px;
}

.forum-picker-sub::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 8px;
    height: 1px;
    background: var(--br);
}

.forum-picker-name {
    font-weight: 600;
}

.forum-picker-lock {
    color: var(--red);
    font-size: 11px;
}

.markup-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--br);
    border-radius: 8px;
    background: var(--bg3);
    margin-bottom: 8px;
}

.markup-toolbar.markup-toolbar--rows {
    flex-direction: column;
    align-items: stretch;
}

.markup-toolbar--rows .markup-toolbar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.markup-toolbar--rows .markup-toolbar-row::-webkit-scrollbar {
    height: 0;
}

.markup-toolbar--rows .markup-btn,
.markup-toolbar--rows .markup-select,
.markup-toolbar--rows .markup-color {
    flex: 0 0 auto;
}

.markup-color {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--br);
    background: var(--bg2);
    color: var(--t2);
    cursor: pointer;
}

.markup-color:hover {
    color: var(--t1);
    border-color: var(--acc);
}

.markup-color-label {
    font-size: 12px;
    color: inherit;
}

.markup-color-input {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.markup-color-input:focus {
    outline: none;
}

.markup-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.markup-color-input::-webkit-color-swatch {
    border: 1px solid var(--br);
    border-radius: 4px;
}

.markup-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.markup-switch-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--br);
    background: var(--bg3);
    color: var(--t2);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.markup-switch-btn.on {
    background: var(--bg4);
    color: var(--t1);
    border-color: var(--acc);
}

.markup-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--br);
    background: var(--bg2);
    color: var(--t2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.markup-btn:hover {
    color: var(--t1);
    border-color: var(--acc);
}

.markup-select {
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--br);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08)), var(--bg2);
    color: var(--t1);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0 36px 0 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    line-height: 32px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--t1) 50%),
        linear-gradient(135deg, var(--t1) 50%, transparent 50%),
        linear-gradient(to right, var(--br), var(--br));
    background-position:
        calc(100% - 16px) 14px,
        calc(100% - 11px) 14px,
        calc(100% - 28px) 50%;
    background-size: 5px 5px, 5px 5px, 1px 18px;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: color 0.15s, border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.markup-select.is-placeholder {
    color: var(--t2);
    font-weight: 500;
}

.markup-select:focus {
    outline: none;
    border-color: var(--acc);
    color: var(--t1);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--t1) 50%),
        linear-gradient(135deg, var(--t1) 50%, transparent 50%),
        linear-gradient(to right, var(--br), var(--br));
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.markup-select:hover {
    color: var(--t1);
    border-color: var(--acc);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--t1) 50%),
        linear-gradient(135deg, var(--t1) 50%, transparent 50%),
        linear-gradient(to right, var(--br), var(--br));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.markup-hint {
    color: var(--t3);
    font-size: 12px;
}

[data-rich-editor][data-editor-mode="code"] .rich-editor {
    display: none;
}

[data-rich-editor][data-editor-mode="code"] .rich-editor-input {
    display: block;
}

[data-rich-editor][data-editor-mode="rich"] .rich-editor-input {
    display: none;
}

.markup-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.markup-counts {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--t3);
    font-size: 12px;
}

.markup-count {
    white-space: nowrap;
}

.markup-preview,
.rich-editor {
    border: 1px solid var(--br);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg3);
    min-height: 180px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rich-editor {
    outline: none;
    cursor: text;
}

.rich-editor-input {
    width: 100%;
    min-height: 180px;
    border: 1px solid var(--br);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg3);
    color: var(--t1);
    font-family: 'Monaco', 'Consolas', monospace;
    resize: vertical;
}

.rich-editor-input:focus {
    outline: none;
    border-color: var(--acc);
}

.rich-editor:focus {
    border-color: var(--acc);
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--t3);
}

.rich-editor--sm {
    min-height: 120px;
}

.markup-preview p,
.rich-editor p {
    margin-bottom: 1em;
}

.markup-preview p:last-child,
.rich-editor p:last-child {
    margin-bottom: 0;
}

.markup-preview a,
.rich-editor a {
    color: var(--acc);
}

.markup-preview blockquote,
.rich-editor blockquote {
    border-left: 3px solid var(--acc);
    padding: 12px 16px;
    background: var(--bg2);
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.markup-preview code,
.rich-editor code {
    background: var(--bg2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.markup-preview pre,
.rich-editor pre {
    background: var(--bg2);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.markup-preview pre code,
.rich-editor pre code {
    background: none;
    padding: 0;
}

.rich-editor table {
    width: 100%;
    border-collapse: collapse;
}

.rich-editor th,
.rich-editor td {
    border: 1px solid var(--br);
    padding: 6px 8px;
}

.markup-preview img,
.rich-editor img {
    border-radius: 8px;
    max-width: 100%;
}

.markup-preview ul, .markup-preview ol,
.rich-editor ul, .rich-editor ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.markup-preview li,
.rich-editor li {
    margin: 0.5em 0;
}

.rich-editor .task-list {
    list-style: none;
    padding-left: 0;
}

.rich-editor .task-list input[type="checkbox"] {
    margin-right: 6px;
}

.bbcode-color--accent,
.bbcode-color--green {
    color: var(--acc);
}

.bbcode-color--red {
    color: var(--red);
}

.bbcode-color--orange {
    color: var(--org);
}

.bbcode-color--blue {
    color: var(--blu);
}

.bbcode-color--purple {
    color: var(--pur);
}

.bbcode-color--gray {
    color: var(--t2);
}

.bbcode-highlight {
    padding: 0 4px;
    border-radius: 4px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    color: inherit;
}

.bbcode-highlight--accent,
.bbcode-highlight--green {
    background: rgba(34, 197, 94, 0.25);
}

.bbcode-highlight--red {
    background: rgba(239, 68, 68, 0.25);
}

.bbcode-highlight--orange {
    background: rgba(245, 158, 11, 0.25);
}

.bbcode-highlight--blue {
    background: rgba(59, 130, 246, 0.25);
}

.bbcode-highlight--purple {
    background: rgba(139, 92, 246, 0.25);
}

.bbcode-highlight--gray {
    background: rgba(148, 163, 184, 0.25);
}

.bbcode-size--xs {
    font-size: 0.75em;
}

.bbcode-size--sm {
    font-size: 0.85em;
}

.bbcode-size--md {
    font-size: 1em;
}

.bbcode-size--lg {
    font-size: 1.2em;
}

.bbcode-size--xl {
    font-size: 1.4em;
}

.markup-preview.is-loading {
    color: var(--t3);
    font-style: italic;
}

.text-left {
    text-align: left;
}

.embed-youtube {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg3);
    border: 1px solid var(--br);
    margin: 16px 0;
}

.embed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.api-embed {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 16px 0;
}

.api-embed .api-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.api-embed table {
    width: 100%;
    border-collapse: collapse;
}

.api-embed th,
.api-embed td {
    padding: 0;
    border-bottom: none;
    text-align: left;
}

.api-embed .api-loading,
.api-embed .api-error {
    color: var(--t3);
    font-style: italic;
}

.api-modal {
    width: min(96vw, 1200px);
    max-width: 1200px;
}

.api-editor {
    display: grid;
    gap: 16px;
}

.api-editor-preview {
    border: 1px solid var(--br);
    border-radius: 12px;
    background: var(--bg3);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.api-preview-note {
    font-size: 12px;
    color: var(--t3);
}

.api-preview-body {
    min-height: 120px;
}

.api-preview-empty {
    color: var(--t3);
    font-style: italic;
}

.api-json {
    background: var(--bg1);
    border: 1px solid var(--br);
    border-radius: 10px;
    padding: 10px;
    max-height: 50vh;
    overflow: auto;
    font-size: 12px;
}

.api-editor-options {
    display: grid;
    gap: 10px;
    margin-bottom: 8px;
}

.api-editor-options-wide {
    margin-top: 4px;
}

.api-filter-help {
    font-size: 12px;
    color: var(--t3);
    grid-column: 1 / -1;
}

.api-fields {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-fields-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.api-field-head {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 140px 140px 120px auto;
    gap: 8px;
    font-size: 12px;
    color: var(--t3);
}

.api-fields-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-field-row {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 140px 140px 120px auto;
    gap: 8px;
    align-items: center;
}

.api-field-row input {
    width: 100%;
}

.api-field-row select {
    width: 100%;
}

.api-fields-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.api-suggestions-title {
    font-size: 12px;
    color: var(--t3);
}

.api-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.api-structure {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-structure-nested {
    gap: 6px;
}

.api-section-title {
    font-weight: 600;
    font-size: 16px;
}

.api-line {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.api-list,
.api-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-sublist {
    gap: 6px;
}

.api-list-item {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.api-sublist .api-list-item {
    background: transparent;
    border-style: none;
}

.api-value {
    word-break: break-word;
}

.api-value--pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg4);
}

.api-value--muted {
    color: var(--t3);
    font-size: 12px;
}

.api-value--card {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg3);
    border: 1px solid var(--br);
}

.api-value--accent {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--acc) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--br));
    color: var(--t1);
}

.api-value--outline {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    border: 1px solid var(--br);
    background: transparent;
}

.api-value--mono {
    font-family: "Courier New", Courier, monospace;
    background: var(--bg1);
    border: 1px solid var(--br);
    border-radius: 8px;
    padding: 2px 6px;
}

.api-size--xs {
    font-size: 11px;
}

.api-size--sm {
    font-size: 12px;
}

.api-size--md {
    font-size: 14px;
}

.api-size--lg {
    font-size: 18px;
}

.api-size--xl {
    font-size: 22px;
}

@media (max-width: 1100px) {
    .api-field-head,
    .api-field-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .api-field-row button {
        justify-self: flex-end;
    }
}

@media (max-width: 720px) {
    .api-field-head {
        display: none;
    }

    .api-field-row {
        grid-template-columns: 1fr;
    }

    .api-field-row button {
        justify-self: flex-end;
    }

    .api-editor-options,
    .api-editor-options-wide {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .api-editor {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        align-items: start;
    }

    .api-editor-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .api-editor-options-wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.markdown-editor[data-markdown-mode="split"] .markup-live {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.markdown-editor[data-markdown-mode="split"] .markup-live textarea,
.markdown-editor[data-markdown-mode="split"] .markup-preview {
    min-height: 220px;
}

@media (max-width: 900px) {
    .markdown-editor[data-markdown-mode="split"] .markup-live {
        grid-template-columns: 1fr;
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 8px;
}

.auth-box p {
    text-align: center;
    color: var(--t3);
    margin-bottom: 24px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--t3);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--br);
}

.btn-discord {
    width: 100%;
    background: #5865F2;
    border-color: #5865F2;
    color: #fff;
    justify-content: center;
}

.btn-discord:hover {
    background: #4752C4;
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--t3);
}

.auth-footer a {
    color: var(--acc);
}

/* ============================================
   USER PROFILE
   ============================================ */
.profile-header {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg4);
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .profile-name {
        justify-content: center;
    }
}

.profile-title {
    color: var(--t3);
    font-size: 14px;
    margin-bottom: 12px;
}

.profile-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .profile-badges {
        justify-content: center;
    }
}

.profile-stats {
    display: flex;
    gap: 24px;
    font-size: 14px;
}

@media (max-width: 600px) {
    .profile-stats {
        justify-content: center;
    }
}

.profile-stats span {
    color: var(--t3);
}

.profile-stats strong {
    color: var(--t1);
}

.profile-bio {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--br);
    color: var(--t2);
    font-size: 14px;
}

/* ============================================
   USER CARD (in posts)
   ============================================ */
.user-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg3);
    border-radius: 10px;
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg4);
    flex-shrink: 0;
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-card-role {
    font-size: 12px;
    color: var(--t3);
}

/* ============================================
   MEMBERS & STAFF PAGES
   ============================================ */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.member-card {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    transition: background 0.15s;
}

.member-card:hover {
    background: var(--bg3);
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg4);
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.member-role {
    font-size: 12px;
    color: var(--t3);
    margin-bottom: 6px;
}

.member-stats {
    font-size: 12px;
    color: var(--t3);
}

.member-stats span {
    margin-right: 12px;
}

/* ============================================
   SEARCH PAGE
   ============================================ */
.search-header {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.search-header h1 {
    font-size: 20px;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    gap: 12px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 8px;
    color: var(--t1);
    font-size: 14px;
}

.search-form input:focus {
    outline: none;
    border-color: var(--acc);
}

@media (max-width: 500px) {
    .search-form {
        flex-direction: column;
    }
}

.search-results {
    font-size: 14px;
    color: var(--t3);
    margin-bottom: 16px;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-stat {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 14px;
    padding: 24px;
}

.admin-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--acc);
    margin-bottom: 4px;
}

.admin-stat-label {
    font-size: 14px;
    color: var(--t3);
}

.setup-grid {
    display: grid;
    gap: 12px;
}

.setup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--br);
    border-radius: 10px;
    background: var(--bg3);
}

.setup-item.ok {
    border-color: var(--acc);
}

.setup-item i {
    color: var(--t3);
    font-size: 18px;
}

.setup-item.ok i {
    color: var(--acc);
}

.setup-title {
    font-weight: 600;
    font-size: 13px;
}

.setup-desc {
    font-size: 12px;
    color: var(--t3);
}

.setup-item .btn {
    margin-left: auto;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--br);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg2);
}

.admin-table th,
.admin-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--br);
}

.admin-table th {
    background: var(--bg1);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--t3);
    letter-spacing: 0.08em;
}

.admin-table tbody tr:nth-child(even) td {
    background: var(--bg3);
}

.admin-table tr:hover td {
    background: var(--bg4);
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.admin-log-details {
    margin: 0;
    white-space: pre-wrap;
    font-size: 12px;
    color: var(--t2);
}

/* ============================================
   ADMIN PANEL - Refresh
   ============================================ */
.admin-page.admin-refresh {
    padding: 20px 0 32px;
    background: var(--bg1);
}

.admin-page.admin-refresh .container {
    max-width: 1180px;
}

.admin-page.admin-refresh .admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid var(--br);
    background: linear-gradient(135deg, var(--bg2), var(--bg3));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
    margin-bottom: 14px;
}

.admin-page.admin-refresh .admin-hero-kicker {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--t3);
    margin-bottom: 6px;
}

.admin-page.admin-refresh .admin-hero h1 {
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-page.admin-refresh .admin-hero p {
    margin: 6px 0 0;
    color: var(--t2);
    font-size: 14px;
}

.admin-page.admin-refresh .admin-header {
    border-radius: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--bg2), var(--bg3));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    border: 1px solid var(--br);
}

.admin-page.admin-refresh .admin-header p {
    margin: 6px 0 0;
    color: var(--t2);
    font-size: 13px;
}

.admin-page.admin-refresh .admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.admin-page.admin-refresh .admin-stat {
    position: relative;
    overflow: hidden;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--bg2);
    border: 1px solid var(--br);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-page.admin-refresh .admin-stat::after {
    content: '';
    position: absolute;
    inset: auto -20% -40% 40%;
    height: 120px;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.18), transparent 70%);
    opacity: 0.6;
}

.admin-page.admin-refresh .admin-stat:hover {
    transform: translateY(-2px);
    border-color: var(--acc);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.admin-page.admin-refresh .admin-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--t1);
}

.admin-page.admin-refresh .admin-stat-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--t3);
}

.admin-page.admin-refresh .setup-item {
    border-radius: 14px;
    background: var(--bg2);
}

.admin-page.admin-refresh .sec {
    margin-bottom: 12px;
}

.admin-page.admin-refresh .admin-form {
    border-radius: 18px;
    background: var(--bg2);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.admin-page.admin-refresh .admin-form h3 {
    font-size: 15px;
}

.admin-page.admin-refresh .admin-table {
    border-radius: 18px;
    border: 1px solid var(--br);
    background: var(--bg2);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.admin-page.admin-refresh .admin-table th {
    font-size: 10px;
    letter-spacing: 0.18em;
    background: var(--bg3);
}

.admin-page.admin-refresh .admin-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.admin-page.admin-refresh .admin-table tr:hover td {
    background: rgba(99, 102, 241, 0.08);
}

.admin-page.admin-refresh .admin-dashboard-grid {
    gap: 16px;
}

.admin-page.admin-refresh .admin-dashboard-grid.admin-dashboard-compact {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.admin-page.admin-refresh .admin-activity {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-page.admin-refresh .admin-shortcuts .sec-c {
    padding: 12px;
}

.admin-page.admin-refresh .admin-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.admin-page.admin-refresh .admin-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--br);
    background: var(--bg2);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-page.admin-refresh .admin-shortcut:hover {
    transform: translateY(-1px);
    border-color: var(--acc);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.admin-page.admin-refresh .admin-shortcut-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--sc, var(--acc));
    font-size: 14px;
}

.admin-page.admin-refresh .admin-shortcut-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-page.admin-refresh .admin-shortcut-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--t1);
}

.admin-page.admin-refresh .admin-shortcut-sub {
    font-size: 11px;
    color: var(--t3);
}

.admin-page.admin-refresh .admin-compact-list .trow {
    padding: 6px 8px;
    border-radius: 12px;
}

.admin-page.admin-refresh .admin-compact-list .trow:hover {
    background: rgba(99, 102, 241, 0.08);
}

@media (max-width: 1200px) {
    .admin-page.admin-refresh .admin-dashboard-grid.admin-dashboard-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .admin-page.admin-refresh .admin-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-page.admin-refresh .admin-stat {
        padding: 16px;
    }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 8px;
    font-size: 13px;
    color: var(--t2);
    transition: all 0.15s;
}

.pagination a:hover {
    background: var(--bg3);
    color: var(--t1);
}

.pagination .active {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--t3);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--t3);
}

.empty-state p {
    margin-bottom: 16px;
}

/* ============================================
   FORUM HEADER
   ============================================ */
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.forum-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.forum-info h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum-info h1 i {
    color: var(--acc);
}

.forum-info p {
    color: var(--t3);
    font-size: 14px;
}

/* ============================================
   SIDEBAR (Stats, Online Users)
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-box {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    overflow: hidden;
}

.side-box-h {
    padding: 12px 16px;
    background: var(--bg3);
    border-bottom: 1px solid var(--br);
    font-weight: 600;
    font-size: 13px;
}

.side-box-c {
    padding: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--br);
    font-size: 13px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: var(--t3);
}

.stat-row span:last-child {
    font-weight: 600;
}

.online-users {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.online-user {
    font-size: 13px;
}

/* ============================================
   FOOTER
   ============================================ */
.ftr {
    background: var(--bg2);
    border-top: 1px solid var(--br);
    margin-top: auto;
    padding: 32px 20px;
}

.ftr-in {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.ftr-copy {
    font-size: 14px;
    color: var(--t3);
}

.ftr-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ftr-links a {
    font-size: 14px;
    color: var(--t3);
}

.ftr-links a:hover {
    color: var(--acc);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg1);
}

::-webkit-scrollbar-thumb {
    background: var(--br);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--t3);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--t3); }
.text-accent { color: var(--acc); }
.text-red { color: var(--red); }
.text-org { color: var(--org); }
.text-blu { color: var(--blu); }
.text-pur { color: var(--pur); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }

/* ============================================
   RULES SECTIONS (for rules posts)
   ============================================ */
.rsec {
    margin-bottom: 24px;
}

.rsec:last-child {
    margin-bottom: 0;
}

.rsec h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--acc);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--br);
    font-size: 14px;
}

.rule:last-child {
    border-bottom: none;
}

.rule-n {
    font-weight: 600;
    color: var(--acc);
    width: 32px;
    flex-shrink: 0;
}

.rule-t {
    color: var(--t2);
}

.rule-p {
    color: var(--red);
    font-weight: 600;
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.error-box {
    max-width: 400px;
}

.error-box i {
    font-size: 64px;
    color: var(--red);
    margin-bottom: 24px;
}

.error-box h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.error-box p {
    color: var(--t3);
    margin-bottom: 24px;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    overflow: hidden;
}

.tabs-h {
    display: flex;
    border-bottom: 1px solid var(--br);
    background: var(--bg3);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--t2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--t1);
}

.tab-btn.on {
    color: var(--acc);
    border-color: var(--acc);
    background: var(--bg2);
}

.tab-c {
    display: none;
    padding: 16px;
}

.tab-c.on {
    display: block;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal .modal-content {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.modal .modal-content.api-modal {
    width: min(96vw, 1200px);
    max-width: 1200px;
    max-height: 94vh;
}

.modal .modal-content > form {
    padding: 16px 20px 20px;
}

.modal .modal-content > form .form-actions {
    margin-top: 12px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--br);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg3);
    border: none;
    color: var(--t2);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--bg4);
    color: var(--t1);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--br);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--br);
    border-top-color: var(--acc);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   THREAD COUNT
   ============================================ */
.thread-count {
    font-size: 12px;
    color: var(--t3);
}

/* ============================================
   ADMIN PAGE - Extended Styles
   ============================================ */
.admin-page {
    padding: 20px 0 32px;
}

.admin-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--br);
    background: var(--bg2);
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header h1 i {
    color: var(--acc);
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Admin Form Styles */
.admin-form {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.admin-form h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 16px;
}

.admin-form h3 i {
    color: var(--acc);
}

.create-form {
    border-color: var(--acc);
    border-width: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.form-section {
    background: var(--bg3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 15px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--br);
}

.page-visibility {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 6px 0 10px;
}

.page-visibility .checkbox-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--t3);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.settings-avatar {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.settings-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: var(--bg3);
    border: 1px solid var(--br);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t3);
}

.settings-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-fields {
    flex: 1;
    min-width: 220px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--t2);
    margin-bottom: 6px;
}

.form-group input:not(.markup-color-input),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 8px;
    color: var(--t1);
    transition: border-color 0.15s;
}

.form-group input:not(.markup-color-input):focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--acc);
}

.form-group input[type="color"]:not(.markup-color-input) {
    padding: 4px;
    height: 42px;
    cursor: pointer;
}

.form-group small {
    display: block;
    font-size: 12px;
    color: var(--t3);
    margin-top: 4px;
}

.disabled-input {
    background: var(--bg1) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--acc);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.role-checkbox,
.badge-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.role-checkbox:hover,
.badge-checkbox:hover {
    border-color: var(--acc);
}

.role-checkbox input,
.badge-checkbox input {
    width: 16px;
    height: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--br);
}

/* Role Card Styles */
.roles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-card {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 20px;
}

.role-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.role-name {
    font-size: 13px;
    color: var(--t3);
}

.role-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--t2);
}

.role-info i {
    margin-right: 4px;
    color: var(--t3);
}

.role-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.permission-tag {
    padding: 4px 10px;
    background: var(--bg3);
    border-radius: 4px;
    font-size: 11px;
    color: var(--t3);
}

.permission-more {
    padding: 4px 10px;
    background: var(--acc);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
}

.role-actions {
    display: flex;
    gap: 8px;
}

.role-actions form {
    display: inline;
}

.staff-badge,
.default-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    background: transparent;
}

.staff-badge {
    color: var(--pur);
}

.default-badge {
    color: var(--acc);
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.badge-card {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.badge-icon {
    flex-shrink: 0;
}

.badge-info {
    flex: 1;
    min-width: 0;
}

.badge-info h4 {
    font-size: 16px;
    margin-bottom: 2px;
}

.badge-name {
    font-size: 12px;
    color: var(--t3);
    margin-bottom: 6px;
}

.badge-desc {
    font-size: 13px;
    color: var(--t2);
    margin-bottom: 8px;
}

.badge-users {
    font-size: 12px;
    color: var(--t3);
}

.badge-actions {
    flex-shrink: 0;
}

/* Permissions Section */
.permissions-section {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 24px;
}

.section-desc {
    color: var(--t2);
    margin-bottom: 20px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.permission-category {
    background: var(--bg3);
    border-radius: 10px;
    padding: 16px;
}

.permission-category h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--acc);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.permission-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.permission-checkbox input {
    margin-top: 2px;
}

.permission-name {
    font-size: 13px;
    font-weight: 500;
    display: block;
}

.permission-desc {
    font-size: 12px;
    color: var(--t3);
    display: block;
}

/* Preview Group */
.preview-group {
    background: var(--bg2);
    border-radius: 8px;
    padding: 16px;
}

.role-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forums Manager */
.forums-manager {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-section {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    border-left-width: 4px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg3);
    flex-wrap: wrap;
    gap: 12px;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.category-icon {
    font-size: 24px;
}

.category-info h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.category-info p {
    font-size: 13px;
    color: var(--t3);
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--t3);
}

.forums-list {
    padding: 12px;
}

.forum-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 8px;
    transition: background 0.15s;
}

.forum-item:hover {
    background: var(--bg3);
}

.forum-item.hidden-forum {
    opacity: 0.6;
}

.forum-item.locked-forum {
    background: rgba(239, 68, 68, 0.05);
}

.forum-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg3);
    border-radius: 8px;
    color: var(--t3);
    flex-shrink: 0;
}

.forum-info {
    flex: 1;
    min-width: 0;
}

.forum-info h4 {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.forum-info h4 .badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg3);
    border-radius: 4px;
    color: var(--t3);
}

.forum-slug {
    font-size: 12px;
    color: var(--t3);
}

.forum-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--t3);
}

.forum-stats i {
    margin-right: 4px;
}

.forum-position {
    font-size: 12px;
    color: var(--t3);
    min-width: 60px;
}

.forum-actions {
    flex-shrink: 0;
}

.no-forums {
    padding: 20px;
    text-align: center;
    color: var(--t3);
    font-size: 13px;
}

/* User Stats in Edit */
.user-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.user-stats .stat-item {
    background: var(--bg2);
    padding: 14px;
    border-radius: 8px;
    text-align: center;
}

.user-stats .stat-label {
    display: block;
    font-size: 11px;
    color: var(--t3);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.user-stats .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--t1);
}

/* Additional styles for current templates */
.hero {
    --hero-image: url('https://images.unsplash.com/photo-1542751371-adc38448a05e?w=1200&q=80');
    --hero-overlay: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(59, 130, 246, 0.9));
    background: var(--hero-overlay), var(--hero-image) center/cover;
    padding: 48px 16px;
    text-align: center;
    margin-bottom: 16px;
}

.hero--image {
    color: #fff;
}

.hero--text {
    background: var(--bg2);
    border: 1px solid var(--br);
}

.hero--full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}

.hero--contained {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
}

.hero-inner {
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .hero {
        padding: 64px 16px;
    }
}

.hero h1 {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 800;
    margin-bottom: 8px;
}

.hero p {
    font-size: clamp(14px, 2vw, 16px);
    margin-bottom: 20px;
}

.hero--image h1 {
    color: #fff;
}

.hero--image p {
    color: rgba(255, 255, 255, 0.9);
}

.hero--text h1 {
    color: var(--t1);
}

.hero--text p {
    color: var(--t2);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    min-width: 140px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--br);
    background: var(--bg2);
}

.hero-stat-v {
    font-size: 30px;
    font-weight: 700;
}

.hero-stat-l {
    font-size: 11px;
    text-transform: uppercase;
}

.hero--image .hero-stat {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.2);
}

.hero--image .hero-stat-v {
    color: #fff;
}

.hero--image .hero-stat-l {
    color: rgba(255, 255, 255, 0.8);
}

.hero--text .hero-stat-v {
    color: var(--t1);
}

.hero--text .hero-stat-l {
    color: var(--t3);
}

.main.main-private {
    max-width: 100%;
    padding: 0;
}

.private-landing {
    --private-hero-image: url('https://images.unsplash.com/photo-1488998527040-85054a85150e?w=1600&q=80');
    --private-hero-overlay: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.85));
    position: relative;
    min-height: calc(100vh - 220px);
    padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px);
    background: var(--private-hero-overlay), var(--private-hero-image) center/cover;
    display: flex;
    align-items: center;
    color: #fff;
}

.private-landing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 55%);
    opacity: 0.7;
    pointer-events: none;
}

.private-landing__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 32px;
    align-items: center;
}

@media (min-width: 900px) {
    .private-landing__inner {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    }
}

.private-landing__copy {
    text-align: left;
}

.private-landing__eyebrow {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 16px;
}

.private-landing__copy h1 {
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.private-landing__copy p {
    font-size: clamp(15px, 2vw, 18px);
    color: rgba(255, 255, 255, 0.78);
    max-width: 520px;
}

.private-landing__panel {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 28px;
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}

.private-landing__panel-inner h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #fff;
}

.private-landing__panel-inner p {
    color: rgba(226, 232, 240, 0.8);
    margin-bottom: 20px;
}

.private-login {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.private-login .form-group label {
    color: rgba(226, 232, 240, 0.9);
}

.private-login__link {
    float: right;
    font-size: 12px;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.85);
}

.private-login__link:hover {
    color: #fff;
}

@media (max-width: 900px) {
    .private-landing {
        min-height: auto;
    }

    .private-landing__panel {
        padding: 22px;
    }
}

.home-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 900px) {
    .home-grid {
        grid-template-columns: 1fr 280px;
    }
}

.content {
    min-width: 0;
}

.side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    overflow: hidden;
}

.card-h {
    padding: 12px 16px;
    background: var(--bg3);
    border-bottom: 1px solid var(--br);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-h i {
    color: var(--acc);
}

.card-c {
    padding: 12px;
}

.lpost {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
}

.lpost:hover {
    background: var(--bg3);
}

.lpost-ava {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg3);
    border: 1px solid var(--br);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--t3);
    flex-shrink: 0;
}

.lpost-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lpost-c {
    min-width: 0;
}

.lpost-t {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
    line-height: 1.2;
}

.lpost-t a {
    min-width: 0;
    max-width: 100%;
    display: inline-block;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lpost-m {
    font-size: 11px;
    color: var(--t3);
    margin-top: 2px;
}

.lpost-m a {
    color: var(--acc);
}

.lpost-cat {
    font-size: 10px;
    color: var(--t3);
    margin-top: 2px;
}

.members {
    font-size: 13px;
    line-height: 1.9;
    padding: 4px 8px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.members a {
    color: var(--t2);
    overflow-wrap: anywhere;
}

.members a:hover {
    color: var(--acc);
}

.members a.staff {
    color: var(--acc);
    font-weight: 500;
}

.members a.mod {
    color: var(--org);
    font-weight: 500;
}

.members a.vip {
    color: var(--pur);
    font-weight: 500;
}

.members-ft {
    padding: 10px 16px;
    background: var(--bg3);
    border-top: 1px solid var(--br);
    font-size: 12px;
    color: var(--t3);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    row-gap: 4px;
}

.members-ft i {
    color: var(--acc);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.stat-card {
    background: var(--bg3);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 0;
}

.stat-card-v {
    font-size: 20px;
    font-weight: 700;
    color: var(--acc);
    overflow-wrap: anywhere;
}

.stat-card-l {
    font-size: 9px;
    color: var(--t3);
    text-transform: uppercase;
    margin-top: 2px;
}

.sec-tog {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg4);
    border: 1px solid var(--br);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--t2);
    font-size: 11px;
    cursor: pointer;
}

.sec-tog:hover {
    color: var(--t1);
}

.forum-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.forum-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--acc);
    font-size: 18px;
}

.forum-header-info h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.forum-header-info p {
    color: var(--t3);
    font-size: 14px;
}

.thread-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.thread-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 10px;
    font-size: 13px;
    color: var(--t2);
}

.trow-latest {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    justify-self: stretch;
    text-align: left;
    min-width: 0;
    padding-left: 4px;
}

.trow-latest-ava {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--t3);
    flex-shrink: 0;
}

.trow-latest-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trow-latest-info {
    min-width: 0;
}

.trow-latest-meta {
    color: var(--t2);
}

.trow-latest-label {
    color: var(--t2);
    margin-right: 6px;
    flex-shrink: 0;
}

.trow-latest-time {
    color: var(--t3);
    margin-left: 0;
    flex-shrink: 0;
}

.trow-latest-user {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.trow-latest-user a {
    color: var(--t1);
    font-weight: 600;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    word-break: break-word;
}

.trow-latest-user a:hover {
    color: var(--acc);
}

.admin-compact-list .trow {
    padding: 6px 8px;
    gap: 6px 10px;
}

.admin-compact-list .trow-meta {
    font-size: 10px;
}

.admin-compact-list .text-muted {
    font-size: 11px;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.admin-dashboard-nav {
    min-width: 0;
}

.admin-dashboard-nav .members-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.admin-dashboard-nav .member-card {
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
    border: 1px solid var(--br);
    background: var(--bg2);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-dashboard-nav .member-card:hover {
    transform: translateY(-2px);
    border-color: var(--acc);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.admin-dashboard-nav .member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.admin-dashboard-nav .member-name {
    font-size: 13px;
}

.admin-dashboard-nav .member-role {
    font-size: 11px;
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .admin-dashboard-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .admin-dashboard-nav {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.import-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-select {
    min-width: 220px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--br);
    background: var(--bg3);
    color: var(--t1);
    font-size: 12px;
}

.thread-header {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.thread-header-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.thread-header h1 {
    font-size: clamp(16px, 3.2vw, 21px);
    font-weight: 700;
}

.thread-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--t3);
}

.thread-header-meta a {
    color: var(--acc);
}

.thread-header-meta i {
    margin-right: 4px;
}

.thread-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.post-author {
    padding: 16px;
    background: var(--bg3);
    border-right: 1px solid var(--br);
    text-align: center;
}

@media (max-width: 700px) {
    .post-author {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid var(--br);
    }
}

.post-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: var(--bg4);
    margin: 0 auto 12px;
    overflow: hidden;
}

@media (max-width: 700px) {
    .post-author-avatar {
        width: 50px;
        height: 50px;
        margin: 0;
        flex-shrink: 0;
    }
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-name {
    font-weight: 600;
    color: var(--acc);
    margin-bottom: 2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.post-author-role {
    font-size: 12px;
    color: var(--t2);
    margin-bottom: 8px;
}

.post-author-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
}

@media (max-width: 700px) {
    .post-author-badges {
        justify-content: flex-start;
    }
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: var(--t2);
    font-size: 11px;
    background: transparent;
}

.user-badge.discord {
    color: #5865f2;
    background: transparent;
}

.user-badge.webhook {
    color: #16a34a;
    background: transparent;
}

.post-author-stats {
    margin-top: 12px;
    font-size: 12px;
    color: var(--t3);
}

@media (max-width: 700px) {
    .post-author-stats {
        display: none;
    }
}

.post-author-stats div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-top: 1px solid var(--br);
}

.post-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--br);
    font-size: 12px;
    color: var(--t3);
}

.post-header a:hover {
    color: var(--acc);
}

.post-edited {
    margin-top: 12px;
    font-size: 12px;
    color: var(--t3);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg3);
    border-top: 1px solid var(--br);
    flex-wrap: wrap;
    gap: 8px;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg4);
    border: 1px solid var(--br);
    border-radius: 8px;
    font-size: 13px;
    color: var(--t2);
    cursor: pointer;
    transition: all 0.15s;
}

.post-action-btn:hover {
    color: var(--t1);
}

.post-reactions {
    display: flex;
    gap: 6px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg4);
    border: 1px solid var(--br);
    border-radius: 8px;
    font-size: 12px;
    color: var(--t3);
    cursor: pointer;
    transition: all 0.15s;
}

.reaction-btn:hover {
    color: var(--t1);
}

/* ============================================
   PROFILE (New)
   ============================================ */
.ph {
    background: var(--bg2);
    border: 1px solid var(--br);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.ph-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--acc), var(--blu));
}

@media (min-width: 600px) {
    .ph-banner {
        height: 140px;
    }
}

.ph-info {
    padding: 0 16px 16px;
    margin-top: -40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 600px) {
    .ph-info {
        flex-direction: row;
        align-items: flex-end;
        text-align: left;
        gap: 16px;
        margin-top: -50px;
    }
}

.ph-ava {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: var(--bg2);
    border: 3px solid var(--bg2);
    overflow: hidden;
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .ph-ava {
        width: 100px;
        height: 100px;
    }
}

.ph-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ph-details {
    flex: 1;
    padding-top: 8px;
}

@media (min-width: 600px) {
    .ph-details {
        padding-top: 54px;
    }
}

.ph-name {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.ph-name-text {
    color: var(--t1);
}

[data-theme="light"] .ph-name-text {
    color: var(--t1) !important;
}

@media (min-width: 600px) {
    .ph-name {
        justify-content: flex-start;
        font-size: 26px;
    }
}

.ph-badge {
    padding: 4px 12px;
    background: transparent;
    color: var(--t2);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.ph-title {
    font-size: 14px;
    color: var(--t2);
    margin: 4px 0 12px;
}

.ph-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 600px) {
    .ph-stats {
        justify-content: flex-start;
    }
}

.ph-stat {
    text-align: center;
}

.ph-stat-v {
    font-size: 18px;
    font-weight: 700;
}

.ph-stat-l {
    font-size: 11px;
    color: var(--t3);
    text-transform: uppercase;
}

.ph-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 54px;
}

@media (min-width: 600px) {
    .ph-actions {
        margin-left: auto;
    }
}

@media (max-width: 599px) {
    .ph-actions {
        padding-top: 0;
    }
}

.ph-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 8px;
    margin-top: 10px;
    align-items: flex-start;
}

/* Profile Tabs */
.act {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
}

.act:hover {
    background: var(--bg3);
}

.act-i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.act-i.rep {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blu);
}

.act-i.lik {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.act-i.pst {
    background: rgba(139, 92, 246, 0.15);
    color: var(--pur);
}

.act-t {
    font-size: 14px;
}

.act-t a {
    color: var(--acc);
    font-weight: 500;
}

.act-m {
    font-size: 12px;
    color: var(--t3);
    margin-top: 2px;
}

.pst {
    padding: 14px 0;
    border-bottom: 1px solid var(--br);
}

.pst:last-child {
    border-bottom: none;
}

.pst-t {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.pst-t a:hover {
    color: var(--acc);
}

.pst-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    background: transparent;
    color: var(--t2);
}

.pst-badge.red { color: var(--red); }
.pst-badge.org { color: var(--org); }

.pst-ex {
    font-size: 13px;
    color: var(--t2);
    margin-bottom: 8px;
    line-height: 1.5;
}

.pst-m {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--t3);
}

.pst-m i {
    color: var(--acc);
    margin-right: 4px;
}

.abt-sec {
    margin-bottom: 20px;
}

.abt-sec:last-child {
    margin-bottom: 0;
}

.abt-h {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.abt-h i {
    color: var(--acc);
}

.abt-txt {
    font-size: 14px;
    color: var(--t2);
    line-height: 1.7;
}

.abt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.abt-item {
    background: var(--bg3);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--br);
}

.abt-item-l {
    font-size: 11px;
    color: var(--t3);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.abt-item-v {
    font-size: 14px;
    font-weight: 500;
}

.author-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    justify-content: center;
    margin-bottom: 8px;
    margin-top: 6px;
}

@media (max-width: 700px) {
    .author-badges {
        justify-content: flex-start;
    }
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: var(--t2);
    font-size: 11px;
    background: transparent;
}

.sbtn a.sbtn-link {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg4);
    border: 1px solid var(--br);
    color: var(--t3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.sbtn a.sbtn-link:hover {
    color: var(--t1);
}

/* ============================================
   MESSAGES & NOTIFICATIONS
   ============================================ */
.msg-list,
.notify-list {
    display: flex;
    flex-direction: column;
}

.notify-group-title {
    padding: 10px 14px;
    background: var(--bg3);
    border-bottom: 1px solid var(--br);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--t3);
}

.msg-item,
.notify-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--br);
    color: var(--t1);
    text-decoration: none;
    transition: background 0.15s;
}

.msg-item:last-child,
.notify-item:last-child {
    border-bottom: none;
}

.msg-item:hover,
.notify-item:hover {
    background: var(--bg3);
}

.msg-item.unread {
    background: var(--bg3);
    box-shadow: inset 3px 0 0 var(--acc);
}

.msg-ava,
.notify-ava,
.msg-row-ava {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg3);
    border: 1px solid var(--br);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--t2);
    overflow: hidden;
    flex-shrink: 0;
}

.msg-ava.lg {
    width: 54px;
    height: 54px;
    border-radius: 16px;
}

.msg-ava img,
.notify-ava img,
.msg-row-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-main,
.notify-main {
    flex: 1;
    min-width: 0;
}

.msg-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.msg-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.msg-pill,
.notify-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--acc);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.msg-time,
.notify-time {
    font-size: 12px;
    color: var(--t3);
    white-space: nowrap;
}

.msg-preview,
.notify-preview {
    margin-top: 4px;
    color: var(--t3);
    font-size: 13px;
    line-height: 1.4;
}

.msg-you {
    color: var(--t2);
    margin-right: 6px;
    font-weight: 600;
}

.notify-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: 8px;
}

.notify-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.msg-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.msg-thread {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.msg-row.mine {
    flex-direction: row-reverse;
}

.msg-row-bubble {
    background: var(--bg3);
    border: 1px solid var(--br);
    border-radius: 12px;
    padding: 10px 12px;
    max-width: 70%;
    min-width: 0;
}

.msg-row.mine .msg-row-bubble {
    border-color: var(--acc);
}

.msg-row-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--t3);
    margin-bottom: 6px;
}

.msg-row.mine .msg-row-meta {
    flex-direction: row-reverse;
    text-align: right;
}

.msg-row-name {
    font-weight: 600;
    color: var(--t2);
}

.msg-row-body {
    font-size: 14px;
    color: var(--t1);
}

.msg-row-body p:last-child {
    margin-bottom: 0;
}

@media (max-width: 700px) {
    .msg-item,
    .notify-item {
        padding: 12px;
    }

    .msg-row-bubble {
        max-width: 100%;
    }

    .notify-meta {
        align-items: flex-start;
    }
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 900px) {
    .hdr-in {
        height: auto;
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .hdr-nav-in {
        padding: 10px 12px;
        gap: 12px;
        font-size: 11px;
    }

    .nav-in {
        padding: 0 12px;
    }

    .nav a {
        padding: 10px 12px;
        font-size: 12px;
    }

    .main {
        padding: 14px;
    }

    .btn-create-thread {
        padding: 8px 16px;
        font-size: 13px;
    }

    .th,
    .thread-header,
    .notice {
        padding: 12px;
    }

    .post-body {
        padding: 14px;
    }

    .post-hd,
    .post-header,
    .post-ft,
    .post-footer {
        padding: 10px 14px;
    }

    .post-edited {
        padding: 0 14px;
    }

    .author,
    .post-author {
        padding: 14px;
    }

    .markup-toolbar {
        gap: 4px;
    }

    .markup-btn {
        width: 28px;
        height: 28px;
    }

    .admin-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 700px) {
    .admin-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 600px) {
    .hdr-in {
        padding: 10px 12px;
        gap: 10px;
    }

    .logo {
        font-size: 18px;
    }

    .logo-text {
        font-size: 18px;
    }

    .hdr-nav-in {
        padding: 8px 10px;
        gap: 10px;
        letter-spacing: 0.05em;
    }

    .nav a {
        padding: 8px 10px;
        font-size: 11px;
    }

    .main {
        padding: 10px;
    }

    .btn-create-thread {
        width: 100%;
        justify-content: center;
    }

    .th,
    .thread-header,
    .notice {
        padding: 10px;
    }

    .post-body {
        padding: 12px;
        font-size: 14px;
    }

    .post-hd,
    .post-header,
    .post-ft,
    .post-footer {
        padding: 8px 12px;
    }

    .post-edited {
        padding: 0 12px;
    }

    .author,
    .post-author {
        padding: 12px;
    }

    .markup-toolbar:not(.markup-toolbar--rows) {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .markup-toolbar:not(.markup-toolbar--rows)::-webkit-scrollbar {
        height: 0;
    }

    .markup-btn {
        flex: 0 0 auto;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }

    .sec {
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .sec-h {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sec-t {
        font-size: 12px;
        letter-spacing: 0.03em;
    }

    .frow {
        grid-template-columns: 28px 1fr;
        gap: 8px;
        padding: 10px 12px;
    }

    .ficon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .finfo h3 {
        font-size: 12px;
    }

    .finfo p {
        font-size: 10px;
    }

    .srow {
        padding: 10px 12px;
        gap: 10px;
    }

    .srow-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .srow-t {
        font-size: 13px;
    }

    .online-users {
        gap: 4px;
    }

    .online-user {
        font-size: 11px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
