/* ============================================================
   HIVEMIND — A bold, modern design with hexagonal honeycomb DNA
   ============================================================ */

:root, [data-theme="light"] {
  --bg: #fafaf7;
  --bg-soft: #f4f1eb;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(255,255,255,0.78);
  --border: #ece6dc;
  --border-strong: #d8cdb9;
  --text: #1a1a17;
  --text-soft: #514a3f;
  --text-muted: #918878;
  --primary: #f59e0b;             /* honey */
  --primary-strong: #d97706;
  --primary-soft: #fef3c7;
  --accent: #7c3aed;              /* purple */
  --accent-soft: #ede9fe;
  --upvote: #f59e0b;
  --downvote: #6366f1;
  --success: #10b981;
  --danger: #ef4444;
  --info: #0ea5e9;
  --shadow-sm: 0 1px 2px rgba(20, 14, 5, 0.05);
  --shadow: 0 4px 16px -2px rgba(20, 14, 5, 0.08), 0 2px 4px rgba(20, 14, 5, 0.04);
  --shadow-lg: 0 12px 40px -8px rgba(20, 14, 5, 0.18), 0 4px 12px rgba(20, 14, 5, 0.06);
  --shadow-glow: 0 0 0 4px rgba(245, 158, 11, 0.18);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --hex-clip: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

[data-theme="dark"] {
  --bg: #0f0d0a;
  --bg-soft: #1a1612;
  --bg-card: #1e1a14;
  --bg-elevated: #25201a;
  --bg-overlay: rgba(15,13,10,0.85);
  --border: #2d2820;
  --border-strong: #3d362a;
  --text: #f5f1e8;
  --text-soft: #c2b89e;
  --text-muted: #8a8068;
  --primary: #fbbf24;
  --primary-strong: #f59e0b;
  --primary-soft: rgba(251, 191, 36, 0.15);
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.15);
  --upvote: #fbbf24;
  --downvote: #818cf8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 0 4px rgba(251, 191, 36, 0.25);
}

[data-theme="amber"] {
  --bg: #fef7e6;
  --bg-soft: #fdecc8;
  --bg-card: #ffffff;
  --bg-elevated: #fffaed;
  --border: #f9d97e;
  --border-strong: #f3c440;
  --text: #2a1a05;
  --text-soft: #5e4220;
  --text-muted: #9a7a3f;
  --primary: #c2410c;
  --primary-strong: #9a3412;
  --primary-soft: #fed7aa;
  --accent: #b45309;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #0f0d0a; --bg-soft: #1a1612; --bg-card: #1e1a14; --bg-elevated: #25201a; --bg-overlay: rgba(15,13,10,0.85);
    --border: #2d2820; --border-strong: #3d362a;
    --text: #f5f1e8; --text-soft: #c2b89e; --text-muted: #8a8068;
    --primary: #fbbf24; --primary-strong: #f59e0b; --primary-soft: rgba(251, 191, 36, 0.15);
    --accent: #a78bfa; --accent-soft: rgba(167, 139, 250, 0.15);
    --upvote: #fbbf24; --downvote: #818cf8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.45);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
    --shadow-glow: 0 0 0 4px rgba(251, 191, 36, 0.25);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus { outline: none; }
*:focus-visible { box-shadow: var(--shadow-glow); border-radius: 6px; }

html { scroll-behavior: smooth; }
html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-feature-settings: 'cv11', 'ss01';
}

