/*
 Theme Name:  Lumen Forum
 Theme URI:   https://example.com/lumen-forum
 Description: Modern community forum theme. Requires the "Lumen Forum Engine" plugin, which owns all forum data and logic so your content survives theme switches. Dark/light mode, bidirectional voting, moderation, notifications, @mentions, image uploads, emoji picker, AJAX feed with load-more.
 Version:     2.2.0
 Requires Plugins: lumen-forum-engine
 Author:      Lumen
 Text Domain: lumen-forum
 License:     GPL-2.0-or-later
*/

/* ============================================================
   0. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:       #0A0E14;
  --bg2:      #141620;
  --bg3:      #1E2130;
  --surface:  #141A22;
  --card:     #1B2330;
  --accent:   #6366F1;
  --accent-2: #14B8A6;
  --accent-hover: #4F46E5;
  --text:     #E5E7EB;
  --text-2:   #9CA3AF;
  --text-3:   #6B7280;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.14);
  --shadow:   0 4px 20px rgba(0,0,0,0.3);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.2);
  --radius:   16px;
  --radius-sm:10px;
}
[data-theme="light"] {
  --bg:       #F8FAFC;
  --bg2:      #F1F5F9;
  --bg3:      #E2E8F0;
  --surface:  #FFFFFF;
  --card:     #FFFFFF;
  --accent-hover: #4F46E5;
  --text:     #0F172A;
  --text-2:   #475569;
  --text-3:   #64748B;
  --border:   rgba(15,23,42,0.08);
  --border2:  rgba(15,23,42,0.16);
  --shadow:   0 4px 20px rgba(15,23,42,0.08);
  --shadow-sm:0 2px 8px rgba(15,23,42,0.06);
}

/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a          { color: inherit; text-decoration: none; }
a:hover    { color: var(--accent); }
button     { font-family: inherit; cursor: pointer; }
img        { max-width: 100%; height: auto; display: block; }
ul, ol     { list-style: none; }

/* WordPress core overrides */
.alignleft  { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter{ display: block; margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* Admin bar offset */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ============================================================
   2. SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10,14,20,0.80);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
[data-theme="light"] .site-header { background: rgba(248,250,252,0.80); }

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle,
.icon-btn.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
}
.menu-toggle:hover { color: var(--text); }

/* Logo */
.site-branding { display: flex; align-items: center; gap: 10px; }
.site-branding a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.3px;
  color: var(--text);
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
  flex-shrink: 0;
}
.logo-mark svg { width: 16px; height: 16px; color: white; }

/* Search */
.header-search { flex: 1; max-width: 520px; position: relative; display: none; }
@media (min-width: 768px) { .header-search { display: block; } }
.header-search input {
  width: 100%;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px 0 40px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: var(--card);
}
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-3);
  pointer-events: none;
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn-create {
  height: 38px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 11px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(99,102,241,.28);
  text-decoration: none;
}
.btn-create:hover { color: white; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,.38); }
.btn-create .plus { font-size: 18px; line-height: 1; }
.btn-create .text { }
@media (max-width: 900px) { .btn-create .text { display: none; } }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-2);
  transition: color .15s, border-color .15s, background .15s;
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: rgba(255,255,255,.15); background: var(--card); }
[data-theme="light"] .icon-btn:hover { border-color: rgba(0,0,0,.12); }
.icon-btn svg { width: 18px; height: 18px; }

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.user-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: none;
  text-decoration: none;
}
.user-avatar-btn img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Notification dropdown */
.notif-wrapper { position: relative; }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 60;
}
.notif-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.notif-head {
  font-weight: 600;
  font-size: 13px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.notif-item {
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  color: var(--text-2);
}
.notif-item:hover { background: var(--surface); color: var(--text); }
.notif-item strong { font-weight: 600; color: var(--text); }
.notif-empty { padding: 20px 8px; text-align: center; font-size: 13px; color: var(--text-3); }

/* ============================================================
   3. APP LAYOUT (3-column grid)
   ============================================================ */
.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1200px) {
  .app { grid-template-columns: 220px 1fr; }
  .right-sidebar { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 16px 16px 60px; gap: 16px; }
}

/* ============================================================
   4. LEFT SIDEBAR
   ============================================================ */
.left-sidebar {
  position: sticky;
  top: 84px;
  height: fit-content;
  min-width: 0;
}
@media (max-width: 900px) {
  .left-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    padding: 20px 16px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    top: 0;
    height: 100vh;
  }
  .left-sidebar.open { transform: translateX(0); }
  .menu-toggle,
  .icon-btn.menu-toggle { display: flex; }
}

