/* ============================================
   GOXEM Forum Feed — LinkedIn-Style Layout
   ============================================ */

/* --- Tabs Bar --- */
.feed-tabs-bar {
  background: var(--color-bg);
  border-bottom: 1px solid var(--surface-border);
  padding-top: var(--space-sm);
  position: sticky;
  top: 72px;
  z-index: 99;
  margin-top: 72px;
}

/* --- Category Tabs (Top Nav) --- */
.feed-category-tabs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding: var(--space-xs) 0 var(--space-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.feed-category-tabs::-webkit-scrollbar {
  height: 4px;
}
.feed-category-tabs::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
.feed-category-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.feed-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 1px solid var(--surface-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.feed-tab:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}
.feed-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(110, 79, 158, 0.3);
}
.feed-tab .tab-count {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* --- Content Section --- */
.feed-content-section {
  background: var(--color-bg-alt);
  padding: var(--space-xl) 0 var(--space-3xl);
  min-height: calc(100vh - 120px);
}

/* --- 3-Column Layout --- */
.feed-layout {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: var(--space-xl);
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Left Sidebar (Profile Panel) --- */
.feed-sidebar-left {
  position: sticky;
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.feed-profile-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
}

.feed-profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--surface-border);
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-purple-100);
}
.feed-profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-profile-avatar-large .avatar-initials {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-primary);
}

.feed-profile-info {
  text-align: center;
}
.feed-profile-name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}
.feed-profile-title {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 2px 0;
  line-height: 1.4;
}
.feed-profile-location {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 4px 0;
}
.feed-profile-institution {
  font-size: 0.8125rem;
  color: var(--color-primary);
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.feed-profile-institution svg {
  flex-shrink: 0;
  stroke: var(--color-primary);
}
.feed-profile-dept {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 2px 0;
  line-height: 1.4;
}
.feed-profile-name .feed-role-badge {
  vertical-align: middle;
  margin-left: 6px;
  font-size: 0.625rem;
}
.feed-profile-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}
.feed-profile-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.feed-profile-ext-link:hover {
  background: var(--color-bg-soft);
  border-color: var(--surface-border);
  color: var(--color-primary);
}
.feed-profile-ext-link svg,
.feed-profile-ext-link img {
  flex-shrink: 0;
  display: block;
}
.feed-ext-inactive {
  opacity: 0.22;
  filter: grayscale(100%);
  cursor: default;
  pointer-events: none;
}
.feed-ext-active:hover {
  opacity: 0.85;
}
.feed-profile-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--surface-border);
}
.feed-profile-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.feed-profile-stat:not(:last-child) {
  border-right: 1px solid var(--surface-border);
}
.feed-profile-stat-num {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.feed-profile-stat-label {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}
.feed-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-left: auto;
}

/* Quick Nav Card (below profile) */
.feed-quick-nav {
  padding: var(--space-sm) var(--space-md);
}
.feed-quick-nav .feed-profile-action:first-child {
  padding-top: var(--space-sm);
}

.feed-profile-action {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}
.feed-profile-action:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
}
.feed-profile-action svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Login prompt for sidebar */
.feed-login-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}
.feed-login-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}
.feed-login-card p {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}
.feed-login-card .btn-primary {
  width: 100%;
  margin-bottom: var(--space-sm);
}
.feed-login-card .btn-secondary {
  width: 100%;
}

/* --- Main Feed Column --- */
.feed-main {
  min-width: 0;
}

/* --- Inline Post Creation Box --- */
.feed-create-box {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}
.feed-create-box:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);
}
.feed-create-collapsed {
  display: block;
}
.feed-create-expanded {
  display: none;
  cursor: default;
}
.feed-create-box.expanded {
  cursor: default;
}
.feed-create-box.expanded .feed-create-collapsed {
  display: none;
}
.feed-create-box.expanded .feed-create-expanded {
  display: block;
  animation: feedExpandIn 0.25s ease-out;
}
@keyframes feedExpandIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 600px; }
}
.feed-create-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-md);
}
.feed-create-input:hover {
  border-color: var(--color-primary-light);
  background: var(--color-bg);
}
.feed-create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--surface-border);
}
.feed-create-actions-left {
  display: flex;
  gap: var(--space-xs);
}
.feed-create-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.feed-create-action:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
}
.feed-create-action svg { opacity: 0.7; }
.feed-create-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.feed-create-send:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(110, 79, 158, 0.3);
}