/* Honeycomb background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 25% 25%, var(--primary-soft) 0%, transparent 35%),
    radial-gradient(circle at 75% 75%, var(--accent-soft) 0%, transparent 35%);
  opacity: 0.6;
  pointer-events: none;
}

a { color: var(--primary-strong); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }

code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; }

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-overlay);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.4px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  clip-path: var(--hex-clip);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  animation: pulse-hex 4s ease-in-out infinite;
}
@keyframes pulse-hex {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.search-wrap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23918878' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--text-soft);
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn.has-badge::after {
  content: attr(data-badge);
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
  line-height: 1.3;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35); color: white; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-soft); color: var(--text); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { color: white; filter: brightness(0.92); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== LAYOUT ===== */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1020px) {
  .shell { grid-template-columns: minmax(0, 1fr) 300px; }
  .shell .leftbar { display: none; }
}
@media (max-width: 768px) {
  .shell { grid-template-columns: 1fr; padding: 16px; }
  .shell .rightbar { display: none; }
}

.leftbar, .rightbar { position: sticky; top: 84px; }
.rightbar { display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 100px); overflow-y: auto; }
.rightbar::-webkit-scrollbar { width: 6px; }
.rightbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Left sidebar nav */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s;
}
.side-nav-item:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.side-nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}
[data-theme="dark"] .side-nav-item.active { color: var(--primary); }
.side-nav-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.side-nav-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 40%, #fef3c7 100%);
  border-radius: var(--radius-xl);
  padding: 48px 36px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1e1a14 0%, #2a2418 40%, #1e1a14 100%);
  border-color: var(--border-strong);
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 52'%3E%3Cpolygon points='30,2 56,17 56,37 30,52 4,37 4,17' fill='none' stroke='%23f59e0b' stroke-opacity='0.18' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 50px 43px;
  opacity: 0.5;
  pointer-events: none;
}
.hero::before { top: -20px; right: -30px; width: 240px; height: 240px; transform: rotate(15deg); }
.hero::after { bottom: -30px; left: -40px; width: 200px; height: 200px; transform: rotate(-25deg); }
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-emoji {
  font-size: 60px;
  line-height: 1;
  margin-bottom: 16px;
  display: inline-block;
  animation: bee-fly 3s ease-in-out infinite;
}
@keyframes bee-fly {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(8px, -4px) rotate(8deg); }
  75% { transform: translate(-6px, 4px) rotate(-6deg); }
}
.hero h1 {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary-strong) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto 24px;
  line-height: 1.5;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px dashed var(--border-strong);
}
@media (max-width: 600px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
.hero-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hero-stat span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-top: 4px;
}

/* ===== Sort tabs ===== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.tabs {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-soft);
  transition: all 0.15s;
  white-space: nowrap;
}
.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.tab:not(.active):hover { background: var(--bg-soft); color: var(--text); }

/* ===== POST CARD ===== */
.posts-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 56px 1fr;
  transition: all 0.18s;
}
.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 4px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, transparent 100%);
  gap: 2px;
}
.vote-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.12s;
}
.vote-btn:hover { background: var(--bg-card); color: var(--upvote); transform: scale(1.12); }
.vote-btn.down:hover { color: var(--downvote); }
.vote-btn.active-up { color: var(--upvote); background: var(--primary-soft); }
.vote-btn.active-down { color: var(--downvote); background: var(--accent-soft); }
.vote-btn svg { width: 18px; height: 18px; }
.score {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: center;
}
.score.up { color: var(--upvote); }
.score.down { color: var(--downvote); }

.post-body { padding: 14px 18px; min-width: 0; }
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.post-meta a { color: var(--text-soft); font-weight: 600; }
.post-meta a:hover { color: var(--primary-strong); }
.hive-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft);
  color: var(--text-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--border);
}
.hive-pill:hover { background: var(--primary-soft); color: var(--primary-strong); text-decoration: none; border-color: var(--primary); }
.dot-sep { color: var(--text-muted); user-select: none; }

.author-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-soft);
  display: inline-block;
  vertical-align: middle;
}
.avatar.lg { width: 64px; height: 64px; }
.avatar.md { width: 32px; height: 32px; }

.verified-mark {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  background: var(--info);
  color: white;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}

.post-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 6px 0;
  color: var(--text);
  display: block;
}
.post-title:hover { color: var(--primary-strong); text-decoration: none; }