.nav-section { margin-bottom: 24px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item svg { width: 20px; height: 20px; opacity: .85; flex-shrink: 0; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.current-menu-item,
.nav-item.active {
  background: rgba(99,102,241,.12);
  color: var(--accent);
}
.nav-item.active svg,
.nav-item.current-menu-item svg { opacity: 1; }

.nav-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 600;
  margin: 18px 12px 8px;
}

/* Forum list in sidebar */
.sidebar-forum {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.sidebar-forum:hover { background: var(--surface); color: var(--text); }
.sidebar-forum.active { color: var(--accent); }
.forum-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-forum-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   5. MAIN FEED
   ============================================================ */
.main-feed { min-width: 0; }

/* Used on pages (e.g. Login) that intentionally render with no sidebars,
   so the 3-column grid collapses to one centered column on desktop. */
.app--single-column { grid-template-columns: 1fr; max-width: 720px; }

/* Welcome banner */
.welcome {
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(20,184,166,.14));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.welcome::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(99,102,241,.3), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.welcome h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 4px; }
.welcome p { color: var(--text-2); font-size: 14px; }
.welcome-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }

/* Mobile search */
.mobile-search { display: none; margin-bottom: 16px; position: relative; }
@media (max-width: 767px) { .mobile-search { display: block; } }
.mobile-search input {
  width: 100%;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px 0 42px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.mobile-search input:focus { border-color: var(--accent); }
.mobile-search input::placeholder { color: var(--text-3); }
.mobile-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-3);
  pointer-events: none;
}

/* Category filter pills */
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
  font-family: inherit;
}
.pill:hover { border-color: rgba(99,102,241,.4); color: var(--text); transform: translateY(-1px); }
.pill.active { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 2px 10px rgba(99,102,241,.28); }

/* ============================================================
   6. TOPIC / POST CARDS
   ============================================================ */
.posts { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(99,102,241,.22);
}

.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.post-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.post-avatar img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; }

.post-meta { min-width: 0; flex: 1; }
.post-author { font-weight: 600; font-size: 14px; line-height: 1.2; }
.post-time {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.dot-sep {
  width: 3px; height: 3px;
  background: var(--text-3);
  border-radius: 50%;
  flex-shrink: 0;
}

.post-title {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.2px;
  margin-bottom: 6px;
  color: var(--text);
  transition: color .15s;
}
.post-card:hover .post-title { color: var(--accent); }

.post-preview {
  font-size: 14px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  padding: 4px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 500;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}
.tag:hover { color: var(--accent); border-color: rgba(99,102,241,.3); }

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-stats { display: flex; align-items: center; gap: 14px; }

.stat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
  font-family: inherit;
}
.stat-btn:hover { border-color: rgba(99,102,241,.4); color: var(--text); background: var(--surface); }
.stat-btn svg { width: 15px; height: 15px; transition: transform .15s; flex-shrink: 0; }
.stat-btn.upvoted { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.4); color: var(--accent); }
.stat-btn.upvoted svg { fill: currentColor; }
.stat-btn:disabled { opacity: .5; cursor: not-allowed; }

.stat-plain { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-3); }
.stat-plain svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Avatar stack (recent repliers) */
.avatar-stack { display: flex; align-items: center; }
.mini-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--card);
  margin-left: -7px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.mini-avatar:first-child { margin-left: 0; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   7. EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-3); margin: 0 auto 16px; opacity: .6; }
.empty-state h3 { font-size: 18px; margin-bottom: 6px; }
.empty-state p { color: var(--text-2); font-size: 14px; }

/* ============================================================
   8. RIGHT SIDEBAR
   ============================================================ */
.right-sidebar {
  position: sticky;
  top: 84px;
  height: fit-content;
}

.right-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.right-title {
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}
.right-title span { color: var(--text-3); font-weight: 500; font-size: 12px; }

/* Active users */
.active-now { display: flex; flex-wrap: wrap; gap: 8px; }
.active-avatar-wrap { position: relative; }
.active-avatar-wrap .post-avatar { width: 38px; height: 38px; font-size: 12px; }
.active-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  background: #22C55E;
  border: 2px solid var(--card);
  border-radius: 50%;
}

