 /* ── Page hero ───────────────────────────────────────── */
    .forum-hero {
      padding: 4rem 0 3rem;
      position: relative;
      overflow: hidden;
    }
    .forum-hero::before {
      content: '';
      position: absolute;
      width: 600px; height: 300px;
      background: var(--accent);
      border-radius: 50%;
      filter: blur(100px);
      opacity: 0.08;
      top: -80px; left: -100px;
      pointer-events: none;
    }
    .forum-hero h1 {
      font-size: clamp(2rem, 5vw, 3.2rem);
      font-weight: 900;
      letter-spacing: -0.03em;
      background: linear-gradient(90deg, var(--accent), #06b6d4);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin-bottom: 0.5rem;
      animation: fadeUp 0.5s ease both;
    }
    .forum-hero p {
      color: var(--text-muted);
      font-size: 1rem;
      animation: fadeUp 0.5s 0.08s ease both;
    }

    /* ── Layout ──────────────────────────────────────────── */
    .forum-layout {
      display: grid;
      grid-template-columns: 220px 1fr;
      gap: 2rem;
      align-items: start;
      padding-bottom: 5rem;
    }

    /* ── Sidebar ─────────────────────────────────────────── */
    .sidebar { position: sticky; top: 80px; }
    .sidebar-section { margin-bottom: 1.5rem; }
    .sidebar-label {
      font-size: 0.7rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--text-muted); margin-bottom: 0.6rem; padding: 0 0.5rem;
    }
    .cat-btn {
      display: flex; align-items: center; gap: 0.6rem;
      width: 100%; padding: 0.6rem 0.8rem;
      border-radius: 10px; border: none; background: none;
      color: var(--text-muted); font-family: inherit;
      font-size: 0.9rem; font-weight: 500; cursor: pointer;
      transition: 0.2s; text-align: left;
    }
    .cat-btn:hover { background: var(--bg-hover); color: var(--text-main); }
    .cat-btn.active { background: rgba(124,58,237,0.15); color: var(--accent); font-weight: 600; }
    .cat-btn .cat-icon { font-size: 1rem; width: 20px; text-align: center; }
    .cat-btn .cat-count {
      margin-left: auto; font-size: 0.72rem;
      background: var(--bg-hover); border-radius: 999px;
      padding: 1px 7px; color: var(--text-muted);
    }
    .cat-btn.active .cat-count { background: rgba(124,58,237,0.2); color: var(--accent); }

    .new-thread-btn {
      width: 100%; padding: 0.75rem; border-radius: 12px; border: none;
      background: var(--accent); color: white; font-family: inherit;
      font-size: 0.9rem; font-weight: 700; cursor: pointer;
      transition: 0.2s; margin-bottom: 1.5rem;
    }
    .new-thread-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
    .new-thread-btn:disabled {
      opacity: 0.45; cursor: not-allowed; transform: none;
    }

    /* ── User card in sidebar ────────────────────────────── */
    .user-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1rem;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .user-card-avatar {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), #06b6d4);
      display: flex; align-items: center; justify-content: center;
      font-weight: 800; font-size: 0.85rem; color: white;
      flex-shrink: 0;
    }
    .user-card-info { flex: 1; min-width: 0; }
    .user-card-name {
      font-weight: 700; font-size: 0.88rem;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .user-card-role {
      font-size: 0.7rem; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.05em;
    }
    .user-card-logout {
      background: none; border: none; color: var(--text-muted);
      font-size: 0.78rem; cursor: pointer; font-family: inherit;
      transition: color 0.2s; padding: 2px 6px; border-radius: 6px;
      white-space: nowrap;
    }
    .user-card-logout:hover { color: var(--danger); }

    .login-prompt-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1rem;
      margin-bottom: 1.5rem;
      text-align: center;
    }
    .login-prompt-card p {
      font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem;
    }
    .login-prompt-card .btn {
      display: block; width: 100%; text-align: center;
      padding: 0.6rem; font-size: 0.85rem;
    }

    /* ── Main content ────────────────────────────────────── */
    .forum-main { min-width: 0; }
    .forum-toolbar {
      display: flex; align-items: center;
      justify-content: space-between; gap: 1rem;
      margin-bottom: 1.2rem; flex-wrap: wrap;
    }
    .forum-toolbar h2 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
    .toolbar-right { display: flex; gap: 0.6rem; align-items: center; }
    .search-wrap { position: relative; }
    .search-wrap input {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 999px; padding: 0.35rem 1rem 0.35rem 2.2rem;
      font-family: inherit; font-size: 0.82rem; color: var(--text-main);
      width: 180px; transition: border-color 0.2s, width 0.3s; margin: 0;
    }
    .search-wrap input:focus { border-color: var(--accent); width: 220px; }
    .search-wrap::before {
      content: '🔍'; position: absolute;
      left: 0.75rem; top: 50%; transform: translateY(-50%);
      font-size: 0.7rem; pointer-events: none;
    }

    /* ── Thread cards ────────────────────────────────────── */
    .thread-list { display: grid; gap: 0.75rem; }
    .thread-card {
      display: flex; align-items: center; gap: 1rem;
      padding: 1.1rem 1.3rem; cursor: pointer;
      animation: fadeUp 0.35s ease both;
      text-decoration: none; color: inherit;
    }
    .thread-card:nth-child(1) { animation-delay: 0.04s; }
    .thread-card:nth-child(2) { animation-delay: 0.08s; }
    .thread-card:nth-child(3) { animation-delay: 0.12s; }
    .thread-card:nth-child(4) { animation-delay: 0.16s; }
    .thread-card:nth-child(5) { animation-delay: 0.20s; }
    .thread-avatar {
      width: 42px; height: 42px; border-radius: 12px;
      background: linear-gradient(135deg, var(--accent), #06b6d4);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem; flex-shrink: 0;
    }
    .thread-body { flex: 1; min-width: 0; }
    .thread-title-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 3px; }
    .thread-title {
      font-size: 0.97rem; font-weight: 700;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .pin-badge {
      font-size: 0.65rem; background: rgba(6,182,212,0.12); color: #06b6d4;
      border: 1px solid rgba(6,182,212,0.3); border-radius: 999px;
      padding: 1px 7px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
    }
    .hot-badge {
      font-size: 0.65rem; background: rgba(239,68,68,0.12); color: #ef4444;
      border: 1px solid rgba(239,68,68,0.25); border-radius: 999px;
      padding: 1px 7px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
    }
    .thread-meta { color: var(--text-muted); font-size: 0.8rem; }
    .thread-meta span { color: var(--text-main); font-weight: 500; }
    .thread-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
    .reply-count { font-size: 1.1rem; font-weight: 800; color: var(--accent); line-height: 1; }
    .reply-label { font-size: 0.72rem; color: var(--text-muted); }

    /* ── Empty state ─────────────────────────────────────── */
    .empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
    .empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
    .empty-state p { font-size: 0.9rem; }

    /* ── Auth Modal + New Thread Modal ───────────────────── */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(6px);
      z-index: 500;
      display: flex; align-items: center; justify-content: center;
      padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s;
    }
    .modal-overlay.open { opacity: 1; pointer-events: all; }
    .modal {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 2rem;
      width: 100%; max-width: 460px;
      box-shadow: var(--shadow);
      transform: translateY(20px); transition: transform 0.2s;
    }
    .modal-overlay.open .modal { transform: translateY(0); }
    .modal-title {
      font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em;
      background: linear-gradient(90deg, var(--accent), #06b6d4);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      margin-bottom: 1.5rem;
    }
    .field-label {
      display: block; font-size: 0.75rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.07em;
      color: var(--text-muted); margin-bottom: 0.4rem;
    }
    .modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }
    .btn-ghost {
      background: var(--bg-hover); color: var(--text-muted);
      border: 1px solid var(--border); padding: 0.7rem 1.2rem;
      border-radius: 12px; font-family: inherit;
      font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: 0.2s;
    }
    .btn-ghost:hover { color: var(--text-main); }

    /* Auth tab switcher */
    .auth-tabs {
      display: flex; gap: 0; margin-bottom: 1.5rem;
      background: var(--bg-main); border-radius: 10px; padding: 3px;
    }
    .auth-tab {
      flex: 1; padding: 0.5rem; border: none; background: none;
      border-radius: 8px; font-family: inherit; font-size: 0.88rem;
      font-weight: 600; color: var(--text-muted); cursor: pointer; transition: 0.2s;
    }
    .auth-tab.active { background: var(--bg-card); color: var(--text-main); }

    .auth-error {
      background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
      border-radius: 8px; padding: 0.6rem 0.9rem;
      font-size: 0.82rem; color: #ef4444;
      margin-bottom: 1rem; display: none;
    }
    .auth-error.show { display: block; }

    /* ── Nav ─────────────────────────────────────────────── */
    .site-header {
      background: var(--bg-main); border-bottom: 1px solid var(--border);
      position: sticky; top: 0; z-index: 100;
    }
    .nav-inner {
      display: flex; justify-content: space-between; align-items: center;
      padding: 1rem; max-width: 1400px; margin: auto; width: 90%;
    }
    .logo {
      font-size: 1.6rem; font-weight: 900;
      background: linear-gradient(90deg, var(--accent), #06b6d4);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      letter-spacing: -0.03em; text-decoration: none;
    }
    .nav-links { display: flex; gap: 1.5rem; align-items: center; }
    .nav-links a {
      color: var(--text-muted); text-decoration: none;
      font-size: 0.9rem; font-weight: 500; transition: color 0.2s;
    }
    .nav-links a:hover { color: var(--text-main); }
    .nav-links a.active { color: var(--accent); font-weight: 700; }
    .nav-theme-btn {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 999px; padding: 0.4rem 0.9rem;
      color: var(--text-muted); font-size: 0.85rem; cursor: pointer;
      transition: 0.2s; font-family: inherit;
    }
    .nav-theme-btn:hover { border-color: var(--accent); color: var(--accent); }

    /* Nav user pill */
    .nav-user {
      display: flex; align-items: center; gap: 0.5rem;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 999px; padding: 0.3rem 0.8rem 0.3rem 0.4rem;
      font-size: 0.82rem; font-weight: 600; color: var(--text-main);
    }
    .nav-user-dot {
      width: 24px; height: 24px; border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), #06b6d4);
      display: flex; align-items: center; justify-content: center;
      font-size: 0.65rem; font-weight: 800; color: white;
    }

    /* ── Toast ───────────────────────────────────────────── */
    #toast {
      position: fixed; bottom: 24px; right: 24px;
      background: var(--bg-card); border: 1px solid var(--success);
      border-radius: 12px; padding: 0.75rem 1.2rem;
      font-size: 0.85rem; color: var(--success);
      z-index: 999; opacity: 0; transform: translateY(8px);
      transition: 0.2s; pointer-events: none;
    }
    #toast.show { opacity: 1; transform: translateY(0); }
    #toast.error { border-color: var(--danger); color: var(--danger); }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    @media (max-width: 768px) {
      .forum-layout { grid-template-columns: 1fr; }
      .sidebar { position: static; display: flex; flex-wrap: wrap; gap: 0.5rem; }
      .sidebar-section { margin: 0; }
      .sidebar-label { display: none; }
      .cat-btn { width: auto; border: 1px solid var(--border); border-radius: 999px; }
      .new-thread-btn { width: auto; padding: 0.55rem 1rem; margin: 0; }
      .user-card, .login-prompt-card { display: none; }
      .search-wrap input { width: 140px; }
      .nav-links a:not(.nav-auth-link):not(:last-child) { display: none; }
    }
     /* Target Injected Wiki Preview System Typography Framework */
    .wiki-clean-wrapper {
      padding: 1rem 0;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      line-height: 1.6;
      color: #e4e4e7;
    }
    .wiki-clean-wrapper h1 { font-size: 1.875rem; font-weight: 800; color: #ffffff; margin-bottom: 0.25rem; margin-top: 1rem; letter-spacing: -0.025em; }
    .wiki-clean-wrapper .sub-heading-text { font-size: 0.875rem; color: #71717a; margin-bottom: 1.25rem; font-weight: 500; display: block; line-height: 1.4; }
    .wiki-clean-wrapper h2 { font-size: 1.35rem; font-weight: 700; color: #f4f4f5; margin-top: 1.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.25rem; }
    .wiki-clean-wrapper h3 { font-size: 1.125rem; font-weight: 600; color: #e4e4e7; margin-top: 1.25rem; margin-bottom: 0.5rem; }
    .wiki-clean-wrapper p { margin-bottom: 1.15rem; color: #a1a1aa; font-size: 0.95rem; }
    .wiki-clean-wrapper ul { list-style-type: disc; margin-left: 1.5rem; margin-bottom: 1.25rem; color: #a1a1aa; }
    .wiki-clean-wrapper ol { list-style-type: decimal; margin-left: 1.5rem; margin-bottom: 1.25rem; color: #a1a1aa; }
    .wiki-clean-wrapper li { margin-bottom: 0.35rem; }
    
    /* Hyperlinks Framework Styling */
    .wiki-clean-wrapper .wiki-link {
      color: #60a5fa;
      text-decoration: none;
      font-weight: 500;
      border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
      transition: all 0.15s ease;
    }
    .wiki-clean-wrapper .wiki-link:hover {
      color: #93c5fd;
      border-bottom-style: solid;
      background-color: rgba(59, 130, 246, 0.08);
    }

    /* Button Components Style Rulesets */
    .wiki-btn-container {
      display: flex;
      gap: 0.75rem;
      flex-wrap: wrap;
      margin: 1rem 0 1.25rem 0;
    }
    .wiki-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.5rem 1rem;
      font-size: 0.875rem;
      font-weight: 600;
      border-radius: 0.5rem;
      transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
      text-decoration: none !important;
    }
    .wiki-btn-primary {
      background-color: #2563eb;
      color: #ffffff !important;
      border: 1px solid #3b82f6;
    }
    .wiki-btn-primary:hover {
      background-color: #1d4ed8;
      box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
    }
    .wiki-btn-secondary {
      background-color: #18181b;
      color: #e4e4e7 !important;
      border: 1px solid #3f3f46;
    }
    .wiki-btn-secondary:hover {
      background-color: #27272a;
      border-color: #52525b;
      color: #ffffff !important;
    }
    .wiki-btn-destructive {
      background-color: rgba(220, 38, 38, 0.15);
      color: #fca5a5 !important;
      border: 1px solid rgba(239, 68, 68, 0.4);
    }
    .wiki-btn-destructive:hover {
      background-color: #dc2626;
      color: #ffffff !important;
      border-color: #ef4444;
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
    }

    .wiki-clean-wrapper details { background: #18181b; border: 1px solid #27272a; padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 0.5rem; }
    .wiki-clean-wrapper summary { font-weight: 600; color: #ffffff; cursor: pointer; outline: none; }
    .wiki-clean-wrapper details[open] summary { margin-bottom: 0.5rem; border-bottom: 1px solid #27272a; padding-bottom: 0.5rem; }
    .wiki-clean-wrapper aside { padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.25rem; border-left: 4px solid; font-size: 0.9rem; }
    .wiki-clean-wrapper .alert-info { background: rgba(59, 130, 246, 0.1); border-color: #3b82f6; color: #93c5fd; }
    .wiki-clean-wrapper .alert-warning { background: rgba(234, 179, 8, 0.1); border-color: #eab308; color: #fde047; }
    .wiki-clean-wrapper .alert-critical { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; color: #fca5a5; }
    .wiki-clean-wrapper figure { margin: 1.5rem 0; text-align: center; }
    .wiki-clean-wrapper img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 0 auto; border: 1px solid #27272a; }
    .wiki-clean-wrapper figcaption { font-size: 0.8rem; color: #71717a; margin-top: 0.5rem; font-style: italic; }
    
    /* Responsive Wiki Specific Style Framework Data Tables Tables Styling */
    .wiki-table-container { overflow-x: auto; margin-bottom: 1.5rem; border: 1px solid #27272a; border-radius: 0.5rem; }
    .wiki-clean-wrapper table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; }
    .wiki-clean-wrapper th { background-color: #18181b; color: #ffffff; font-weight: 600; padding: 0.75rem 1rem; border-bottom: 1px solid #27272a; }
    .wiki-clean-wrapper td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(39, 39, 42, 0.6); color: #e4e4e7; }
    .wiki-clean-wrapper tr:last-child td { border-bottom: none; }
    .wiki-clean-wrapper tr:nth-child(even) { background-color: rgba(255, 255, 255, 0.01); }