﻿/* ═══════════════════════════════════════════
   Design System — امنیت‌پلاس
   ═══════════════════════════════════════════ */
:root {
    --bg-base: #0b0f14;
    --bg-surface: #111827;
    --bg-elevated: #1a2332;
    --bg-hover: #1e293b;
    --border: #1e293b;
    --border-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #00ff88;
    --accent-dim: rgba(0, 255, 136, 0.12);
    --accent-hover: #34d399;
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.12);
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --font-ui: "Vazirmatn", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
    --max-width: 72rem;
    --input-bg: #0f172a;
    --panel-header-bg: rgba(15, 23, 42, 0.5);
    --footer-bg: #060a0f;
    --prose-color: #cbd5e1;
    --pre-bg: #0f172a;
    --hero-mid: #0f172a;
    --glow-1: rgba(0, 255, 136, 0.04);
    --glow-2: rgba(59, 130, 246, 0.03);
    --link: #60a5fa;
    --link-hover: #93c5fd;
    --heading-blue: #93c5fd;
    --heading-emerald: #34d399;
    --heading-purple: #c084fc;
    --heading-red: #f87171;
    --heading-orange: #fb923c;
    --badge-blue-text: #93c5fd;
    --badge-emerald-text: #6ee7b7;
    --transition-theme: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

[data-theme="light"] {
    color-scheme: light;
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-hover: #e2e8f0;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #059669;
    --accent-dim: rgba(5, 150, 105, 0.1);
    --accent-hover: #047857;
    --blue-dim: rgba(59, 130, 246, 0.1);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --input-bg: #f8fafc;
    --panel-header-bg: rgba(241, 245, 249, 0.9);
    --footer-bg: #e2e8f0;
    --prose-color: #334155;
    --pre-bg: #f1f5f9;
    --hero-mid: #e2e8f0;
    --glow-1: rgba(5, 150, 105, 0.06);
    --glow-2: rgba(59, 130, 246, 0.05);
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --heading-blue: #1d4ed8;
    --heading-emerald: #059669;
    --heading-purple: #7e22ce;
    --heading-red: #dc2626;
    --heading-orange: #c2410c;
    --badge-blue-text: #1d4ed8;
    --badge-emerald-text: #047857;
}

/* ── Light mode: Tailwind utility overrides (readable on light backgrounds) ── */
[data-theme="light"] .text-slate-100 { color: var(--text-primary) !important; }
[data-theme="light"] .text-slate-200 { color: var(--text-primary) !important; }
[data-theme="light"] .text-slate-300 { color: var(--text-secondary) !important; }
[data-theme="light"] .text-slate-400 { color: var(--text-muted) !important; }
[data-theme="light"] .text-slate-500 { color: #64748b !important; }
[data-theme="light"] .text-slate-950 { color: #0f172a !important; }
[data-theme="light"] .text-blue-300 { color: var(--heading-blue) !important; }
[data-theme="light"] .text-blue-400 { color: var(--link) !important; }
[data-theme="light"] .text-emerald-300 { color: var(--accent-hover) !important; }
[data-theme="light"] .text-emerald-400 { color: var(--heading-emerald) !important; }
[data-theme="light"] .text-purple-400 { color: var(--heading-purple) !important; }
[data-theme="light"] .text-red-300 { color: #b91c1c !important; }
[data-theme="light"] .text-red-400 { color: var(--heading-red) !important; }
[data-theme="light"] .hover\:text-blue-300:hover { color: var(--link-hover) !important; }
[data-theme="light"] .hover\:text-emerald-300:hover { color: var(--accent-hover) !important; }
[data-theme="light"] .hover\:text-emerald-400:hover { color: var(--accent-hover) !important; }
[data-theme="light"] .hover\:text-slate-200:hover { color: var(--text-primary) !important; }
[data-theme="light"] .border-slate-700 { border-color: var(--border-light) !important; }
[data-theme="light"] .border-slate-800 { border-color: var(--border) !important; }
[data-theme="light"] .hover\:bg-slate-800:hover { background-color: var(--bg-hover) !important; }
[data-theme="light"] .border-blue-600\/40 { border-color: rgba(37, 99, 235, 0.35) !important; }
[data-theme="light"] .border-emerald-600\/50 { border-color: rgba(5, 150, 105, 0.4) !important; }
[data-theme="light"] .badge-blue { color: var(--badge-blue-text); }
[data-theme="light"] .btn-blue { color: var(--link); }
[data-theme="light"] .prose-content blockquote,
[data-theme="light"] .forum-content blockquote { color: var(--prose-color); background: var(--bg-elevated); }

:root { color-scheme: dark; }

html {
    scroll-behavior: smooth;
    transition: var(--transition-theme);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-ui);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: var(--transition-theme);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 0%, var(--glow-1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--glow-2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.5s ease;
}

a { transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s; }

/* ── Animations ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
    50% { box-shadow: 0 0 20px 2px rgba(0, 255, 136, 0.15); }
}
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes countPop {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-page { animation: fadeIn 0.45s ease-out; }
.animate-fade-up { animation: fadeInUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-slide-down { animation: slideDown 0.35s ease-out both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.4s; }

.animate-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hover-lift {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ── Theme Toggle / Nav Icon Buttons ── */
.theme-toggle,
.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.nav-icon-btn svg { width: 1.125rem; height: 1.125rem; }
.theme-toggle:hover,
.nav-icon-btn:hover {
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}
.theme-toggle:hover { transform: rotate(15deg) scale(1.05); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { width: 1.125rem; height: 1.125rem; transition: opacity 0.3s, transform 0.3s; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@keyframes themeSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.theme-toggle-spin { animation: themeSpin 0.4s ease; }

/* ── Site Header ── */
.site-header {
    transition: box-shadow 0.3s ease, var(--transition-theme);
}
.site-header.is-scrolled {
    box-shadow: var(--shadow-lg);
}
.site-header.is-scrolled .header-top-bar {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
    overflow: hidden;
}
.header-top-bar {
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease, var(--transition-theme);
    max-height: 3rem;
}
.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.header-top-text { font-size: 0.75rem; color: var(--text-muted); }
.header-top-date { display: none; }
@media (min-width: 640px) {
    .header-top-date { display: inline; }
}
.nav-container {
    width: 100%;
    max-width: 72rem;
    margin-inline: auto;
    padding-inline: 1rem;
}
.site-nav {
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-theme);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-block: 0.75rem;
    min-height: 4rem;
}
.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
    flex: 1 1 auto;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    flex-shrink: 0;
}
.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: rgba(16, 185, 129, 0.15);
    font-size: 1.125rem;
    font-weight: 700;
    color: #34d399;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s;
}
.site-logo:hover .logo-mark {
    transform: rotate(90deg) scale(1.08);
    background: var(--accent-dim);
}
.logo-image {
    flex-shrink: 0;
}
.logo-text { min-width: 0; }
.logo-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--accent-hover);
    line-height: 1.2;
}
.logo-sub {
    display: none;
    font-size: 0.625rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
@media (min-width: 640px) {
    .logo-sub { display: block; }
}
.nav-links-desktop {
    display: none;
    align-items: center;
    gap: 0.25rem;
}
@media (min-width: 1024px) {
    .nav-links-desktop { display: flex; }
}
.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
    flex: 0 0 auto;
    min-width: 0;
}
@media (min-width: 1024px) {
    .nav-actions { gap: 0.625rem; }
}
.nav-cta-btn {
    display: none;
    padding: 0.375rem 0.875rem !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-auth-btn {
    display: none;
    padding: 0.375rem 0.875rem !important;
    font-size: 0.8125rem !important;
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .nav-cta-btn,
    .nav-auth-btn { display: inline-flex; }
}
.mobile-menu-btn {
    display: flex;
}
@media (min-width: 1024px) {
    .mobile-menu-btn { display: none; }
}
@media (max-width: 1023px) {
    .nav-inner {
        gap: 0.5rem;
        padding-block: 0.625rem;
        min-height: 3.5rem;
    }
    .nav-brand-group {
        gap: 0.625rem;
        flex: 1 1 auto;
        min-width: 0;
    }
    .logo-title {
        font-size: 0.875rem;
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .nav-actions {
        gap: 0.25rem;
        flex-shrink: 0;
    }
    .nav-icon-btn,
    .theme-toggle {
        width: 2rem;
        height: 2rem;
    }
    .user-menu,
    .nav-cta-btn,
    .nav-auth-btn,
    .notification-menu,
    .header-search-desktop,
    .nav-links-desktop {
        display: none !important;
    }
}
@media (min-width: 1024px) and (max-width: 1199px) {
    .nav-brand-group {
        gap: 0.875rem;
    }
    .nav-link {
        padding-inline: 0.5625rem;
    }
    .nav-link span {
        display: none;
    }
    .header-search-desktop .site-search-form input[type="search"] {
        width: 8.5rem;
    }
}
.mobile-menu-icon-close { display: none; }
.mobile-menu-btn.is-open .mobile-menu-icon-open { display: none; }
.mobile-menu-btn.is-open .mobile-menu-icon-close { display: block; }
.user-menu {
    position: relative;
    display: none;
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .user-menu { display: block; }
}
.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 11rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    padding: 0.3125rem 0.625rem 0.3125rem 0.375rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.08);
}
.user-menu-avatar { width: 1.75rem; height: 1.75rem; }
.user-menu-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.user-menu-chevron {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.user-menu-toggle[aria-expanded="true"] .user-menu-chevron {
    transform: rotate(180deg);
}
.user-menu-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    inset-inline-end: 0;
    inset-inline-start: auto;
    min-width: 13rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 60;
}
.user-menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-menu-header {
    padding: 0.625rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}