/* Top contributors */
.contributor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.contributor:not(:last-child) { border-bottom: 1px solid var(--border); }
.contrib-rank {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
}
.contributor:nth-child(1) .contrib-rank { background: rgba(251,191,36,.15); color: #FBBF24; }
.contributor:nth-child(2) .contrib-rank { background: rgba(148,163,184,.15); color: #94A3B8; }
.contributor:nth-child(3) .contrib-rank { background: rgba(205,127,50,.15); color: #CD7F32; }
.contrib-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.contrib-avatar img { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; }
.contrib-info { flex: 1; min-width: 0; }
.contrib-name { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contrib-points { font-size: 12px; color: var(--text-3); }

/* Community stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.stat-num { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* Trending tags */
.trending-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.trend-tag {
  padding: 6px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}
.trend-tag:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.08); }

/* ============================================================
   9. OVERLAY (mobile sidebar)
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* ============================================================
   10. TOAST
   ============================================================ */
.lumen-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  white-space: nowrap;
}
.lumen-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   11. BBPRESS — SINGLE TOPIC PAGE
   ============================================================ */
.topic-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.topic-header h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 12px; line-height: 1.3; }
.topic-header .post-time { margin-bottom: 16px; }
.topic-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
}
.topic-body p { margin-bottom: 1em; }
.topic-body p:last-child { margin-bottom: 0; }
.topic-body a { color: var(--accent); }
.topic-body a:hover { text-decoration: underline; }
.topic-body h1, .topic-body h2, .topic-body h3 { color: var(--text); margin: 1.2em 0 .5em; }
.topic-body ul, .topic-body ol { padding-left: 1.5em; margin: .8em 0; }
.topic-body li { margin-bottom: .3em; }
.topic-body code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: 'Fira Code', 'Consolas', monospace;
}
.topic-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 1em 0;
}
.topic-body pre code { background: none; border: none; padding: 0; }
.topic-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-3);
  margin: 1em 0;
  font-style: italic;
}

/* Topic tags in header */
.topic-tags-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Replies heading */
.replies-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.replies-count-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-3);
}

/* Reply card */
.reply-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.reply-card .post-head { margin-bottom: 12px; }
.reply-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.reply-body p { margin-bottom: .8em; }
.reply-body p:last-child { margin-bottom: 0; }
.reply-body a { color: var(--accent); }
.reply-body code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; font-size: 12.5px; }
.reply-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.reply-actions { display: flex; gap: 8px; }
.reply-link-btn {
  font-size: 12.5px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s;
}
.reply-link-btn:hover { color: var(--accent); }

/* ============================================================
   12. BBPRESS — FORMS (new topic / reply)
   ============================================================ */
.lumen-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}
.lumen-form-card h3 {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 18px;
  color: var(--text);
}

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea.form-control { min-height: 120px; line-height: 1.55; }

/* bbPress default form overrides */
#new-topic, #reply-form { all: unset; display: block; }
#bbp_topic_title, #bbp_reply_content, #bbp_topic_content {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
#bbp_topic_title { height: 44px; resize: none; }
#bbp_reply_content, #bbp_topic_content { min-height: 120px; resize: vertical; }
#bbp_topic_title:focus, #bbp_reply_content:focus, #bbp_topic_content:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

.btn-primary {
  height: 40px;
  padding: 0 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.38); }

.btn-secondary {
  height: 40px;
  padding: 0 18px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-secondary:hover { color: var(--text); border-color: rgba(255,255,255,.18); }

/* bbPress submit button override */
#bbp_topic_submit, #bbp_reply_submit {
  height: 40px;
  padding: 0 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
#bbp_topic_submit:hover, #bbp_reply_submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,.38);
}

/* Form errors */
.bbp-template-notice,
.lumen-notice {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.bbp-template-notice.error,
.lumen-notice.error { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #FCA5A5; }
.bbp-template-notice.info,
.lumen-notice.info { background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.3); color: var(--accent); }
.bbp-template-notice p { margin: 0; }

/* Login notice */
.login-notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-top: 20px;
}
.login-notice p { color: var(--text-2); font-size: 14px; margin-bottom: 14px; }

/* ============================================================
   13. BBPRESS — SINGLE FORUM PAGE
   ============================================================ */
.forum-header {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(20,184,166,.1));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.forum-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 6px; }
.forum-header p { color: var(--text-2); font-size: 14px; }
.forum-meta-row { display: flex; gap: 20px; margin-top: 14px; }
.forum-meta-item { font-size: 13px; color: var(--text-3); }
.forum-meta-item strong { color: var(--text-2); font-weight: 600; }

/* Pagination */
.bbp-pagination,
.lumen-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.bbp-pagination a,
.bbp-pagination span,
.page-numbers {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  transition: all .15s;
}
.bbp-pagination a:hover,
.page-numbers:hover { color: var(--text); border-color: rgba(99,102,241,.3); }
.bbp-pagination .current,
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: white; }
.bbp-pagination .dots,
.page-numbers.dots { border: none; background: none; }

/* ============================================================
   14. FOOTER
   ============================================================ */
.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a:hover { color: var(--text); }