/* Inline expanded form fields */
.feed-inline-title {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition-fast);
  margin-bottom: var(--space-md);
}
.feed-inline-title:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.feed-inline-editor {
  margin-bottom: var(--space-md);
  min-height: 150px;
}
.feed-create-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--surface-border);
}
.feed-create-cancel {
  padding: 8px 20px;
  border: 1px solid var(--surface-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-create-cancel:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.feed-create-post {
  padding: 8px 24px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-create-post:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(110, 79, 158, 0.3);
}
.feed-create-post:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- Forum Rules Modal (kept for rules dialog) --- */
.feed-editor-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}
.feed-editor-modal.open { display: flex; }
.feed-editor-content {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.feed-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--surface-border);
}
.feed-editor-header h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-editor-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.feed-editor-close:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.feed-editor-body {
  padding: var(--space-lg);
}

/* --- Feed Post Card --- */
.feed-post {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 16px);
  margin-bottom: var(--space-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.feed-post:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);
}

/* Repost header */
.feed-repost-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg) 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.feed-repost-header svg { opacity: 0.6; }

/* Post header */
.feed-post-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-lg) 0;
}
.feed-post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-purple-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
}
.feed-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-post-avatar .avatar-initials {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
}
.feed-post-meta {
  flex: 1;
  min-width: 0;
}
.feed-post-author-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.feed-post-author {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}
.feed-post-author:hover { color: var(--color-primary); }
.feed-post-role {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 1px;
  line-height: 1.3;
}
.feed-post-time {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.feed-post-menu {
  flex-shrink: 0;
  position: relative;
}
.feed-post-menu-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.feed-post-menu-btn:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.feed-post-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}
.feed-post-menu-dropdown.open { display: block; }
.feed-post-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-post-menu-item:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.feed-post-menu-item.danger { color: var(--color-error); }
.feed-post-menu-item.danger:hover { background: rgba(248, 113, 113, 0.1); }

/* Category badge */
.feed-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: var(--color-purple-50);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: var(--space-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-category-badge:hover {
  background: var(--color-purple-100);
}

/* Post content */
.feed-post-content {
  padding: var(--space-md) var(--space-lg);
}
.feed-post-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-sm);
  cursor: pointer;
  line-height: 1.4;
}
.feed-post-title:hover { color: var(--color-primary); }
.feed-post-body {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-height: 200px;
  overflow: hidden;
  position: relative;
}
.feed-post-body.expanded {
  max-height: none;
}
.feed-post-body-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--surface-card));
  pointer-events: none;
}
.feed-post-expand {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: var(--space-xs) 0;
  font-family: var(--font-body);
}
.feed-post-expand:hover { text-decoration: underline; }

/* Post images */
.feed-post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: var(--space-sm) 0;
}

/* Pinned badge */
.feed-post-pinned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--color-warm-light);
  color: var(--color-warm);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

/* --- Interaction Counters --- */
.feed-post-counters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.feed-post-counters-left {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.feed-reaction-icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.feed-reaction-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
}
.feed-post-counters-right {
  display: flex;
  gap: var(--space-md);
}
.feed-post-counters-right span {
  cursor: pointer;
}
.feed-post-counters-right span:hover {
  text-decoration: underline;
  color: var(--color-primary);
}

/* --- Interaction Bar --- */
.feed-interaction-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  border-top: 1px solid var(--surface-border);
  padding: 4px var(--space-sm);
}
/* Like button wrapper (holds button + reaction picker as siblings) */
.feed-interaction-btn-wrap {
  flex: 1 1 0;
  position: relative;
  display: flex;
}
.feed-interaction-btn-wrap .feed-interaction-btn {
  flex: 1;
}
.feed-interaction-btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}
.feed-interaction-btn:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
}
.feed-interaction-btn.active {
  color: var(--color-primary);
  font-weight: 600;
}
.feed-interaction-btn svg {
  flex-shrink: 0;
}
.feed-interaction-count {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 0;
}

