:root {
  --bg:          #08090e;
  --bg-2:        #0d1117;
  --bg-3:        #13181f;
  --bg-4:        #1a2030;
  --bg-hover:    #1e2538;
  --border:      #21283a;
  --border-soft: #191f2c;
  --primary:     #7c5cfc;
  --primary-d:   #6645f0;
  --primary-glow:rgba(124,92,252,0.18);
  --primary-dim: rgba(124,92,252,0.08);
  --accent:      #a78bfa;
  --green:       #34d399;
  --green-dim:   rgba(52,211,153,0.12);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,0.12);
  --yellow:      #fbbf24;
  --yellow-dim:  rgba(251,191,36,0.12);
  --text:        #dde1ea;
  --text-2:      #b0b8c8;
  --text-muted:  #7a849a;
  --text-dim:    #4a5468;
  --r:           10px;
  --r-sm:        6px;
  --r-lg:        14px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow:      0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.3);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.3);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

/* ── Layout ─────────────────────────────────────── */
.container { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; }

.site-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0 4rem;
  min-height: calc(100vh - 64px - 52px);
  align-items: start;
}

/* ── Header ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8,9,14,0.85);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
  color: var(--text);
  flex-shrink: 0;
  text-decoration: none;
}
.logo:hover { color: var(--primary); }
.logo-icon { font-size: 1.3rem; }
.logo-text { background: linear-gradient(135deg, #c4b5fd, #7c5cfc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.header-nav {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.nav-link {
  color: var(--text-muted);
  font-size: .875rem;
  padding: .35rem .65rem;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-4); }

/* User menu */
.user-menu { position: relative; }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: .35rem .65rem .35rem .45rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: .875rem;
  font-family: var(--font);
  transition: border-color .15s, background .15s;
}
.user-menu-btn:hover { border-color: var(--primary); background: var(--bg-4); color: var(--text); }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 300;
}
.user-dropdown a,
.user-dropdown .dropdown-item-btn {
  display: block;
  padding: .6rem 1rem;
  color: var(--text-2);
  font-size: .875rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  transition: background .1s, color .1s;
}
.user-dropdown a:hover,
.user-dropdown .dropdown-item-btn:hover { background: var(--bg-hover); color: var(--text); }
.user-dropdown a + a,
.user-dropdown form + form,
.user-dropdown a + form { border-top: 1px solid var(--border-soft); }

.hidden { display: none !important; }
.chevron { font-size: .65rem; color: var(--text-dim); margin-left: .1rem; }

/* Avatar */
.avatar-sm {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }

.sidebar-section {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 1rem .6rem .3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .6rem;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  font-size: .875rem;
  transition: background .12s, color .12s;
  user-select: none;
}
.sidebar-link:hover { background: var(--bg-3); color: var(--text-2); }
.sidebar-link.active,
.sidebar-link:focus-visible { background: var(--primary-dim); color: var(--primary); outline: none; }
.sidebar-link.highlight-link { color: var(--primary); font-weight: 500; }
.sidebar-link--child { padding-left: 1.75rem; font-size: .83rem; color: var(--text-dim); }
.sidebar-link--child:hover { color: var(--text-muted); }
.sidebar-icon { width: 1.1rem; text-align: center; flex-shrink: 0; font-size: .95rem; }

/* ── Main ─────────────────────────────────────────── */
.main-content { min-width: 0; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 0 var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-d); color: #fff; box-shadow: 0 0 0 4px var(--primary-glow); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-3); border-color: var(--border); color: var(--text-2); }
.btn-danger { background: transparent; border-color: transparent; color: var(--red); }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: .95rem; }
.btn-full { width: 100%; }

/* ── Hero / Home ─────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,92,252,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); margin-bottom: .6rem; }
.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.2;
  margin-bottom: .6rem;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { color: var(--text-muted); font-size: .95rem; max-width: 480px; margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: .75rem; }

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--bg-2);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.stat-num { font-size: 1.4rem; font-weight: 700; color: var(--text); letter-spacing: -.04em; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--text-muted); line-height: 1.3; }

/* ── Category cards ──────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1.5rem; }

.cat-card { background: var(--bg-2); transition: background .15s; }
.cat-card:hover { background: var(--bg-3); }

.cat-card-header {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1.1rem 1.1rem .75rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.cat-card-header:hover .cat-card-name { color: var(--primary); }

.cat-card-icon-wrap {
  width: 36px; height: 36px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.cat-card-name { font-weight: 600; font-size: .92rem; color: var(--text); margin-bottom: .2rem; transition: color .15s; }
.cat-card-desc { font-size: .79rem; color: var(--text-muted); line-height: 1.4; }

.cat-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  padding: 0 1.1rem .9rem;
}
.cat-subcat-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  background: var(--bg-4);
  border-radius: 99px;
  font-size: .77rem;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  transition: all .12s;
  text-decoration: none;
}
.cat-subcat-link:hover { background: var(--primary-dim); color: var(--primary); border-color: rgba(124,92,252,.3); }

/* Section heading */
.section-title {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-soft);
}