/* ============================================================
   15. LOADING / SPINNER
   ============================================================ */
.lumen-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lumen-spinner::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   16. RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 640px) {
  .post-card { padding: 16px; }
  .post-title { font-size: 16px; }
  .welcome { padding: 18px; }
  .welcome h1 { font-size: 18px; }
  .topic-header h1 { font-size: 20px; }
  .lumen-form-card { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .post-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-inner { padding: 10px 14px; }
}

/* ============================================================
   17. UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
.text-muted { color: var(--text-3); }
.mb-0 { margin-bottom: 0 !important; }

/* ============================================================
   18. BBPRESS — USER PROFILE PAGES
   ============================================================ */
.user-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.user-profile-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}
.user-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-profile-info { flex: 1; min-width: 0; }
.user-profile-info h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 6px;
}
.user-profile-stats {
  display: flex;
  gap: 24px;
  margin-top: 14px;
}
.user-stat-item {
  font-size: 13px;
  color: var(--text-3);
}
.user-stat-item strong {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  display: block;
  line-height: 1.2;
}

/* Profile sub-nav pills (re-used .pill class) */
.user-profile-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.user-profile-nav .pill {
  text-decoration: none;
}

/* ============================================================
   19. BBPRESS — TOPIC TAG ARCHIVE
   ============================================================ */
/* Re-uses .forum-header; nothing extra needed beyond the tag glyph colour
   defined inline. Only the search-form wrapper needs styling. */

/* ============================================================
   20. BBPRESS — SEARCH PAGE
   ============================================================ */
.lumen-search-form-wrap {
  margin-bottom: 24px;
}
.lumen-search-form-wrap #bbp-search-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.lumen-search-form-wrap input[type="text"],
.lumen-search-form-wrap input[type="search"] {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.lumen-search-form-wrap input[type="text"]:focus,
.lumen-search-form-wrap input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.lumen-search-form-wrap input[type="submit"] {
  height: 44px;
  padding: 0 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
  white-space: nowrap;
}
.lumen-search-form-wrap input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,.38);
}

/* ============================================================
   21. BBPRESS — EDIT FORMS (topic edit / reply edit)
   ============================================================ */
/* Edit pages render form-topic.php / form-reply.php directly inside main;
   they already inherit .lumen-form-card styles. Add page-level spacing. */
.bbp-topic-edit .lumen-form-card,
.bbp-reply-edit .lumen-form-card {
  margin-top: 0;
}

/* ============================================================
   22. BBPRESS — STATUS LABELS & BADGES
   ============================================================ */
/* BBPress appends status classes to post wrappers */
.post-card.bbp-topic-status-closed .post-title::after,
.topic-header.bbp-topic-status-closed h1::after {
  content: 'Closed';
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: rgba(107,114,128,.18);
  color: var(--text-3);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 10px;
  vertical-align: middle;
  letter-spacing: .3px;
}
.post-card.bbp-topic-status-spam .post-title::after,
.topic-header.bbp-topic-status-spam h1::after {
  content: 'Spam';
  background: rgba(239,68,68,.12);
  color: #FCA5A5;
}
.post-card.bbp-topic-status-trash .post-title::after,
.topic-header.bbp-topic-status-trash h1::after {
  content: 'Trash';
  background: rgba(239,68,68,.12);
  color: #FCA5A5;
}

/* BBPress sticky topic indicator */
.post-card.bbp-topic-status-sticky::before,
.post-card.bbp-topic-status-super-sticky::before {
  content: '📌';
  float: right;
  font-size: 13px;
  line-height: 1;
  margin-top: 2px;
}

/* ============================================================
   23. BBPRESS — ROLE BADGES (keymaster / moderator / participant)
   ============================================================ */
.bbp-reply-header .bbp-author-role,
.bbp-topic-author .bbp-author-role {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 500;
  vertical-align: middle;
}
.bbp-role-keymaster  { background: rgba(99,102,241,.15); color: var(--accent); }
.bbp-role-moderator  { background: rgba(20,184,166,.15); color: var(--accent-2); }
.bbp-role-participant { background: rgba(255,255,255,.06); color: var(--text-3); }

/* ============================================================
   24. BBPRESS — ADMIN LINKS (edit/delete on posts)
   ============================================================ */