.user-menu-header-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}
.user-menu-header-meta {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.user-menu-item {
    display: block;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.user-menu-item:hover {
    background: var(--bg-hover);
    color: var(--accent-hover);
}
.user-menu-item-danger { color: #f87171; }
.user-menu-item-danger:hover {
    background: rgba(248, 113, 113, 0.08);
    color: #fca5a5;
}
.user-menu-divider {
    height: 1px;
    margin: 0.25rem 0;
    background: var(--border);
}
.user-menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    margin-inline-start: 0.375rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    background: var(--accent);
    color: #0b0f14;
    font-size: 0.625rem;
    font-weight: 700;
}
.notification-menu {
    position: relative;
    display: none;
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .notification-menu { display: block; }
}
.notification-menu-toggle {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: -0.125rem;
    inset-inline-start: -0.125rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.125rem;
    text-align: center;
    pointer-events: none;
}
.notification-menu-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    inset-inline-end: 0;
    inset-inline-start: auto;
    width: min(22rem, 88vw);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.375rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 60;
    overflow: hidden;
}
.notification-menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--panel-header-bg);
}
.notification-menu-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}
.notification-menu-count {
    font-size: 0.75rem;
    color: var(--accent-hover);
    font-weight: 600;
}
.notification-menu-list {
    max-height: 18rem;
    overflow-y: auto;
}
.notification-menu-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.2s ease;
}
.notification-menu-item:hover {
    background: color-mix(in srgb, var(--bg-base) 88%, var(--blue-dim));
}
.notification-menu-item-unread {
    background: color-mix(in srgb, var(--bg-base) 92%, var(--accent-dim));
}
.notification-menu-item-message {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-primary);
}
.notification-menu-item-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
}
.notification-menu-empty {
    padding: 1.25rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}
.notification-menu-footer {
    display: block;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--link);
    text-align: center;
    text-decoration: none;
}
.notification-menu-footer:hover {
    background: var(--accent-dim);
}
.notification-list {
    overflow: hidden;
}
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.2s ease;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover {
    background: color-mix(in srgb, var(--bg-base) 88%, var(--blue-dim));
}
.notification-item-unread {
    background: color-mix(in srgb, var(--bg-base) 92%, var(--accent-dim));
}
.notification-item-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--blue-dim);
    color: var(--link);
}
.notification-item-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}
.notification-item-icon-announcement {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.notification-item-icon-mention {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}
.notification-item-icon-best_answer {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.notification-item-body {
    flex: 1;
    min-width: 0;
}
.notification-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
.notification-item-type {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--link);
}
.notification-item-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
}
.notification-item-message {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text-primary);
}
.notification-item-detail {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.notification-item-actor {
    display: inline-block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.notification-item-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 9999px;
    background: var(--accent);
}
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.pagination-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.search-loading {
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    z-index: 55;
}
.mobile-menu-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(20rem, 88vw);
    height: 100dvh;
    border-left: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 60;
    display: flex;
    flex-direction: column;
}
.mobile-menu-drawer.is-open {
    transform: translateX(0);
}
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}
.mobile-menu-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}
.mobile-menu-subtitle {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
}
.mobile-menu-section { margin-top: 1rem; }
.mobile-menu-section:first-child { margin-top: 0; }
.mobile-menu-label {
    margin-bottom: 0.375rem;
    padding-inline: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
body.nav-open { overflow: hidden; }

/* ── Feed & Home widgets ── */
.feed-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.25rem;
    transition: var(--transition-theme);
}
.feed-panel-title { font-size: 1.125rem; font-weight: 700; }
.feed-link {
    display: block;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    padding: 0.875rem 1rem;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.feed-link:hover {
    transform: translateX(-4px);
    background: var(--bg-hover);
}
.feed-link-title { font-weight: 600; color: var(--text-primary); }
.feed-link-meta { margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-muted); }
.feed-link-emerald:hover { border-color: var(--accent-hover); }
.feed-link-blue:hover { border-color: var(--blue); }
.feed-link-purple:hover { border-color: #a855f7; }
.feed-link-orange:hover { border-color: #f97316; }
.feed-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.feed-panel-link { font-size: 0.75rem; color: var(--text-muted); }
.feed-panel-link:hover { color: var(--accent-hover); }
.section-heading { color: var(--text-primary); }
.hero-title {
    margin-top: 1.25rem;
    font-size: clamp(1.875rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
}
.hero-desc {
    margin-top: 1.25rem;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 2;
    color: var(--text-secondary);
}
.hero-accent { color: var(--accent-hover); }
.footer-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.footer-text { font-size: 0.875rem; line-height: 1.75; color: var(--text-muted); }
.footer-link { color: var(--text-muted); transition: color 0.2s; }
.footer-link:hover { color: var(--accent-hover); }
.footer-divider { border-top: 1px solid var(--border); }
.footer-bottom { font-size: 0.75rem; color: var(--text-muted); }


/* ── Layout ── */
.layout-sidebar {
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .layout-sidebar { grid-template-columns: 260px 1fr; }
}

/* ── Blog archive (content + sidebar) ── */
.blog-archive-layout {
    display: grid;
    gap: 2rem;
    align-items: start;
}
.blog-archive-content {
    order: 1;
    min-width: 0;
}
.blog-archive-sidebar {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 1024px) {
    .blog-archive-layout {
        grid-template-columns: 17.5rem minmax(0, 1fr);
    }
    .blog-archive-content,
    .blog-archive-sidebar {
        order: unset;
    }
    .blog-archive-sidebar {
        position: sticky;
        top: 6rem;
        align-self: start;
    }
}
.blog-archive-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1rem;
}
.blog-archive-panel-title {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent-hover);
}
.blog-archive-search-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}
.blog-archive-search-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.blog-archive-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.blog-archive-search-actions .btn {
    flex: 1 1 auto;
    min-width: 5rem;
}
.blog-post-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    align-items: stretch;
}
.blog-post-grid .empty-state {
    grid-column: 1 / -1;
}
@media (min-width: 640px) {
    .blog-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.blog-post-grid-item {
    display: flex;
    min-width: 0;
}
.blog-post-grid-item > .blog-post-card {
    width: 100%;
}
.blog-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.28s, box-shadow 0.28s;
}
.blog-post-card:hover {
    border-color: rgba(0, 255, 136, 0.25);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.blog-post-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}