/* ── Thread list ─────────────────────────────────── */
.thread-list {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.thread-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: var(--bg-3); }
.thread-row.pinned { background: rgba(124,92,252,.05); }
.thread-row.pinned:hover { background: rgba(124,92,252,.1); }

.thread-avatar {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.thread-row-main { min-width: 0; }
.thread-row-title {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .2rem;
  line-height: 1.4;
}
.thread-row:hover .thread-row-title { color: var(--primary); }
.thread-row-meta { font-size: .775rem; color: var(--text-dim); }
.thread-row-meta strong { color: var(--text-muted); }

.thread-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  flex-shrink: 0;
}
.thread-row-time { font-size: .75rem; color: var(--text-dim); white-space: nowrap; }
.thread-row-counts { display: flex; gap: .75rem; font-size: .75rem; color: var(--text-dim); }

/* Status badges in thread rows */
.status-icons { display: flex; gap: .2rem; font-size: .8rem; flex-direction: column; align-items: center; }

/* ── Tags ────────────────────────────────────────── */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  border: 1px solid;
  vertical-align: middle;
  margin-left: .3rem;
  letter-spacing: .02em;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .7rem;
  border-radius: 99px;
  font-size: .8rem;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all .12s;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.tag-chip.active { background: var(--primary-dim); color: var(--primary); border-color: rgba(124,92,252,.4); }

.toolbar { margin-bottom: 1rem; }
.tag-filters { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ── Subcats bar ─────────────────────────────────── */
.subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.subcat-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: .85rem;
  transition: all .12s;
  text-decoration: none;
}
.subcat-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.subcat-count { background: var(--bg-4); padding: .1rem .4rem; border-radius: 99px; font-size: .72rem; color: var(--text-dim); }

/* ── Breadcrumb ──────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-dim); opacity: .5; }

/* Page header */
.page-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: .25rem; }
.page-subtitle { color: var(--text-muted); font-size: .875rem; }

/* ── Thread page ─────────────────────────────────── */
.thread-header {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.35rem;
  margin-bottom: .75rem;
}
.thread-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.thread-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.3; }
.thread-header-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.thread-meta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.thread-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.thread-stats { font-size: .78rem; color: var(--text-dim); }

/* ── Posts ───────────────────────────────────────── */
.posts { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }

.post {
  display: grid;
  grid-template-columns: 148px 1fr;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .15s;
}
.post:target { border-color: var(--primary); }
.post--solution { border-color: rgba(52,211,153,.4); }

.post-aside {
  background: var(--bg-3);
  border-right: 1px solid var(--border-soft);
  padding: 1.15rem .85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  text-align: center;
}

.post-avatar {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .25rem;
  border: 2px solid rgba(255,255,255,.06);
}
.post-author a { font-weight: 600; font-size: .875rem; color: var(--text); }
.post-author a:hover { color: var(--primary); }
.post-role {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .15rem .45rem;
  border-radius: 3px;
  margin-top: .1rem;
}
.role-admin    { background: var(--red-dim); color: var(--red); }
.role-moderator{ background: var(--primary-dim); color: var(--primary); }
.role-member   { background: var(--bg-4); color: var(--text-dim); }
.role-badge    { display: inline-flex; padding: .15rem .5rem; border-radius: 3px; font-size: .72rem; font-weight: 600; }
.post-count, .post-joined { font-size: .7rem; color: var(--text-dim); margin-top: .1rem; }

.post-body { padding: 1.15rem 1.2rem; display: flex; flex-direction: column; min-width: 0; }
.solution-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,.25);
  color: var(--green);
  padding: .35rem .8rem;
  border-radius: var(--r-sm);
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .85rem;
  width: fit-content;
}

.post-content { flex: 1; line-height: 1.75; word-wrap: break-word; }
.post-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border-soft); }
.post-time { font-size: .75rem; color: var(--text-dim); }
.post-actions { display: flex; align-items: center; gap: .5rem; }

/* Reactions */
.reactions { display: flex; gap: .25rem; flex-wrap: wrap; }
.react-btn {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  padding: .2rem .55rem;
  font-size: .82rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .12s;
  font-family: var(--font);
}
.react-btn:hover { border-color: var(--primary); background: var(--primary-dim); color: var(--text); }
.react-btn.active { border-color: rgba(124,92,252,.5); background: var(--primary-dim); color: var(--primary); }
.react-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }
.react-count { font-size: .72rem; font-weight: 600; }

