/* ==========================================================================
   Axios Community Forum - Core Design System & Stylesheet
   (c) 2026 Axios AI Media Group. All rights reserved.
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode Default */
  --bg-primary: #09090b;
  --bg-secondary: #121215;
  --bg-tertiary: #18181b;
  --bg-card: #18181c;
  --bg-card-hover: #222227;
  --bg-input: #131316;
  --border-subtle: #27272a;
  --border-focus: #3f3f46;
  --border-active: #8b5cf6;

  /* Text & Typography */
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-accent: #38bdf8;

  /* Accent Colors */
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --amber: #f59e0b;
  --rose: #f43f5e;

  /* Surface Shadows & Elevations */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6), 0 4px 10px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Dimensions & Spacing */
  --header-height: 64px;
  --sidebar-width: 280px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
html[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --border-subtle: #e2e8f0;
  --border-focus: #cbd5e1;
  --border-active: #7c3aed;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #0284c7;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 15px rgba(124, 58, 237, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* -------------------------------------------------------------
   Header & Navigation
   ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(18, 18, 21, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

html[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.9);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 0 12px var(--primary-glow);
}

.brand-img-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 0 12px var(--primary-glow);
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: transform var(--transition-fast);
}

.brand-logo:hover .brand-img-icon {
  transform: scale(1.05);
}

.brand-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Search trigger in header */
.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 1.5rem;
}

.search-trigger-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-trigger-bar:hover {
  border-color: var(--border-focus);
  color: var(--text-secondary);
  background: var(--bg-card-hover);
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
}

.kbd-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
  font-size: 0.725rem;
  font-family: monospace;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6d28d9);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9d71f7, #7c3aed);
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.65rem 0.25rem 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-profile-badge:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1.25rem;
}

.user-name-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* -------------------------------------------------------------
   Layout Structure
   ------------------------------------------------------------- */
.app-layout {
  display: flex;
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Left Sidebar */
.sidebar-left {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  padding: 0 0.5rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.nav-item-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item-btn.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary);
  border-color: rgba(139, 92, 246, 0.3);
  font-weight: 600;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
}

.nav-count-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.nav-item-btn.active .nav-count-badge {
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary);
}

/* Sidebar Stats Card */
.sidebar-stats-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 900px;
  min-height: calc(100vh - var(--header-height));
}

/* Right Sidebar */
.sidebar-right {
  width: 260px;
  min-width: 260px;
  padding: 1.5rem 1rem;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
}

/* -------------------------------------------------------------
   Feed Controls & Filters
   ------------------------------------------------------------- */
.feed-header {
  margin-bottom: 1.25rem;
}

.channel-hero {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-info h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.channel-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.sort-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.sort-tab-btn {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.sort-tab-btn:hover {
  color: var(--text-primary);
}

.sort-tab-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* -------------------------------------------------------------
   Thread Cards & Discussion List
   ------------------------------------------------------------- */
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.thread-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  gap: 1rem;
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.thread-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.thread-card.is-pinned {
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.05), transparent);
}

.thread-card.is-solved {
  border-left: 4px solid var(--emerald);
}

/* Voting Box */
.vote-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 44px;
}

.vote-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: var(--transition-fast);
}

.vote-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.vote-btn.has-voted {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}

.thread-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.thread-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-pin {
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-solved {
  color: var(--emerald);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.thread-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.thread-card:hover .thread-title {
  color: var(--text-accent);
}

.thread-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.thread-tags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.tag-pill:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.thread-stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* -------------------------------------------------------------
   Thread Detail View
   ------------------------------------------------------------- */
.thread-detail-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.back-to-feed-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem 0;
  transition: var(--transition-fast);
}

.back-to-feed-btn:hover {
  color: var(--primary);
}

.detail-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.detail-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.author-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-display-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.role-badge.super-admin, .role-badge.admin {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.role-badge.moderator {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.post-timestamp {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.detail-actions-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-post-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.detail-post-body {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.detail-post-body p {
  margin-bottom: 0.85rem;
}

.detail-post-body h2, .detail-post-body h3, .detail-post-body h4 {
  margin: 1.25rem 0 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.detail-post-body ul, .detail-post-body ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.detail-post-body code {
  font-family: 'JetBrains Mono', monospace, Consolas;
  background: var(--bg-tertiary);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: #38bdf8;
}

.detail-post-body pre {
  background: #0f0f12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.detail-post-body pre code {
  background: transparent;
  padding: 0;
  color: #f1f5f9;
}

/* -------------------------------------------------------------
   Poll Widget Inside Detail View
   ------------------------------------------------------------- */
.poll-container {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.poll-question {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.poll-option-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-fast);
}

.poll-option-card:hover {
  border-color: var(--border-focus);
}

.poll-option-card.voted {
  border-color: var(--primary);
}

.poll-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(139, 92, 246, 0.18);
  transition: width 0.4s ease;
  z-index: 1;
}

.poll-option-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poll-option-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.poll-option-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.poll-total-footer {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* -------------------------------------------------------------
   Replies & Discussion Section
   ------------------------------------------------------------- */
.replies-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.replies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.replies-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.reply-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.reply-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
}

.reply-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.reply-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
}

.reply-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  position: relative;
}

.reply-card.is-accepted-solution {
  border: 2px solid var(--emerald);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}

.accepted-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.reply-body {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.reply-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.775rem;
}

.reply-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.reply-action-btn:hover {
  color: var(--text-primary);
}

.reply-card.nested-reply {
  margin-left: 2.5rem;
  border-left: 3px solid var(--border-focus);
}

/* -------------------------------------------------------------
   Modals (New Thread, Manual, Search Palette)
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

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

/* Poll Creator Box */
.poll-creator-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* -------------------------------------------------------------
   Member Directory & Drawer
   ------------------------------------------------------------- */
.member-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.member-list-item:hover {
  background: var(--bg-tertiary);
}

.member-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.member-item-meta {
  display: flex;
  flex-direction: column;
}

.member-item-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
}

.member-item-rep {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   Operations Manual Modal Styles
   ------------------------------------------------------------- */
.manual-modal-card {
  max-width: 840px;
}

.manual-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  overflow-x: auto;
}

.manual-tab-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.manual-tab-btn:hover {
  color: var(--text-primary);
}

.manual-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}

.manual-article-content {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 65vh;
  line-height: 1.7;
}

.manual-article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  color: var(--text-primary);
}

.manual-article-content p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.manual-article-content ul, .manual-article-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-secondary);
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.shortcut-table th, .shortcut-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.shortcut-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* -------------------------------------------------------------
   Responsive Breakpoints
   ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar-left {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    z-index: 45;
    background: var(--bg-card);
    transition: left var(--transition-normal);
    width: 280px;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-left.open {
    left: 0;
  }

  .main-content {
    padding: 1rem;
  }

  .header-center {
    display: none;
  }
}

/* Print styles for Operations Manual */
@media print {
  .site-header, .sidebar-left, .sidebar-right, .modal-footer, .manual-tabs-nav {
    display: none !important;
  }
  .modal-overlay {
    position: static;
    background: white;
  }
  .modal-card {
    box-shadow: none;
    border: none;
    max-width: 100%;
  }
  body, .manual-article-content {
    color: black !important;
    background: white !important;
  }
}