.blog-post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.blog-post-card:hover .blog-post-card-media img {
    transform: scale(1.04);
}
.blog-post-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 1rem 1.25rem 1.25rem;
    min-width: 0;
}
.blog-post-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.blog-post-card-title {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
}
.blog-post-card-title:hover {
    color: var(--accent-hover);
}
.blog-post-card-excerpt {
    flex: 1 1 auto;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.blog-post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.blog-post-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.blog-post-card-author:hover {
    color: var(--accent-hover);
}
.blog-post-card-author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.blog-post-card-views {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Forum archive (content + sidebar) ── */
.forum-archive-layout {
    display: grid;
    gap: 1.75rem;
    align-items: start;
}
.forum-archive-content {
    order: 1;
    min-width: 0;
}
.forum-archive-sidebar {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
[data-forum-sidebar-widgets] {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 1024px) {
    .forum-archive-layout {
        grid-template-columns: 18rem minmax(0, 1fr);
    }
    .forum-archive-content,
    .forum-archive-sidebar {
        order: unset;
    }
    .forum-archive-sidebar {
        position: sticky;
        top: 6rem;
        align-self: start;
    }
}
.forum-archive-panel {
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.125rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}
[data-theme="light"] .forum-archive-panel {
    border-color: #eef2f7;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}
.forum-archive-panel-title {
    margin-bottom: 0.875rem;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--heading-blue);
}
.forum-sidebar-widget-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.forum-sidebar-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
}
.forum-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    border-radius: 0.625rem;
    padding: 0.5625rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.forum-sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--accent-hover);
    transform: translateX(-2px);
}
.forum-sidebar-link-active {
    background: var(--blue-dim);
    color: var(--link);
    font-weight: 600;
}
.forum-sidebar-count {
    flex-shrink: 0;
    border-radius: 9999px;
    background: var(--bg-hover);
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
}
.forum-sidebar-link-active .forum-sidebar-count {
    background: rgba(59, 130, 246, 0.18);
    color: var(--link);
}
.forum-hot-topic-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    transition: background 0.2s, transform 0.2s;
}
.forum-hot-topic-item:hover {
    background: var(--bg-hover);
    transform: translateX(-2px);
}
.forum-hot-topic-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.14);
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--link);
    flex-shrink: 0;
}
.forum-hot-topic-body {
    min-width: 0;
}
.forum-hot-topic-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-hot-topic-meta {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
}
.forum-hot-topic-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: #fb923c;
    opacity: 0.9;
    flex-shrink: 0;
}
.forum-hot-topic-icon svg {
    width: 1rem;
    height: 1rem;
}
.forum-active-thread-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    transition: background 0.2s, transform 0.2s;
}
.forum-active-thread-item:hover {
    background: var(--bg-hover);
    transform: translateX(-2px);
}
.forum-active-thread-body {
    min-width: 0;
    flex: 1 1 auto;
}
.forum-active-thread-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-active-thread-meta {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
}
.forum-active-thread-replies {
    flex-shrink: 0;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.22);
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #a5b4fc;
    white-space: nowrap;
}
[data-theme="light"] .forum-active-thread-replies {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}
.forum-avatar-stack {
    display: flex;
    flex-direction: row-reverse;
    flex-shrink: 0;
}
.forum-avatar-stack-item {
    display: flex;
    height: 1.625rem;
    width: 1.625rem;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 9999px;
    border: 2px solid var(--bg-surface);
    background: var(--bg-hover);
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--accent-hover);
}
.forum-avatar-stack-item + .forum-avatar-stack-item {
    margin-inline-end: -0.45rem;
}
.forum-avatar-stack-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.forum-toolbar-panel,
.forum-thread-list-panel {
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow);
}
[data-theme="light"] .forum-toolbar-panel,
[data-theme="light"] .forum-thread-list-panel {
    border-color: #eef2f7;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}
.forum-toolbar-panel {
    padding: 0.875rem 1rem;
    margin-bottom: 0.875rem;
}
.forum-thread-list-panel {
    padding: 0.875rem;
}
.forum-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem 1rem;
}
.forum-toolbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 15rem;
    max-width: 20rem;
}
.forum-toolbar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 0.5625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.forum-toolbar-search-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.forum-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.forum-filter-tab {
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: transparent;
    padding: 0.4375rem 0.9375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    white-space: nowrap;
}
.forum-filter-tab:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
    color: var(--text-primary);
}
.forum-filter-tab-active {
    background: var(--link);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
}
[data-theme="dark"] .forum-filter-tab-active {
    background: #3b82f6;
    color: #f8fafc;
}
.forum-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.forum-thread-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.875rem 1.125rem;
    border-radius: 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 1rem 1.125rem;
    transition: all 0.2s ease;
}
.forum-thread-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}
[data-theme="light"] .forum-thread-card {
    background: #fff;
}
[data-theme="light"] .forum-thread-card:hover {
    border-color: #e2e8f0;
}
.forum-thread-card-main {
    min-width: 0;
}
.forum-thread-card-body {
    min-width: 0;
}
.forum-thread-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}
.forum-thread-title-link {
    display: block;
    min-width: 0;
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text-primary);
    transition: color 0.2s;
}
.forum-thread-title-link:hover {
    color: var(--link);
}
.forum-thread-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-thread-card-excerpt {
    margin-top: 0.4375rem;
    margin-bottom: 0.5625rem;
    font-size: 0.8125rem;
    line-height: 1.65;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.forum-thread-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.forum-thread-card-meta-author {
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.forum-thread-card-meta-author:hover {
    color: var(--link);
}
.forum-thread-card-meta-dot {
    color: var(--border-light);
    font-weight: 700;
    line-height: 1;
    user-select: none;
}
.forum-thread-card-meta-category {
    border-radius: 9999px;
    background: var(--blue-dim);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--link);
    white-space: nowrap;
}
.forum-thread-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}
.forum-thread-card-tag {
    border-radius: 9999px;
    background: var(--accent-dim);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--badge-emerald-text);
    white-space: nowrap;
}
.forum-thread-card-metrics {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 5.5rem;
}
.forum-thread-metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    padding: 0.4375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.forum-thread-card:hover .forum-thread-metric {
    transform: translateY(-1px);
}
.forum-thread-metric svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    opacity: 0.9;
}
.forum-thread-metric-value {
    font-variant-numeric: tabular-nums;
}
.forum-thread-metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    opacity: 0.9;
}
.forum-thread-metric-replies-active {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.28);
    color: #a5b4fc;
}
[data-theme="light"] .forum-thread-metric-replies-active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}
.forum-thread-metric-replies-empty {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-muted);
    opacity: 0.92;
}
.forum-thread-metric-views {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--text-muted);
}
@media (max-width: 767px) {
    .forum-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .forum-toolbar-search {
        max-width: none;
    }
    .forum-thread-card {
        grid-template-columns: 1fr;
    }
    .forum-thread-card-metrics {
        flex-direction: row;
        flex-wrap: wrap;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
        min-width: 0;
    }
}

.sidebar-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.25rem;
    height: fit-content;
}
.sidebar-panel h2 {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.sidebar-link {
    display: block;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--accent-hover); }
.sidebar-link-active { background: var(--accent-dim); color: var(--accent-hover); }

/* ── Page Header ── */
.page-header { margin-bottom: 2rem; }
.page-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}
.page-subtitle {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    max-width: 36rem;
}
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.breadcrumbs a:hover { color: var(--accent-hover); }
.breadcrumbs-sep { color: var(--border-light); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
[data-theme="dark"] .btn-primary { color: #0b0f14; }
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.25);
}
.btn-outline {
    border-color: var(--border-light);
    color: var(--text-secondary);
    background: transparent;
}
.btn-outline:hover {
    border-color: rgba(0, 255, 136, 0.4);
    color: var(--accent-hover);
    background: var(--accent-dim);
}
.btn-blue {
    background: var(--blue-dim);
    color: var(--link);
    border-color: rgba(59, 130, 246, 0.3);
}
.btn-blue:hover { background: rgba(59, 130, 246, 0.2); }

/* ── Panels & Cards ── */
.panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    overflow: hidden;
}
.panel-body { padding: 1.5rem; }
.panel-header {
    border-bottom: 1px solid var(--border);
    background: var(--panel-header-bg);
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: var(--transition-theme);
}