/* ── Markdown ─────────────────────────────────────── */
.markdown-body { font-size: .9rem; color: var(--text-2); }
.markdown-body h1,.markdown-body h2,.markdown-body h3 { color: var(--text); letter-spacing: -.03em; margin: 1.25rem 0 .5rem; }
.markdown-body h1 { font-size: 1.3rem; }
.markdown-body h2 { font-size: 1.1rem; }
.markdown-body h3 { font-size: .95rem; }
.markdown-body p { margin-bottom: .75rem; }
.markdown-body ul,.markdown-body ol { margin: .5rem 0 .75rem 1.4rem; }
.markdown-body li { margin-bottom: .2rem; }
.markdown-body code {
  background: var(--bg-4);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: .1rem .35rem;
  font-family: var(--mono);
  font-size: .83em;
  color: #c4b5fd;
}
.markdown-body pre {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  overflow-x: auto;
  margin: .75rem 0;
}
.markdown-body pre code { background: none; border: none; padding: 0; color: var(--text-2); font-size: .85rem; }
.markdown-body blockquote {
  border-left: 3px solid var(--primary);
  padding: .6rem 1rem;
  color: var(--text-muted);
  background: var(--bg-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: .75rem 0;
  font-style: italic;
}
.markdown-body a { color: var(--primary); }
.markdown-body hr { border: none; border-top: 1px solid var(--border-soft); margin: 1rem 0; }
.markdown-body img { max-width: 100%; border-radius: var(--r-sm); }
.markdown-body table { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .875rem; }
.markdown-body th,.markdown-body td { border: 1px solid var(--border); padding: .5rem .75rem; }
.markdown-body th { background: var(--bg-3); font-weight: 600; color: var(--text-2); }
.markdown-body strong { color: var(--text); font-weight: 600; }

/* ── Post images (inline) ────────────────────────── */
.post-images {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
}
.post-image-link {
  display: block;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color .15s;
  max-width: 100%;
}
.post-image-link:hover { border-color: var(--primary); }
.post-image {
  display: block;
  max-width: 520px;
  max-height: 400px;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: var(--bg-3);
}

/* ── Uploads ─────────────────────────────────────── */
.post-uploads { margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border-soft); }
.uploads-label { font-size: .75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.upload-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .4rem .75rem;
  margin: .25rem .3rem 0 0;
  color: var(--text-2);
  font-size: .8rem;
  transition: all .12s;
  text-decoration: none;
}
.upload-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.upload-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .78rem; }
.upload-size { color: var(--text-dim); font-size: .72rem; }

/* ── Editor / Reply ──────────────────────────────── */
.reply-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
}
.reply-title { font-size: .92rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-2); }

.editor-toolbar {
  display: flex;
  gap: .2rem;
  padding: .45rem .6rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  flex-wrap: wrap;
  align-items: center;
}
.editor-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: .25rem .5rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .82rem;
  font-family: var(--font);
  transition: all .1s;
}
.editor-btn:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text-2); }

.editor-textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r) var(--r);
  color: var(--text);
  font-family: var(--mono);
  font-size: .855rem;
  padding: .85rem;
  resize: vertical;
  line-height: 1.65;
  outline: none;
  transition: border-color .15s;
}
.editor-textarea:focus { border-color: var(--primary); }
.editor-preview-area {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  min-height: 120px;
}

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 500; color: var(--text-2); margin-bottom: .4rem; letter-spacing: -.01em; }
.form-hint { color: var(--text-dim); font-weight: 400; font-size: .78rem; }

.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .875rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-input::placeholder { color: var(--text-dim); }
.form-input--sm { width: auto; }

.form-select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .875rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.form-select:focus { border-color: var(--primary); }
.form-select--sm { padding: .28rem .55rem; font-size: .78rem; }

.form-row { display: flex; justify-content: space-between; align-items: center; margin-top: .85rem; flex-wrap: wrap; gap: .75rem; }
.form-actions { display: flex; gap: .5rem; margin-left: auto; }
.form-check { display: flex; align-items: center; gap: .4rem; font-size: .875rem; cursor: pointer; color: var(--text-muted); }

