/* ==========================================================================
   kyo3xrex Community Platform - XenForo 2.x Dark Style (v4.20)
   Custom Engineered for kyo3xrex :: Private Gaming & Tech Forum
   ========================================================================== */

:root {
    --bg-base: #0f1115;
    --bg-header: #15181f;
    --bg-subnav: #1b1e27;
    --bg-card: #161922;
    --bg-card-header: #1f2330;
    --bg-card-hover: #1c202c;
    --bg-alt: #12141b;
    --bg-input: #11131a;

    --border-main: #242938;
    --border-light: rgba(255, 255, 255, 0.05);
    --border-focus: #10b981;

    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: rgba(16, 185, 129, 0.12);
    --accent-glow: rgba(16, 185, 129, 0.25);

    --text-primary: #f1f5f9;
    --text-main: #f1f5f9;
    --text-secondary: #acbac9;
    --text-muted: #8a9bad;
    --text-dim: #60718a;
    --bg-dark: #0e1218;

    --badge-admin: #ef4444;
    --badge-dev: #3b82f6;
    --badge-mod: #10b981;
    --badge-vip: #a855f7;
    --badge-verified: #f59e0b;
    --badge-member: #64748b;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent);
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
}

/* ==========================================================================
   TOP BAR & NAVIGATION (XENFORO STYLE)
   ========================================================================== */
.p-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-main);
}

.p-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 58px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    user-select: none;
}

.brand-logo img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
}

.brand-logo .dot {
    color: var(--accent);
}

.brand-tag {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 2px;
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 18px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.15s ease;
}