/* ── Badges ── */
.badge {
    display: inline-block;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
}
.badge-emerald {
    background: rgba(16, 185, 129, 0.18);
    color: var(--badge-emerald-text);
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-blue { background: var(--blue-dim); color: var(--badge-blue-text); border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-amber { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-red { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
[data-theme="light"] .badge-emerald { background: rgba(5, 150, 105, 0.12); color: #047857; border-color: rgba(5, 150, 105, 0.25); }
[data-theme="light"] .badge-amber { color: #b45309; }
[data-theme="light"] .badge-red { color: #b91c1c; }

/* ── Post Cards ── */
.post-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.28s, box-shadow 0.28s, var(--transition-theme);
}
.post-card:hover {
    border-color: rgba(0, 255, 136, 0.25);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.post-card-inner {
    display: flex;
    align-items: stretch;
    min-height: 100%;
}
.post-card-has-thumb .post-card-inner {
    flex-direction: row;
}
.post-card-thumb {
    display: block;
    flex: 0 0 8.5rem;
    width: 8.5rem;
    min-height: 8.5rem;
    overflow: hidden;
    border-inline-start: 1px solid var(--border);
    background: var(--bg-hover);
}
.post-card-thumb-img {
    width: 100%;
    height: 100%;
    min-height: 8.5rem;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.post-card:hover .post-card-thumb-img {
    transform: scale(1.04);
}
.post-card-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.125rem 1.25rem;
}
.post-card:not(.post-card-has-thumb) .post-card-content {
    padding: 1.25rem;
}
.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}
.post-card-title {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}
.post-card-title:hover { color: var(--accent-hover); }
.post-card-excerpt {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.post-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.post-card-author:hover { color: var(--accent-hover); }
.author-avatar-sm {
    display: flex;
    height: 1.75rem;
    width: 1.75rem;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 9999px;
    background: var(--bg-hover);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--accent-hover);
}
.author-avatar-sm img { height: 100%; width: 100%; object-fit: cover; }

/* ── Article (Blog detail) ── */
.article-header { margin-bottom: 1.5rem; }
.article-title {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.article-author-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel-header-bg);
}

/* ── Prose / Content ── */
.prose-content, .forum-content {
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--prose-color);
    font-feature-settings: "ss01" on;
    transition: color 0.35s ease;
}
.prose-content h2, .forum-content h2 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.75rem; color: var(--text-primary); }
.prose-content h3, .forum-content h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.prose-content p, .forum-content p { margin: 0.75rem 0; }
.prose-content p:has(> img:only-child),
.prose-content p:has(> video:only-child),
.prose-content p:has(> audio:only-child),
.forum-content p:has(> img:only-child),
.forum-content p:has(> video:only-child),
.forum-content p:has(> audio:only-child) {
    margin: 0;
}
.prose-content img,
.forum-content img,
.comment-content img {
    float: right;
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.35rem 0 0.35rem 1.25rem;
    shape-outside: margin-box;
}
.prose-content video:not(.video-full),
.forum-content video:not(.video-full),
.comment-content video:not(.video-full),
.page-content video:not(.video-full) {
    float: right;
    display: block;
    max-width: 100%;
    min-width: 160px;
    min-height: 90px;
    height: auto;
    border-radius: 0.5rem;
    background: #000;
    margin: 0.35rem 0 0.35rem 1.25rem;
    shape-outside: margin-box;
}
.prose-content audio,
.forum-content audio,
.comment-content audio,
.page-content audio {
    float: right;
    display: block;
    width: min(100%, 320px);
    max-width: 100%;
    min-width: 220px;
    min-height: 32px;
    border-radius: 0.5rem;
    margin: 0.35rem 0 0.35rem 1.25rem;
    shape-outside: margin-box;
}
.prose-content li audio,
.forum-content li audio,
.comment-content li audio {
    float: none;
    display: inline-block;
    vertical-align: middle;
    margin: 0.35rem 0;
}
.prose-content video.video-full,
.forum-content video.video-full,
.comment-content video.video-full,
.page-content video.video-full {
    float: none;
    clear: both;
    display: block;
    width: 100%;
    height: auto;
    margin: 1rem 0;
}
.prose-content img[style*="float:left"],
.forum-content img[style*="float:left"],
.comment-content img[style*="float:left"],
.prose-content img[style*="float: left"],
.forum-content img[style*="float: left"],
.comment-content img[style*="float: left"],
.prose-content video[style*="float:left"],
.forum-content video[style*="float:left"],
.comment-content video[style*="float:left"],
.prose-content video[style*="float: left"],
.forum-content video[style*="float: left"],
.comment-content video[style*="float: left"] {
    float: left;
    margin: 0.35rem 1.25rem 0.35rem 0;
}
.prose-content img[style*="float:right"],
.forum-content img[style*="float:right"],
.comment-content img[style*="float:right"],
.prose-content img[style*="float: right"],
.forum-content img[style*="float: right"],
.comment-content img[style*="float: right"],
.prose-content video[style*="float:right"],
.forum-content video[style*="float:right"],
.comment-content video[style*="float:right"],
.prose-content video[style*="float: right"],
.forum-content video[style*="float: right"],
.comment-content video[style*="float: right"],
.prose-content audio[style*="float:right"],
.forum-content audio[style*="float:right"],
.comment-content audio[style*="float:right"],
.prose-content audio[style*="float: right"],
.forum-content audio[style*="float: right"],
.comment-content audio[style*="float: right"] {
    float: right;
    margin: 0.35rem 0 0.35rem 1.25rem;
}
.prose-content audio[style*="float:left"],
.forum-content audio[style*="float:left"],
.comment-content audio[style*="float:left"],
.prose-content audio[style*="float: left"],
.forum-content audio[style*="float: left"],
.comment-content audio[style*="float: left"] {
    float: left;
    margin: 0.35rem 1.25rem 0.35rem 0;
}
.prose-content img[style*="display: block"],
.forum-content img[style*="display: block"],
.comment-content img[style*="display: block"],
.prose-content img[style*="display:block"],
.forum-content img[style*="display:block"],
.comment-content img[style*="display:block"],
.prose-content img[style*="margin-left: auto"],
.forum-content img[style*="margin-left: auto"],
.comment-content img[style*="margin-left: auto"],
.prose-content img[style*="margin: 0px auto"],
.forum-content img[style*="margin: 0px auto"],
.comment-content img[style*="margin: 0px auto"] {
    float: none;
    clear: both;
    margin-inline: auto;
}
.prose-content::after,
.forum-content::after,
.comment-content::after,
.page-content::after {
    content: "";
    display: block;
    clear: both;
}
.prose-content blockquote, .forum-content blockquote {
    border-right: 3px solid var(--blue);
    padding: 0.5rem 1rem;
    margin: 0.75rem 0;
    background: rgba(15, 23, 42, 0.5);
    color: var(--prose-color);
}
.prose-content pre, .forum-content pre {
    background: var(--pre-bg);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}
.prose-content code, .forum-content code {
    background: var(--bg-hover);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.875em;
}
.prose-content pre code, .forum-content pre code, .comment-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}
.prose-content pre code.hljs, .forum-content pre code.hljs, .comment-content pre code.hljs {
    display: block;
    overflow-x: auto;
}
.comment-content pre, .comment-content code {
    direction: ltr;
    text-align: left;
}

/* ── TinyMCE — هماهنگ با Design System سایت ── */
.tox.tox-tinymce {
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius) !important;
    background: var(--bg-surface) !important;
    box-shadow: var(--shadow) !important;
    font-family: var(--font-ui) !important;
    transition: var(--transition-theme);
    overflow: hidden;
}

.tox .tox-editor-container {
    background: var(--bg-surface) !important;
}

.tox .tox-editor-header {
    background: var(--panel-header-bg) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
    padding: 0.25rem 0.375rem !important;
}

.tox .tox-editor-header .tox-toolbar,
.tox .tox-editor-header .tox-toolbar__primary {
    background: transparent !important;
    background-image: none !important;
}

.tox .tox-toolbar-overlord {
    background: var(--panel-header-bg) !important;
}

.tox .tox-toolbar__group {
    border-color: var(--border) !important;
    padding: 0.125rem 0.25rem !important;
}

.tox .tox-tbtn {
    color: var(--text-secondary) !important;
    border-radius: 0.375rem !important;
    margin: 0 1px !important;
}

.tox .tox-tbtn:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.tox .tox-tbtn--enabled,
.tox .tox-tbtn--enabled:hover {
    background: var(--accent-dim) !important;
    color: var(--accent-hover) !important;
}

.tox .tox-tbtn svg {
    fill: currentColor !important;
}

.tox .tox-split-button__chevron {
    color: var(--text-muted) !important;
}

.tox .tox-split-button:hover {
    box-shadow: none !important;
}

.tox .tox-edit-area {
    border-top: 1px solid var(--border) !important;
}

.tox .tox-edit-area__iframe {
    background: var(--input-bg) !important;
}

.tox .tox-statusbar {
    background: var(--bg-elevated) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-family: var(--font-ui) !important;
    font-size: 0.75rem !important;
}

.tox .tox-statusbar__path-item,
.tox .tox-statusbar__wordcount,
.tox .tox-statusbar a {
    color: var(--text-muted) !important;
}

.tox .tox-statusbar__resize-handle svg {
    fill: var(--text-muted) !important;
}

/* منوها و dropdown */
.tox .tox-menu,
.tox .tox-collection--list {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
}

.tox .tox-collection__item,
.tox .tox-collection__item-label {
    color: var(--text-primary) !important;
    font-family: var(--font-ui) !important;
}

.tox .tox-collection__item--active,
.tox .tox-collection__item--enabled {
    background: var(--accent-dim) !important;
    color: var(--accent-hover) !important;
}

.tox .tox-collection__item--state-disabled {
    color: var(--text-muted) !important;
    opacity: 0.55;
}

/* منوی overflow تولبار (سه‌نقطه) */
.tox.tox-tinymce-aux .tox-toolbar__overflow,
.tox .tox-pop__dialog {
    background: var(--bg-surface) !important;
    background-image: none !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
}

.tox.tox-tinymce-aux .tox-toolbar__overflow {
    padding: 0.375rem !important;
}

.tox .tox-pop__dialog .tox-toolbar,
.tox .tox-pop__dialog .tox-toolbar__primary,
.tox.tox-tinymce-aux .tox-toolbar__overflow .tox-toolbar,
.tox.tox-tinymce-aux .tox-toolbar__overflow .tox-toolbar__primary {
    background: transparent !important;
    background-image: none !important;
}

.tox.tox-tinymce-aux .tox-toolbar__overflow .tox-toolbar__group,
.tox .tox-pop__dialog .tox-toolbar__group {
    border-color: var(--border) !important;
}

.tox .tox-pop.tox-pop--bottom::after {
    border-top-color: var(--bg-surface) !important;
}

.tox .tox-pop.tox-pop--bottom::before {
    border-top-color: var(--border-light) !important;
}

.tox .tox-pop.tox-pop--top::after {
    border-bottom-color: var(--bg-surface) !important;
}

.tox .tox-pop.tox-pop--top::before {
    border-bottom-color: var(--border-light) !important;
}

.tox .tox-pop.tox-pop--left::after {
    border-right-color: var(--bg-surface) !important;
}

.tox .tox-pop.tox-pop--left::before {
    border-right-color: var(--border-light) !important;
}

.tox .tox-pop.tox-pop--right::after {
    border-left-color: var(--bg-surface) !important;
}

.tox .tox-pop.tox-pop--right::before {
    border-left-color: var(--border-light) !important;
}

/* دیالوگ‌ها (بلوک کد، لینک، ...) */
.tox .tox-dialog-wrap__backdrop {
    background: rgba(2, 6, 23, 0.72) !important;
}

[data-theme="light"] .tox .tox-dialog-wrap__backdrop {
    background: rgba(15, 23, 42, 0.35) !important;
}

.tox .tox-dialog {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    background: var(--bg-surface) !important;
    font-family: var(--font-ui) !important;
    box-shadow: var(--shadow-lg) !important;
}

.tox .tox-dialog__header {
    background: var(--panel-header-bg) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    padding: 0.875rem 1rem !important;
}

.tox .tox-dialog__title {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

.tox .tox-dialog__body {
    color: var(--text-primary) !important;
    background: var(--bg-surface) !important;
}

.tox .tox-dialog__body-content {
    background: var(--bg-surface) !important;
}

.tox .tox-dialog__footer {
    background: var(--bg-elevated) !important;
    border-top: 1px solid var(--border) !important;
}

.tox .tox-label,
.tox .tox-form__group {
    color: var(--text-secondary) !important;
    font-family: var(--font-ui) !important;
}

.tox .tox-textfield,
.tox .tox-textarea,
.tox .tox-selectfield select,
.tox .tox-listboxfield .tox-listbox--select {
    background: var(--input-bg) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 0.5rem !important;
    color: var(--text-primary) !important;
    font-family: var(--font-ui) !important;
}

.tox .tox-textfield:focus,
.tox .tox-textarea:focus,
.tox .tox-selectfield select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent) !important;
}

