/* ═══════════════════════════════════════════════════════════════════════════
   CyberForum — Main Stylesheet
   Dark terminal aesthetic inspired by XSS.is / Exploit.in
   Palette: #0d0d0d bg · #00ff88 accent · #ff4444 danger
   Fonts: JetBrains Mono (code) · IBM Plex Sans (text)
═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ────────────────────────────────────────────── */
:root {
  --bg: #0d0d0d;
  --bg-2: #141414;
  --bg-3: #1a1a1a;
  --bg-4: #222222;
  --border: #2a2a2a;
  --border-2: #333333;
  --text: #e0e0e0;
  --text-muted: #666666;
  --text-dim: #444444;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --accent-bg: rgba(0, 255, 136, 0.08);
  --danger: #ff4444;
  --danger-dim: #cc3333;
  --danger-bg: rgba(255, 68, 68, 0.08);
  --warn: #ffaa00;
  --warn-bg: rgba(255, 170, 0, 0.08);
  --success: #00ff88;
  --info: #4488ff;
  --info-bg: rgba(68, 136, 255, 0.08);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --transition: 0.15s ease;
}

/* Light theme overrides */
.light {
  --bg: #f5f5f5;
  --bg-2: #ffffff;
  --bg-3: #f0f0f0;
  --bg-4: #e8e8e8;
  --border: #dddddd;
  --border-2: #cccccc;
  --text: #1a1a1a;
  --text-muted: #666666;
  --text-dim: #999999;
  --accent: #007744;
  --accent-dim: #005533;
  --accent-bg: rgba(0, 119, 68, 0.08);
}

/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dim); text-decoration: underline; }

code, pre, .mono { font-family: var(--font-mono); }

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

/* ─── Typography ───────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }
.time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
}
.page-narrow { max-width: 720px; }
.main-content { flex: 1; }
.page-title { font-size: 1.5rem; font-family: var(--font-mono); color: var(--text); margin-bottom: 16px; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; margin-bottom: 16px; }

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 54px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-mono);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg-3); text-decoration: none; }
.nav-link.active { color: var(--accent); }
.mod-link { color: var(--warn) !important; }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #000; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dim); }
.btn-success { background: #00aa55; color: #fff; border-color: #00aa55; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 24px; font-size: 0.9rem; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-xs { padding: 3px 8px; font-size: 0.7rem; }
.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--bg-3); }

/* ─── Icons ─────────────────────────────────────────────────────────────── */
.icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: middle; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 40px; height: 40px; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 9px 12px;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.form-input::placeholder { color: var(--text-dim); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form-card, .settings-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.form-title { font-size: 1.2rem; font-family: var(--font-mono); margin-bottom: 20px; }
.input-wrapper { position: relative; }
.input-icon { width: 16px; height: 16px; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.with-icon { padding-left: 34px; }
.input-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); }
.form-input-inline { width: 140px; padding: 3px 8px; font-size: 0.75rem; }

textarea.form-input { resize: vertical; min-height: 80px; }

/* ─── Editor ─────────────────────────────────────────────────────────────── */
.editor-tabs { display: flex; gap: 2px; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 5px 14px; font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-muted); border-radius: var(--radius) var(--radius) 0 0;
  transition: all var(--transition);
}
.tab-btn.active, .tab-btn:hover { color: var(--accent); background: var(--accent-bg); }
.editor-input { min-height: 200px; }
.editor-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; }
.preview-pane { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-height: 80px; }
.rules-reminder {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--info-bg); border: 1px solid rgba(68,136,255,0.2);
  border-radius: var(--radius); padding: 10px 12px;
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px;
}

