/* ==========================================
   GROUNDPOST — MAIN STYLESHEET
   Dark mode default, electric green accent
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;600;700&display=swap');

:root {
  --bg-primary:     #080808;
  --bg-secondary:   #111111;
  --bg-tertiary:    #1c1c1c;
  --bg-input:       #1a1a1a;
  --border:         #2a2a2a;
  --text-primary:   #ededed;
  --text-secondary: #909090;
  --text-muted:     #525252;
  --accent:         #39FF14;
  --accent-dim:     #2bcc10;
  --accent-glow:    rgba(57, 255, 20, 0.12);
  --upvote:         #39FF14;
  --downvote:       #ff4444;
  --link:           #5aabff;
  --link-hover:     #7dc3ff;
  --danger:         #ff4444;
  --warning:        #ffaa00;
  --success:        #39FF14;
  --mod-badge:      #00bcd4;
  --admin-badge:    #ff6600;
  --code-bg:        #161616;
  --nav-height:     56px;
  --radius-sm:      5px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --shadow-card:    0 1px 3px rgba(0,0,0,0.5);
  --shadow-hover:   0 4px 20px rgba(0,0,0,0.65);
  --font-ui:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'IBM Plex Mono', 'Consolas', 'Menlo', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ==========================================
   LAYOUT
   ========================================== */

.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.layout {
  display: flex;
  gap: 24px;
  padding: 16px 0;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
}

/* ==========================================
   NAVBAR
   ========================================== */

.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.navbar-logo-svg {
  display: block;
}

.search-form {
  flex: 1;
  max-width: 480px;
  display: flex;
  gap: 0;
}

.search-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.search-form input:focus {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.search-form button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 4px 4px 0;
  padding: 6px 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-form button:hover {
  color: var(--accent);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

/* ==========================================
   USER MENU
   ========================================== */

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
}

.user-menu-trigger:hover {
  border-color: var(--accent);
}

.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.karma-badge {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 175px;
  box-shadow: var(--shadow-hover);
  z-index: 200;
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 13px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
  text-decoration: none;
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ==========================================
   FLASH MESSAGES
   ========================================== */

.flash-messages {
  padding: 8px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.flash {
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.flash-success { background: rgba(57,255,20,0.1); border: 1px solid var(--accent); color: var(--accent); }
.flash-error   { background: rgba(255,68,68,0.1); border: 1px solid var(--danger); color: var(--danger); }
.flash-info    { background: rgba(74,158,255,0.1); border: 1px solid var(--link); color: var(--link); }

/* ==========================================
   POST CARD (FEED VIEW)
   ========================================== */

.post-card {
  display: flex;
  gap: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow-card);
}

.post-card:hover {
  border-color: rgba(57, 255, 20, 0.35);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* Vote Column */
.vote-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  background: var(--bg-tertiary);
}

.vote-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 3px;
  border-radius: 3px;
  transition: color 0.1s;
}

.vote-btn:hover,
.vote-btn.active {
  color: var(--accent);
}

.vote-btn.downvote:hover,
.vote-btn.downvote.active {
  color: var(--downvote);
}

.vote-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding: 2px 0;
  min-width: 20px;
}

.vote-score.positive { color: var(--upvote); }
.vote-score.negative { color: var(--downvote); }

/* Report flag — sits at bottom of vote column */
.report-flag {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  margin-top: auto;
  border-radius: 3px;
  opacity: 0.35;
  transition: color 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-flag:hover {
  color: var(--danger);
  opacity: 1;
}

.report-flag.reporting {
  opacity: 0.5;
  pointer-events: none;
}

.report-flag.reported {
  color: var(--danger);
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

/* Post Content */
.post-content {
  flex: 1;
  padding: 10px 12px;
  min-width: 0;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.subboard-tag {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 12px;
}

.subboard-tag:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-author a {
  color: var(--text-secondary);
}

.post-author a:hover {
  color: var(--link);
}

.separator {
  color: var(--text-muted);
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 5px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-preview {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-flair {
  font-size: 11px;
}

/* Post Thumbnails */
.post-thumbnails {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.thumb-count {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Post Actions */
.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}

.action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}

.action-btn.danger:hover {
  color: var(--danger);
}

/* Sort Tabs */
.sort-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px;
}

.sort-tab {
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sort-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}

.sort-tab.active {
  background: var(--accent);
  color: #000;
}

/* ==========================================
   SINGLE POST VIEW
   ========================================== */

.post-full {
  display: flex;
  gap: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 12px;
}

.vote-column-lg {
  width: 44px;
}

.post-body-container {
  flex: 1;
  padding: 12px 16px;
  min-width: 0;
}

.post-body-container h1.post-title {
  font-size: 22px;
  margin-bottom: 12px;
}

/* Markdown Content */
.markdown-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.markdown-content p { margin-bottom: 12px; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 {
  margin: 16px 0 8px;
  color: var(--text-primary);
}
.markdown-content ul, .markdown-content ol {
  padding-left: 20px;
  margin-bottom: 12px;
}
.markdown-content li { margin-bottom: 4px; }
.markdown-content a { color: var(--link); }
.markdown-content a:hover { color: var(--link-hover); }
.markdown-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  color: var(--text-secondary);
  margin: 8px 0;
}
.markdown-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent);
}
.markdown-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  overflow-x: auto;
  margin-bottom: 12px;
}
.markdown-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}
.markdown-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Image Gallery */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.gallery-item figcaption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================
   REPLY CONTROLS
   ========================================== */

.reply-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.reply-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.reply-sort-tabs {
  display: flex;
  gap: 4px;
}

.reply-sort-tab {
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.reply-sort-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}

.reply-sort-tab.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==========================================
   REPLY FORM
   ========================================== */

.reply-form-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.reply-form-container p.auth-prompt {
  color: var(--text-secondary);
  font-size: 13px;
}

.reply-form textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
}