.post-preview {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-link-card {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-image {
  margin-top: 10px;
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  object-fit: cover;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag-chip {
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 9px;
  border-radius: 999px;
}
.tag-chip:hover { filter: brightness(0.95); text-decoration: none; }

.post-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.post-actions a, .post-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.12s;
}
.post-actions a:hover, .post-actions button:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}
.post-actions .active { color: var(--primary-strong); }

.markdown { color: var(--text); }
.markdown p { margin: 0 0 10px; }
.markdown p:last-child { margin-bottom: 0; }
.markdown a { color: var(--accent); text-decoration: underline; }
.markdown code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}
.markdown pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
  margin: 10px 0;
}
.markdown pre code { background: none; border: none; padding: 0; }
.markdown blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 12px;
  color: var(--text-soft);
  margin: 10px 0;
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
}
.markdown ul, .markdown ol { margin: 8px 0 10px 22px; }
.markdown li { margin-bottom: 4px; }
.markdown img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
  margin: 14px 0 8px; line-height: 1.3; letter-spacing: -0.3px;
}
.markdown table { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.markdown th, .markdown td { padding: 6px 12px; border: 1px solid var(--border); }
.markdown th { background: var(--bg-soft); }

/* ===== WIDGETS ===== */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.widget h3 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.widget h3 .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  margin-right: 4px;
  animation: pulse-dot 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 13px;
}
.stat-row + .stat-row { border-top: 1px dashed var(--border); }
.stat-row span { color: var(--text-soft); }
.stat-row strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.hive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.hive-row:hover { background: var(--bg-soft); text-decoration: none; }
.hive-row .hive-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 16px;
  flex-shrink: 0;
}
.hive-row .hive-name { font-weight: 600; color: var(--text); }
.hive-row .hive-count { color: var(--text-muted); font-size: 11px; margin-left: auto; }

.activity-feed {
  max-height: 420px;
  overflow-y: auto;
  margin: -4px;
  padding: 4px;
}
.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.activity-row {
  font-size: 12px;
  padding: 8px 6px;
  border-bottom: 1px dashed var(--border);
  color: var(--text-soft);
  line-height: 1.4;
}
.activity-row:last-child { border-bottom: none; }
.activity-row a { color: var(--text); font-weight: 600; }
.activity-row.fresh { animation: highlight 1.6s ease-out; }
@keyframes highlight {
  0% { background: var(--primary-soft); }
  100% { background: transparent; }
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { display: inline-block; }

/* ===== Forms ===== */
.form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  margin: 40px auto;
}
.form h1, .form h2 { margin-bottom: 6px; letter-spacing: -0.4px; }
.form .form-sub { color: var(--text-soft); font-size: 14px; margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card);
}
.field textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid;
  margin-bottom: 14px;
}
.alert-error { background: rgba(239, 68, 68, 0.08); color: var(--danger); border-color: rgba(239, 68, 68, 0.25); }
.alert-success { background: rgba(16, 185, 129, 0.08); color: var(--success); border-color: rgba(16, 185, 129, 0.25); }
.alert-info { background: rgba(14, 165, 233, 0.08); color: var(--info); border-color: rgba(14, 165, 233, 0.25); }
.alert-warn { background: rgba(245, 158, 11, 0.1); color: var(--primary-strong); border-color: rgba(245, 158, 11, 0.3); }
.alert pre {
  margin-top: 8px;
  background: var(--text);
  color: var(--bg-card);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== Single post page ===== */
.single-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 18px;
}
.single-post .post-title { font-size: 26px; line-height: 1.25; margin: 10px 0 14px; }
.single-post .markdown { font-size: 15px; line-height: 1.65; }

/* ===== Comments ===== */
.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.comment-form textarea {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  min-height: 90px;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
}
.comment-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--shadow-glow); background: var(--bg-card);
}
.comment-form .form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.markdown-hint { font-size: 11px; color: var(--text-muted); }
.markdown-hint code { font-size: 11px; }