/* ─── Password Strength ──────────────────────────────────────────────────── */
.password-strength { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.strength-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.strength-fill.weak { background: var(--danger); }
.strength-fill.medium { background: var(--warn); }
.strength-fill.strong { background: var(--success); }
.strength-label { font-size: 0.75rem; font-family: var(--font-mono); min-width: 50px; color: var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; font-size: 0.65rem; font-family: var(--font-mono);
  font-weight: 700; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-lg { padding: 4px 10px; font-size: 0.75rem; }
.badge-premium { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; }
.badge-mod { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.badge-verified { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-success { background: var(--accent-bg); color: var(--accent); }

/* ─── Rank Badges ────────────────────────────────────────────────────────── */
.rank-badge {
  display: inline-block; padding: 1px 6px;
  font-size: 0.65rem; font-family: var(--font-mono); font-weight: 700;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em;
}
.rank-lg { padding: 3px 10px; font-size: 0.75rem; }
.rank-newbie { background: #222; color: #888; border: 1px solid #333; }
.rank-user { background: #1a2a1a; color: #44aa44; border: 1px solid #2a3a2a; }
.rank-veteran { background: #1a1a2a; color: #4488ff; border: 1px solid #2a2a3a; }
.rank-expert { background: #2a1a2a; color: #cc44ff; border: 1px solid #3a2a3a; }
.rank-elder { background: #2a1a00; color: var(--warn); border: 1px solid #3a2a00; }
.rank-moderator { background: #1a1a00; color: var(--warn); border: 1px solid var(--warn); }
.rank-admin { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }

/* ─── Alerts / Flashes ───────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 0.875rem; display: flex; align-items: center; gap: 8px;
}
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: var(--accent-bg); border: 1px solid var(--accent); color: var(--accent); }
.flash {
  position: fixed; top: 64px; right: 16px; z-index: 200;
  background: var(--bg-3); border: 1px solid var(--accent);
  color: var(--accent); padding: 10px 16px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg); font-family: var(--font-mono); font-size: 0.85rem;
}

/* ─── Hero Banner ────────────────────────────────────────────────────────── */
.hero-banner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin-bottom: 24px;
  text-align: center;
}
.hero-terminal {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.prompt { color: var(--accent); }
.cmd { color: var(--text-muted); }
.hero-sub { color: var(--text-muted); font-size: 0.9rem; letter-spacing: 0.05em; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── Stats Bar ──────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.stat {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px;
  font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono);
}

/* ─── Sections Grid ──────────────────────────────────────────────────────── */
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.section-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  gap: 14px;
  transition: border-color var(--transition), background var(--transition);
}
.section-card:hover { border-color: var(--border-2); background: var(--bg-3); }
.section-icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.section-body { flex: 1; min-width: 0; }
.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.section-title { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600; color: var(--text); }
.section-title:hover { color: var(--accent); text-decoration: none; }
.section-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.section-stats { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); }
.section-stats span { display: flex; align-items: center; gap: 4px; }

/* ─── Section Header ─────────────────────────────────────────────────────── */
.section-header-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}

/* ─── Thread List ────────────────────────────────────────────────────────── */
.thread-list {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.thread-list-header {
  display: grid;
  grid-template-columns: 1fr 80px 80px 120px;
  gap: 8px; padding: 10px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim);
}
.thread-row {
  display: grid;
  grid-template-columns: 24px 1fr 80px 80px 120px;
  gap: 8px; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: var(--bg-3); }
.thread-row.pinned { background: var(--accent-bg); }
.thread-info { min-width: 0; }
.thread-title {
  display: block; font-weight: 500; color: var(--text);
  font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.thread-title:hover { color: var(--accent); text-decoration: none; }
.thread-meta { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; flex-wrap: wrap; }
.thread-replies, .thread-views, .thread-last {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); text-align: center;
}
.thread-status { display: flex; align-items: center; justify-content: center; }
.author-link { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem; }
.author-link:hover { color: var(--accent); }

/* ─── Thread View ────────────────────────────────────────────────────────── */
.thread-title-bar {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 12px;
}
.thread-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.thread-meta-bar { display: flex; align-items: center; gap: 16px; font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ─── Posts ──────────────────────────────────────────────────────────────── */
.posts-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.post-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.post-op { border-color: var(--border-2); }
.post-author {
  background: var(--bg-3);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.author-name {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.author-name:hover { color: var(--accent); }
.author-emoji { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.author-stats { font-size: 0.72rem; color: var(--text-muted); }
.post-body { padding: 16px; display: flex; flex-direction: column; min-width: 0; }
.post-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.post-link { font-family: var(--font-mono); font-size: 0.75rem; }
.post-content { flex: 1; word-break: break-word; font-size: 0.875rem; line-height: 1.7; }
.post-footer { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ─── Post Content (Markdown) ────────────────────────────────────────────── */
.post-content h1, .post-content h2, .post-content h3 {
  font-family: var(--font-mono); margin: 16px 0 8px; color: var(--text);
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
.post-content h1 { font-size: 1.3rem; }
.post-content h2 { font-size: 1.1rem; }
.post-content h3 { font-size: 0.95rem; }
.post-content p { margin-bottom: 10px; }
.post-content code {
  font-family: var(--font-mono); font-size: 0.82em;
  background: var(--bg-3); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 3px; color: var(--accent);
}
.post-content pre {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; overflow-x: auto;
  margin: 12px 0; font-size: 0.82rem; line-height: 1.5;
}
.post-content pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.post-content blockquote {
  border-left: 3px solid var(--accent); padding-left: 12px;
  color: var(--text-muted); margin: 12px 0; font-style: italic;
}
.post-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.85rem; }
.post-content th, .post-content td { padding: 8px 12px; border: 1px solid var(--border); }
.post-content th { background: var(--bg-3); font-family: var(--font-mono); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.post-content a { color: var(--accent); }
.post-content ul, .post-content ol { padding-left: 20px; margin-bottom: 10px; }
.post-content li { margin-bottom: 4px; }

/* Syntax highlight (Pygments monokai style override) */
.highlight { background: var(--bg-3) !important; }
.highlight .k, .highlight .kd { color: #ff79c6; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #f1fa8c; }
.highlight .c, .highlight .c1 { color: var(--text-dim); font-style: italic; }
.highlight .n { color: var(--text); }
.highlight .o { color: #ff79c6; }
.highlight .mi, .highlight .mf { color: #bd93f9; }
.highlight .nf { color: var(--accent); }
.highlight .nb { color: #8be9fd; }

/* ─── Vote Buttons ────────────────────────────────────────────────────────── */
.vote-row { display: flex; align-items: center; gap: 4px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 8px;
  font-family: var(--font-mono); font-size: 0.75rem;
  cursor: pointer; transition: all var(--transition); color: var(--text-muted);
}
.vote-btn:hover { border-color: var(--border-2); color: var(--text); }
.vote-btn.upvote.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.vote-btn.downvote.active { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.vote-display { display: flex; gap: 8px; font-family: var(--font-mono); font-size: 0.75rem; }

/* ─── Reply Form ──────────────────────────────────────────────────────────── */
.reply-form-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-top: 16px;
}
.locked-notice, .login-notice {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 0.875rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  padding: 6px 12px; font-family: var(--font-mono); font-size: 0.8rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted);
  transition: all var(--transition); text-decoration: none;
}
.page-btn:hover { background: var(--bg-3); color: var(--text); text-decoration: none; }
.page-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ─── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-family: var(--font-mono);
  color: var(--text-muted); margin-bottom: 16px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.sep { color: var(--text-dim); }

/* ─── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-container {
  display: flex; justify-content: center; align-items: flex-start;
  min-height: calc(100vh - 100px); padding: 40px 16px;
}
.auth-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.auth-card-wide { max-width: 720px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-title { font-size: 1.4rem; font-family: var(--font-mono); margin: 12px 0 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.85rem; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 8px; justify-content: center; }
.terms-notice { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

/* ─── TOTP ─────────────────────────────────────────────────────────────────── */
.totp-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.qr-container {
  background: #0d0d0d; border: 2px solid var(--accent);
  border-radius: var(--radius-lg); padding: 12px;
  display: flex; justify-content: center;
}
.qr-code { max-width: 180px; image-rendering: pixelated; }
.manual-key { margin-top: 10px; font-size: 0.8rem; cursor: pointer; }
.totp-secret {
  display: block; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent);
  word-break: break-all; margin-top: 6px;
}
.totp-input { font-size: 1.2rem !important; text-align: center; letter-spacing: 0.3em; }
.totp-countdown { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); }
.countdown-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.countdown-fill { height: 100%; background: var(--accent); transition: width 1s linear; }
.steps { padding-left: 20px; font-size: 0.875rem; line-height: 1.8; color: var(--text-muted); }
.steps li { margin-bottom: 6px; }

/* ─── Profile ──────────────────────────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.profile-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; text-align: center;
  position: sticky; top: 70px;
}
.profile-avatar { font-size: 3rem; margin-bottom: 8px; }
.profile-username { font-family: var(--font-mono); font-size: 1rem; margin: 8px 0; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 16px; }
.profile-stats { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.stat-item { text-align: center; }
.stat-value { display: block; font-size: 1.2rem; font-family: var(--font-mono); font-weight: 700; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.profile-bio { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.profile-meta { font-size: 0.75rem; font-family: var(--font-mono); display: flex; flex-direction: column; gap: 2px; }
.ban-notice {
  margin-top: 12px; padding: 6px 10px; background: var(--danger-bg);
  border: 1px solid var(--danger); border-radius: var(--radius);
  font-size: 0.75rem; color: var(--danger); display: flex; align-items: center; gap: 4px;
}
.mini-post {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px;
}
.mini-post-preview { font-size: 0.82rem; font-family: var(--font-mono); color: var(--text-muted); display: block; white-space: pre-wrap; }
.profile-section { margin-bottom: 24px; }

/* ─── Settings ──────────────────────────────────────────────────────────────── */
.settings-section-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.9rem; margin-bottom: 16px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.settings-label { font-weight: 500; margin-bottom: 2px; }
.settings-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Subscription Plans ───────────────────────────────────────────────────── */
.subscription-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; text-align: center;
}
.plan-featured { border-color: var(--accent); background: var(--accent-bg); }
.plan-name { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 4px; }
.plan-price { font-size: 1.6rem; font-family: var(--font-mono); font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.plan-price span { font-size: 0.75rem; color: var(--text-muted); }
.plan-features { list-style: none; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.8; }
.plan-features li::before { content: "✓ "; color: var(--accent); }

/* ─── Nav Badge (unread count dot) ──────────────────────────────────────── */
.nav-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 0.6rem; font-family: var(--font-mono); font-weight: 700;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; pointer-events: none;
}

/* ─── Notifications ────────────────────────────────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); min-width: 220px;
  box-shadow: var(--shadow-lg); z-index: 50;
}
.notif-header { padding: 10px 14px; font-size: 0.75rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.notif-link { display: block; padding: 10px 14px; font-size: 0.82rem; color: var(--accent); text-decoration: none; text-align: center; }
.notif-list { display: flex; flex-direction: column; gap: 2px; }
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; transition: background var(--transition);
}
.notif-item.unread { background: var(--bg-3); border-color: var(--border-2); }
.notif-icon { color: var(--accent); flex-shrink: 0; }
.notif-text { font-size: 0.875rem; margin-bottom: 2px; }
.notif-time { font-size: 0.75rem; font-family: var(--font-mono); }

/* ─── User Dropdown ────────────────────────────────────────────────────────── */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 10px; cursor: pointer;
  transition: all var(--transition); color: var(--text);
}
.user-btn:hover { background: var(--bg-3); border-color: var(--border-2); }
.user-emoji { font-size: 1rem; }
.username { font-family: var(--font-mono); font-size: 0.8rem; }
.dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); min-width: 160px;
  box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden;
}
.dropdown-item {
  display: block; padding: 9px 16px;
  font-size: 0.82rem; color: var(--text); text-decoration: none;
  transition: background var(--transition); cursor: pointer;
  background: none; border: none; width: 100%; text-align: left; font-family: var(--font-sans);
}
.dropdown-item:hover { background: var(--bg-3); text-decoration: none; color: var(--text); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ─── Admin ────────────────────────────────────────────────────────────────── */
.admin-nav { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.admin-nav-link { padding: 6px 14px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); border-radius: var(--radius); text-decoration: none; transition: all var(--transition); }
.admin-nav-link:hover, .admin-nav-link.active { background: var(--bg-3); color: var(--text); text-decoration: none; }
.admin-stats { display: flex; gap: 12px; margin-bottom: 24px; }
.admin-stat {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 24px;
}
.admin-stat.danger { border-color: var(--danger); background: var(--danger-bg); }
.stat-num { display: block; font-size: 2rem; font-family: var(--font-mono); font-weight: 700; color: var(--danger); }
.stat-name { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }
.flagged-item {
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-lg); padding: 14px 18px;
  margin-bottom: 8px; display: flex; gap: 16px; align-items: flex-start;
}
.flagged-content { flex: 1; min-width: 0; }
.flagged-text { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); white-space: pre-wrap; max-height: 100px; overflow: hidden; margin: 6px 0; }
.flagged-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.flagged-meta { display: flex; gap: 12px; font-size: 0.8rem; flex-wrap: wrap; margin-bottom: 6px; }
.flagged-preview { margin-top: 16px; }
.modlog-table { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.modlog-header, .modlog-row {
  display: grid; grid-template-columns: 100px 80px 100px 120px 1fr;
  gap: 8px; padding: 10px 14px; font-size: 0.8rem;
}
.modlog-header { background: var(--bg-3); border-bottom: 1px solid var(--border); font-family: var(--font-mono); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--text-dim); }
.modlog-row { border-bottom: 1px solid var(--border); }
.modlog-row:last-child { border-bottom: none; }

/* ─── Thread tags ────────────────────────────────────────────────────────────── */
.thread-tag {
  display: inline-block; padding: 1px 6px;
  font-size: 0.6rem; font-family: var(--font-mono); font-weight: 700;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent);
  white-space: nowrap;
}
.tag-filter {
  display: inline-block; padding: 3px 10px;
  font-size: 0.75rem; font-family: var(--font-mono); font-weight: 600;
  border-radius: var(--radius); text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-muted);
  transition: all var(--transition);
}
.tag-filter:hover, .tag-filter.active {
  background: var(--accent-bg); border-color: var(--accent); color: var(--accent);
  text-decoration: none;
}

/* ─── Admin table ────────────────────────────────────────────────────────────── */
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table thead tr { background: var(--bg-3); }
.admin-table th { padding: 10px 12px; text-align: left; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-3); }
.admin-table tbody tr.row-danger { background: var(--danger-bg); }
.admin-table tbody tr.row-danger:hover { background: color-mix(in srgb, var(--danger-bg) 80%, var(--bg-3)); }

/* ─── Search ────────────────────────────────────────────────────────────────── */
.search-form { margin-bottom: 20px; }
.search-input-row { display: flex; gap: 8px; align-items: center; position: relative; }
.search-icon { width: 18px; height: 18px; position: absolute; left: 12px; color: var(--text-dim); pointer-events: none; }
.search-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-mono); font-size: 0.9rem;
  padding: 10px 12px 10px 36px; outline: none; transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); }
.search-meta { margin-bottom: 12px; font-size: 0.85rem; font-family: var(--font-mono); }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-result {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.result-link { display: block; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }
.result-link:hover { color: var(--accent); }
.result-meta { font-size: 0.75rem; }

/* ─── Error Pages ───────────────────────────────────────────────────────────── */
.error-page {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 50vh; text-align: center; padding: 40px;
}
.error-terminal { font-family: var(--font-mono); font-size: 0.9rem; margin-bottom: 16px; color: var(--text-muted); }
.error-output { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 40px; }
.error-code { display: block; font-size: 5rem; font-family: var(--font-mono); font-weight: 900; line-height: 1; margin-bottom: 12px; }
.error-output p { color: var(--text-muted); margin-bottom: 20px; }

/* ─── Empty States ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px; text-align: center; gap: 12px; color: var(--text-muted);
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 16px; margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; font-size: 0.78rem;
}
.footer-brand { font-family: var(--font-mono); font-weight: 700; color: var(--accent); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); }
.footer-tagline { color: var(--text-dim); font-style: italic; font-family: var(--font-mono); }

/* ─── Mod Actions ───────────────────────────────────────────────────────────── */
.mod-actions { position: relative; }
.post-actions { margin-left: auto; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .thread-list-header { grid-template-columns: 1fr 60px 80px; }
  .thread-row { grid-template-columns: 24px 1fr 60px 80px; }
  .thread-last { display: none; }
  .thread-list-header .col-last { display: none; }
  .post-card { grid-template-columns: 1fr; }
  .post-author { flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 14px; gap: 10px; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .totp-setup-grid { grid-template-columns: 1fr; }
  .subscription-plans { grid-template-columns: 1fr; }
  .modlog-header, .modlog-row { grid-template-columns: 80px 70px 80px 1fr; }
  .modlog-row span:nth-child(4) { display: none; }
  .sections-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .auth-card { padding: 24px 16px; }
}

@media (max-width: 480px) {
  .nav-links { display: none; }
  .thread-row { grid-template-columns: 24px 1fr; }
  .thread-replies, .thread-views { display: none; }
}