/* Repost button */
.feed-repost-btn.active {
  color: var(--color-success, #16a34a);
}
.feed-repost-btn.active svg {
  stroke: var(--color-success, #16a34a);
}

/* Save button (bookmark) */
.feed-save-btn {
  flex: 0 0 auto;
  padding: 10px 12px;
}
.feed-save-btn.active {
  color: var(--color-primary);
}
.feed-save-btn.active svg {
  fill: var(--color-primary);
  stroke: var(--color-primary);
}

/* Repost count link */
.feed-repost-count-link {
  cursor: pointer;
  transition: color var(--transition-fast);
}
.feed-repost-count-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Reposters list view */
.feed-reposter-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}
.feed-reposter-card:hover {
  box-shadow: var(--shadow-md);
}
.feed-reposter-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
}
.feed-reposter-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-reposter-info {
  flex: 1;
  min-width: 0;
}
.feed-reposter-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
}
.feed-reposter-name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.feed-reposter-role {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.feed-reposter-comment {
  font-size: 0.85rem;
  color: var(--color-text);
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--color-bg-soft, #f5f5f5);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.feed-reposter-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Saved posts view header */
.feed-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.feed-saved-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.feed-saved-back {
  padding: 6px 16px;
  border: 1px solid var(--surface-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-saved-back:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

/* Forum rules styles */
.feed-rules-body {
  padding: var(--space-lg) !important;
}
.feed-rule {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}
.feed-rule:not(:last-child) {
  border-bottom: 1px solid var(--surface-border);
}
.feed-rule-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
}
.feed-rule strong {
  font-size: 0.875rem;
  color: var(--color-text);
  display: block;
  margin-bottom: 4px;
}
.feed-rule p {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Reaction picker popup */
.feed-reaction-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 6px 10px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  white-space: nowrap;
  gap: 4px;
}
.feed-reaction-picker.open { display: flex; }
.feed-reaction-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast);
  font-size: 1.5rem;
}
.feed-reaction-picker-btn:hover {
  transform: scale(1.3);
  background: var(--color-bg-soft);
}

/* --- Inline Comments --- */
.feed-comments-section {
  border-top: 1px solid var(--surface-border);
  padding: var(--space-md) var(--space-lg);
}
.feed-comment {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.feed-comment:last-child { margin-bottom: 0; }
.feed-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-purple-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 0.75rem;
}
.feed-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-comment-bubble {
  flex: 1;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}
.feed-comment-author {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-text);
}
.feed-comment-author-title {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 400;
}
.feed-comment-text {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}
.feed-comment-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: 4px;
  font-size: 0.75rem;
}
.feed-comment-action {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}
.feed-comment-action:hover { color: var(--color-primary); }
.feed-comment-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.feed-view-all-comments {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: var(--space-sm);
}
.feed-view-all-comments:hover { color: var(--color-primary); }

/* Comment input */
.feed-comment-input-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-top: var(--space-sm);
}
.feed-comment-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  background: var(--color-bg-alt);
  color: var(--color-text);
  resize: none;
  min-height: 36px;
  max-height: 100px;
  transition: border-color var(--transition-fast);
}
.feed-comment-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg);
}
.feed-comment-submit {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}
.feed-comment-submit.has-text { opacity: 1; }
.feed-comment-submit:hover { background: var(--color-bg-soft); }

/* --- Right Sidebar --- */
.feed-sidebar-right {
  position: sticky;
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.feed-sidebar-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

/* Sidebar header with menu button */
.feed-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--surface-border);
}
.feed-sidebar-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.feed-sidebar-menu-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.feed-sidebar-menu-btn:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}

/* Trending items */
.feed-trending-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-bg-soft);
}
.feed-trending-item:last-child { border-bottom: none; }