.comments-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.comment {
  position: relative;
  padding: 12px 0 12px 14px;
  border-left: 2px solid var(--border);
  margin-top: 10px;
  transition: border-color 0.15s;
}
.comment:hover { border-left-color: var(--primary); }
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.comment-head a { color: var(--text); font-weight: 600; }
.comment-body { font-size: 14px; line-height: 1.55; }
.comment-foot {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
}
.comment-foot button { color: var(--text-muted); padding: 3px 6px; border-radius: 5px; font-weight: 600; }
.comment-foot button:hover { background: var(--bg-soft); color: var(--text); }
.comment-foot .vote-mini { display: inline-flex; align-items: center; gap: 4px; }
.comment-foot .vote-mini button { padding: 2px 4px; }
.comment-foot .vote-mini button.active-up { color: var(--upvote); }
.comment-foot .vote-mini button.active-down { color: var(--downvote); }
.comment-replies { margin-left: 16px; }

/* ===== Hive header ===== */
.hive-header {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}
.hive-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsla(var(--hive-hue), 80%, 90%, 0.5) 0%, transparent 80%);
  pointer-events: none;
}
[data-theme="dark"] .hive-header::before { background: linear-gradient(135deg, hsla(var(--hive-hue), 50%, 25%, 0.5) 0%, transparent 80%); }
.hive-header > * { position: relative; z-index: 1; }
.hive-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hive-header-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: hsl(var(--hive-hue), 80%, 75%);
  clip-path: var(--hex-clip);
  font-size: 30px;
  margin-bottom: 12px;
}
[data-theme="dark"] .hive-header-icon { background: hsl(var(--hive-hue), 60%, 40%); }
.hive-header h1 { font-size: 28px; letter-spacing: -0.6px; }
.hive-header p { color: var(--text-soft); font-size: 14px; max-width: 600px; margin: 6px 0; }
.hive-meta-row { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.hive-meta-row strong { color: var(--text); }

/* ===== Profile ===== */
.profile-banner {
  background: linear-gradient(135deg, hsl(var(--profile-hue, 200), 70%, 80%) 0%, hsl(calc(var(--profile-hue, 200) + 40), 70%, 75%) 100%);
  height: 120px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.profile-info { padding: 0 24px 24px; }
.profile-info .avatar {
  margin-top: -36px;
  border: 4px solid var(--bg-card);
  background: var(--bg-card);
  display: block;
}
.profile-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-handle { color: var(--text-muted); font-size: 14px; }
.profile-bio { margin: 12px 0; color: var(--text-soft); font-size: 14px; line-height: 1.5; }
.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.profile-stats strong { color: var(--text); font-weight: 700; }
.badges-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ===== Notifications dropdown ===== */
.dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  width: 340px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 480px;
  overflow-y: auto;
}
.dropdown-header {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}
.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  gap: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-snippet { color: var(--text); line-height: 1.4; }
.notif-time { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

/* ===== Toasts ===== */
#toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg-card);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease-out;
  max-width: 340px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.warn { background: var(--primary); color: white; }
@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Modals ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 0.18s;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.22s ease-out;
}
@keyframes modal-in { from { transform: translateY(20px); opacity: 0; } }
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 18px; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Empty states ===== */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-emoji { font-size: 52px; opacity: 0.6; margin-bottom: 14px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 360px; margin: 0 auto; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 60px auto;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-card) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Docs page ===== */
.docs-page {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin: 20px 0;
}
.docs-page h1 { font-size: 32px; letter-spacing: -0.8px; margin-bottom: 20px; }
.docs-page h2 { font-size: 22px; letter-spacing: -0.4px; color: var(--primary-strong); margin: 32px 0 12px; }
.docs-page h3 { font-size: 16px; margin: 20px 0 8px; }
.docs-page p { margin-bottom: 12px; color: var(--text-soft); }
.docs-page ul, .docs-page ol { margin: 8px 0 14px 24px; color: var(--text-soft); }
.docs-page li { margin-bottom: 4px; }
.docs-page table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.docs-page th, .docs-page td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.docs-page th { background: var(--bg-soft); font-weight: 700; color: var(--text); }
.docs-page code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}
.docs-page pre {
  background: #1a1612;
  color: #fef3c7;
  padding: 14px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 12px 0;
  border: 1px solid #3d362a;
}
[data-theme="dark"] .docs-page pre { background: #0a0805; }
.docs-page pre code { background: none; border: none; color: inherit; }

/* ===== Footer ===== */
footer {
  max-width: 1200px;
  margin: 60px auto 30px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
footer a { color: var(--text-soft); margin: 0 10px; }
footer .footer-mark {
  display: inline-block;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  clip-path: var(--hex-clip);
  vertical-align: middle;
  margin-right: 4px;
}

/* ===== utilities ===== */
.text-center { text-align: center; }
.flex { display: flex; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.fw-700 { font-weight: 700; }

/* hide on small screens */
@media (max-width: 580px) {
  .hide-sm { display: none !important; }
  .search-wrap { max-width: 200px; }
  .hero { padding: 32px 20px; }
  .post-body { padding: 12px; }
  .single-post { padding: 18px; }
}

/* ============ NEW: FAB (Floating Action Button) ============ */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45), 0 2px 6px rgba(0,0,0,0.1);
  z-index: 90;
  cursor: pointer;
  transition: all 0.2s;
}
.fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 28px rgba(245, 158, 11, 0.55); }
.fab:active { transform: translateY(0) scale(0.96); }
.fab.visible { display: flex; }
@media (max-width: 768px) {
  .fab { bottom: 20px; right: 20px; }
}