.tox .tox-button {
    border-radius: 0.5rem !important;
    font-family: var(--font-ui) !important;
    font-weight: 600 !important;
}

.tox .tox-button:not(.tox-button--secondary):not(.tox-button--naked) {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #0b0f14 !important;
}

[data-theme="light"] .tox .tox-button:not(.tox-button--secondary):not(.tox-button--naked) {
    color: #fff !important;
}

.tox .tox-button--secondary {
    background: transparent !important;
    border-color: var(--border-light) !important;
    color: var(--text-secondary) !important;
}

.tox .tox-button--secondary:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent) !important;
    color: var(--accent-hover) !important;
    background: var(--accent-dim) !important;
}

.tox .tox-button--naked,
.tox .tox-button--icon {
    color: var(--text-secondary) !important;
}

.tox .tox-button--naked:hover,
.tox .tox-button--icon:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* fullscreen */
.tox.tox-fullscreen {
    background: var(--bg-base) !important;
}

.tox.tox-fullscreen .tox-edit-area__iframe {
    background: var(--input-bg) !important;
}

/* wrapper در فرم‌ها */
.forum-nested-reply-form .tox-tinymce,
.comment-reply-form .tox-tinymce,
.comment-box .tox-tinymce,
#forum-reply-panel .tox-tinymce {
    margin-top: 0.5rem;
}

textarea.rich-editor {
    width: 100%;
    min-height: 8rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-ui);
    padding: 0.75rem;
    transition: var(--transition-theme);
}

textarea.rich-editor:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.tox-tinymce + textarea.rich-editor,
textarea.rich-editor[data-rich-editor-init="1"] {
    display: none !important;
}

.prose-content ul,
.prose-content ol,
.forum-content ul,
.forum-content ol,
.comment-content ul,
.comment-content ol {
    padding-right: 1.5rem;
    margin: 0.75rem 0;
    list-style-position: outside;
}
.prose-content ul,
.forum-content ul,
.comment-content ul { list-style-type: disc; }
.prose-content ol,
.forum-content ol,
.comment-content ol { list-style-type: decimal; }
.prose-content ul ul,
.forum-content ul ul,
.comment-content ul ul { list-style-type: circle; }
.prose-content ol ol,
.forum-content ol ol,
.comment-content ol ol { list-style-type: lower-alpha; }
.prose-content li,
.forum-content li,
.comment-content li {
    display: list-item;
    margin: 0.25rem 0;
}
.prose-content li > ul,
.prose-content li > ol,
.forum-content li > ul,
.forum-content li > ol,
.comment-content li > ul,
.comment-content li > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}
.prose-content table,
.forum-content table,
.comment-content table {
    display: table;
    max-width: 100%;
    border-collapse: collapse;
    margin-block: 0.5rem;
    font-size: 0.875rem;
    direction: rtl;
    table-layout: auto;
    shape-outside: margin-box;
}
.prose-content table:not([width]):not([style*="width"]),
.forum-content table:not([width]):not([style*="width"]),
.comment-content table:not([width]):not([style*="width"]) {
    float: none;
    clear: both;
    width: 100%;
    margin-inline: 0;
}
.prose-content table[width],
.forum-content table[width],
.comment-content table[width],
.prose-content table[style*="width"],
.forum-content table[style*="width"],
.comment-content table[style*="width"] {
    float: inline-start;
    margin-inline-end: 1.25rem;
}
.prose-content caption,
.forum-content caption,
.comment-content caption {
    caption-side: top;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}
.prose-content th,
.prose-content td,
.forum-content th,
.forum-content td,
.comment-content th,
.comment-content td {
    border: 1px solid var(--border-light);
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    text-align: inherit;
}
.prose-content th,
.forum-content th,
.comment-content th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
}
.prose-content thead th,
.forum-content thead th,
.comment-content thead th {
    border-bottom-width: 2px;
}
.prose-content u,
.forum-content u,
.comment-content u,
.prose-content .underline,
.forum-content .underline,
.comment-content .underline {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.prose-content s,
.forum-content s,
.comment-content s,
.prose-content strike,
.forum-content strike,
.comment-content strike {
    text-decoration: line-through;
}
.prose-content a, .forum-content a { color: var(--link); text-decoration: underline; }
.prose-content a:hover, .forum-content a:hover { color: var(--link-hover); }

/* ── Auth ── */
.auth-page {
    display: flex;
    min-height: calc(100vh - 12rem);
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.auth-card h1 {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--accent-hover);
    margin-bottom: 0.375rem;
}
.auth-card .auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── Empty State ── */
.empty-state {
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-light);
    background: rgba(17, 24, 39, 0.5);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ── Header & Nav ── */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 0.625rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s, background 0.15s, transform 0.15s;
    position: relative;
}
.nav-link-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.85;
    flex-shrink: 0;
}
.nav-link:hover {
    color: var(--accent-hover);
    background: var(--accent-dim);
    transform: translateY(-1px);
}
.nav-link-active {
    color: var(--accent-hover);
    background: var(--accent-dim);
    font-weight: 600;
}
.nav-link-active::after {
    content: "";
    position: absolute;
    bottom: 0.1875rem;
    left: 50%;
    width: 1rem;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-hover);
    transform: translateX(-50%);
}
.nav-link-mobile {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.625rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.nav-link-mobile:hover {
    background: var(--bg-hover);
    color: var(--accent-hover);
    transform: translateX(-2px);
}
.nav-link-mobile-active {
    background: var(--accent-dim);
    color: var(--accent-hover);
    font-weight: 600;
}
.nav-link-mobile-danger { color: #f87171; }
.nav-link-mobile-danger:hover {
    background: rgba(248, 113, 113, 0.08);
    color: #fca5a5;
}

/* ── Hero ── */
.hero-section {
    background: linear-gradient(135deg, var(--bg-base) 0%, var(--hero-mid) 50%, var(--bg-base) 100%);
    transition: var(--transition-theme);
}
.hero-badge {
    animation: pulseGlow 3s ease-in-out infinite;
}
.hero-grid {
    animation: fadeIn 1.2s ease-out;
}
.stat-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(4px);
    transition: transform 0.3s ease, border-color 0.3s ease, var(--transition-theme);
}
.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--accent-hover);
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-hover);
    animation: countPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stat-label { margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-muted); }