.reply-form textarea:focus {
  border-color: var(--accent);
}

.reply-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

/* ==========================================
   THREADED REPLIES
   ========================================== */

.reply-thread {
  display: flex;
  margin-top: 8px;
}

.reply-collapse-bar {
  width: 16px;
  flex-shrink: 0;
  cursor: pointer;
  padding-top: 2px;
  display: flex;
  justify-content: center;
}

.collapse-line {
  width: 2px;
  background: var(--border);
  border-radius: 2px;
  height: 100%;
  min-height: 20px;
  transition: background 0.15s;
}

.reply-collapse-bar:hover .collapse-line {
  background: var(--accent);
}

/* Depth colors */
.reply-thread[data-depth="0"] > .reply-collapse-bar .collapse-line { background: #39FF14; }
.reply-thread[data-depth="1"] > .reply-collapse-bar .collapse-line { background: #4a9eff; }
.reply-thread[data-depth="2"] > .reply-collapse-bar .collapse-line { background: #ff6600; }
.reply-thread[data-depth="3"] > .reply-collapse-bar .collapse-line { background: #00bcd4; }
.reply-thread[data-depth="4"] > .reply-collapse-bar .collapse-line { background: #ff4444; }
.reply-thread[data-depth="5"] > .reply-collapse-bar .collapse-line { background: #ffaa00; }

.reply-content {
  flex: 1;
  padding-left: 8px;
  min-width: 0;
}

.reply-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.collapse-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  font-family: monospace;
}

.collapse-toggle:hover {
  color: var(--text-primary);
}

.reply-author {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.reply-author:hover {
  color: var(--accent);
}

.author-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.author-badge.mod   { background: var(--mod-badge); color: #000; }
.author-badge.admin { background: var(--admin-badge); color: #000; }
.author-badge.op    { background: var(--accent); color: #000; }

.reply-karma {
  color: var(--text-muted);
  font-size: 11px;
}

.reply-time {
  color: var(--text-muted);
}

.edited-marker {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11px;
}

.reply-body {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
  word-break: break-word;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reply-children {
  margin-left: 0;
}

.reply-collapsed-summary {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}

.reply-collapsed-summary:hover {
  color: var(--text-primary);
}

.sub-reply-form {
  margin: 8px 0;
}

.sub-reply-form.hidden {
  display: none;
}

.continue-thread {
  font-size: 12px;
  color: var(--link);
  padding: 8px;
  display: block;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.subboard-banner {
  height: 80px;
  background: linear-gradient(135deg, #1a2a1a, #0d1a0d);
  background-size: cover;
  background-position: center;
}

.sidebar-panel .subboard-name {
  padding: 12px 12px 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-panel .subboard-description {
  padding: 0 12px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.subboard-stats {
  padding: 0 12px 10px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

/* Subboard sidebar single CTA button */
.subboard-info .btn-accent {
  display: block;
  margin: 0 12px 12px;
  text-align: center;
}

/* Homepage sidebar stacked CTA buttons */
.sidebar-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-cta .btn {
  display: flex;
  width: 100%;
  margin: 0;
}

.sidebar-heading {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.rules-list {
  list-style: decimal;
  padding: 8px 12px 8px 28px;
}

.rules-list li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.rules-list li:last-child {
  border-bottom: none;
}

.mod-list {
  list-style: none;
  padding: 8px 12px;
}

.mod-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 0;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge.mod   { background: var(--mod-badge); color: #000; }
.badge.admin { background: var(--admin-badge); color: #000; }

.subboard-list {
  list-style: none;
  padding: 8px 12px;
}

.subboard-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.subboard-list li:last-child {
  border-bottom: none;
}

.subboard-list a {
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
}

.subboard-list a:hover {
  color: var(--accent);
}

.see-all {
  color: var(--link) !important;
  font-size: 12px !important;
}

/* ==========================================
   AUTH PAGES
   ========================================== */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  min-height: calc(100vh - var(--nav-height));
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-hover);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
}

.auth-logo svg {
  max-width: 100%;
  height: auto;
}

.auth-tagline {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-form input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.btn-firebase {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.btn-firebase:hover {
  border-color: var(--link);
  color: var(--text-primary);
  text-decoration: none;
}

.auth-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--link);
  margin-top: 12px;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* ==========================================
   FORMS (CREATE POST / SUBBOARD)
   ========================================== */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23888' viewBox='0 0 16 16'%3e%3cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 32px;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.optional {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
}

.formatting-help {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.formatting-help span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-input);
}

.input-prefix span {
  padding: 9px 10px;
  color: var(--text-muted);
  font-size: 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-tertiary);
  white-space: nowrap;
}

.input-prefix input {
  border: none;
  border-radius: 0;
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ==========================================
   IMAGE UPLOAD
   ========================================== */

.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.image-upload-zone:hover,
.image-upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.image-upload-zone p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted) !important;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--link);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.image-preview-item {
  position: relative;
}

.image-preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-progress {
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.image-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s;
}

/* ==========================================
   PROFILE PAGE
   ========================================== */

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.profile-info h1 {
  font-size: 22px;
  font-weight: 700;
}

.profile-karma {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

.profile-bio {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.profile-joined {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 16px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-indicator {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================
   TOOLTIP / AUTH GATE
   ========================================== */

.auth-gate-tooltip {
  display: none;
  position: absolute;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 50;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.auth-gate-tooltip a {
  color: var(--link);
}

.auth-gate:hover .auth-gate-tooltip {
  display: block;
}

.auth-gate {
  position: relative;
  display: inline-block;
}

/* ==========================================
   FOOTER
   ========================================== */

footer {
  border-top: 1px solid var(--border);
  padding: 20px 16px;
  margin-top: 48px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-copy {
  color: var(--text-muted);
}

.footer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.footer-logo:hover {
  opacity: 1;
  text-decoration: none;
}

/* ==========================================
   SUBBOARDS LIST PAGE
   ========================================== */

.subboards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.subboard-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  transition: border-color 0.15s;
}

.subboard-card:hover {
  border-color: var(--accent);
}

.subboard-card h3 {
  font-size: 15px;
  font-weight: 700;
}

.subboard-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.subboard-card h3 a:hover { color: var(--accent); }

.subboard-card p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.subboard-card .member-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==========================================
   MOD TOOLS
   ========================================== */

.mod-tools {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: rgba(0, 188, 212, 0.05);
  border: 1px solid rgba(0, 188, 212, 0.2);
  border-radius: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.mod-tools .btn-sm {
  font-size: 11px;
}

/* ==========================================
   404 PAGE
   ========================================== */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  text-align: center;
  padding: 32px;
}

.error-code {
  font-size: 96px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.error-message {
  font-size: 18px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.error-page a {
  margin-top: 24px;
  display: inline-block;
}

/* ==========================================
   PAGE HEADER
   ========================================== */

.page-header {
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

/* ==========================================
   PAGINATION
   ========================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
}

.page-btn {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.page-btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.page-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

.page-btn.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================
   UTILITIES
   ========================================== */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }

.end-of-feed {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
}

/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 640px) {
  .post-title { font-size: 15px; }
  .navbar-logo-svg { width: 140px; height: 25px; }
  .search-form { max-width: 180px; }
  .sort-tabs { overflow-x: auto; }
  .auth-card { padding: 20px; }
  .post-card { flex-direction: column; }
  .vote-column { flex-direction: row; width: 100%; border-radius: 4px 4px 0 0; padding: 6px 10px; justify-content: flex-start; }
  .profile-header { flex-direction: column; text-align: center; }
  .static-hero { flex-direction: column; gap: 16px; }
  .trade-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================
   STATIC PAGES (about, rules)
   ========================================== */

.static-page {
  max-width: 780px;
  margin: 48px auto;
  padding: 0 16px 80px;
}

.static-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.static-hero-mark {
  flex-shrink: 0;
}

.static-hero-text h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1.1;
}

.static-lead {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.accent {
  color: var(--accent);
}

.static-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.static-section h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}

.static-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.static-section p:last-child {
  margin-bottom: 0;
}

.static-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.static-list li {
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.static-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.static-list li strong {
  color: var(--text-primary);
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.trade-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  transition: border-color 0.15s;
}

.trade-card:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.trade-icon {
  font-size: 20px;
}

.static-cta {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.static-cta p {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.static-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Rules page */
.rules-preamble {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 6px 6px 0;
}

.rules-preamble p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 13px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rule-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.rule-item:last-child {
  border-bottom: none;
}

.rule-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.25;
  flex-shrink: 0;
  width: 48px;
  line-height: 1;
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.rule-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.rule-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 13px;
}

.rules-footer-note {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.rules-footer-note p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.rules-footer-note p:last-child {
  margin-bottom: 0;
}

.rules-footer-note a {
  color: var(--accent);
}

/* ==========================================
   DASHBOARD — shared
   ========================================== */

.dash-layout {
  display: flex;
  gap: 24px;
  padding: 24px 0 48px;
}

.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-side {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 768px) {
  .dash-layout { flex-direction: column; }
  .dash-side { width: 100%; }
}

.dash-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.dash-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-panel > .dash-panel-title {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.dash-item-list {
  list-style: none;
}

.dash-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.dash-item:last-child {
  border-bottom: none;
}

.dash-item-title {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 4px;
  line-height: 1.4;
}

.dash-item-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.dash-item-body {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.5;
}

.dash-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.dash-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.dash-ok {
  color: var(--accent);
  font-style: normal;
}

.dash-see-all {
  display: block;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--link);
  text-decoration: none;
  border-top: 1px solid var(--border);
}

.dash-see-all:hover {
  color: var(--accent);
  text-decoration: none;
}

.dash-link-list {
  list-style: none;
  padding: 8px 0;
}

.dash-link-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  font-size: 13px;
  gap: 8px;
}

.dash-link-list a {
  color: var(--text-primary);
  text-decoration: none;
}

.dash-link-list a:hover {
  color: var(--accent);
}

.dash-mod-count {
  font-size: 11px;
  color: var(--text-muted);
}

.dash-mod-link {
  font-size: 11px;
  color: var(--link) !important;
}

.dash-badge-warn {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.dash-report-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--warning);
  margin-bottom: 4px;
}

.dash-report-reason {
  color: var(--warning);
  font-style: italic;
}

.dash-reply-preview {
  color: var(--text-secondary);
  font-weight: 400;
}

/* Create Board promo panel */
.dash-create-board-body {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-create-board-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

/* Board row in admin panel */
.dash-board-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.dash-board-info {
  flex: 1;
  min-width: 0;
}

.dash-board-display {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.dash-board-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================
   DASHBOARD — Welcome bar (user)
   ========================================== */

.dash-welcome {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-username {
  color: var(--accent);
}

.dash-welcome-stats {
  display: flex;
  gap: 24px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dash-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.dash-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

/* ==========================================
   DASHBOARD — Admin header + stat row
   ========================================== */

.dash-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.dash-admin-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-admin-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-admin-actions {
  display: flex;
  gap: 8px;
}

.dash-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
}

.dash-stat-card.dash-stat-warn {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.05);
}

.dash-stat-card .dash-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.dash-stat-card.dash-stat-warn .dash-stat-num {
  color: var(--danger);
}

.dash-stat-card .dash-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

/* ==========================================
   DASHBOARD — Guest
   ========================================== */

.dash-guest {
  padding-bottom: 60px;
}

.dash-hero {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 24px 0;
  padding: 48px 32px;
  text-align: center;
}

.dash-hero-symbol {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

.dash-hero-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.dash-hero-sub {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.dash-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.dash-section {
  margin: 32px 0;
}

.dash-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.dash-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.dash-post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  display: block;
  text-decoration: none;
  transition: border-color 0.15s;
}

.dash-post-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.dash-post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dash-post-sub {
  color: var(--link);
}

.dash-post-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.dash-post-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.dash-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.dash-sub-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  display: block;
  text-decoration: none;
  transition: border-color 0.15s;
}

.dash-sub-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.dash-sub-all {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dash-sub-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.dash-sub-display {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.dash-sub-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================
   DASHBOARD — Sudo stub
   ========================================== */

.dash-sudo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 80px);
  text-align: center;
  padding: 48px 16px;
}

.dash-sudo-symbol {
  font-size: 64px;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
  margin-bottom: 16px;
}

.dash-sudo-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.dash-sudo-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.dash-sudo-terminal {
  background: #000;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.15);
}

.dash-sudo-prompt {
  opacity: 0.7;
}

.dash-sudo-cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.dash-sudo-note {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.6;
}

/* ==========================================
   BOARD PAGE
   ========================================== */

.board-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.board-banner {
  height: 80px;
  background-size: cover;
  background-position: center;
}

.board-banner-default {
  background: linear-gradient(135deg, #0d1f0d 0%, #0a2a0a 50%, #0d1a0d 100%);
  border-bottom: 2px solid var(--accent);
}

.board-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 14px;
}

.board-icon-wrap {
  flex-shrink: 0;
}

.board-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-secondary);
  margin-top: -28px;
}

.board-header-info {
  flex: 1;
  min-width: 0;
}

.board-title {
  font-size: 20px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  margin: 0 0 2px;
  color: var(--text-primary);
  line-height: 1.2;
}

.board-display-name {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.board-header-actions {
  flex-shrink: 0;
}

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

.feed-controls .sort-tabs {
  flex-shrink: 0;
  margin-bottom: 0;
}

.board-search-form {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.board-search-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 13px;
  min-width: 0;
}

.board-search-form button {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  padding: 6px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.board-search-form button:hover {
  color: var(--accent);
}

.board-search-clear {
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  height: 100%;
  cursor: pointer;
}

.board-search-clear:hover {
  color: var(--text-primary);
}

.board-search-banner {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.board-search-banner a {
  color: var(--accent);
}

/* Empty feed */
.empty-feed {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-feed-icon {
  font-size: 36px;
  margin-bottom: 12px;
  color: var(--accent);
  opacity: 0.4;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Sidebar panel header */
.sidebar-panel-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

/* Board about panel */
.board-about-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.board-about-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 10px;
}

.board-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.board-stat-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
}

.board-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.board-created {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.board-created a {
  color: var(--text-secondary);
}

/* Board rules list */
.board-rules-list {
  list-style: none;
  counter-reset: rules;
  padding: 8px 0;
  margin: 0;
}

.board-rule-item {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  counter-increment: rules;
  gap: 2px;
}

.board-rule-item:last-child {
  border-bottom: none;
}

.board-rule-item::before {
  content: counter(rules) ". ";
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
}

.board-rule-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.board-rule-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Search Results ─────────────────────────────────────── */
.search-empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.search-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.search-header {
  padding: 28px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.search-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.search-summary {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.search-no-results {
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.search-section {
  margin-top: 28px;
}
.search-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Board results */
.search-board-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-board-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s;
}
.search-board-card:hover {
  border-color: var(--accent);
}
.search-board-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}
.search-board-info {
  flex: 1;
  min-width: 0;
}
.search-board-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.search-board-display {
  font-size: 12px;
  color: var(--text-secondary);
}
.search-board-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-board-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* User results */
.search-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s;
}
.search-user-card:hover {
  border-color: var(--accent);
}
.search-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}
.search-user-info {
  flex: 1;
  min-width: 0;
}
.search-user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.search-user-display {
  font-size: 12px;
  color: var(--text-secondary);
}
.search-user-bio {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================
   DESIGN REFRESH — MODERN LAYER
   Inter body, mono accents, mobile vote fix
   ========================================== */

/* Monospace kept for brand/code/labels */
code, pre, kbd,
.vote-score,
.badge,
.karma-badge,
.subboard-tag,
.sidebar-heading,
.sort-tab,
.reply-karma,
.post-meta .separator,
.auth-form label,
.form-group label,
.dash-stat-num,
.dash-panel-title,
.search-section-title,
.search-board-name,
.board-icon,
.search-user-avatar,
.navbar-logo {
  font-family: var(--font-mono);
}

/* Post title uses Inter for legibility */
.post-title,
.post-title a {
  font-family: var(--font-ui);
}

/* Post preview slightly larger */
.post-preview {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Subboard tag - tighter */
.subboard-tag {
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* post-full single view */
.post-full {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* reply form textarea */
.reply-form textarea,
.form-group input,
.form-group select,
.form-group textarea,
.auth-form input,
.search-form input {
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
}

/* navbar */
.navbar {
  border-bottom: 1px solid var(--border);
}

.user-menu-trigger {
  border-radius: var(--radius-sm);
}

/* profile header */
.profile-header {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* flash messages */
.flash {
  border-radius: var(--radius-sm);
}

/* vote btn */
.vote-btn {
  border-radius: 4px;
  font-size: 14px;
}

/* report flag */
.report-flag {
  border-radius: 4px;
}

/* action btn */
.action-btn {
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
}

/* reply thread */
.reply-form-container .reply-form textarea {
  border-radius: var(--radius-sm);
}

/* ── Focus ring ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Selection ── */
::selection { background: rgba(57, 255, 20, 0.2); color: var(--text-primary); }

/* ── Mobile: vote column goes horizontal below content ── */
@media (max-width: 600px) {
  .post-card {
    flex-direction: column;
  }

  .vote-column {
    flex: none;
    width: 100%;
    min-width: unset;
    max-width: 100%;
    flex-direction: row;
    padding: 7px 12px;
    gap: 10px;
    border-top: 1px solid var(--border);
    order: 2;
    background: var(--bg-tertiary);
  }

  .post-content {
    order: 1;
    padding: 10px 14px;
  }

  .vote-column .report-flag {
    margin-top: 0;
    margin-left: auto;
  }

  .post-title {
    font-size: 15px;
  }

  .post-meta {
    font-size: 11px;
  }

  /* Prevent horizontal overflow from any child */
  .post-card,
  .post-content,
  .post-title,
  .post-preview {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ── Desktop: tighten vote column ── */
@media (min-width: 601px) {
  .vote-column {
    border-right: 1px solid var(--border);
  }
}

/* ── Dash panels ── */
.dash-panel {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dash-stat-card {
  border-radius: var(--radius-md);
}

/* ── Board header ── */
.board-banner-default {
  background: linear-gradient(135deg, #0d1f0d 0%, #091409 50%, #061206 100%);
}

/* ── Search cards ── */
.search-board-card,
.search-user-card {
  border-radius: var(--radius-md);
}

.search-board-icon {
  border-radius: 50%;
}

/* ── Sidebar panel header ── */
.sidebar-panel-header {
  border-radius: 0;
}

/* ── Link color update ── */
a {
  color: var(--link);
}

/* ==========================================
   LIGHT MODE
   Triggered by: system preference OR clock fallback (6 AM – 8 PM)
   ========================================== */

/* ── Light palette — media query (CSS fallback, no-JS) + JS attribute ── */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary:     #f3f2ed;
    --bg-secondary:   #ffffff;
    --bg-tertiary:    #eae9e3;
    --bg-input:       #fafaf8;
    --border:         #d4d3cd;
    --text-primary:   #1b1a18;
    --text-secondary: #575450;
    --text-muted:     #9c9a94;
    --accent:         #1da600;
    --accent-dim:     #178500;
    --accent-glow:    rgba(29, 166, 0, 0.12);
    --upvote:         #1da600;
    --downvote:       #cc3030;
    --link:           #1a6fb0;
    --link-hover:     #0d4f8a;
    --code-bg:        #ebebe5;
    --shadow-card:    0 1px 3px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
    --shadow-hover:   0 4px 16px rgba(0,0,0,0.11);
  }
}

/* JS-applied override — same values, higher specificity (wins over :root) */
html[data-theme="light"] {
  --bg-primary:     #f3f2ed;
  --bg-secondary:   #ffffff;
  --bg-tertiary:    #eae9e3;
  --bg-input:       #fafaf8;
  --border:         #d4d3cd;
  --text-primary:   #1b1a18;
  --text-secondary: #575450;
  --text-muted:     #9c9a94;
  --accent:         #1da600;
  --accent-dim:     #178500;
  --accent-glow:    rgba(29, 166, 0, 0.12);
  --upvote:         #1da600;
  --downvote:       #cc3030;
  --link:           #1a6fb0;
  --link-hover:     #0d4f8a;
  --code-bg:        #ebebe5;
  --shadow-card:    0 1px 3px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-hover:   0 4px 16px rgba(0,0,0,0.11);
}

/* ── Light mode element overrides ── */

/* Navbar logo "Ground" text — SVG fill override for light bg */
html[data-theme="light"] .navbar-logo-svg text:first-of-type {
  fill: #1b1a18;
}
@media (prefers-color-scheme: light) {
  .navbar-logo-svg text:first-of-type { fill: #1b1a18; }
}

/* Sort tab active state — green on dark bg, stays legible on light */
html[data-theme="light"] .sort-tab.active {
  background: var(--accent);
  color: #fff;
}

/* Badge backgrounds — keep contrast on light */
html[data-theme="light"] .badge.sudo {
  background: #1b1a18;
  color: #f3f2ed;
}

/* Vote column separator */
html[data-theme="light"] .vote-column {
  border-right-color: var(--border);
}

/* Reply collapse line depth colors — adjusted for light */
html[data-theme="light"] .reply-thread[data-depth="0"] > .reply-collapse-bar .collapse-line { background: #1da600; }
html[data-theme="light"] .reply-thread[data-depth="1"] > .reply-collapse-bar .collapse-line { background: #1a6fb0; }
html[data-theme="light"] .reply-thread[data-depth="2"] > .reply-collapse-bar .collapse-line { background: #c84f00; }
html[data-theme="light"] .reply-thread[data-depth="3"] > .reply-collapse-bar .collapse-line { background: #007d99; }
html[data-theme="light"] .reply-thread[data-depth="4"] > .reply-collapse-bar .collapse-line { background: #cc3030; }
html[data-theme="light"] .reply-thread[data-depth="5"] > .reply-collapse-bar .collapse-line { background: #b07800; }

/* Board default banner in light mode */
html[data-theme="light"] .board-banner-default {
  background: linear-gradient(135deg, #c8e8c0 0%, #a8d898 50%, #88c878 100%);
}

/* Scrollbar in light mode */
html[data-theme="light"] ::-webkit-scrollbar-track { background: #eae9e3; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4c3bc; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b0afaa; }

/* Selection highlight */
html[data-theme="light"] ::selection {
  background: rgba(29, 166, 0, 0.18);
  color: #1b1a18;
}

/* Code blocks in light mode */
html[data-theme="light"] .markdown-content code {
  color: #158000;
}

/* Flash messages stay legible in light */
html[data-theme="light"] .flash-success { background: rgba(29,166,0,0.08); border-color: var(--accent); color: var(--accent); }
html[data-theme="light"] .flash-error   { background: rgba(204,48,48,0.08); border-color: var(--downvote); color: var(--downvote); }
html[data-theme="light"] .flash-info    { background: rgba(26,111,176,0.08); border-color: var(--link); color: var(--link); }

/* Auth divider lines */
html[data-theme="light"] .auth-divider::before,
html[data-theme="light"] .auth-divider::after {
  background: var(--border);
}

/* Image upload zone */
html[data-theme="light"] .image-upload-zone {
  border-color: var(--border);
}
html[data-theme="light"] .image-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Focus ring in light mode */
html[data-theme="light"] :focus-visible {
  outline-color: var(--accent);
}

/* ==========================================
   MOBILE NAVBAR FIX
   ========================================== */

/* Prevent the html element itself from overflowing */
html {
  overflow-x: hidden;
}

/* Desktop: show full logo, hide icon */
.logo-icon { display: none; }
.logo-full  { display: block; }

@media (max-width: 600px) {
  /* Swap logos */
  .logo-full { display: none; }
  .logo-icon { display: block; }

  /* Tighten navbar inner */
  .navbar-inner {
    gap: 8px;
    padding: 0 10px;
  }

  /* Let search form shrink but not disappear */
  .search-form {
    min-width: 0;
    flex: 1;
  }

  /* Shrink search input placeholder text */
  .search-form input {
    font-size: 12px;
    padding: 6px 8px;
    min-width: 0;
  }

  /* Tighten search button */
  .search-form button {
    padding: 6px 8px;
    flex-shrink: 0;
  }

  /* Shrink action buttons slightly */
  .navbar-actions {
    gap: 5px;
    flex-shrink: 0;
  }

  .navbar-actions .btn-sm {
    padding: 5px 9px;
    font-size: 12px;
  }

  /* Logged-in: hide username + karma to save space, show only avatar */
  .user-menu-trigger .username,
  .user-menu-trigger .karma-badge {
    display: none;
  }

  .user-menu-trigger {
    padding: 4px 6px;
  }

  /* Dropdown should not overflow right edge */
  .user-dropdown {
    right: 0;
    left: auto;
    min-width: 160px;
  }
}

/* Narrowest phones — further squeeze */
@media (max-width: 380px) {
  .navbar-actions .btn-outline {
    display: none; /* hide Log In, keep Sign Up */
  }
}

/* ==========================================
   MOBILE VOTE COLUMN — SCOPED FIX
   Previous rule used unscoped .vote-column which broke .post-full.
   This block overrides and corrects both contexts.
   ========================================== */

@media (max-width: 600px) {

  /* 1. Reset the unscoped vote-column back to vertical defaults */
  .vote-column {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    flex-direction: column;
    padding: 10px 6px;
    gap: 0;
    order: 0;
    border-top: none;
  }

  /* 2. Feed card: post-card column flip + vote bar at bottom */
  .post-card {
    flex-direction: column;
  }
  .post-card .vote-column {
    flex: none;
    width: 100%;
    min-width: unset;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 7px 12px;
    gap: 10px;
    border-top: 1px solid var(--border);
    order: 2;
  }
  .post-content {
    order: 1;
  }
  .post-card .vote-column .report-flag {
    margin-top: 0;
    margin-left: auto;
  }

  /* 3. Single post view: same treatment */
  .post-full {
    flex-direction: column;
  }
  .post-full .vote-column {
    flex: none;
    width: 100%;
    min-width: unset;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 7px 12px;
    gap: 10px;
    border-top: 1px solid var(--border);
    order: 2;
  }
  .post-body-container {
    order: 1;
    padding: 12px 14px;
  }
}

/* ═══════════════════════════════════════════════════════
   DM / Direct Messages
   ═══════════════════════════════════════════════════════ */

/* Navbar DM link */
.dm-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.dm-nav-link:hover { color: var(--accent); background: var(--bg-hover); }
.dm-nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* ── Inbox ── */
.dm-inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dm-inbox-title {
  font-size: 22px;
  font-weight: 700;
}
.dm-conversation-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 680px;
}
.dm-inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s, box-shadow 0.15s;
}
.dm-inbox-item:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-card);
}
.dm-inbox-item--unread { border-left: 3px solid var(--accent); }
.dm-inbox-body { flex: 1; min-width: 0; }
.dm-inbox-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.dm-inbox-name { font-weight: 700; font-size: 14px; font-family: var(--font-mono); }
.dm-inbox-display { color: var(--text-secondary); font-size: 13px; }
.dm-inbox-time { margin-left: auto; color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.dm-inbox-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── New DM modal ── */
.dm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.dm-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.dm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dm-modal-header h2 { font-size: 18px; font-weight: 700; }
.dm-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.dm-modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.dm-modal-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.dm-modal-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-mono);
  box-sizing: border-box;
}
.dm-modal-input:focus { outline: none; border-color: var(--accent); }

/* ── Conversation page layout ── */
.dm-conversation-page .page-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  padding: 0;
  max-width: 740px;
  margin: 0 auto;
  box-sizing: border-box;
}
.dm-conv-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.dm-back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.dm-back-link:hover { color: var(--accent); }
.dm-conv-user { display: flex; align-items: center; gap: 10px; }
.dm-conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-secondary);
}
.dm-conv-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.dm-conv-username {
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-decoration: none;
}
.dm-conv-username:hover { color: var(--accent); }
.dm-conv-displayname {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 6px;
}

/* Messages area */
.dm-messages-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.dm-load-more-wrap {
  text-align: center;
  padding: 8px;
  flex-shrink: 0;
}

/* Individual messages */
.dm-msg {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}
.dm-msg--mine { align-self: flex-end; align-items: flex-end; }
.dm-msg--theirs { align-self: flex-start; align-items: flex-start; }
.dm-msg-text {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.dm-msg--mine .dm-msg-text {
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}
.dm-msg--theirs .dm-msg-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.dm-msg-image-link { display: block; }
.dm-msg-image {
  max-width: 280px;
  max-height: 320px;
  border-radius: 12px;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.dm-msg-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  padding: 0 4px;
}

/* Compose area */
.dm-compose {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 12px 14px;
  flex-shrink: 0;
}
.dm-image-preview {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.dm-image-preview img {
  max-height: 120px;
  max-width: 200px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.dm-remove-img {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  padding: 0;
}
.dm-compose-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.dm-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.dm-attach-btn:hover { color: var(--accent); background: var(--bg-hover); }
.dm-text-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-ui);
  resize: none;
  min-height: 38px;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
  box-sizing: border-box;
}
.dm-text-input:focus { outline: none; border-color: var(--accent); }
.dm-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.dm-send-btn:hover { opacity: 0.85; transform: scale(1.05); }
.dm-send-btn:active { transform: scale(0.95); }

/* Utility */
.dm-loading { text-align: center; color: var(--text-secondary); padding: 40px 0; font-size: 14px; }
.dm-empty { text-align: center; color: var(--text-secondary); padding: 40px 0; font-size: 14px; }
.dm-error { color: #ff4d4d; font-size: 13px; margin-top: 6px; }

/* Mobile */
@media (max-width: 600px) {
  .dm-conversation-page .page-wrap { height: calc(100dvh - 54px); }
  .dm-msg { max-width: 85%; }
  .dm-msg-image { max-width: 200px; max-height: 240px; }
  .dm-inbox-item { padding: 12px; }
}