/* ============ NEW: Skeleton loaders ============ */
.post-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
}
.post-skeleton .sk-vote { width: 32px; height: 80px; }
.post-skeleton .sk-body { display: flex; flex-direction: column; gap: 8px; }
.post-skeleton .sk-meta { width: 60%; height: 12px; }
.post-skeleton .sk-title { width: 80%; height: 20px; }
.post-skeleton .sk-text { width: 100%; height: 14px; }
.post-skeleton .sk-text.short { width: 70%; }
.post-skeleton > div { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }

/* ============ NEW: Load more button ============ */
.load-more {
  margin: 16px auto;
  display: block;
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.load-more:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.load-more:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ NEW: Markdown editor with preview tabs ============ */
.md-editor {
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  transition: border 0.15s;
}
.md-editor:focus-within { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.md-editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.md-editor-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.md-editor-tab.active { color: var(--primary-strong); border-bottom-color: var(--primary); background: var(--bg-card); }
.md-editor-tab:not(.active):hover { color: var(--text); }
.md-editor-area {
  position: relative;
}
.md-editor textarea {
  width: 100%;
  border: none;
  background: var(--bg-card);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  min-height: 120px;
  resize: vertical;
  outline: none;
}
.md-preview {
  padding: 12px 14px;
  min-height: 120px;
  font-size: 14px;
  background: var(--bg-card);
}
.md-preview .empty-preview { color: var(--text-muted); font-style: italic; }

/* ============ NEW: Keyboard shortcut hints ============ */
kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
}

/* ============ NEW: Onboarding banner ============ */
.onboard {
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.onboard-icon { font-size: 28px; flex-shrink: 0; }
.onboard-body { flex: 1; min-width: 200px; }
.onboard-body strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.onboard-body span { font-size: 13px; color: var(--text-soft); }
.onboard-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}
.onboard-close:hover { color: var(--text); }

/* ============ NEW: Copy-link button feedback ============ */
.copy-feedback {
  position: relative;
}
.copy-feedback.copied::after {
  content: '✓ Copied';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  animation: fade-up 1.4s;
}
@keyframes fade-up {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  20%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

/* ============ NEW: Keyboard shortcuts modal ============ */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.shortcuts-grid > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-soft);
}
.shortcuts-grid > div:last-child, .shortcuts-grid > div:nth-last-child(2) { border-bottom: none; }