.bbp-admin-links,
.bbp-reply-admin-links {
  display: inline-flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.bbp-admin-links a,
.bbp-reply-admin-links a {
  color: var(--text-3);
  transition: color .15s;
}
.bbp-admin-links a:hover,
.bbp-reply-admin-links a:hover { color: var(--accent); }

/* ============================================================
   25. BBPRESS — SUBSCRIPTIONS & FAVOURITES ACTIONS
   ============================================================ */
.bbp-topic-subscription,
.bbp-topic-favorite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.bbp-topic-subscription:hover,
.bbp-topic-favorite:hover {
  color: var(--accent);
  border-color: rgba(99,102,241,.3);
}

/* ============================================================
   26. BBPRESS — SEARCH RESULT SPECIFIC
   ============================================================ */
/* bbPress wraps search results in #bbp-search-results; reset margins */
#bbp-search-results { margin: 0; padding: 0; }

/* ============================================================
   27. BBPRESS — GENERIC bbp- CLASS RESETS
   ============================================================ */
/* Prevent BBPress default table-based layouts from leaking in */
#bbpress-forums,
#bbpress-forums table,
#bbpress-forums thead,
#bbpress-forums tbody,
#bbpress-forums tfoot,
#bbpress-forums tr,
#bbpress-forums th,
#bbpress-forums td {
  display: revert;
}

/* If BBPress compat layer emits its own wrapper, hide it so only our
   custom templates show; only fires when add_theme_support('bbpress') is
   declared AND our template is the one in use. */
.bbp-forum-content > #bbpress-forums:empty { display: none; }

/* BBPress wraps the entire output in #bbpress-forums on some page types;
   let it inherit our card background rather than a bare white box */
#bbpress-forums { background: transparent; }

/* ============================================================
   28. BBPRESS — WP EDITOR OVERRIDE (bbp_use_wp_editor)
   ============================================================ */
/* When the visual editor is active, TinyMCE renders inside the form;
   ensure it respects our colour scheme */
.mce-container,
.mce-container * { box-sizing: border-box; }
.wp-editor-wrap .wp-editor-area { background: var(--surface); color: var(--text); border-color: var(--border); }

/* ============================================================
   29. BBPRESS — RESPONSIVE (user profile)
   ============================================================ */
@media (max-width: 640px) {
  .user-profile-header { flex-direction: column; }
  .user-profile-header > [style*="margin-left:auto"] { margin-left: 0 !important; }
  .user-profile-stats { gap: 16px; }
  .lumen-search-form-wrap #bbp-search-form { flex-direction: column; }
  .lumen-search-form-wrap input[type="text"],
  .lumen-search-form-wrap input[type="search"],
  .lumen-search-form-wrap input[type="submit"] { width: 100%; }
}


/* =================================================================
   LUMEN FORUM v2 — ADDONS
   Profile, voting, image upload, emoji picker, sort tabs, etc.
   ================================================================= */

/* --- Logo -------------------------------------------------------- */
.lumen-logo-link{display:flex;align-items:center;gap:9px;text-decoration:none;color:var(--text);font-weight:700;font-size:17px;letter-spacing:-.25px;flex-shrink:0;}
.lumen-logo-img{height:36px;width:auto;max-width:180px;object-fit:contain;display:block;}
.lumen-logo-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px;}
.lumen-logo-link:hover{opacity:.85;}