.feed-trending-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-purple-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-trending-body {
  flex: 1;
  min-width: 0;
}
.feed-trending-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  display: block;
}
.feed-trending-title:hover { color: var(--color-primary); }
.feed-trending-category {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.feed-trending-meta {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.feed-trending-more {
  display: block;
  text-align: center;
  padding: var(--space-sm) 0 0;
  margin-top: var(--space-sm);
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border-top: 1px solid var(--surface-border);
}
.feed-trending-more:hover { text-decoration: underline; }

/* Suggested items (left sidebar) */
.feed-sidebar-card > h3 {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--surface-border);
}
.feed-suggested-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-bg-soft);
}
.feed-suggested-item:last-child { border-bottom: none; }
.feed-suggested-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  display: block;
  line-height: 1.4;
}
.feed-suggested-title:hover { color: var(--color-primary); }
.feed-suggested-category {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* --- Skeleton Loader --- */
.feed-skeleton {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.feed-skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--color-bg-soft) 25%, var(--color-bg-alt) 50%, var(--color-bg-soft) 75%);
  background-size: 200% 100%;
  animation: feedShimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: var(--space-sm);
}
.feed-skeleton-line.short { width: 60%; }
.feed-skeleton-line.medium { width: 80%; }
.feed-skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--color-bg-soft) 25%, var(--color-bg-alt) 50%, var(--color-bg-soft) 75%);
  background-size: 200% 100%;
  animation: feedShimmer 1.5s ease-in-out infinite;
}
@keyframes feedShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Empty & Loading States --- */
.feed-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--color-text-muted);
}
.feed-empty svg { margin-bottom: var(--space-md); opacity: 0.5; }
.feed-empty h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}
.feed-empty p {
  font-size: 0.875rem;
  max-width: 360px;
  margin: 0 auto;
}

/* --- Load More / Infinite Scroll --- */
.feed-load-more {
  text-align: center;
  padding: var(--space-xl);
}
.feed-load-more-btn {
  padding: 10px 28px;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-load-more-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.feed-load-more-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Mobile Profile Strip (hidden on desktop, shown ≤1024px) --- */
.feed-mobile-profile {
  display: none;
}
.feed-mob-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}
.feed-mob-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.feed-mob-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-purple-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-mob-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-mob-avatar .avatar-initials {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}
.feed-mob-info {
  flex: 1;
  min-width: 0;
}
.feed-mob-name {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-mob-name .feed-role-badge {
  font-size: 0.5625rem;
  vertical-align: middle;
  margin-left: 4px;
}
.feed-mob-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-mob-links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.feed-mob-links .feed-profile-ext-link {
  padding: 4px 6px;
  font-size: 0;
}
.feed-mob-stats {
  display: flex;
  gap: 0;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--surface-border);
}
.feed-mob-stat {
  flex: 1;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.feed-mob-stat:not(:last-child) {
  border-right: 1px solid var(--surface-border);
}
.feed-mob-stat-num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-right: 2px;
}
.feed-mob-actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--surface-border);
}
.feed-mob-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--surface-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-mob-action:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}
.feed-mob-action svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.feed-mob-action .feed-nav-count {
  min-width: 16px;
  height: 16px;
  font-size: 0.625rem;
  margin-left: 2px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .feed-layout {
    grid-template-columns: 1fr;
    max-width: 640px;
  }
  .feed-sidebar-left { display: none; }
  .feed-mobile-profile { display: block; }
  .feed-sidebar-right {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }
}

@media (max-width: 640px) {
  .feed-category-tabs {
    padding: var(--space-xs) 0;
  }
  .feed-tab {
    padding: 8px 14px;
    font-size: 0.8125rem;
  }
  .feed-post-header { padding: var(--space-md) var(--space-md) 0; }
  .feed-post-content { padding: var(--space-sm) var(--space-md); }
  .feed-post-counters { padding: var(--space-sm) var(--space-md); }
  .feed-interaction-bar { padding: 2px var(--space-xs); }
  .feed-interaction-btn {
    font-size: 0.75rem;
    padding: 8px 4px;
  }
  .feed-save-btn { padding: 8px 8px; }
  .feed-comments-section { padding: var(--space-sm) var(--space-md); }
  .feed-sidebar-right {
    grid-template-columns: 1fr;
  }
  .feed-create-box { padding: var(--space-md); }
  .feed-create-actions { flex-wrap: wrap; gap: var(--space-sm); }
  .feed-create-actions-left { flex-wrap: wrap; }
  .feed-inline-editor { min-height: 120px; }
  .feed-editor-modal { padding: 0; }
  .feed-editor-content {
    max-width: none;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }
  .feed-reaction-picker {
    left: 0;
    transform: none;
  }
  .feed-saved-header {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
  }
  .feed-saved-header h3 { font-size: 0.875rem; }
}