/* ============ NEW: Connection indicator ============ */
.ws-indicator {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  display: none;
  align-items: center;
  gap: 5px;
  animation: slide-down 0.3s;
}
.ws-indicator.show { display: inline-flex; }
.ws-indicator.connected .ws-dot { background: var(--success); }
.ws-indicator.disconnected { color: var(--danger); }
.ws-indicator.disconnected .ws-dot { background: var(--danger); }
.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
@keyframes slide-down {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

/* ============ NEW: Improved hero badges ============ */
.beta-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ============ NEW: Tag tile improvements ============ */
.tag-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(124, 58, 237, 0.18); }

/* ===== Leaderboard ===== */
.tab-bar { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--border); padding: 0 4px; flex-wrap: wrap; }
.tab-bar .tab { padding: 10px 16px; color: var(--text-soft); text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.tab-bar .tab:hover { color: var(--text); }
.tab-bar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 48px 44px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: all .15s; }
.lb-row:hover { transform: translateX(2px); border-color: var(--accent); box-shadow: 0 2px 12px rgba(245,158,11,.08); }
.lb-row.lb-top { background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(251,191,36,.04)); border-color: rgba(245,158,11,.3); }
.lb-rank { font-size: 20px; font-weight: 700; text-align: center; color: var(--text-soft); }
.lb-row.lb-top .lb-rank { font-size: 26px; }
.lb-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-soft); }
.lb-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.lb-handle { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.lb-stats { text-align: right; }
.lb-karma { font-size: 18px; font-weight: 700; color: var(--accent); }
.lb-sub { font-size: 11px; color: var(--text-soft); }
@media (max-width: 640px) { .lb-row { grid-template-columns: 36px 40px 1fr auto; gap: 10px; padding: 12px; } .lb-rank { font-size: 16px; } }

/* ===== Direct Messages ===== */
.dm-thread-list { display: flex; flex-direction: column; gap: 6px; }
.dm-thread-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: all .15s; }
.dm-thread-row:hover { border-color: var(--accent); transform: translateX(2px); }
.dm-thread-row.unread { background: linear-gradient(90deg, rgba(245,158,11,.06), transparent 60%); border-color: rgba(245,158,11,.25); }
.dm-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-soft); }
.dm-name { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.dm-snippet { font-size: 13px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.dm-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

.dm-pane { display: flex; flex-direction: column; height: calc(100vh - 120px); max-height: 720px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.dm-back { padding: 8px 16px; color: var(--text-soft); text-decoration: none; font-size: 13px; border-bottom: 1px solid var(--border); }
.dm-back:hover { color: var(--accent); }
.dm-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.dm-header-avatar { width: 40px; height: 40px; border-radius: 50%; }
.dm-header-name { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.dm-header-handle { font-size: 12px; color: var(--text-soft); text-decoration: none; }
.dm-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.dm-empty { text-align: center; color: var(--text-soft); padding: 40px 20px; }
.dm-msg { display: flex; flex-direction: column; max-width: 75%; }
.dm-msg.mine { align-self: flex-end; align-items: flex-end; }
.dm-msg.theirs { align-self: flex-start; align-items: flex-start; }
.dm-bubble { padding: 10px 14px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.dm-msg.mine .dm-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.dm-msg.theirs .dm-bubble { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.dm-time { font-size: 10px; color: var(--text-soft); margin-top: 3px; padding: 0 6px; }
.dm-composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.dm-composer textarea { flex: 1; resize: none; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-family: inherit; font-size: 14px; }
.dm-composer button { align-self: flex-end; }
@media (max-width: 640px) { .dm-pane { height: calc(100vh - 80px); border-radius: 0; } .dm-snippet { max-width: 200px; } }