/* ── Features ── */
.feature-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.3s, var(--transition-theme);
}
.feature-card:hover {
    border-color: rgba(16, 185, 129, 0.35);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.feature-icon {
    font-size: 1.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
}
.feature-card:hover .feature-icon { transform: scale(1.2) rotate(-5deg); }
.cta-section {
    backdrop-filter: blur(4px);
    transition: var(--transition-theme);
}

/* ── Forum ── */
.forum-side-list a { transition: all 0.15s ease; }
.forum-post-box { box-shadow: var(--shadow); }
.forum-replies-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.forum-replies-heading {
    margin: 0;
    padding: 0 0.125rem;
}
.forum-replies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.forum-replies-list > .forum-reply-card,
.forum-replies-list > .forum-post-box {
    margin: 0;
}
.forum-reply-form-panel {
    margin-top: 0.5rem;
}
.forum-post-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}
.forum-post-layout-stretch {
    align-items: stretch;
}
.forum-post-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}
.forum-post-date {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    white-space: nowrap;
}
.forum-post-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding-top: 0.75rem;
}
.forum-post-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0;
}
.forum-post-main { min-width: 0; flex: 1 1 auto; }
.forum-reply-children {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 2px solid rgba(100, 116, 139, 0.35);
}
.forum-reply-threaded {
    box-shadow: none;
}
.forum-reply-quote {
    text-decoration: none;
    background: color-mix(in srgb, var(--bg-base) 88%, var(--bg-elevated));
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    border-left: 1px solid rgba(148, 163, 184, 0.12);
}
.forum-reply-quote:hover {
    background: color-mix(in srgb, var(--bg-base) 78%, var(--blue-dim));
    border-color: rgba(59, 130, 246, 0.22);
}
.forum-reply-quote-icon {
    color: var(--text-muted);
}
.forum-reply-quote-author {
    color: var(--heading-blue);
}
.forum-reply-quote-date {
    color: var(--text-muted);
}
.forum-reply-quote-text {
    line-height: 1.65;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
[data-theme="light"] .forum-reply-quote {
    background: var(--bg-elevated);
    border-color: rgba(148, 163, 184, 0.28);
}
[data-theme="light"] .forum-reply-quote-text {
    color: var(--text-secondary);
}
[data-theme="light"] .forum-reply-children {
    border-right-color: rgba(100, 116, 139, 0.28);
}
[data-theme="light"] .forum-reply-quote.border-slate-500\/50 {
    border-right-color: rgba(100, 116, 139, 0.45) !important;
}
.forum-nested-reply-form {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.forum-nested-reply-form.is-open { display: block; }
.forum-reply-to-btn { flex-shrink: 0; }
.forum-reply-fab {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-start: 1.5rem;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.25rem;
    padding: 0 1rem 0 0.875rem;
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 9999px;
    background: var(--accent);
    color: #0b0f14;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 255, 136, 0.28), 0 4px 14px rgba(15, 23, 42, 0.35);
    transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, visibility 0.25s ease;
}
.forum-reply-fab:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 255, 136, 0.35), 0 6px 18px rgba(15, 23, 42, 0.4);
}
.forum-reply-fab:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 3px;
}
.forum-reply-fab.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0.75rem);
}
.forum-reply-fab-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.forum-reply-fab-label {
    white-space: nowrap;
}
[data-theme="light"] .forum-reply-fab {
    color: #fff;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.28), 0 4px 12px rgba(15, 23, 42, 0.12);
}
@media (max-width: 640px) {
    .forum-reply-fab {
        bottom: 1rem;
        inset-inline-start: 1rem;
        min-height: 3rem;
        padding-inline: 0.875rem;
    }
    .forum-reply-fab-label {
        display: none;
    }
    .forum-reply-fab {
        width: 3rem;
        height: 3rem;
        padding: 0;
        justify-content: center;
        border-radius: 9999px;
    }
}
.forum-user-card {
    align-self: stretch;
    flex-shrink: 0;
    width: 248px;
    overflow: hidden;
    border-left: 1px solid var(--border);
    background: var(--bg-surface);
    font-family: var(--font-ui);
    line-height: 1.55;
    padding-bottom: 0.875rem;
}
.forum-user-badge { color: inherit; text-decoration: none; }
.forum-user-badge:hover .forum-user-badge-name { color: var(--link-hover); }
.forum-user-badge-avatar {
    display: block;
    width: 2rem;
    height: 2rem;
    background: var(--bg-base);
}
.forum-user-badge-avatar img { width: 100%; height: 100%; object-fit: cover; }
.forum-user-badge-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-muted);
}
.forum-user-badge-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--heading-blue);
}
.forum-user-badge-meta {
    font-size: 0.625rem;
    color: var(--text-muted);
}
.forum-user-avatar {
    display: block;
    width: 3.25rem;
    height: 3.25rem;
    background: linear-gradient(145deg, var(--bg-base), var(--accent-dim));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.forum-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.forum-user-card:hover .forum-user-avatar {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.forum-user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-muted);
}
.forum-user-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--heading-blue);
    transition: color 0.2s;
}
.forum-user-name:hover { color: var(--link-hover); }
.forum-user-handle,
.forum-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.forum-user-job {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.forum-user-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.forum-user-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-user-meta-row {
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-muted);
}
.forum-user-meta-muted { opacity: 0.85; }
.forum-user-meta-value {
    font-weight: 500;
    color: var(--text-secondary);
}
.forum-user-meta-sep { color: var(--border-light); }
.forum-user-tag {
    font-size: 0.75rem;
    color: var(--badge-blue-text);
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: var(--blue-dim);
}
.forum-user-stats-row {
    margin-top: 0.625rem;
}
.forum-user-stat-inline {
    flex: 1 1 0;
}
.forum-user-role-job {
    min-width: 0;
}
.forum-user-social-row {
    margin-top: auto;
}
.forum-user-social-btn {
    display: inline-flex;
    flex: 1 1 calc(50% - 0.375rem);
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-width: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    background: var(--bg-base);
    padding: 0.4375rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.forum-user-social-btn svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}
.forum-user-social-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: var(--blue-dim);
    color: var(--link-hover);
}
[data-theme="light"] .forum-user-tag {
    border-color: rgba(37, 99, 235, 0.25);
}
[data-theme="light"] .forum-user-social-btn:hover { color: var(--link); }
[data-theme="light"] .forum-user-level-member { color: #047857; }
[data-theme="light"] .forum-user-level-newbie { color: #1d4ed8; }
[data-theme="light"] .forum-user-level-active { color: #b45309; }
[data-theme="light"] .forum-user-level-expert { color: #7e22ce; }
[data-theme="light"] .reply-best-badge {
    color: #047857;
    background: rgba(5, 150, 105, 0.12);
}
[data-theme="light"] .forum-reply-best {
    border-color: rgba(5, 150, 105, 0.45) !important;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12);
}
.forum-tag-hash {
    display: inline-block;
    unicode-bidi: isolate;
    font-weight: 700;
}
.forum-user-level {
    background: var(--accent-dim);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.28);
}
.forum-user-level-newbie {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
}
.forum-user-level-member {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.28);
}
.forum-user-level-active {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.32);
}
.forum-user-level-expert {
    background: rgba(168, 85, 247, 0.14);
    color: #d8b4fe;
    border-color: rgba(168, 85, 247, 0.32);
}
.forum-reply-best {
    border: 2px solid rgba(16, 185, 129, 0.55) !important;
    box-shadow:
        0 0 0 1px rgba(16, 185, 129, 0.2),
        0 10px 28px rgba(16, 185, 129, 0.14);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--bg-surface) 92%, #10b981 8%),
        var(--bg-surface)
    );
}
.forum-thread-question {
    border: 2px solid rgba(59, 130, 246, 0.5) !important;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.18),
        0 10px 28px rgba(59, 130, 246, 0.12);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--bg-surface) 92%, #3b82f6 8%),
        var(--bg-surface)
    );
}
.forum-thread-header {
    background: rgba(59, 130, 246, 0.1);
    border-bottom-color: rgba(59, 130, 246, 0.22);
}
.forum-thread-header-start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}
.thread-question-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #93c5fd;
}
.forum-thread-title {
    color: var(--heading-blue);
}
[data-theme="light"] .forum-thread-question {
    border-color: rgba(37, 99, 235, 0.4) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}