/* --- Role badges in feed --- */
.feed-role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 4px;
  vertical-align: middle;
}
.feed-role-superadmin {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.2));
  color: #b45309;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.feed-role-logo {
  width: 12px;
  height: 12px;
  object-fit: contain;
  vertical-align: middle;
}
.feed-role-admin {
  background: rgba(248, 113, 113, 0.1);
  color: var(--color-error);
}
.feed-role-mod {
  background: var(--color-warm-light);
  color: var(--color-warm);
}

/* ORCID verified badge */
.orcid-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.orcid-badge:hover {
  opacity: 1;
}
.orcid-badge img {
  display: block;
}

/* Onboarding modal — interest selection */
.onboarding-interests-grid {
  max-height: 360px;
  overflow-y: auto;
  padding-right: var(--space-xs);
}
.onboarding-category-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin: var(--space-md) 0 var(--space-xs);
}
.onboarding-category-label:first-child {
  margin-top: 0;
}
.onboarding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.onboarding-chip {
  display: inline-block;
  padding: 5px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}
.onboarding-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.onboarding-chip.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.onboarding-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Onboarding modal footer buttons */
.feed-editor-footer .btn-text {
  padding: 8px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.feed-editor-footer .btn-text:hover {
  background: var(--color-bg-hover, rgba(0,0,0,0.04));
  border-color: var(--color-text-muted);
}

/* People in Your Field sidebar */
.people-field-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.people-field-item + .people-field-item {
  border-top: 1px solid var(--color-border-light, var(--color-border));
}
.people-field-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.people-field-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light, rgba(59,130,246,0.08));
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
}
.people-field-info {
  flex: 1;
  min-width: 0;
}
.people-field-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.people-field-name:hover {
  color: var(--color-primary);
}
.people-field-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.people-field-follow {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 0.75rem;
}

/* Research interests in left sidebar */
.feed-interests-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-xs);
}
.feed-interests-edit {
  display: block;
  font-size: 0.75rem;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: var(--space-xs);
}
.feed-interests-edit:hover {
  text-decoration: underline;
}

/* Featured publications in right sidebar */
.feed-pub-item {
  padding: 6px 0;
}
.feed-pub-item + .feed-pub-item {
  border-top: 1px solid var(--color-border-light, var(--color-border));
}
.feed-pub-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}
.feed-pub-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.feed-pub-meta a {
  color: var(--color-primary);
  text-decoration: none;
}
.feed-pub-meta a:hover {
  text-decoration: underline;
}
.feed-pub-doi {
  display: inline-block;
  padding: 1px 5px;
  background: var(--color-primary-light, rgba(59,130,246,0.08));
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Schedule embed card (block type rendered in posts) */
.schedule-embed-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1.5px solid #7c3aed33;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(124,58,237,0.01));
  margin: var(--space-md) 0;
}
.schedule-embed-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,58,237,0.1);
  border-radius: var(--radius-sm);
  color: #7c3aed;
}
.schedule-embed-icon svg {
  stroke: #7c3aed;
}
.schedule-embed-body {
  flex: 1;
  min-width: 0;
}
.schedule-embed-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}
.schedule-embed-dept {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.schedule-embed-link {
  display: inline-block;
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #7c3aed;
  text-decoration: none;
}
.schedule-embed-link:hover {
  text-decoration: underline;
}

/* Contextual DERSIS promo card in sidebar */
.dersis-context-card {
  display: flex;
  gap: var(--space-sm);
  border: 1.5px solid rgba(124,58,237,0.15);
  background: linear-gradient(135deg, rgba(124,58,237,0.03), rgba(124,58,237,0.01));
}
.dersis-context-icon {
  flex-shrink: 0;
  padding-top: 2px;
}
.dersis-context-body strong {
  font-size: 0.875rem;
  color: var(--color-text);
}
.dersis-context-body p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 4px 0;
  line-height: 1.4;
}
.dersis-context-cta {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #7c3aed;
  text-decoration: none;
}
.dersis-context-cta:hover {
  text-decoration: underline;
}