/* Tag checkboxes */
.tag-checkboxes { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-checkbox { display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.tag-checkbox input { display: none; }
.tag-checkbox input:checked + .tag-pill { opacity: 1; box-shadow: 0 0 0 2px currentColor; }
.tag-checkbox .tag-pill { opacity: .45; transition: opacity .15s; }
.tag-checkbox:hover .tag-pill { opacity: .75; }

/* File drop */
.file-drop-zone {
  background: var(--bg-3);
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.file-drop-zone:hover, .file-drop-zone.drag-over { border-color: var(--primary); background: var(--primary-dim); }
.file-drop-inner { display: flex; flex-direction: column; gap: .3rem; align-items: center; pointer-events: none; color: var(--text-muted); font-size: .875rem; }
.file-drop-icon { font-size: 1.75rem; margin-bottom: .25rem; }
.file-drop-hint { font-size: .75rem; color: var(--text-dim); font-family: var(--mono); }
.file-browse-link { color: var(--primary); cursor: pointer; pointer-events: all; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-label { font-size: .8rem; color: var(--text-muted); cursor: pointer; }
.file-input-inline { font-size: .8rem; color: var(--text-muted); margin-left: .4rem; }
.file-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.file-chip {
  display: flex; align-items: center; gap: .4rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: .3rem .6rem; font-size: .78rem;
}
.file-chip-remove { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0 .15rem; font-size: 1rem; line-height: 1; }
.file-chip-remove:hover { color: var(--red); }

/* Image previews */
.img-previews { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.img-preview-wrap {
  position: relative;
  width: 120px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-3);
  flex-shrink: 0;
}
.img-preview-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.img-preview-name {
  padding: .3rem .4rem;
  font-size: .68rem;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-soft);
}
.img-preview-remove {
  position: absolute;
  top: .3rem;
  right: .3rem;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,.65);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .12s;
}
.img-preview-remove:hover { background: var(--red); }

/* ── Auth pages ──────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px - 52px);
  padding: 2rem;
}
.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; color: var(--text); }
.auth-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.04em; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; }
.auth-footer { margin-top: 1.25rem; text-align: center; font-size: .83rem; color: var(--text-muted); }

/* ── Gate page ───────────────────────────────────── */
.gate-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px - 52px);
  padding: 2rem;
}
.gate-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 460px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.gate-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.gate-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.04em; margin-bottom: .6rem; }
.gate-desc { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; line-height: 1.6; }
.gate-actions { display: flex; gap: .75rem; justify-content: center; margin-bottom: 1.5rem; }
.gate-perks { text-align: left; display: flex; flex-direction: column; gap: .5rem; }
.gate-perk { display: flex; align-items: center; gap: .6rem; font-size: .875rem; color: var(--text-muted); }
.gate-perk span { color: var(--green); font-size: .9rem; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  border: 1px solid;
}
.alert-error { background: var(--red-dim); border-color: rgba(248,113,113,.25); color: #fca5a5; }
.alert-success { background: var(--green-dim); border-color: rgba(52,211,153,.25); color: #6ee7b7; }

/* ── Pagination ──────────────────────────────────── */
.pagination { display: flex; gap: .3rem; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.page-btn {
  padding: .38rem .65rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: .8rem;
  text-decoration: none;
  transition: all .12s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Search ──────────────────────────────────────── */
.search-form { margin-bottom: 1.5rem; }
.search-bar { display: flex; gap: .75rem; }
.search-input { flex: 1; }
.search-results-header { font-size: .83rem; color: var(--text-muted); margin-bottom: .75rem; }

/* ── Profile ─────────────────────────────────────── */
.profile-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.profile-avatar {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.08);
}
.profile-name { font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: .4rem; }
.profile-meta { display: flex; align-items: center; gap: .65rem; font-size: .82rem; color: var(--text-muted); flex-wrap: wrap; margin-bottom: .5rem; }
.profile-bio { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* ── Admin ───────────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.admin-stat-card {
  background: var(--bg-2);
  padding: 1.1rem 1.25rem;
}
.admin-stat-num { font-size: 1.75rem; font-weight: 700; color: var(--text); letter-spacing: -.05em; line-height: 1; margin-bottom: .2rem; }
.admin-stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

.admin-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-link-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .7rem 1.1rem;
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  transition: all .12s;
  text-decoration: none;
}
.admin-link-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.admin-table th {
  background: var(--bg-3);
  padding: .6rem .9rem;
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-3); }
.row-banned td { opacity: .55; }

.admin-section { margin-bottom: 1.75rem; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form .form-input { width: auto; }

.tag-admin-list { display: flex; flex-direction: column; gap: .5rem; }
.tag-admin-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.tag-use-count { font-size: .78rem; color: var(--text-dim); margin-left: auto; }
.color-input { width: 38px; height: 34px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-3); cursor: pointer; padding: 2px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-ok     { background: var(--green-dim); color: var(--green); }
.badge-warn   { background: var(--yellow-dim); color: var(--yellow); }
.badge-danger { background: var(--red-dim); color: var(--red); }

.fp-code { font-family: var(--mono); font-size: .75rem; color: var(--text-muted); }

/* ── Tickets ──────────────────────────────────────────── */
.ticket-list { display:flex; flex-direction:column; gap:.5rem; }
.ticket-row {
  display:flex; align-items:center; gap:.75rem;
  padding:.9rem 1rem; background:var(--bg-2); border:1px solid var(--border);
  border-radius:var(--r); text-decoration:none; color:var(--text);
  transition:border-color .15s, background .15s;
}
.ticket-row:hover { border-color:var(--primary); background:var(--bg-3); }
.ticket-status-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.ticket-status-dot.status-open        { background:#34d399; }
.ticket-status-dot.status-in_progress { background:#60a5fa; }
.ticket-status-dot.status-resolved    { background:#a78bfa; }
.ticket-status-dot.status-closed      { background:#4a5468; }
.ticket-row-main { flex:1; min-width:0; }
.ticket-row-title { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ticket-row-meta  { font-size:.78rem; color:var(--text-muted); margin-top:.2rem; }
.ticket-status-badge {
  font-size:.72rem; font-weight:700; padding:.25rem .6rem;
  border-radius:20px; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap;
}
.status-badge-open        { background:rgba(52,211,153,.12);  color:#34d399; }
.status-badge-in_progress { background:rgba(96,165,250,.12);  color:#60a5fa; }
.status-badge-resolved    { background:rgba(167,139,250,.12); color:#a78bfa; }
.status-badge-closed      { background:rgba(74,84,104,.2);    color:#6b7280; }
.ticket-priority { font-size:.72rem; font-weight:600; padding:.2rem .5rem; border-radius:4px; }
.priority-low    { background:rgba(74,84,104,.2);    color:#9ca3af; }
.priority-normal { background:rgba(96,165,250,.1);   color:#60a5fa; }
.priority-high   { background:rgba(248,113,113,.12); color:#f87171; }
.ticket-thread { display:flex; flex-direction:column; gap:.75rem; }
.ticket-msg { border:1px solid var(--border); border-radius:var(--r); padding:1rem 1.25rem; }
.ticket-msg--staff { border-color:var(--primary); background:var(--primary-dim); }
.ticket-msg-header { display:flex; align-items:center; gap:.5rem; font-size:.8rem; color:var(--text-muted); margin-bottom:.5rem; }
.ticket-msg-header strong { color:var(--text); font-size:.9rem; }
.ticket-msg-time { margin-left:auto; }
.ticket-msg-body { color:var(--text-2); white-space:pre-wrap; line-height:1.65; }
.badge-mod { background:rgba(124,92,252,.18); color:#a78bfa; }

/* ── Mod post actions ─────────────────────────────────── */
.mod-post-actions { margin-top:.5rem; }
.mod-panel { display:flex; flex-direction:column; gap:.5rem; margin-top:.5rem; padding:.75rem; background:var(--bg-3); border:1px solid var(--border); border-radius:var(--r-sm); }
.mod-inline-form { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.form-input--xs { padding:.25rem .5rem; font-size:.78rem; border-radius:var(--r-sm); border:1px solid var(--border); background:var(--bg); color:var(--text); flex:1; min-width:120px; }
.form-input--xs:focus { outline:none; border-color:var(--primary); }
.btn-warn { background:rgba(251,191,36,.12); color:var(--yellow); border:1px solid rgba(251,191,36,.25); }
.btn-warn:hover { background:rgba(251,191,36,.2); }

/* Card / form util */
.card { background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r); padding:1.5rem; }
.form-stack { display:flex; flex-direction:column; gap:1rem; }

/* ── Notification bell / header icons ────────────────── */
.header-icon-btn {
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:var(--r-sm); font-size:1rem;
  color:var(--text-muted); text-decoration:none; transition:background .15s, color .15s;
}
.header-icon-btn:hover { background:var(--bg-3); color:var(--text); }
.notif-badge {
  position:absolute; top:-3px; right:-4px;
  background:var(--red); color:#fff; font-size:.6rem; font-weight:700;
  padding:.1rem .3rem; border-radius:10px; min-width:16px; text-align:center;
  line-height:1.4;
}

/* ── Notification list ────────────────────────────────── */
.notif-list { display:flex; flex-direction:column; gap:.35rem; }
.notif-item {
  display:flex; align-items:center; gap:.75rem;
  padding:.75rem 1rem; background:var(--bg-2); border:1px solid var(--border);
  border-radius:var(--r); transition:border-color .15s;
}
.notif-unread { border-color:var(--primary); background:var(--primary-dim); }
.notif-icon { font-size:1.1rem; flex-shrink:0; width:24px; text-align:center; }
.notif-body { flex:1; min-width:0; }
.notif-title { font-size:.875rem; color:var(--text); }
.notif-title a { color:var(--text); text-decoration:none; }
.notif-title a:hover { color:var(--accent); }
.notif-time { font-size:.75rem; color:var(--text-dim); margin-top:.2rem; }
.notif-dot { width:8px; height:8px; border-radius:50%; background:var(--primary); flex-shrink:0; }

/* ── DM thread ────────────────────────────────────────── */
.dm-thread { display:flex; flex-direction:column; gap:.5rem; padding:1rem; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r); min-height:200px; }
.dm-msg { max-width:72%; display:flex; flex-direction:column; gap:.2rem; }
.dm-msg--mine { align-self:flex-end; align-items:flex-end; }
.dm-msg--theirs { align-self:flex-start; align-items:flex-start; }
.dm-content {
  padding:.6rem .9rem; border-radius:12px; font-size:.875rem; line-height:1.55; white-space:pre-wrap; word-break:break-word;
}
.dm-msg--mine .dm-content { background:var(--primary); color:#fff; border-bottom-right-radius:3px; }
.dm-msg--theirs .dm-content { background:var(--bg-3); color:var(--text); border-bottom-left-radius:3px; }
.dm-time { font-size:.7rem; color:var(--text-dim); }

/* ── Leaderboard ─────────────────────────────────────── */
.lb-row { display:flex; align-items:center; gap:.75rem; padding:.5rem 0; border-bottom:1px solid var(--border-soft); }
.lb-row:last-child { border-bottom:none; }
.lb-rank { width:1.5rem; text-align:center; font-size:.8rem; color:var(--text-dim); font-weight:700; flex-shrink:0; }
.lb-name { flex:1; color:var(--text); text-decoration:none; font-weight:500; }
.lb-name:hover { color:var(--accent); }
.lb-score { font-size:.8rem; color:var(--text-muted); white-space:nowrap; }

/* ── Online dot / profile avatar img ─────────────────── */
.online-dot {
  position:absolute; bottom:2px; right:2px;
  width:12px; height:12px; border-radius:50%; background:var(--green);
  border:2px solid var(--bg-2);
}
.profile-avatar-img {
  width:72px; height:72px; border-radius:50%; object-fit:cover;
  border:2px solid var(--border);
}

/* ── Post edit area ───────────────────────────────────── */
.post-edit-textarea { width:100%; resize:vertical; margin-top:.5rem; }
.alert-success { background:rgba(52,211,153,.1); border:1px solid rgba(52,211,153,.3); color:var(--green); padding:.75rem 1rem; border-radius:var(--r-sm); }
.sidebar-link--locked { opacity:.5; pointer-events:none; cursor:default; }
.sidebar-lock { margin-left:auto; font-size:.7rem; opacity:.6; }

/* ── Notices ─────────────────────────────────────── */
.locked-notice, .login-notice, .empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: .875rem;
  line-height: 1.6;
}

/* New thread form */
.new-thread-form { max-width: 860px; }

/* ── Guest banner ────────────────────────────────── */
.guest-banner {
  background: linear-gradient(90deg, rgba(124,92,252,.12) 0%, rgba(124,92,252,.06) 100%);
  border-bottom: 1px solid rgba(124,92,252,.2);
  padding: .6rem 0;
}
.guest-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.guest-banner-text {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.guest-banner-icon { font-size: 1rem; }
.guest-banner-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ── VIP sidebar styles ───────────────────────────── */
.vip-section-label { color: #fbbf24 !important; }
.vip-link { color: #fbbf24 !important; }
.vip-link:hover { background: rgba(251,191,36,.08) !important; color: #fde68a !important; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border-soft);
  padding: 1rem 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .775rem;
  color: var(--text-dim);
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 860px) {
  .site-body { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; display: none; }
  .thread-row { grid-template-columns: 2rem 1fr; }
  .thread-row-right { display: none; }
  .post { grid-template-columns: 1fr; }
  .post-aside { flex-direction: row; padding: .75rem 1rem; border-right: none; border-bottom: 1px solid var(--border-soft); gap: .75rem; }
  .post-count, .post-joined { display: none; }
  .hero { padding: 1.5rem 1.25rem; }
  .hero-title { font-size: 1.5rem; }
  .cat-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .stats-bar { grid-template-columns: 1fr; }
}

/* ── Trust level badges ─────────────────────────────────────── */
.trust-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 600; padding: .15rem .45rem;
  border-radius: 20px; margin-top: .25rem; border: 1px solid;
}
.trust-new     { color: #94a3b8; border-color: #94a3b840; background: #94a3b810; }
.trust-member  { color: #60a5fa; border-color: #60a5fa40; background: #60a5fa10; }
.trust-regular { color: #34d399; border-color: #34d39940; background: #34d39910; }
.trust-veteran { color: #fb923c; border-color: #fb923c40; background: #fb923c10; }
.trust-legend  { color: #fbbf24; border-color: #fbbf2440; background: #fbbf2410; }

/* ── Thread prefix badges ───────────────────────────────────── */
.prefix-badge {
  display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .04em;
  padding: .12rem .4rem; border-radius: 4px; margin-right: .35rem; vertical-align: middle;
  text-transform: uppercase;
}
.prefix-solved     { background: #34d39920; color: #34d399; border: 1px solid #34d39940; }
.prefix-question   { background: #60a5fa20; color: #60a5fa; border: 1px solid #60a5fa40; }
.prefix-help       { background: #f8717120; color: #f87171; border: 1px solid #f8717140; }
.prefix-guide      { background: #a78bfa20; color: #a78bfa; border: 1px solid #a78bfa40; }
.prefix-release    { background: #fbbf2420; color: #fbbf24; border: 1px solid #fbbf2440; }
.prefix-wip        { background: #fb923c20; color: #fb923c; border: 1px solid #fb923c40; }
.prefix-discussion { background: #9ca3af20; color: #9ca3af; border: 1px solid #9ca3af40; }

/* ── Announcement banner ────────────────────────────────────── */
.announcement-banner {
  display: flex; align-items: center; gap: .75rem;
  background: linear-gradient(135deg, #6366f115, #7c5cfc10);
  border: 1px solid #7c5cfc40; border-radius: var(--r);
  padding: .75rem 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.announce-icon { font-size: 1.1rem; }
.announce-text { flex: 1; color: var(--text); font-size: .92rem; }
.announce-link { color: var(--primary); font-size: .85rem; text-decoration: none; white-space: nowrap; }
.announce-link:hover { text-decoration: underline; }
.announce-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1rem; padding: 0 .25rem; line-height: 1; margin-left: auto;
}
.announce-close:hover { color: var(--text); }

/* ── Poll ───────────────────────────────────────────────────── */
.poll-box {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 1.25rem; margin-bottom: 1.5rem;
}
.poll-question { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 1rem; }
.poll-option { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; margin-bottom: .4rem; border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--border-soft); background: var(--bg-2); }
.poll-option:hover { border-color: var(--primary); }
.poll-vote-btn { margin-top: .75rem; }
.poll-bar-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.poll-bar-label { font-size: .85rem; color: var(--text-2); }
.poll-bar-label.poll-voted { color: var(--primary); font-weight: 600; }
.poll-bar-track { background: var(--bg-4); border-radius: 4px; height: 8px; overflow: hidden; }
.poll-bar-fill { background: var(--primary); height: 100%; border-radius: 4px; transition: width .4s; }
.poll-bar-pct { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.poll-total { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }
.poll-login-hint { font-size: .85rem; color: var(--text-muted); }

/* ── Profile badges ─────────────────────────────────────────── */
.badge-list { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }
.profile-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--bg-3); border: 1px solid; border-radius: var(--r-sm);
  padding: .4rem .75rem; font-size: .82rem;
}
.profile-badge-icon { font-size: 1.1rem; }
.profile-badge-name { color: var(--text-2); font-weight: 500; }

/* ── Chart container ────────────────────────────────────────── */
.chart-container {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 1.25rem; margin-bottom: 2rem;
}

/* ── Changelog ──────────────────────────────────────────────── */
.changelog-list { display: flex; flex-direction: column; gap: 1rem; }
.changelog-entry {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.changelog-entry-header { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.changelog-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; padding: .15rem .5rem; border-radius: 4px; }
.changelog-type--feature    { background: #6366f120; color: #818cf8; }
.changelog-type--fix        { background: #f8717120; color: #f87171; }
.changelog-type--improvement{ background: #34d39920; color: #34d399; }
.changelog-type--security   { background: #fbbf2420; color: #fbbf24; }
.changelog-type--breaking   { background: #fb923c20; color: #fb923c; }
.changelog-version { font-size: .75rem; color: var(--text-muted); background: var(--bg-4); padding: .1rem .4rem; border-radius: 4px; }
.changelog-date { font-size: .78rem; color: var(--text-muted); }
.changelog-title { font-size: .98rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.changelog-body { font-size: .85rem; color: var(--text-2); white-space: pre-wrap; }

/* ── Search advanced filters ────────────────────────────────── */
.search-filters { margin-top: .75rem; }
.search-filters-toggle { cursor: pointer; color: var(--text-muted); font-size: .85rem; padding: .35rem 0; user-select: none; }
.search-filters-toggle:hover { color: var(--text); }
.search-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: .75rem; margin-top: .75rem; }

/* ── Admin word filter table ────────────────────────────────── */
.admin-form { margin-bottom: 1.5rem; }

/* ── Status chips (admin users table) ──────────────────────── */
.status-chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: .18rem .5rem; border-radius: 20px; white-space: nowrap; }
.status-ok      { background: #34d39918; color: #34d399; border: 1px solid #34d39935; }
.status-pending { background: #fbbf2418; color: #fbbf24; border: 1px solid #fbbf2435; }
.status-banned  { background: #f8717118; color: #f87171; border: 1px solid #f8717135; }
.status-muted   { background: #fb923c18; color: #fb923c; border: 1px solid #fb923c35; }
.status-new     { background: #60a5fa18; color: #60a5fa; border: 1px solid #60a5fa35; }
.admin-users-table td { vertical-align: top; padding: .65rem .75rem; }

/* ── Landing page ───────────────────────────────────────────── */
.lp-main { padding-top: 0 !important; }

.lp-hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 1.75rem; border: 1px solid var(--border);
  background: var(--bg-2);
}
.lp-hero-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse, rgba(124,92,252,.28) 0%, transparent 70%);
  filter: blur(40px);
}
.lp-hero-inner {
  position: relative; z-index: 1; text-align: center;
  padding: 3rem 2rem 2.5rem;
}
.lp-hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: rgba(124,92,252,.12); border: 1px solid rgba(124,92,252,.25);
  padding: .3rem .85rem; border-radius: 20px; margin-bottom: 1.25rem;
}
.lp-hero-title {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; color: var(--text);
  margin: 0 0 .75rem; letter-spacing: -.03em; line-height: 1.1;
  background: linear-gradient(135deg, #fff 30%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.lp-hero-desc {
  font-size: 1rem; color: var(--text-2); max-width: 480px;
  margin: 0 auto 1.75rem; line-height: 1.65;
}
.lp-hero-btns { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.lp-btn-join { padding: .65rem 1.75rem; font-size: .95rem; font-weight: 700; }
.btn-outline {
  padding: .65rem 1.75rem; font-size: .95rem; font-weight: 600;
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  border-radius: var(--r-sm); text-decoration: none; display: inline-flex;
  align-items: center; transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.lp-stats-row {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 0; border-top: 1px solid var(--border);
  background: rgba(0,0,0,.2);
}
.lp-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: .9rem 2rem; gap: .1rem;
}
.lp-stat-n { font-size: 1.35rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.lp-stat-l { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }
.lp-online { color: var(--green) !important; }
.lp-stat-sep { width: 1px; height: 2.5rem; background: var(--border); }

/* Body grid */
.lp-body { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.25rem; }
@media (max-width: 860px) { .lp-body { grid-template-columns: 1fr; } }

/* Panel headers */
.lp-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.lp-panel-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.lp-panel-link { font-size: .8rem; color: var(--primary); text-decoration: none; }
.lp-panel-link:hover { text-decoration: underline; }

/* Categories */
.lp-cats { display: flex; flex-direction: column; gap: .45rem; }
.lp-cat {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.lp-cat:hover { border-color: rgba(124,92,252,.5); transform: translateY(-1px); }
.lp-cat-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; text-decoration: none;
}
.lp-cat-icon { font-size: 1.5rem; flex-shrink: 0; }
.lp-cat-text { flex: 1; min-width: 0; }
.lp-cat-name { display: block; font-weight: 600; color: var(--text); font-size: .9rem; }
.lp-cat-desc { display: block; font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .05rem; }
.lp-cat-chevron { color: var(--text-dim); font-size: 1.2rem; flex-shrink: 0; }
.lp-cat-subs {
  display: flex; flex-wrap: wrap; gap: .3rem;
  padding: .45rem .9rem .55rem 3.25rem;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-3);
}
.lp-cat-sub-chip {
  font-size: .72rem; color: var(--text-2); background: var(--bg-4);
  padding: .18rem .5rem; border-radius: 20px; text-decoration: none;
  border: 1px solid var(--border-soft); white-space: nowrap;
  transition: color .1s, background .1s;
}
.lp-cat-sub-chip:hover { color: var(--text); background: var(--bg-hover); border-color: var(--border); }

/* Thread list */
.lp-threads { display: flex; flex-direction: column; gap: .35rem; }
.lp-thread {
  display: grid; grid-template-columns: 32px 1fr auto;
  align-items: center; gap: .75rem;
  padding: .7rem .9rem; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.lp-thread:hover { border-color: rgba(124,92,252,.5); background: var(--bg-3); transform: translateX(2px); }
.lp-thread-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-dim); color: var(--accent);
  font-weight: 700; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lp-thread-body { min-width: 0; }
.lp-thread-title {
  font-size: .875rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-thread-meta { font-size: .73rem; color: var(--text-muted); display: flex; gap: .4rem; margin-top: .15rem; align-items: center; }
.lp-thread-cat-chip {
  background: var(--bg-4); color: var(--text-2);
  padding: .05rem .4rem; border-radius: 3px; font-size: .7rem;
}
.lp-thread-right { text-align: right; flex-shrink: 0; }
.lp-thread-time { display: block; font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.lp-thread-replies { display: block; font-size: .72rem; color: var(--text-dim); margin-top: .1rem; }

/* CTA block */
.lp-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: .75rem; padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, rgba(124,92,252,.1), rgba(124,92,252,.04));
  border: 1px solid rgba(124,92,252,.25); border-radius: var(--r); flex-wrap: wrap;
}
.lp-cta-left { display: flex; flex-direction: column; gap: .2rem; }
.lp-cta-title { font-weight: 700; color: var(--text); font-size: .92rem; }
.lp-cta-sub { font-size: .78rem; color: var(--text-2); }

/* ── Mobile nav hamburger ───────────────────────────────────── */
.hamburger {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: none; cursor: pointer; padding: .4rem; z-index: 1001;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1001; }
.mobile-nav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw;
  background: var(--bg-2); border-right: 1px solid var(--border);
  z-index: 1002; display: flex; flex-direction: column; overflow-y: auto;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.mobile-nav.hidden { display: none !important; }
.mobile-nav-overlay.hidden { display: none !important; }
.mobile-nav-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.mobile-nav-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }
.mobile-nav-links { display: flex; flex-direction: column; padding: .75rem; gap: .2rem; }
.mobile-nav-links a { color: var(--text-2); text-decoration: none; padding: .6rem .75rem; border-radius: var(--r-sm); font-size: .9rem; }
.mobile-nav-links a:hover { background: var(--bg-hover); color: var(--text); }

@media (max-width: 700px) {
  .hamburger { display: flex; }
  .header-nav { display: none; }
}

/* ── Invite admin ───────────────────────────────────────────── */
.invite-code { font-size: .72rem; background: var(--bg-4); padding: .2rem .5rem; border-radius: 4px; word-break: break-all; }
.form-row-inline { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1.5rem; }
.row-dim { opacity: .5; }

/* ── Site settings form ─────────────────────────────────────── */
.settings-form { max-width: 700px; }
.settings-section { margin-bottom: 2rem; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r); padding: 1.25rem; }
.settings-section-title { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 1rem; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }
.color-picker { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-4); cursor: pointer; }

.toggle-label { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg-4); border: 1px solid var(--border); border-radius: 24px; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--text-muted); border-radius: 50%; transition: .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

.settings-preview { background: var(--bg-2); border: 1px dashed var(--border); border-radius: var(--r); padding: 1.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.settings-preview-logo { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.settings-preview-tagline { color: var(--text-2); font-size: .9rem; margin: 0; }