[data-theme="light"] .forum-thread-header {
    background: rgba(59, 130, 246, 0.08);
}
[data-theme="light"] .thread-question-badge {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
}
.forum-reply-best .forum-reply-badge-slot {
    padding-bottom: 0.25rem;
}
.reply-best-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.45);
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #6ee7b7;
}
@media (max-width: 768px) {
    .forum-post-layout { flex-direction: column; }
    .forum-user-card {
        width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.pagination a, .pagination span {
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.pagination a:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
.pagination-current {
    background: var(--accent-dim);
    border-color: rgba(0, 255, 136, 0.3) !important;
    color: var(--accent-hover) !important;
}

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="search"], input[type="file"], input[type="date"], input[type="datetime-local"],
input[type="number"], textarea, select {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--input-bg);
    color: var(--text-primary);
    padding: 0.625rem 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    transition: border-color 0.2s, background 0.35s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"],
input[type="datetime-local"],
input[type="number"] {
    -webkit-appearance: auto;
    appearance: auto;
    color-scheme: dark;
    min-height: 2.625rem;
    cursor: pointer;
}
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="datetime-local"] {
    color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.75;
    filter: invert(0.85);
}
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.65;
}
.cms-meta-box input[type="datetime-local"],
.cms-meta-box input[type="date"] {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}
input[type="search"]::placeholder {
    color: var(--text-muted);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}
.form-error { margin-top: 0.25rem; font-size: 0.75rem; color: #f87171; }
[data-theme="light"] .form-error { color: #b91c1c; }

/* ── Profile pages ── */
.profile-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-emerald);
}
.profile-back-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.profile-back-link:hover { color: var(--text-primary); }
.profile-form-section {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.25rem;
    transition: var(--transition-theme);
}
.profile-form-heading {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}
.profile-form-heading-blue { color: var(--heading-blue); }
.profile-form-heading-purple { color: var(--heading-purple); }
.profile-form-heading-emerald { color: var(--heading-emerald); }
.profile-form-heading-orange { color: var(--heading-orange, #fb923c); }
[data-theme="light"] .profile-form-heading-orange { color: #c2410c; }
.profile-form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.profile-form-check {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.profile-tag-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-base);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.profile-tag-option:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: var(--blue-dim);
}
.profile-tag-option:has(input:checked) {
    border-color: rgba(59, 130, 246, 0.45);
    background: var(--blue-dim);
    color: var(--text-primary);
}
.profile-form-error {
    border-radius: 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    font-size: 0.875rem;
    color: #f87171;
}
[data-theme="light"] .profile-form-error {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
}
.profile-preview-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    object-fit: cover;
}
.profile-preview-cover {
    width: 100%;
    height: 4rem;
    border-radius: 0.5rem;
    object-fit: cover;
}
.input-field {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--input-bg);
    color: var(--text-primary);
    padding: 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    transition: border-color 0.2s, background 0.35s, box-shadow 0.2s;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.input-file {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--input-bg);
    color: var(--text-secondary);
    padding: 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.875rem;
}
.input-file::file-selector-button {
    margin-inline-end: 0.75rem;
    border: none;
    border-radius: 0.25rem;
    background: var(--accent);
    color: #0b0f14;
    padding: 0.375rem 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}
[data-theme="light"] .input-file::file-selector-button { color: #fff; }
.input-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-light);
    background: var(--input-bg);
    accent-color: var(--accent);
    cursor: pointer;
}
.profile-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: var(--transition-theme);
}
.profile-cover {
    position: relative;
    height: 10rem;
    background: linear-gradient(to left, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--blue) 18%, transparent));
    overflow: hidden;
}
@media (min-width: 640px) {
    .profile-cover { height: 13rem; }
}
.profile-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-surface) 0%, transparent 55%);
    pointer-events: none;
}
.profile-card-body { margin-top: -0.25rem; }
.profile-avatar-lg {
    margin-top: -3rem;
    width: 6rem;
    height: 6rem;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 9999px;
    border: 4px solid var(--bg-surface);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) {
    .profile-avatar-lg {
        margin-top: -3.5rem;
        width: 7rem;
        height: 7rem;
    }
}
.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-muted);
}
.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-emerald);
}
.profile-level-badge {
    border-radius: 9999px;
    background: var(--accent-dim);
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    color: var(--accent-hover);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.profile-username {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.profile-job {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.profile-edit-btn {
    border-radius: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--accent-hover);
    transition: background 0.2s, border-color 0.2s;
}
.profile-edit-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent-hover);
}
.profile-completion-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.profile-progress-track {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 9999px;
    background: var(--bg-base);
}
.profile-progress-fill {
    height: 100%;
    border-radius: 9999px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.profile-bio {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-secondary);
}
.profile-chip {
    border-radius: 9999px;
    background: var(--bg-base);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.profile-skill-tag {
    border-radius: 9999px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: var(--blue-dim);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--badge-blue-text);
}
.profile-social-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.profile-social-links a:hover { color: var(--accent-hover); }
.profile-stat-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1rem;
    text-align: center;
    transition: var(--transition-theme);
}
.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}
.profile-stat-emerald { color: var(--heading-emerald); }
.profile-stat-blue { color: var(--link); }
.profile-stat-purple { color: var(--heading-purple); }
.profile-stat-label {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.profile-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.25rem;
    transition: var(--transition-theme);
}
.profile-panel-title {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}
.profile-panel-title-emerald { color: var(--heading-emerald); }
.profile-panel-title-blue { color: var(--heading-blue); }
.profile-panel-title-orange { color: var(--heading-orange, #fb923c); }
[data-theme="light"] .profile-panel-title-orange { color: #c2410c; }
.profile-list-item {
    display: block;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-base);
    padding: 0.625rem 0.75rem;
    transition: border-color 0.2s, background 0.2s;
}
.profile-list-item:hover { border-color: rgba(59, 130, 246, 0.4); }
.profile-list-item-emerald:hover { border-color: rgba(16, 185, 129, 0.4); }
.profile-list-item-orange:hover { border-color: rgba(249, 115, 22, 0.4); }
.profile-list-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}
.profile-list-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.profile-list-meta {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.profile-empty {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Blog CMS ── */
.cms-shell {
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .cms-shell { grid-template-columns: 240px 1fr; }
}
.cms-sidebar { height: fit-content; position: sticky; top: 5.5rem; }
.cms-sidebar-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent-hover);
    margin-bottom: 0.75rem;
}
.cms-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.cms-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}
.cms-nav-link:hover { background: var(--bg-hover); color: var(--accent-hover); }
.cms-nav-link-active { background: var(--accent-dim); color: var(--accent-hover); }
.cms-editor-layout {
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 1100px) {
    .cms-editor-layout { grid-template-columns: 1fr 320px; align-items: start; }
}
.cms-editor-sidebar { position: sticky; top: 5.5rem; }
.cms-meta-box .panel-header { font-size: 0.8125rem; }
.cms-title-input {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    padding: 0.75rem !important;
}
.cms-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.cms-cover-preview {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    max-height: 160px;
    object-fit: cover;
}
.cms-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.cms-media-grid-page {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.cms-media-item {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0;
    background: var(--bg-hover);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.cms-media-item:hover { transform: scale(1.03); border-color: var(--accent-hover); }
.cms-media-item img { width: 100%; height: 64px; object-fit: cover; display: block; }
.cms-media-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.post-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.post-card-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
    .post-card-has-thumb .post-card-inner {
        flex-direction: column;
    }
    .post-card-thumb {
        width: 100%;
        flex-basis: auto;
        min-height: 0;
        border-inline-start: none;
        border-bottom: 1px solid var(--border);
    }
    .post-card-thumb-img {
        min-height: 10rem;
        max-height: 12rem;
    }
}
.list-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 1rem;
}
.list-search-form input[type="search"] {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
}
.list-search-form .search-page-input-wrap {
    flex: 1 1 0;
    min-width: 0;
}
.comment-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--bg-surface);
}
.comment-reply {
    margin-top: 0.75rem;
    margin-right: 1.5rem;
    border-right: 2px solid var(--border-light);
    padding-right: 1rem;
}
.cms-preview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #fbbf24;
}
.cms-editor-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.cms-publish-actions {
    display: grid;
    gap: 0.5rem;
}
.cms-stat-active {
    outline: 2px solid rgba(16, 185, 129, 0.4);
    outline-offset: 2px;
}
.cms-post-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1rem;
    transition: background 0.2s;
}
.cms-post-row:last-child { border-bottom: none; }
.cms-post-row:hover { background: var(--bg-hover); }
.cms-revision-row, .cms-taxonomy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
}
.cms-tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.cms-tag-chip {
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-hover);
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.cms-tag-chip:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
.cms-char-counter { margin-top: 0.25rem; font-size: 0.75rem; }
.cms-media-picker-item { display: flex; flex-direction: column; gap: 0.25rem; }
.cms-media-set-cover {
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--bg-surface);
    padding: 0.125rem;
    font-size: 0.625rem;
    color: var(--text-muted);
    cursor: pointer;
}
.cms-media-set-cover:hover { color: var(--accent-hover); border-color: var(--accent-hover); }
.hidden { display: none !important; }