/* Post type badges */
.feed-post-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.feed-badge-question {
  background: rgba(59,130,246,0.1);
  color: #3b82f6;
}
.feed-badge-question.feed-badge-answered {
  background: rgba(22,163,74,0.1);
  color: #16a34a;
}
.feed-badge-practice {
  background: rgba(234,179,8,0.1);
  color: #ca8a04;
}
.feed-badge-practice.feed-badge-verified {
  background: rgba(22,163,74,0.1);
  color: #16a34a;
}
.feed-badge-review {
  background: rgba(124,58,237,0.1);
  color: #7c3aed;
}
.feed-badge-newsletter {
  background: rgba(234,88,12,0.1);
  color: #ea580c;
}
.feed-badge-newsletter svg {
  vertical-align: -2px;
  margin-right: 2px;
}

/* --- Newsletter Hook Post --- */
.feed-post-newsletter-hook .newsletter-hook-image img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}
.feed-post-newsletter-hook .newsletter-hook-cta {
  margin-top: var(--space-sm);
  font-size: 0.9375rem;
}
.feed-post-newsletter-hook .newsletter-hook-cta a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.feed-post-newsletter-hook .newsletter-hook-cta a:hover {
  text-decoration: underline;
}

/* --- Post Type Toggle (Discussion / Question) --- */
.feed-post-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-md);
}
.feed-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.feed-type-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}
.feed-type-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* --- Accepted Answer --- */
.feed-comment-accepted {
  border-left: 3px solid #16a34a;
  padding-left: 8px;
  background: rgba(22,163,74,0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.feed-accepted-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(22,163,74,0.1);
  color: #16a34a;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.feed-accept-btn {
  color: #3b82f6 !important;
  font-weight: 500 !important;
}
.feed-accept-btn:hover {
  color: #16a34a !important;
}

/* Invite action highlight */
.feed-invite-action {
  color: var(--color-primary) !important;
  font-weight: 500;
}

/* Academic Context Card (hover popup) */
.context-card-popup {
  width: 300px;
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,0.15));
  padding: var(--space-md);
  animation: ctxFadeIn 0.15s ease;
}
@keyframes ctxFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ctx-card-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: var(--space-sm);
}
.ctx-card-avatar img,
.ctx-card-avatar .avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.ctx-card-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}
.ctx-card-orcid {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: #a6ce39;
  font-weight: 600;
  vertical-align: middle;
}
.ctx-card-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.ctx-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-xs);
}
.ctx-card-tag {
  padding: 2px 8px;
  background: var(--color-primary-light, rgba(59,130,246,0.08));
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
}
.ctx-card-pubs {
  margin-bottom: var(--space-xs);
}
.ctx-card-pub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  padding: 2px 0;
}
.ctx-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-border-light, var(--color-border));
}
.ctx-card-footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.ctx-card-footer a:hover {
  text-decoration: underline;
}

/* Confirm dialog override for feed */
.feed-confirm-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.feed-confirm-overlay.open { display: flex; }
.feed-confirm-box {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}
.feed-confirm-box p {
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}
.feed-confirm-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* ============================================
   FORUM FEED — MOBILE PREMIUM REDESIGN
   (max-width: 768px) — does NOT affect desktop
   ============================================ */