.nav-links a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-links a.active {
    color: #ffffff;
    background: var(--bg-subnav);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

/* Nav Auth */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sub-Navigation Bar */
.p-subnav {
    background: var(--bg-subnav);
    border-bottom: 1px solid var(--border-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.p-subnav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

.subnav-links {
    display: flex;
    gap: 4px;
    list-style: none;
}

.subnav-links a {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 5px;
}

.subnav-links a:hover, .subnav-links a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.subnav-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input-pill {
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 5px 12px 5px 30px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    outline: none;
    width: 200px;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}

.search-input-pill:focus {
    width: 260px;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Breadcrumbs */
.p-breadcrumbs {
    padding: 12px 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.p-breadcrumbs a {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.p-breadcrumbs a:hover {
    color: var(--accent);
}

.p-breadcrumbs .separator {
    color: var(--text-dim);
    font-size: 10px;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.btn-primary {
    background-color: var(--accent);
    color: #042413;
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #000;
    box-shadow: 0 0 12px var(--accent-glow);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-main);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
    color: #ffffff;
}

.btn-blue {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-blue:hover {
    background-color: #1d4ed8;
}

/* User Badges */
.user-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 3px;
}

.badge-admin {
    background: rgba(239, 68, 68, 0.15);
    color: var(--badge-admin);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-dev {
    background: rgba(59, 130, 246, 0.15);
    color: var(--badge-dev);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-mod {
    background: rgba(16, 185, 129, 0.15);
    color: var(--badge-mod);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-vip {
    background: rgba(168, 85, 247, 0.15);
    color: var(--badge-vip);
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-verified {
    background: rgba(245, 158, 11, 0.15);
    color: var(--badge-verified);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Notice Banner */
.notice-bar {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #d1fae5;
    min-width: 0;
    flex: 1;
}

.notice-badge {
    background: var(--accent);
    color: #042413;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notice-text {
    line-height: 1.4;
    white-space: nowrap;
}

.notice-action {
    flex-shrink: 0;
    white-space: nowrap;
}

.tree-node-highlight {
    outline: 2px solid var(--accent) !important;
    background: rgba(16, 185, 129, 0.12) !important;
}

/* ==========================================================================
   LAYOUT GRID (CONTENT + SIDEBAR)
   ========================================================================== */
.p-body-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
    align-items: start;
    margin-bottom: 40px;
}

.p-body-full {
    display: block;
    margin-bottom: 40px;
}

/* ==========================================================================
   FORUM CATEGORIES & NODE ROWS (XENFORO STANDARD)
   ========================================================================== */
.block {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.block-header {
    background: linear-gradient(180deg, var(--bg-card-header) 0%, #1a1e29 100%);
    border-bottom: 1px solid var(--border-main);
    padding: 11px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: -0.2px;
}

.block-header a {
    color: #ffffff;
}

.block-header-side {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Forum Node Row */
.node-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 140px 240px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: background-color 0.15s ease;
}

.node-row:last-child {
    border-bottom: none;
}

.node-row:hover {
    background-color: var(--bg-card-hover);
}

.node-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--accent);
}

.node-main {
    padding-right: 14px;
}

.node-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-title a {
    color: #ffffff;
}

.node-title a:hover {
    color: var(--accent);
}

.node-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.node-subforums {
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.node-subforums a {
    color: var(--text-secondary);
}

.node-subforums a:hover {
    color: var(--accent);
}

.node-stats {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

.node-stats strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Node Last Post */
.node-extra {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    min-width: 0;
}

.node-extra-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-main);
}

.node-extra-info {
    min-width: 0;
    flex: 1;
}

.node-extra-title {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 2px;
}

.node-extra-title:hover {
    color: var(--accent);
}

.node-extra-meta {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

/* ==========================================================================
   SIDEBAR WIDGETS
   ========================================================================== */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.widget-header {
    background: linear-gradient(180deg, var(--bg-card-header) 0%, #1a1e29 100%);
    border-bottom: 1px solid var(--border-main);
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-body {
    padding: 12px 14px;
}

/* Statistics Grid */
.stat-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-widget-cell {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.stat-widget-val {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.stat-widget-lbl {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 3px;
}

/* Staff Online List */
.staff-online-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-light);
}

.staff-online-item:last-child {
    border-bottom: none;
}

.staff-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-main);
    flex-shrink: 0;
}

.staff-info {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.staff-name {
    font-size: 12.5px;
    font-weight: 600;
}

/* Online Members Cloud */
.online-members-cloud {
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.online-members-cloud a {
    font-weight: 500;
}

.online-members-cloud a:hover {
    text-decoration: underline;
}

/* Latest Posts Widget */
.widget-post-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.widget-post-item:last-child {
    border-bottom: none;
}

.widget-post-body {
    flex: 1;
    min-width: 0;
}

.widget-post-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.widget-post-title:hover {
    color: var(--accent);
}

.widget-post-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   THREAD VIEW & POSTBIT (XENFORO STYLE)
   ========================================================================== */
.thread-header {
    margin-bottom: 18px;
}

.thread-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.4px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.thread-meta-bar {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.thread-meta-bar a {
    color: var(--text-secondary);
}

/* Post Container */
.post-block {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    border-bottom: 1px solid var(--border-main);
    background: var(--bg-card);
}

.post-block:last-child {
    border-bottom: none;
}

/* Post User Info (Left Column) */
.post-user {
    background: var(--bg-alt);
    padding: 20px 16px;
    border-right: 1px solid var(--border-main);
    text-align: center;
}

.post-user-avatar {
    width: 84px;
    height: 84px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-main);
    object-fit: cover;
    margin: 0 auto 10px;
    display: block;
    background: #11131a;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.post-user-avatar:hover {
    transform: scale(1.04);
    border-color: var(--accent);
}

.post-user-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.post-user-title {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.post-user-badge {
    margin-bottom: 12px;
}

.post-user-stats {
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-user-stats-row {
    display: flex;
    justify-content: space-between;
}

.post-user-stats-row strong {
    color: var(--text-primary);
}

/* Post Main Content (Right Column) */
.post-content-area {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.post-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
    margin-bottom: 16px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.post-top-meta a {
    color: var(--text-muted);
}

.post-body {
    font-size: 13.5px;
    line-height: 1.7;
    color: #e2e8f0;
    word-break: break-word;
    flex: 1;
}

.post-body p {
    margin-bottom: 14px;
}

.post-body h3, .post-body h4 {
    color: #ffffff;
    margin: 18px 0 10px;
}

.post-body ul, .post-body ol {
    margin: 0 0 14px 20px;
}

.post-body li {
    margin-bottom: 6px;
}

/* Diagrams & Thread Images */
.post-diagram-box {
    margin: 18px 0;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0d0f14;
}

.post-diagram-header {
    background: #141720;
    padding: 8px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-diagram-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Code Snippets */
.code-block {
    background: #0c0e12;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-sm);
    margin: 14px 0;
    overflow: hidden;
}

.code-header {
    background: #141720;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
}

.code-content {
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #7dd3fc;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre;
}

/* Post Signature */
.post-signature {
    border-top: 1px dashed var(--border-main);
    margin-top: 20px;
    padding-top: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-style: italic;
}

/* Post Footer Actions */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: 20px;
}

.post-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.post-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.post-action-btn.liked {
    color: var(--accent);
}

/* Quick Reply Box */
.quick-reply-box {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-top: 22px;
}

.quick-reply-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    background: #12151c;
    border: 1px solid var(--border-main);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 6px 10px;
}

.editor-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
}

.editor-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.quick-reply-textarea {
    width: 100%;
    min-height: 110px;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    color: var(--text-primary);
    padding: 12px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease;
}

.quick-reply-textarea:focus {
    border-color: var(--accent);
}

.quick-reply-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

/* ==========================================================================
   SHOUTBOX (CHATBOX)
   ========================================================================== */
.shoutbox-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shoutbox-header {
    background: linear-gradient(180deg, var(--bg-card-header) 0%, #1a1e29 100%);
    border-bottom: 1px solid var(--border-main);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
}

.shoutbox-messages {
    max-height: 520px;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #11131a;
}

.shout-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.shout-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.shout-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-main);
}

.shout-body {
    flex: 1;
    min-width: 0;
}

.shout-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.shout-user {
    font-weight: 700;
}

.shout-time {
    font-size: 11px;
    color: var(--text-muted);
}

.shout-text {
    color: #e2e8f0;
    word-break: break-word;
}

.shoutbox-input-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--border-main);
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.shout-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 9px 14px;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.15s ease;
}

.shout-input:focus {
    border-color: var(--accent);
}

/* ==========================================================================
   MEMBER PROFILES
   ========================================================================== */
.profile-cover {
    height: 180px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-main);
    border-bottom: none;
    position: relative;
    background: linear-gradient(135deg, #1e2538 0%, #11141e 100%);
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0 24px 20px;
    margin-bottom: 24px;
    position: relative;
}

.profile-header-strip {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    position: relative;
    top: -45px;
    margin-bottom: -30px;
}

.profile-avatar-lg {
    width: 110px;
    height: 110px;
    border-radius: var(--radius-md);
    border: 4px solid var(--bg-card);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    background: #11131a;
    flex-shrink: 0;
}

.profile-title-block {
    flex: 1;
    min-width: 0;
}

.profile-username-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.profile-username {
    font-size: 24px;
    font-weight: 800;
}

.profile-submeta {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-main);
    margin: 20px 0 16px;
    padding-bottom: 2px;
}

.profile-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-tab.active, .profile-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.profile-tab.active {
    border-bottom: 2px solid var(--accent);
}

.profile-layout-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-key {
    color: var(--text-muted);
}

.spec-val {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* ==========================================================================
   FORMS & AUTHENTICATION
   ========================================================================== */
.form-box {
    max-width: 440px;
    margin: 40px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.form-header {
    background: linear-gradient(180deg, var(--bg-card-header) 0%, #1a1e29 100%);
    border-bottom: 1px solid var(--border-main);
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.form-body {
    padding: 24px 22px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
    transition: all 0.15s ease;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.alert-message {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: 16px;
    display: none;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #86efac;
}

/* ==========================================================================
   MODAL & TOAST
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-head {
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-main);
    padding: 12px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 18px;
}

.toast-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e2330;
    border: 1px solid var(--accent);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    font-size: 12.5px;
    animation: toastSlide 0.2s ease-out;
}

@keyframes toastSlide {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   FOOTER (AUTHENTIC XENFORO 2.X STYLE)
   ========================================================================== */
.p-footer {
    background: var(--bg-header);
    border-top: 1px solid var(--border-main);
    margin-top: auto;
    padding: 24px 0 32px;
}

.p-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
}

.footer-nav-list {
    display: flex;
    gap: 16px;
    list-style: none;
}

.footer-nav-list a {
    color: var(--text-secondary);
}

.footer-nav-list a:hover {
    color: var(--accent);
}

.p-footer-copyright {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

.p-footer-copyright a {
    color: var(--text-secondary);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE / TABLET)
   ========================================================================== */
@media (max-width: 960px) {
    .p-body-main {
        grid-template-columns: 1fr;
    }

    .node-row {
        grid-template-columns: 46px minmax(0, 1fr) 180px;
    }

    .node-stats {
        display: none;
    }

    .post-block {
        grid-template-columns: 1fr;
    }

    .post-user {
        border-right: none;
        border-bottom: 1px solid var(--border-main);
        display: flex;
        align-items: center;
        gap: 14px;
        text-align: left;
        padding: 14px 18px;
    }

    .post-user-avatar {
        width: 50px;
        height: 50px;
        margin: 0;
    }

    .post-user-stats {
        display: none;
    }

    .profile-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .node-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .node-extra {
        display: none;
    }

    .nav-links a {
        padding: 12px 8px;
        font-size: 11.5px;
    }

    .search-input-pill {
        display: none;
    }
}

/* ==========================================================================
   MEMBERS & GRID LAYOUT
   ========================================================================== */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.member-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #151924;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.member-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.member-card-avatar {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.member-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-card-name {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.member-card-title {
    font-size: 12px;
    color: var(--text-secondary);
}

.member-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Shared responsive polish & layout enhancements */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
main.container { flex: 1 0 auto; width: 100%; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid #69e4b2; outline-offset: 3px; }
.brand-logo { flex-shrink: 0; white-space: nowrap; }
.brand-logo img { width: 34px; height: 34px; border-radius: 8px; }
.nav-links { min-width: 0; }
.nav-auth { flex-shrink: 0; }
.node-row, .node-main, .node-extra, .p-body-content, .p-body-sidebar { min-width: 0; }
.node-row-link { cursor: pointer; }
.node-row-link:hover .node-title a { color: #8ce3b4; }
/* 4-column node-row default */
.node-row { grid-template-columns: 44px minmax(0, 1fr) 130px 230px; gap: 14px; }
.node-title { min-width: 0; flex-wrap: wrap; line-height: 1.38; }
.node-title a { overflow-wrap: anywhere; }
.node-extra-title { max-width: 100%; }
.thread-view-header, .thread-header { margin-bottom: 20px; }
.thread-view-title { color: #fff; font-size: clamp(19px, 2.5vw, 25px); line-height: 1.3; letter-spacing: -.025em; margin-bottom: 10px; }
.thread-view-title .tag-badge { vertical-align: middle; margin-right: 8px; }
.tag-badge { display: inline-flex; align-items: center; border: 1px solid rgba(16,185,129,.32); background: var(--accent-light); border-radius: 3px; padding: 2px 7px; color: #83e9bc; font-size: 10px; font-weight: 700; letter-spacing: .035em; }
.profile-tabs { overflow-x: auto; white-space: nowrap; }
.profile-tab { flex: 0 0 auto; }
.profile-cover { background-size: cover !important; background-position: center !important; }
.modal-overlay[style*="flex"] { display: flex; }
.search-results-box { max-height: min(50vh, 380px); overflow-y: auto; display: grid; gap: 3px; margin-top: 14px; }
.search-results-box a { display: block; padding: 10px 12px; background: var(--bg-alt); border: 1px solid var(--border-main); border-radius: 4px; color: var(--text-primary); }
.search-results-box a:hover, .search-results-box a:focus-visible { background: var(--accent-light); border-color: var(--accent); }
.search-results-hint { color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.subnav-links button, .footer-nav-list button { border: 0; background: none; color: var(--text-secondary); cursor: pointer; }
.subnav-links button { display: flex; align-items: center; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; white-space: nowrap; }
.subnav-links button:hover, .subnav-links button:focus-visible { color: #fff; background: rgba(255,255,255,.05); }
.footer-nav-list button { font-size: inherit; }
.footer-nav-list button:hover { color: var(--accent); }
.profile-cover { background-image: radial-gradient(circle at 82% 15%, rgba(92,186,153,.14),transparent 34%), repeating-linear-gradient(115deg, transparent 0 22px, rgba(174,221,198,.035) 23px 24px), linear-gradient(110deg,#212e30,#182127) !important; }
.profile-cover.cover-kyo { background-image: radial-gradient(circle at 85% 18%, rgba(224,144,123,.23),transparent 32%), repeating-linear-gradient(115deg,transparent 0 22px,rgba(240,157,150,.035) 23px 24px),linear-gradient(105deg,#3c3035,#1b2428) !important; }
.profile-cover.cover-xen { background-image: radial-gradient(circle at 85% 18%, rgba(135,191,210,.24),transparent 32%), repeating-linear-gradient(115deg,transparent 0 22px,rgba(156,207,232,.038) 23px 24px),linear-gradient(105deg,#23384a,#1a252b) !important; }
.post-body a, .modal-body a { color: #86e4b5; text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover, .modal-body a:hover { color: #c9ffe2; }
.post-body ul, .post-body ol { color: #bdcbd4 !important; }
.code-content { max-width: 100%; overflow-x: auto; }
.post-diagram-box a { display: block; cursor: zoom-in; }
.post-diagram-box a:focus-visible { outline-offset: -3px; }
.snippet { background: #0e151c; border: 1px solid var(--border-main); border-radius: 5px; margin: 16px 0; overflow: hidden; }
.snippet-copy { display: flex; width: max-content; margin: 9px 9px 0 auto; }
.post-body .snippet pre { margin: 0 !important; background: transparent !important; color: #addec8 !important; padding: 12px 16px 17px !important; overflow-x: auto; white-space: pre; font-size: 12px; }
.member-card-info { min-width: 0; }
.more-reading { margin: 12px 0 32px; }
.more-reading h2 { font-size: 15px; margin-bottom: 12px; }
.more-reading-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.more-reading-grid a { display: block; min-width: 0; border: 1px solid var(--border-main); border-radius: 6px; padding: 16px; background: var(--bg-card); }
.more-reading-grid a:hover { border-color: #47775e; background: var(--bg-card-hover); }
.more-reading-grid strong { display: block; font-size: 13px; margin-bottom: 3px; }
.more-reading-grid span { display: block; font-size: 11.5px; color: var(--text-secondary); }
.feature-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 39%); overflow: hidden; border: 1px solid #2c453f; border-radius: 8px; background: linear-gradient(130deg, #1c302c, #172322 60%, #171e24); margin: 0 0 22px; }
.feature-copy { padding: clamp(22px, 3.5vw, 38px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.feature-eyebrow { color: #83e9bc; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 11px; }
.feature-lead h1 { font-size: clamp(23px, 2.6vw, 33px); line-height: 1.16; max-width: 600px; letter-spacing: -.04em; }
.feature-lead p { max-width: 490px; color: #b2c8c2; margin: 12px 0 18px; font-size: 13px; }
.feature-visual { position: relative; min-height: 220px; overflow: hidden; background: #101b1a; }
.feature-visual img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center; opacity: .86; }
.feature-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #172923, transparent 30%); pointer-events: none; }
.feature-picks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 0 0 24px; }
.feature-pick { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px; border: 1px solid var(--border-main); border-radius: 6px; background: var(--bg-card); }
.feature-pick:hover { border-color: #467461; background: var(--bg-card-hover); }
.feature-pick img { width: 66px; height: 53px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.feature-pick strong { display: block; font-size: 12px; line-height: 1.35; }
.feature-pick small { display: block; color: var(--text-secondary); font-size: 10px; margin-bottom: 3px; }
.p-footer { margin-top: 30px; }
.notice-bar { align-items: center; }

@media (max-width: 1100px) {
    .node-row { grid-template-columns: 48px minmax(0, 1fr) 172px !important; }
    .node-stats { display: none; }
    .nav-links a { padding-inline: 9px; }
}
@media (max-width: 960px) {
    .node-row { grid-template-columns: 48px minmax(0,1fr) 172px; }
}
@media (max-width: 800px) {
    .p-header-inner { height: auto; min-height: 60px; flex-wrap: wrap; gap: 0 10px; padding-top: 8px; }
    .brand-logo { margin-bottom: 8px; }
    .nav-auth { margin-left: auto; margin-bottom: 8px; }
    .nav-links { order: 3; width: 100%; overflow-x: auto; scrollbar-width: thin; }
    .nav-links a { padding: 10px 12px; white-space: nowrap; }
    .p-subnav-inner { height: auto; min-height: 42px; gap: 8px; }
    .subnav-links { overflow-x: auto; min-width: 0; padding: 5px 0; }
    .subnav-links a { white-space: nowrap; }
    .subnav-search { display: none; }
    .feature-lead { grid-template-columns: 1fr; }
    .feature-visual { min-height: 165px; max-height: 210px; }
    .feature-picks { grid-template-columns: 1fr; }
    .feature-pick img { width: 86px; }
    .more-reading-grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
    .container { padding-inline: 14px; }
    .p-header-inner { padding-top: 10px; }
    .brand-logo { font-size: 17px; }
    .nav-auth { gap: 5px; }
    .nav-auth .btn { padding: 5px 8px !important; font-size: 11px; }
    .nav-auth .btn:first-child { font-size: 0; }
    .nav-auth .btn:first-child i { font-size: 13px; }
    .p-breadcrumbs { overflow-x: auto; white-space: nowrap; }
    .node-row { grid-template-columns: 40px minmax(0,1fr) !important; padding: 12px !important; }
    .node-extra { display: none !important; }
    .node-icon { width: 31px; height: 31px; font-size: 13px !important; }
    .node-main { padding: 0; }
    .post-content-area { padding: 16px; }
    .post-user { padding: 10px 14px; }
    .nav-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
    .nav-links a { justify-content: center; padding: 8px 4px; }
    .profile-tabs { display: grid; grid-template-columns: repeat(auto-fit,minmax(88px,1fr)); white-space: normal; overflow: visible; gap: 2px; }
    .profile-tab { padding: 8px 4px; text-align: center; font-size: 11px; line-height: 1.3; }
    .profile-header-strip { gap: 12px; top: 0; margin: 0; align-items: center; }
    .profile-card { padding-top: 14px; }
    .profile-avatar-lg { width: 76px; height: 76px; }
    .profile-username { font-size: 19px; overflow-wrap: anywhere; }
    .profile-card { padding-inline: 14px; }
    .profile-cover { height: 92px; }
    .block-header-side { display: none; }
    .footer-nav-list { flex-wrap: wrap; gap: 8px 14px; }
    .notice-bar { flex-wrap: wrap; }
    .notice-text { white-space: normal; word-break: break-word; }
    .stat-widget-grid[style] { grid-template-columns: repeat(2,1fr) !important; }
    main:has(> .stat-widget-grid) .block [style*="margin-left:"] { margin-left: 7px !important; padding-left: 7px !important; }
    main:has(> .stat-widget-grid) .block [style*="justify-content:space-between"] { flex-wrap: wrap; gap: 7px; }
    main:has(> .stat-widget-grid) .block [style*="justify-content:space-between"] > div { min-width: 0; }
    main:has(> .stat-widget-grid) .block [style*="justify-content:space-between"] > span { margin-left: auto; }
    main:has(> .stat-widget-grid) .block [style*="font-size:11px"] { overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
    .brand-logo img { width: 28px; height: 28px; }
    .nav-auth .btn { padding: 5px 6px !important; }
}