/* --- Avatar link ------------------------------------------------- */
.lumen-avatar-link{display:contents;}
.avatar-upload-label{position:absolute;bottom:-2px;right:-2px;background:var(--accent);color:#fff;border-radius:50%;width:22px;height:22px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:2px solid var(--bg);transition:background .15s;}
.avatar-upload-label:hover{background:var(--accent-hover,#4f46e5);}

/* --- BIDIRECTIONAL VOTE COLUMN ----------------------------------- */
.vote-column{display:flex;flex-direction:column;align-items:center;gap:4px;padding:4px;flex-shrink:0;}
.vote-column--topic{padding:8px 4px;}
.vote-column--reply{padding:2px 4px;}
.vote-btn{background:none;border:none;cursor:pointer;padding:6px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--text-3);transition:color .15s,background .15s,transform .12s;line-height:1;}
.vote-btn svg{width:16px;height:16px;pointer-events:none;}
.vote-btn:hover{background:var(--bg3,#1e2130);color:var(--text);}
.vote-btn.active.upvote-btn{color:var(--accent,#6366f1);background:rgba(99,102,241,.12);}
.vote-btn.active.downvote-btn{color:#EF4444;background:rgba(239,68,68,.12);}
.vote-btn:disabled{opacity:.4;cursor:default;}
.vote-score{font-size:14px;font-weight:700;min-width:20px;text-align:center;transition:color .2s;}

/* topic card layout with vote column */
.post-card{display:flex;gap:12px;align-items:flex-start;}
.post-card-body{flex:1;min-width:0;}
.post-card-link{display:block;text-decoration:none;color:inherit;}

/* --- SORT TABS --------------------------------------------------- */
.sort-tabs{display:flex;gap:4px;background:var(--bg2,#141620);border-radius:10px;padding:3px;}
.sort-tab{background:none;border:none;cursor:pointer;padding:6px 12px;border-radius:8px;font-size:13px;font-weight:500;color:var(--text-2);transition:background .15s,color .15s;display:flex;align-items:center;gap:4px;}
.sort-tab:hover{color:var(--text);}
.sort-tab.active{background:var(--bg,#0f1117);color:var(--text);box-shadow:0 1px 4px rgba(0,0,0,.3);}

/* --- PILLS ROW --------------------------------------------------- */
.pills-row{display:flex;gap:6px;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none;margin-bottom:16px;}
.pills-row::-webkit-scrollbar{display:none;}

/* --- PROFILE PAGE ------------------------------------------------ */
.user-profile-header{display:flex;gap:20px;align-items:flex-start;flex-wrap:wrap;background:var(--bg2,#141620);border-radius:16px;padding:24px;margin-bottom:24px;border:1px solid var(--border,#1e2130);}
.user-profile-info{flex:1;min-width:0;}
.user-profile-stats{display:flex;gap:20px;margin-top:14px;}
.user-stat-item{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:13px;color:var(--text-2);}
.user-stat-item strong{font-size:20px;font-weight:700;color:var(--text);line-height:1.1;}

/* role badges */
.role-badge{font-size:10px;font-weight:700;padding:2px 7px;border-radius:999px;margin-left:6px;vertical-align:middle;}
.role-admin{background:rgba(239,68,68,.15);color:#EF4444;}
.role-mod{background:rgba(99,102,241,.15);color:#818cf8;}

/* --- FORM CARD --------------------------------------------------- */
.lumen-form-card{background:var(--bg2,#141620);border-radius:16px;padding:24px;border:1px solid var(--border,#1e2130);}
.lumen-form-card h3{font-size:16px;font-weight:600;margin:0 0 20px;color:var(--text);}
.form-group{margin-bottom:18px;}
.form-label{display:block;font-size:13px;font-weight:600;color:var(--text-2);margin-bottom:6px;}
.form-control{width:100%;background:var(--bg,#0f1117);border:1px solid var(--border,#1e2130);border-radius:10px;padding:10px 14px;color:var(--text);font-size:14px;font-family:inherit;transition:border-color .15s,box-shadow .15s;box-sizing:border-box;}
.form-control:focus{outline:none;border-color:var(--accent,#6366f1);box-shadow:0 0 0 3px rgba(99,102,241,.18);}
textarea.form-control{resize:vertical;min-height:80px;line-height:1.6;}
select.form-control{-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px;height:44px;cursor:pointer;}
.form-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:8px;}

/* --- UPLOAD PREVIEW ---------------------------------------------- */
.lumen-upload-preview{margin-top:8px;padding:8px;background:var(--bg,#0f1117);border-radius:8px;border:1px solid var(--border,#1e2130);}
.lumen-inline-img{max-width:100%;border-radius:8px;margin-top:8px;display:block;}

/* --- EMOJI PICKER ------------------------------------------------ */
#lumenEmojiPicker{display:none;} /* JS overrides to grid */

/* --- NOTICES ----------------------------------------------------- */
.lumen-notice{border-radius:10px;padding:12px 16px;margin-bottom:16px;font-size:14px;}
.lumen-notice p{margin:0;}
.lumen-notice.success{background:rgba(34,197,94,.1);border:1px solid rgba(34,197,94,.25);color:#22c55e;}
.lumen-notice.error{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.25);color:#ef4444;}
.lumen-notice.info{background:rgba(99,102,241,.08);border:1px solid rgba(99,102,241,.2);color:var(--text-2);}

/* --- TOAST ------------------------------------------------------- */
#lumenToast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(8px);background:var(--bg2,#1a1d24);color:var(--text);padding:10px 20px;border-radius:30px;font-size:13px;font-weight:500;border:1px solid var(--border,#2a2d36);box-shadow:0 4px 20px rgba(0,0,0,.4);opacity:0;visibility:hidden;transition:opacity .2s,transform .2s,visibility .2s;white-space:nowrap;z-index:99999;}
#lumenToast.show{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0);}

/* --- REPLY CARD -------------------------------------------------- */
.reply-card{background:var(--bg2,#141620);border-radius:14px;padding:16px;margin-bottom:12px;border:1px solid var(--border,#1e2130);transition:border-color .15s;}
.reply-card:hover{border-color:var(--border2,#2a2d3a);}
.reply-body{font-size:15px;line-height:1.7;color:var(--text);margin:12px 0;word-break:break-word;}
.reply-body img{max-width:100%;border-radius:8px;display:block;margin-top:8px;}
.reply-foot{display:flex;align-items:center;justify-content:space-between;margin-top:10px;}
.reply-actions{display:flex;gap:8px;align-items:center;}
.reply-link-btn{background:none;border:none;cursor:pointer;font-size:13px;color:var(--text-3);padding:4px 8px;border-radius:6px;transition:color .15s,background .15s;text-decoration:none;display:inline-flex;align-items:center;gap:4px;}
.reply-link-btn:hover{color:var(--text);background:var(--bg3,rgba(255,255,255,.05));}

/* --- TOPIC POST -------------------------------------------------- */
.topic-post{background:var(--bg2,#141620);border-radius:16px;padding:24px;margin-bottom:24px;border:1px solid var(--border,#1e2130);}
.topic-content{font-size:16px;line-height:1.8;color:var(--text);word-break:break-word;}
.topic-content img{max-width:100%;border-radius:8px;display:block;margin:12px 0;}
.topic-content p{margin:0 0 14px;}

/* --- FORUM BREADCRUMB ------------------------------------------- */
.forum-breadcrumb{font-size:13px;color:var(--text-3);display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin-bottom:8px;}
.forum-breadcrumb a{color:var(--text-2);text-decoration:none;transition:color .15s;}
.forum-breadcrumb a:hover{color:var(--accent,#6366f1);}
.forum-breadcrumb .current{color:var(--text);}

/* --- SEARCH RESULTS ---------------------------------------------- */
.empty-state{text-align:center;padding:60px 20px;color:var(--text-3);}
.empty-state svg{width:48px;height:48px;margin:0 auto 16px;display:block;opacity:.4;}
.empty-state h3{font-size:18px;font-weight:600;color:var(--text-2);margin:0 0 8px;}
.empty-state p{font-size:14px;margin:0;}

/* --- STAT PLAIN -------------------------------------------------- */
.stat-plain{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--text-3);text-decoration:none;}
.stat-plain:hover{color:var(--text-2);}
.stat-plain svg{width:14px;height:14px;}

/* --- LOGIN NOTICE ----------------------------------------------- */
.login-notice{background:var(--bg2,#141620);border:1px solid var(--border,#1e2130);border-radius:14px;padding:24px;text-align:center;margin-top:24px;}
.login-notice p{margin:0 0 12px;color:var(--text-2);}

/* --- FEED CONTROLS ---------------------------------------------- */
.feed-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px;}

/* --- MINI AVATARS (participant stack) ---------------------------- */
.avatar-stack{display:flex;flex-direction:row-reverse;margin-left:8px;}
.mini-avatar{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:#fff;border:2px solid var(--bg,#0f1117);margin-left:-8px;overflow:hidden;flex-shrink:0;}

/* --- VOTE SCORE COLORS ------------------------------------------ */
.vote-score.positive{color:var(--accent,#6366f1);}
.vote-score.negative{color:#EF4444;}

/* --- RICH TEXTAREA ----------------------------------------------- */
.lumen-rich-textarea{resize:vertical;min-height:120px;font-family:inherit;line-height:1.7;}

/* --- RESPONSIVE -------------------------------------------------- */
@media (max-width:640px){
  .user-profile-header{flex-direction:column;}
  .sort-tabs .sort-tab{padding:5px 10px;font-size:12px;}
  .vote-column{gap:2px;}
  .vote-btn svg{width:14px;height:14px;}
  .topic-post{padding:16px;}
  .lumen-form-card{padding:16px;}
}

/* ============================================================
   NOTIFICATIONS (real feed)
   ============================================================ */
.notif-item { display:block; text-decoration:none; }
.notif-item em { font-style: normal; color: var(--text); }
.notif-item .notif-time { display:block; font-size:11px; color: var(--text-3); margin-top:2px; }
.notif-item.is-unread { background: rgba(99,102,241,.08); }
.notif-item.is-unread strong { color: var(--accent); }
.lumen-notif-badge {
  position:absolute; top:2px; right:2px; min-width:16px; height:16px; padding:0 4px;
  border-radius:8px; background:#EF4444; color:#fff; font-size:10px; font-weight:700;
  display:flex; align-items:center; justify-content:center; line-height:1;
}

/* ============================================================
   HOMEPAGE — WELCOME CONTAINER (editable from Forums → Settings)
   ============================================================ */
.lumen-welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(20,184,166,.12));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 26px;
  margin-bottom: 20px;
}
.lumen-welcome-heading { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 6px; }
.lumen-welcome-desc { color: var(--text-2); font-size: 14px; margin: 0 0 14px; max-width: 560px; }
.lumen-welcome-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.lumen-welcome-stats div { display: flex; flex-direction: column; }
.lumen-welcome-stats strong { font-size: 20px; font-weight: 700; line-height: 1.2; }
.lumen-welcome-stats span { font-size: 12px; color: var(--text-3); }
.lumen-welcome-cta { display: flex; gap: 10px; flex-shrink: 0; }

/* ============================================================
   HOMEPAGE — FORUM STATS BAR (Threads / Replies / Members / Latest member)
   ============================================================ */
.lumen-forum-stats-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  margin: 20px 0;
}
.lumen-forum-stat { display: flex; flex-direction: column; }
.lumen-forum-stat strong { font-size: 18px; font-weight: 700; line-height: 1.2; }
.lumen-forum-stat span { font-size: 12px; color: var(--text-3); }
.lumen-forum-stat-member { margin-left: auto; align-items: flex-end; }
.lumen-forum-stat-label { font-size: 11px; color: var(--text-3); }
.lumen-forum-stat-name { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.lumen-forum-stat-name:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .lumen-forum-stats-bar { gap: 16px 22px; }
  .lumen-forum-stat-member { margin-left: 0; align-items: flex-start; }
}

/* ============================================================
   HOMEPAGE — PER-FORUM CARDS (BeerMoneyForum-style index)
   ============================================================ */
.lumen-forum-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.lumen-forum-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--forum-color, var(--accent));
  border-radius: 14px;
  padding: 18px 20px;
}
.lumen-forum-card-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
}
.lumen-forum-dot { display: none; } /* color now shown via the card's left border */
.lumen-forum-card-info { min-width: 0; }
.lumen-forum-card-title {
  display: block;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
}
.lumen-forum-card-title:hover { color: var(--accent); }
.lumen-forum-card-desc {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 8px;
  line-height: 1.5;
  max-width: 480px;
}
.lumen-subforum-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lumen-subforum-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  text-decoration: none;
}
.lumen-subforum-pill:hover { color: var(--accent); border-color: var(--accent); }
.lumen-forum-dot-sm { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.lumen-forum-card-counts {
  display: flex;
  gap: 22px;
  text-align: center;
  flex-shrink: 0;
}
.lumen-forum-card-count { display: flex; flex-direction: column; }
.lumen-forum-card-count strong { font-size: 16px; font-weight: 700; }
.lumen-forum-card-count span { font-size: 11px; color: var(--text-3); }

.lumen-forum-card-latest {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 260px;
  flex-shrink: 0;
}
.lumen-forum-latest-avatar { flex-shrink: 0; }
.lumen-forum-latest-info { min-width: 0; }
.lumen-forum-latest-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lumen-forum-latest-title:hover { color: var(--accent); }
.lumen-forum-latest-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.lumen-forum-latest-meta a { color: var(--text-3); text-decoration: none; }
.lumen-forum-latest-meta a:hover { color: var(--accent); }
.lumen-forum-latest-empty { font-size: 12.5px; color: var(--text-3); font-style: italic; }

@media (max-width: 820px) {
  .lumen-forum-card-main { grid-template-columns: 1fr; gap: 12px; }
  .lumen-forum-card-counts { justify-content: flex-start; }
  .lumen-forum-card-latest { max-width: 100%; }
}

/* ============================================================
   HOMEPAGE — LATEST THREADS LIST (compact list format)
   ============================================================ */
.lumen-latest-threads { margin: 24px 0; }
.lumen-section-title { font-size: 15px; font-weight: 650; margin: 0 0 12px; color: var(--text); }
.lumen-latest-threads-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lumen-latest-thread-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.lumen-latest-thread-row:last-child { border-bottom: none; }
.lumen-latest-thread-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lumen-latest-thread-title:hover { color: var(--accent); }
.lumen-latest-thread-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.lumen-latest-thread-meta a { color: var(--text-3); text-decoration: none; }
.lumen-latest-thread-meta a:hover { color: var(--accent); }
.lumen-latest-thread-replies { font-size: 12px; color: var(--text-3); white-space: nowrap; text-align: right; }
@media (max-width: 640px) {
  .lumen-latest-thread-row { grid-template-columns: 1fr; gap: 4px; }
  .lumen-latest-thread-replies { text-align: left; }
}

/* ============================================================
   "+ NEW THREAD" MODAL
   ============================================================ */
.lumen-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lumen-modal[hidden] { display: none; }
.lumen-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.lumen-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 18px;
}
.lumen-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lumen-modal-close:hover { color: var(--text); background: var(--bg2); }
.lumen-modal-form-card { margin-top: 0 !important; border-radius: 18px; }