@media (max-width: 768px) {

  /* --- Feed tabs: horizontal scroll with snap --- */
  .feed-tabs-bar {
    margin-top: 56px;
    padding: var(--space-xs) 0;
    background: var(--color-bg);
    position: sticky;
    top: 56px;
    z-index: 90;
    border-bottom: 1px solid var(--surface-border);
  }
  .feed-category-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 4px var(--space-sm);
  }
  .feed-tab {
    scroll-snap-align: start;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.8125rem;
    border-radius: var(--radius-full);
    font-weight: 500;
  }

  /* --- Feed content section --- */
  .feed-content-section {
    padding-top: var(--space-md);
  }
  .feed-content-section > .container {
    padding: 0 var(--space-xs);
  }

  /* --- Mobile profile: space from sticky tabs --- */
  .feed-mobile-profile {
    padding-top: var(--space-xs);
  }

  /* --- Mobile profile card: compact and modern --- */
  .feed-mob-card {
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }
  .feed-mob-stats {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
  }
  .feed-mob-stat {
    font-size: 0.6875rem;
  }
  .feed-mob-actions {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    gap: 6px;
  }
  .feed-mob-action {
    padding: 7px 8px;
    font-size: 0.6875rem;
    border-radius: var(--radius-md);
  }

  /* --- Create box: clean, compact --- */
  .feed-create-box {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-lg);
  }
  .feed-create-input {
    font-size: 0.875rem;
    padding: 10px 14px;
    border-radius: var(--radius-full);
    background: var(--color-bg-alt);
    border: 1px solid var(--surface-border);
  }
  .feed-create-actions {
    margin-top: var(--space-xs);
  }

  /* --- Post cards: edge-to-edge, no border radius --- */
  .feed-post {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 0;
    border-bottom: 1px solid var(--surface-border);
    box-shadow: none;
  }
  .feed-post + .feed-post {
    border-top: none;
  }

  /* --- Post header: compact --- */
  .feed-post-header {
    padding: var(--space-sm) var(--space-md) 0;
    gap: 10px;
  }
  .feed-post-avatar {
    width: 40px;
    height: 40px;
  }
  .feed-post-avatar img {
    width: 40px;
    height: 40px;
  }
  .feed-post-author {
    font-size: 0.875rem;
  }
  .feed-post-role {
    font-size: 0.6875rem;
  }
  .feed-post-time {
    font-size: 0.625rem;
  }

  /* --- Post content: clean reading --- */
  .feed-post-content {
    padding: var(--space-xs) var(--space-md) var(--space-sm);
  }
  .feed-post-title {
    font-size: 0.9375rem;
    line-height: 1.35;
  }
  .feed-post-body {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  /* --- Category badge in post: smaller --- */
  .feed-category-badge {
    font-size: 0.5625rem;
    padding: 1px 5px;
  }

  /* --- Interaction bar: full-width, evenly spaced --- */
  .feed-interaction-bar {
    padding: 0 var(--space-sm);
    border-top: 1px solid var(--surface-border);
    margin-top: 0;
    justify-content: space-around;
  }
  .feed-interaction-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 0;
    border-radius: 0;
    font-size: 0.75rem;
  }
  .feed-interaction-btn svg {
    width: 18px;
    height: 18px;
  }
  .feed-save-btn {
    flex: none;
    padding: 10px 12px;
  }

  /* --- Counters: compact --- */
  .feed-post-counters {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
  }

  /* --- Comments section: tight --- */
  .feed-comments-section {
    padding: var(--space-xs) var(--space-md) var(--space-sm);
  }
  .feed-comment {
    gap: 8px;
  }
  .feed-comment-bubble {
    padding: 8px 12px;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
  }
  .feed-comment-input {
    padding: 10px 14px;
    font-size: 0.875rem;
    border-radius: var(--radius-full);
  }

  /* --- Reaction picker: centered on mobile --- */
  .feed-reaction-picker {
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
  }

  /* --- Saved posts header --- */
  .feed-saved-header {
    margin: 0 0 var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* --- Empty state: centered --- */
  .feed-empty {
    padding: var(--space-3xl) var(--space-lg);
  }
  .feed-empty h3 {
    font-size: 1.1rem;
  }

  /* --- Right sidebar: below feed on mobile, no grid --- */
  .feed-sidebar-right {
    grid-template-columns: 1fr;
    padding: 0 var(--space-sm);
    margin-top: var(--space-md);
    gap: var(--space-sm);
  }

  /* --- Repost header --- */
  .feed-repost-header {
    padding: var(--space-xs) var(--space-md) 0;
    font-size: 0.75rem;
  }

  /* --- Post pinned badge --- */
  .feed-post-pinned {
    font-size: 0.6875rem;
  }

  /* --- Confirm dialog: better mobile sizing --- */
  .feed-confirm-overlay {
    padding: var(--space-md);
  }
  .feed-confirm-box {
    max-width: 100%;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
  }
  .feed-confirm-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .feed-confirm-actions .btn-sm {
    width: 100%;
    padding: 12px;
    font-size: 0.9375rem;
  }

  /* --- Load more: full width --- */
  .feed-load-more {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }
  .feed-load-more-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
  }

  /* --- Login card (not logged in) --- */
  .feed-login-card {
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
  }

  /* --- Expand button --- */
  .feed-post-expand {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
  }
}

/* --- Very small mobile --- */
@media (max-width: 400px) {
  .feed-mob-actions {
    flex-direction: column;
  }
  .feed-mob-action {
    justify-content: center;
  }
  .feed-interaction-btn svg {
    width: 16px;
    height: 16px;
  }
}