/* ── Site Search ── */
.header-search-desktop { display: none; }
.search-toggle-btn { display: flex; }
.mobile-search-inner { padding-bottom: 0.75rem; }
@media (min-width: 1024px) {
    .header-search-desktop { display: flex; }
    .search-toggle-btn { display: none; }
    .mobile-search-bar { display: none !important; }
}
.search-toggle-btn[aria-expanded="true"] {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    background: rgba(0, 255, 136, 0.06);
}
.mobile-search-bar {
    display: none;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
}
.mobile-search-bar.is-open {
    display: block;
    animation: slideDown 0.25s ease-out;
}
.mobile-search-bar .site-search-form {
    width: 100%;
}
.mobile-search-bar .site-search-form input[type="search"] {
    flex: 1;
    width: auto;
}
.site-search-form {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--bg-surface);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.site-search-form:focus-within {
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.08);
}
.site-search-form input[type="search"] {
    width: 10rem;
    border: none;
    background: transparent;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
}
.site-search-form input[type="search"]:focus {
    outline: none;
    box-shadow: none;
}
.site-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.625rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.site-search-btn:hover { color: var(--accent-hover); }
.site-search-page-form {
    display: flex;
    gap: 0.5rem;
    max-width: 36rem;
}
.site-search-page-form input[type="search"] {
    flex: 1;
}
@media (min-width: 1024px) {
    .site-search-form input[type="search"] { width: 12rem; }
}

/* ── Search Results Page ── */
.search-page { display: flex; flex-direction: column; gap: 1.5rem; }
.search-hero { padding: 1.5rem; }
.search-hero-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}
.search-summary-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--accent-dim);
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-hover);
    white-space: nowrap;
}
.search-page-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}
.search-page-form.list-search-form {
    margin-top: 0;
}
.search-page-input-wrap {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--input-bg);
    transition: border-color 0.2s, background 0.35s, box-shadow 0.2s;
}
.search-page-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.search-page-input-wrap input[type="search"] {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.625rem 0.75rem;
    padding-right: 2.75rem;
    box-shadow: none;
}
.search-page-input-wrap input[type="search"]:focus {
    border: none;
    box-shadow: none;
}
.search-page-icon {
    position: absolute;
    top: 50%;
    right: 0.875rem;
    width: 1.125rem;
    height: 1.125rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.search-filters-panel {
    padding: 0.875rem 1rem;
}
.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0;
}
.search-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-base);
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.search-filter-pill:hover {
    border-color: var(--accent-hover);
    color: var(--accent-hover);
    transform: translateY(-1px);
}
.search-filter-pill-active {
    border-color: rgba(0, 255, 136, 0.35);
    background: var(--accent-dim);
    color: var(--accent-hover);
    font-weight: 600;
}
.search-filter-pill-empty { opacity: 0.55; }
.search-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    padding-inline: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
}
.search-filter-pill-active .search-filter-count {
    background: rgba(0, 255, 136, 0.15);
}
.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin-top: 1.25rem;
}
.search-suggestions-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.search-suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.search-suggestion-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.search-suggestion-chip:hover {
    border-color: var(--accent-hover);
    background: var(--accent-dim);
    color: var(--accent-hover);
}
.search-section { display: flex; flex-direction: column; gap: 1rem; }
.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.search-section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}
.search-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
}
.search-section-icon svg { width: 1.125rem; height: 1.125rem; }
.search-section-icon-posts { background: var(--accent-dim); color: var(--accent-hover); }
.search-section-icon-threads { background: var(--blue-dim); color: var(--badge-blue-text); }
.search-section-icon-pages { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }
.search-section-icon-users { background: rgba(168, 85, 247, 0.12); color: var(--heading-purple); }
.search-section-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.search-result-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1rem 1.125rem;
    transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.search-result-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}
.search-result-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}
.search-result-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
}
.search-result-badge-post { background: var(--accent-dim); color: var(--accent-hover); }
.search-result-badge-thread { background: var(--blue-dim); color: var(--badge-blue-text); }
.search-result-badge-page { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }
.search-result-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}
.search-result-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}
.search-result-title a:hover { color: var(--accent-hover); }
.search-result-snippet {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.875rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.search-result-author {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.search-result-author:hover { color: var(--accent-hover); }
.search-section-more {
    align-self: flex-start;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-hover);
    transition: transform 0.2s;
}
.search-section-more:hover { transform: translateX(-4px); }
.search-highlight {
    background: rgba(0, 255, 136, 0.18);
    color: var(--accent-hover);
    border-radius: 0.25rem;
    padding-inline: 0.125rem;
}
[data-theme="light"] .search-highlight {
    background: rgba(250, 204, 21, 0.35);
    color: var(--text-primary);
}
.search-results-grid {
    display: grid;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .search-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.search-user-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1rem;
    transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.search-user-card:hover {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: var(--shadow-md);
}
.search-user-avatar { width: 2.75rem; height: 2.75rem; flex-shrink: 0; }
.search-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}
.search-user-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}
.search-user-handle {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.search-user-bio {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.search-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.search-empty-icon {
    font-size: 2rem;
    line-height: 1;
}
.search-empty-title {
    margin-top: 0.875rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}
.search-empty-text {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}
.search-empty .search-suggestion-chips {
    justify-content: center;
    margin-top: 1.25rem;
}
.search-empty .btn { margin-top: 1.25rem; }
.search-landing {
    display: grid;
    gap: 1rem;
}
@media (min-width: 640px) {
    .search-landing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .search-landing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.search-landing-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.search-landing-icon { font-size: 1.75rem; line-height: 1; }
.search-landing-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.search-landing-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-secondary);
}
.search-landing-link {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-hover);
}

/* ── Forum Moderation & Voting ── */
.forum-mod-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}
.forum-mod-bar-text {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.forum-mod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.forum-mod-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.forum-mod-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.forum-locked-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.08);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.forum-post-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.forum-post-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}
.forum-post-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.forum-post-title-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.forum-post-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}
.forum-post-footer-left {
    justify-content: flex-end;
}
.forum-post-footer-form { margin: 0; }
.forum-post-footer .vote-stack {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}
.forum-post-footer .vote-btn-up,
.forum-post-footer .vote-btn-down {
    width: 2.375rem;
    height: 2.375rem;
    min-width: 2.375rem;
}
.vote-box {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.vote-form { display: inline; margin: 0; }
.vote-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 2.75rem;
    min-height: 2.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border-light);
    background: var(--bg-base);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.vote-btn-action:focus-visible {
    outline: 2px solid rgba(52, 211, 153, 0.45);
    outline-offset: 2px;
}
.vote-btn svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.vote-btn:hover {
    border-color: var(--accent-hover);
    color: var(--accent-hover);
    transform: translateY(-1px);
}
.vote-btn.is-active {
    border-color: rgba(0, 255, 136, 0.35);
    background: var(--accent-dim);
    color: var(--accent-hover);
}
.vote-btn-up,
.vote-btn-down {
    width: 2.375rem;
    height: 2.375rem;
    min-width: 2.375rem;
    padding: 0;
}
.vote-btn-down.is-active {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}
.vote-btn-static { cursor: default; }
.vote-score {
    min-width: 2rem;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--text-secondary);
}
.vote-score-positive { color: var(--accent-hover); }
.vote-score-negative { color: #f87171; }
.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* ── Forum AJAX Toasts ── */
.forum-toast-container {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.forum-toast {
    min-width: 16rem;
    max-width: 24rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.forum-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.forum-toast-success { border-color: rgba(0, 255, 136, 0.25); }
.forum-toast-error { border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }

/* ── Footer ── */
.site-footer {
    background: var(--footer-bg);
    transition: var(--transition-theme);
}

.hero-grid {
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.hero-glow {
    background:
        radial-gradient(ellipse at 30% 50%, var(--glow-1) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, var(--glow-2) 0%, transparent 50%);
    animation: float 8s ease-in-out infinite;
}
