:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-input: #f8fafc;
  --bg-main: #f8fafc;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-link: #2563eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #ef4444;
  --success: #10b981;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   APP SHELL & CLOUDFLARE-STYLE SIDEBAR LAYOUT
   ========================================================================== */
:root {
  --sidebar-width: 256px;
  --topbar-height: 60px;
  --content-max-width: 1272px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-body);
  position: relative;
}

/* SIDEBAR: Pinned to the left edge of the screen */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 90;
  background: var(--bg-card, #ffffff);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-main);
}

/* SIDEBAR SEARCH TRIGGER (Cloudflare Spotlight in left column) */
.sidebar-search-container {
  padding: 0 14px 14px 14px;
  border-bottom: 1px solid var(--border-subtle, var(--border-color));
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
}

.sidebar-search-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-muted, #64748b);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.sidebar-search-trigger:hover {
  border-color: var(--primary, #d97706);
  background: var(--bg-hover, #f8fafc);
  color: var(--text-main, #0f172a);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.search-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.sidebar-search-trigger:hover .search-trigger-icon {
  color: var(--primary, #d97706);
}

.search-trigger-placeholder {
  flex: 1;
  font-size: 0.825rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-trigger-kbd {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  line-height: 1.2;
  flex-shrink: 0;
}

/* SIDEBAR NAV */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-header {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}

.sidebar-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary, #475569);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.sidebar-menu-item:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.04));
  color: var(--primary);
  transform: translateX(2px);
}

.sidebar-menu-item.active {
  background: var(--primary-light, #eff6ff);
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.sidebar-menu-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.sidebar-menu-item:hover .sidebar-menu-icon {
  color: var(--primary);
}

.sidebar-menu-item.active .sidebar-menu-icon {
  color: var(--primary);
}

.sidebar-menu-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-footer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer-title {
  font-weight: 700;
  color: var(--text-main);
}

.sidebar-footer-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* MAIN AREA */
.app-main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--topbar-height);
  box-sizing: border-box;
}

.topbar-inner {
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: var(--bg-hover, #f1f5f9);
}

.topbar-mobile-brand {
  display: none;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.9;
}

.brand-icon-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-title {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.brand-highlight {
  color: var(--primary);
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  min-width: 0;
}

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

/* CONTENT CONTAINER (MAX-WIDTH 1272PX, FLUID) */
.app-content-wrapper {
  flex: 1;
  width: 100%;
}

.content-container {
  max-width: var(--content-max-width, 1272px);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  box-sizing: border-box;
}

/* LAYOUT CONTAINER INSIDE CONTENT CONTAINER */
.layout-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.main-column {
  min-width: 0;
  width: 100%;
}

.sidebar-column {
  min-width: 0;
  width: 100%;
}

/* FEED TABS */
.feed-tabs-header {
  border-bottom: none;
  margin-bottom: 20px;
}

.feed-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-color);
  padding: 5px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
}

.feed-tabs::-webkit-scrollbar {
  display: none;
}

.feed-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  transition: all 0.2s ease;
  border: none !important;
  white-space: nowrap !important;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}

.feed-tab-item svg {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.feed-tab-item:hover {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.feed-tab-item:hover svg {
  color: var(--primary);
}

.feed-tab-item.active {
  background: #ffffff !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.12) !important;
  font-weight: 700;
}

.feed-tab-item.active svg {
  color: var(--primary) !important;
}

@media (max-width: 768px) {
  .feed-tabs {
    padding: 4px;
    gap: 6px;
  }
  .feed-tab-item {
    padding: 7px 12px;
    font-size: 0.82rem;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .feed-tabs {
    padding: 4px;
    gap: 4px;
  }
  .feed-tab-item {
    padding: 6px 10px;
    font-size: 0.78rem;
    gap: 5px;
  }
}

.feed-tab-item.danger-tab:hover {
  color: #dc2626 !important;
}

.feed-tab-item.danger-tab:hover svg {
  color: #dc2626 !important;
}

.feed-tab-item.danger-tab.active {
  color: #dc2626 !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15) !important;
}

.feed-tab-item.danger-tab.active svg {
  color: #dc2626 !important;
}

/* EMPTY FEED STATE */
.empty-feed-state {
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.empty-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 0.9rem;
  color: #64748b;
  max-width: 420px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.empty-action-btn {
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* POST CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.card-header.card-header-integrated {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/* ==========================================================================
   INTEGRATED POST HEADER (Option B: Space + Author combo with corner badge)
   ========================================================================== */
.space-author-combo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.space-logo-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
}

.space-main-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.space-main-logo.is-group {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.space-main-logo.is-blog {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
}

.space-main-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.space-main-logo:hover {
  transform: scale(1.05);
  border-color: var(--primary, #0284c7);
}

.space-corner-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.space-corner-badge.is-group {
  background: #d97706;
  color: #ffffff;
}

.space-corner-badge.is-blog {
  background: #7c3aed;
  color: #ffffff;
}

.space-corner-badge svg {
  width: 10px;
  height: 10px;
  stroke: #ffffff;
}

.combo-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.combo-space-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.combo-space-name {
  font-weight: 800;
  font-size: 0.975rem;
  color: var(--text-main, #0f172a);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.combo-space-name:hover {
  color: var(--primary, #0284c7);
  text-decoration: underline;
}

.combo-author-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-mini-avatar-link {
  display: inline-flex;
  flex-shrink: 0;
  text-decoration: none;
}

.author-mini-avatar {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.author-mini-avatar.author-mini-placeholder {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-muted, #64748b);
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.combo-author-name {
  color: var(--text-main, #0f172a);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.combo-author-name:hover {
  color: var(--primary, #0284c7);
  text-decoration: underline;
}

.combo-author-line .meta-bullet {
  opacity: 0.45;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.combo-post-time,
.combo-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted, #64748b);
  font-size: 0.775rem;
  font-weight: 400;
  flex-shrink: 0;
}

.combo-meta-item.combo-meta-type {
  color: var(--text-muted, #64748b);
  font-size: 0.775rem;
  font-weight: 400;
}

.post-space-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.post-space-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-space-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  min-width: 0;
}

.post-space-mini-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary, #e2e8f0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary, #0284c7);
  flex-shrink: 0;
}

.post-space-mini-logo.is-blog {
  background: #f5f3ff;
  color: #6d28d9;
}

.post-space-mini-logo.is-group {
  background: #fefce8;
  color: #b45309;
}

.post-space-mini-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-space-bar-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main, #0f172a);
  max-width: 460px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-space-bar-link:hover .post-space-bar-name {
  color: var(--primary, #0284c7);
  text-decoration: underline;
}

.post-space-kind-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  cursor: default;
}

.post-space-kind-icon:hover {
  transform: scale(1.1);
}

.post-space-kind-icon.is-blog {
  background: #ede9fe;
  color: #6d28d9;
}

.post-space-kind-icon.is-group {
  background: #fef3c7;
  color: #b45309;
}

.post-space-kind-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.post-space-kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 12px;
}

.post-space-kind-badge.blog {
  background: #ede9fe;
  color: #6d28d9;
}

.post-space-kind-badge.group {
  background: #e0f2fe;
  color: #0369a1;
}

.post-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #475569;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-lg {
  width: 96px;
  height: 96px;
  border: 4px solid #fff;
}

.avatar:hover .avatar-edit-overlay {
  opacity: 1 !important;
}

.author-meta .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.author-meta .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.post-content {
  font-size: 0.925rem;
  color: #334155;
  margin-bottom: 14px;
  white-space: pre-line;
  line-height: 1.6;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-badge,
.pin-tag-chip {
  background: var(--bg-surface, #f8fafc);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.775rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 9999px;
  white-space: nowrap !important;
  word-break: keep-all;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
  flex-shrink: 0;
  text-decoration: none;
  transition: all 0.15s ease;
}

.tag-badge:hover,
.pin-tag-chip:hover {
  background: var(--primary-light, #eff6ff);
  color: var(--primary, #2563eb);
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.post-space-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-decoration: none;
  vertical-align: middle;
  line-height: 1.3;
}

.post-space-badge.group {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.2);
}

.post-space-badge.group:hover {
  background: #bae6fd;
  color: #0284c7;
}

.post-space-badge.blog {
  background: #ede9fe;
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.post-space-badge.blog:hover {
  background: #ddd6fe;
  color: #6d28d9;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 0px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  transition: color 0.15s;
}

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

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

/* SIDEBAR WIDGETS */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* NAV MENU WIDGET */
.nav-menu-widget {
  padding: 8px;
}

.nav-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 500;
  color: #334155;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-menu-item:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

.nav-menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-menu-icon {
  font-size: 1.05rem;
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* USER PROFILE WIDGET */
.user-profile-widget {
  padding: 16px;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.avatar-widget {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  font-weight: 700;
}

.user-profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.user-profile-email {
  font-size: 0.775rem;
  color: #64748b;
  word-break: break-all;
}

.user-profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
  text-align: center;
}

.stat-box .stat-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.stat-box .stat-label {
  font-size: 0.675rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.5px;
}

.profile-btn {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  text-align: center;
}

/* WIDGET LIST */
.widget-list {
  list-style: none;
}

.widget-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-body);
}

.btn-block {
  width: 100%;
}

/* FOOTER */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  margin-top: 48px;
  padding: 36px 0 0;
  color: #64748b;
}

.footer-container {
  max-width: var(--content-max-width, 1272px);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.footer-desc {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.6;
  max-width: 380px;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
}

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

.footer-bottom {
  margin-top: 32px;
  border-top: 1px solid var(--border-color);
  padding: 16px 0;
  font-size: 0.8rem;
  background: var(--bg-body);
}

.footer-bottom-container {
  max-width: var(--content-max-width, 1272px);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* SPACE BANNER */
.space-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  position: relative;
}

.space-cover {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}

.space-body {
  padding: 0 24px 20px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.space-info {
  margin-top: -48px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

/* UNIFIED SPACE & BLOG HEADER LAYOUT (TWITTER / FACEBOOK 2-TIER PATTERN) */
.space-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}

.space-header-avatar {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
  margin-top: -42px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
}

.space-header-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
  word-break: break-word;
}

@media (max-width: 640px) {
  .space-body,
  .blog-header-content {
    padding: 0 16px 16px 16px !important;
  }

  .space-header-top-row {
    margin-bottom: 10px !important;
    gap: 10px !important;
  }

  .space-header-avatar {
    width: 68px !important;
    height: 68px !important;
    margin-top: -34px !important;
    border-radius: 14px !important;
    font-size: 1.8rem !important;
  }

  .space-header-title {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
  }
}

/* COMMENTS */
.comments-container {
  margin-top: 16px;
}

.comment-item {
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
}

.comment-reply {
  margin-left: 36px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active,
.modal-backdrop.is-open {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.input-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 12px;
  outline: none;
}

.input-control:focus {
  border-color: var(--primary);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--primary, #d97706);
  cursor: pointer;
}

/* RESPONSIVE (BELOW 1200PX: COLLAPSE 3-COLUMN TO 2-COLUMN, HIDE RIGHT SIDEBAR) */
@media (max-width: 1200px) {
  .layout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .home-sidebar-column {
    display: none !important;
  }

  .sidebar-column {
    order: 2;
  }
}

/* RESPONSIVE (BELOW 880PX: SIDEBAR COLLAPSES INTO HAMBURGER) */
@media (max-width: 880px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    width: 280px;
    max-width: 85vw;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .sidebar-toggle-btn {
    display: flex;
  }

  .topbar-mobile-brand {
    display: flex;
  }

  .topbar-inner {
    padding: 0 16px;
  }

  .content-container {
    padding: 16px 12px;
  }

  .layout-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-sidebar-column {
    display: none !important;
  }

  .sidebar-column {
    order: 2;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 16px;
  }

  .footer-bottom-container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 0 16px;
  }
}

/* MEDIA CAROUSEL (REDDIT STYLE) */
.media-carousel {
  position: relative;
  width: 100%;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f172a;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  min-height: 280px;
  max-height: 520px;
  user-select: none;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.carousel-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 5;
  pointer-events: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s;
  font-size: 1rem;
  outline: none;
}

.carousel-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn-prev {
  left: 10px;
}

.carousel-btn-next {
  right: 10px;
}

/* YOUTUBE PLAYER FACADE (FAST LOAD & ZERO-WASTE) */
.youtube-facade {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.youtube-facade img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: opacity 0.2s, transform 0.2s;
}

.youtube-facade:hover img {
  opacity: 1;
  transform: scale(1.01);
}

.youtube-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 44px;
  background: rgba(220, 38, 38, 0.9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
  z-index: 2;
}

.youtube-facade:hover .youtube-play-btn {
  background: #ff0000;
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-play-btn svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  margin-left: 2px;
}

.youtube-facade iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* COMPOSER MODERN REDESIGN */
.composer-card {
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.composer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.composer-segmented-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
}

.composer-tab-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.composer-tab-btn:hover {
  color: var(--text-main);
}

.composer-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.composer-article-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.composer-article-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.composer-main-area {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.composer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.composer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-inputs-box {
  flex: 1;
  min-width: 0;
}

.composer-title-field {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  outline: none;
  box-sizing: border-box;
}

.composer-title-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.composer-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  line-height: 1.5;
  color: var(--text-main);
  resize: vertical;
  min-height: 75px;
  outline: none;
  box-sizing: border-box;
  background: #ffffff;
}

.composer-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.composer-field-error {
  display: none;
  color: var(--danger, #dc2626);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 2px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.composer-media-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.composer-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  flex-shrink: 0;
}

.composer-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer-preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: none;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}

.composer-preview-remove:hover {
  background: var(--danger);
}

.composer-youtube-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.composer-youtube-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  margin-top: 10px;
}

.composer-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px solid #f1f5f9;
  gap: 10px;
  flex-wrap: nowrap;
}

.composer-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-tool-btn {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.composer-tool-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

.composer-tag-wrap {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  height: 32px;
}

.composer-tag-input {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-main);
  outline: none;
  width: 110px;
}

.composer-submit-btn {
  padding: 7px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-discussion {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* NOTIFICATIONS DROPDOWN & BADGE */
.notification-wrapper {
  position: relative;
}

.notification-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.15s;
}

.notification-btn:hover {
  background: var(--bg-hover, #f1f5f9);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-card, #ffffff);
  line-height: 1;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 380px;
  max-width: 90vw;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.notification-dropdown.active {
  display: flex;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
}

.notification-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main, #0f172a);
}

.notification-header .btn-link {
  background: none;
  border: none;
  color: var(--primary, #2563eb);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.notification-header .btn-link:hover {
  text-decoration: underline;
}

.notification-list {
  max-height: 380px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.notification-item:hover {
  background: var(--bg-hover, #f8fafc);
}

.notification-item.unread {
  background: rgba(37, 99, 235, 0.05);
}

.notification-item.unread:hover {
  background: rgba(37, 99, 235, 0.09);
}

.notification-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #475569;
}

.notification-item-body {
  flex: 1;
  min-width: 0;
}

.notification-item-text {
  font-size: 0.85rem;
  color: var(--text-main, #0f172a);
  line-height: 1.35;
  margin-bottom: 4px;
  word-break: break-word;
}

.notification-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  display: inline-block;
}

.notification-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
}

/* OPTIONS DROPDOWN (Three dots menu) */
.options-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ukrycie kropek dopóki nie najedzie się na rodzica (karta wpisu, komentarz, wiersz) */
.card .card-header .options-dropdown,
.comment-item .options-dropdown,
.comment-reply .options-dropdown,
.member-card .options-dropdown {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.card:hover .card-header .options-dropdown,
.comment-item:hover .options-dropdown,
.comment-reply:hover .options-dropdown,
.member-card:hover .options-dropdown,
.options-dropdown:focus-within,
.options-dropdown:has(.options-menu.active) {
  opacity: 1;
  visibility: visible;
}

@media (hover: none) {
  .card .card-header .options-dropdown,
  .comment-item .options-dropdown,
  .comment-reply .options-dropdown,
  .member-card .options-dropdown {
    opacity: 1;
    visibility: visible;
  }
}

.options-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: var(--radius-sm, 6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.options-btn svg {
  display: block;
  flex-shrink: 0;
}

.options-btn:hover {
  background: #f1f5f9;
  color: var(--text-main, #0f172a);
}

.options-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 160px;
  padding: 4px 0;
  display: none;
}

.options-menu.active {
  display: block;
}

.options-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-main, #334155);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
  text-decoration: none;
}

.options-item:hover {
  background: #f8fafc;
}

.options-item.danger {
  color: #dc2626;
}

.options-item.danger:hover {
  background: #fef2f2;
}

/* OAUTH / SOCIAL LOGIN BUTTONS */
.oauth-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color, #e2e8f0);
  background: #ffffff;
  color: var(--text-main, #1e293b);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-oauth:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-oauth svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-oauth.btn-google {
  background: #ffffff;
  color: #374151;
  border-color: #e5e7eb;
}
.btn-oauth.btn-google:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-oauth.btn-facebook {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}
.btn-oauth.btn-facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted, #94a3b8);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.auth-divider span {
  padding: 0 12px;
}

/* USER MENU & DROPDOWN */
.user-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.user-menu-trigger:hover,
.user-menu-wrapper:hover .user-menu-trigger {
  background-color: var(--bg-card-hover, #f1f5f9);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}

.avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.avatar-link:hover {
  transform: scale(1.05);
}

.user-menu-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #64748b);
  transition: transform 0.2s ease, color 0.15s ease;
  pointer-events: none;
}

.user-menu-wrapper:hover .user-menu-chevron {
  transform: rotate(180deg);
  color: var(--text-main, #0f172a);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% - 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  transition-delay: 0.25s;
  pointer-events: none;
  overflow: hidden;
  padding: 6px 0;
}

/* Hover bridge: covers top and surrounding area so cursor movements never break hover */
.user-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -24px;
  left: -20px;
  right: -20px;
  height: 28px;
  background: transparent;
}

.user-menu-wrapper:hover .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.user-dropdown-header {
  padding: 8px 14px 10px 14px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 4px;
}

.user-dropdown-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-dropdown-handle {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.user-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main, #334155);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.user-dropdown-item svg {
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.user-dropdown-item:hover {
  background-color: var(--bg-card-hover, #f1f5f9);
  color: var(--primary, #2563eb);
}

.user-dropdown-item:hover svg {
  color: var(--primary, #2563eb);
}

.user-dropdown-divider {
  height: 1px;
  background-color: var(--border-color, #e2e8f0);
  margin: 6px 0;
  list-style: none;
}

.user-dropdown-logout {
  color: var(--danger, #ef4444);
}

.user-dropdown-logout svg {
  color: var(--danger, #ef4444);
}

.user-dropdown-logout:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.user-dropdown-logout:hover svg {
  color: #dc2626;
}

/* LANGUAGE SELECTOR IN TOPBAR */
.lang-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.lang-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md, 8px);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-main, #0f172a);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.lang-menu-trigger:hover,
.lang-menu-wrapper:hover .lang-menu-trigger {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--border-color, #e2e8f0);
}

.lang-flag {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
}

.lang-flag-svg {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.lang-code {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.lang-chevron {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted, #64748b);
  transition: transform 0.2s ease, color 0.15s ease;
}

.lang-menu-wrapper:hover .lang-chevron {
  transform: rotate(180deg);
  color: var(--text-main, #0f172a);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 0;
  min-width: 270px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  transition-delay: 0.2s;
  pointer-events: none;
  overflow: hidden;
  padding: 6px 0;
}

.lang-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -24px;
  left: -20px;
  right: -20px;
  height: 28px;
  background: transparent;
}

.lang-menu-wrapper:hover .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.lang-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 0.875rem;
  color: var(--text-main, #0f172a);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.lang-dropdown-item:hover {
  background-color: var(--bg-hover, #f1f5f9);
  color: var(--primary, #2563eb);
}

.lang-dropdown-item.active {
  font-weight: 700;
  color: var(--primary, #2563eb);
  background-color: rgba(37, 99, 235, 0.05);
}

.lang-item-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.lang-item-name {
  flex: 1;
}

.lang-sub-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.lang-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: #ffffff;
  color: var(--text-muted, #64748b);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.lang-pill-btn:hover {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: var(--primary, #2563eb);
}

.lang-pill-btn.active {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: var(--primary, #2563eb);
}

.lang-item-check {
  font-size: 0.9rem;
  color: var(--primary, #2563eb);
  font-weight: bold;
}

/* MEMBER & AUTHOR ROLE BADGES */
.member-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  line-height: 1.3;
}
.badge-owner {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-coadmin {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.badge-moderator {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-author {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}
.badge-member {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* SEARCH DROPDOWN & RESULTS STYLING */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 480px;
  overflow-y: auto;
  padding: 8px 0;
}

.search-dropdown-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  padding: 6px 14px 4px;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text-color, #1e293b);
  transition: background 0.15s ease;
}

.search-dropdown-item:hover {
  background: var(--bg-hover, #f1f5f9);
}

.search-dropdown-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.search-dropdown-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.search-dropdown-footer {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding: 8px 14px 4px;
  margin-top: 4px;
  text-align: center;
}

.search-dropdown-footer a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.search-dropdown-info {
  flex: 1;
  min-width: 0;
}

.search-dropdown-title {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.search-dropdown-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.85rem;
}

.search-dropdown-avatar-rounded,
.search-dropdown-icon-rounded {
  border-radius: 50% !important;
}

/* REPORT MODAL HELPERS */
.report-reasons-loading {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.report-reason-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* COMPOSER MEDIA PREVIEWS */
.composer-media-item {
  position: relative;
  display: inline-block;
}

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

.composer-media-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger, #ef4444);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

/* CARD ANIMATION & UTILITIES */
.card-fading {
  opacity: 0.3;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.hidden,
.d-none {
  display: none !important;
}

.d-flex {
  display: flex !important;
}

.d-block {
  display: block !important;
}

.align-center {
  align-items: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

.justify-end {
  justify-content: flex-end !important;
}

.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }

/* SPACE TABS & BADGES */
.space-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.space-nav-tab:hover {
  color: var(--primary);
}
.space-nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.badge-counter {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}
.space-nav-tab.active .badge-counter {
  background: var(--primary-light);
  color: var(--primary);
}
.member-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}
.badge-owner {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-coadmin {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.badge-moderator {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-author {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-member {
  background: #f1f5f9;
  color: #64748b;
}
.member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}
.member-card:last-child {
  border-bottom: none;
}
.member-card:hover {
  background: #f8fafc;
}
.user-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-md);
}
.user-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}
.user-suggestion-item:hover {
  background: #f8fafc;
}

/* BLOG & EDITORIAL STYLES */
.blog-header-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.blog-cover {
  height: 180px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  position: relative;
}
.blog-header-content {
  padding: 0 24px 24px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.blog-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: -50px;
  gap: 16px;
  flex-wrap: wrap;
}
.blog-avatar-wrap {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  background: #7c3aed;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.blog-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.blog-title-section h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}
.blog-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.blog-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  background: var(--bg-body, #f8fafc);
  padding: 3px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease;
}
.blog-author-badge:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.blog-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-editorial-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.article-editorial-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}
.article-cover-wrap {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: #0f172a;
  position: relative;
}
.article-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.article-editorial-card:hover .article-cover-img {
  transform: scale(1.02);
}
.article-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.article-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px 0;
}
.article-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease;
}
.article-title a:hover {
  color: var(--primary);
}
.article-excerpt {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 18px 0;
  flex: 1;
}
.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  padding-bottom: 0px;
  margin-top: auto;
  gap: 12px;
  flex-wrap: wrap;
}
.article-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-meta-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sidebar-sticky-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* COMMAND PALETTE / SPOTLIGHT SEARCH MODAL */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 70px 16px 24px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

body.search-modal-open {
  overflow: hidden;
}

.search-modal-box {
  width: 100%;
  max-width: 620px;
  background: var(--bg-card, #ffffff);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.97) translateY(-10px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 82vh;
}

.search-modal-backdrop.open .search-modal-box {
  transform: scale(1) translateY(0);
}

.search-modal-form {
  margin: 0;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #ffffff;
}

.search-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #d97706);
  flex-shrink: 0;
}

.search-modal-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 1.05rem !important;
  font-family: inherit !important;
  color: var(--text-main, #0f172a) !important;
  padding: 0 !important;
}

.search-modal-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.search-modal-clear-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.search-modal-clear-btn:hover {
  color: var(--text-main, #0f172a);
}

.search-modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.search-modal-esc-label {
  display: inline-flex;
}

.search-modal-esc-label kbd {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  cursor: pointer;
}

.search-modal-close-icon {
  display: none;
}

/* Modal Results */
.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 140px;
  max-height: 52vh;
}

.search-modal-initial-state {
  padding: 16px 8px;
  text-align: left;
}

.search-modal-hints-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.search-modal-hints-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-hint-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.825rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-hint-pill:hover {
  background: var(--primary-light, #fef3c7);
  border-color: var(--primary, #d97706);
  color: var(--primary, #b45309);
}

.search-modal-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 10px 4px 10px;
}

.search-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md, 10px);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.search-modal-item:hover {
  background: var(--bg-hover, #f8fafc);
}

.search-modal-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 6px);
  object-fit: cover;
  flex-shrink: 0;
}

.search-modal-item-avatar.rounded {
  border-radius: 50%;
}

.search-modal-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 6px);
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.search-modal-item-icon.rounded {
  border-radius: 50%;
}

.search-modal-item-icon.tag-hash {
  color: var(--primary, #d97706);
  background: #fffbeb;
}

.search-modal-item-body {
  flex: 1;
  min-width: 0;
}

.search-modal-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-modal-item:hover .search-modal-item-title {
  color: var(--primary, #d97706);
}

.search-modal-item-sub {
  font-size: 0.775rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-modal-item-enter {
  color: #cbd5e1;
  font-size: 1rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.search-modal-item:hover .search-modal-item-enter {
  color: var(--primary, #d97706);
  transform: translateX(3px);
}

.search-modal-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted, #64748b);
}

/* Modal Footer */
.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color, #f1f5f9);
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.search-modal-footer-kbd {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-modal-footer-kbd kbd {
  font-family: inherit;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 3px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  margin-right: 4px;
}

.search-modal-footer-link {
  color: var(--primary, #d97706);
  text-decoration: none;
  font-weight: 600;
}

/* Mobile Search Modal Responsive (No gray footer, full height, touch friendly) */
@media (max-width: 640px) {
  .search-modal-backdrop {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .search-modal-box {
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  .search-modal-results {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  .search-modal-footer {
    display: none !important;
  }
  .search-modal-esc-label {
    display: none !important;
  }
  .search-modal-close-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #64748b;
    padding: 6px;
    border-radius: 6px;
    background: #f1f5f9;
  }
  .search-modal-input {
    font-size: 1rem !important;
  }
}

/* Base Pins Module Styles */
.pins-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--bg-card, #ffffff);
  padding: 10px 16px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}
.pins-feed-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pins-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
}
.pins-tab-item.active {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
  font-weight: 700;
}
.pins-tab-item svg,
.pins-tab-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}
.pin-card-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.pin-thumb-wrapper {
  flex-shrink: 0;
  width: 140px;
  height: 95px;
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  background: #f1f5f9;
  position: relative;
  display: block;
}
.pin-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pin-content-body {
  flex: 1;
  min-width: 0;
}
.pin-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.pin-title-h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}
.pin-excerpt-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pin-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
@media (max-width: 640px) {
  .pin-card-layout {
    flex-direction: column;
  }
  .pin-thumb-wrapper {
    width: 100%;
    height: 170px;
  }
}

/* ==========================================================================
   MONETIZATION, DONATIONS & CREATOR SUITE DESIGN SYSTEM
   ========================================================================== */

.btn-donate {
  background: var(--gold-gradient, linear-gradient(135deg, #f59e0b 0%, #d97706 100%)) !important;
  border: 1px solid #d97706 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer;
  line-height: 1.2 !important;
}

.btn-donate:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  border-color: #b45309 !important;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45) !important;
  transform: translateY(-1.5px);
  color: #ffffff !important;
}

.btn-donate:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3) !important;
}

.btn-donate .donut-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-donate:hover .donut-icon {
  transform: scale(1.2) rotate(-8deg);
}

.btn-creator-studio {
  background: #ffffff !important;
  border: 1.5px solid #f59e0b !important;
  color: #b45309 !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 7px 16px !important;
  border-radius: 9999px !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-creator-studio:hover {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
  color: #92400e !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.25) !important;
  transform: translateY(-1px);
}

.blog-donation-card {
  position: relative;
  background: linear-gradient(155deg, #ffffff 0%, #fffdf9 45%, #fef8ee 100%) !important;
  border: 1px solid #ebdccc !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px -2px rgba(217, 119, 6, 0.08), 0 2px 6px -1px rgba(28, 25, 23, 0.04) !important;
  padding: 20px !important;
  overflow: hidden;
  margin-bottom: 20px;
}

.blog-donation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.blog-donation-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.blog-donation-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.blog-donation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 4px;
}

.blog-donation-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin: 0;
}

.blog-donation-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 14px 0;
}

.blog-goal-box {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(217, 119, 6, 0.05);
}

.blog-goal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.825rem;
  font-weight: 700;
}

.blog-goal-title {
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-goal-percent {
  font-size: 0.85rem;
  font-weight: 800;
  color: #b45309;
}

.blog-goal-track {
  width: 100%;
  height: 8px;
  background: #f1e8dd;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.blog-goal-bar {
  height: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.blog-goal-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recent-supporters-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #ebdccc;
}

.recent-supporters-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recent-supporter-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #f5ede2;
  border-radius: 10px;
  margin-bottom: 7px;
  transition: all 0.15s ease;
}

.recent-supporter-item:hover {
  background: #ffffff;
  border-color: #ebdccc;
  box-shadow: 0 2px 6px rgba(28, 25, 23, 0.04);
}

.supporters-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.supporters-modal-box {
  background: var(--bg-surface, #ffffff);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.custom-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 26px;
}

.custom-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-toggle-switch input:checked + .custom-toggle-slider {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.custom-toggle-switch input:checked + .custom-toggle-slider:before {
  transform: translateX(22px);
}

.donation-tier-pill {
  border: 2px solid #e2e8f0;
  background: transparent;
  border-radius: 14px;
  padding: 12px 8px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.donation-tier-pill:hover {
  border-color: #fed7aa;
  background: #fffcf7;
  transform: translateY(-1px);
}

.donation-tier-pill.active {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #b45309;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.2);
}

.stripe-connect-banner {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.stripe-connect-banner:hover {
  box-shadow: var(--shadow-md);
}

.stripe-logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
  flex-shrink: 0;
}

.creator-metric-card {
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.creator-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.payment-celebration-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 28px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  margin: 40px auto;
  position: relative;
  overflow: hidden;
}

.payment-celebration-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

@keyframes agy-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-animation {
  animation: agy-spin 0.8s linear infinite;
  display: inline-block;
}

/* =============================================================
   UNIFIED TAG INPUT COMPONENT (BADGES / CHIPS UX)
   ============================================================= */

.tag-input-wrapper {
  position: relative;
  width: 100%;
}

.tag-input-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-input, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  min-height: 42px;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.tag-input-box:focus-within {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tag-input-box.has-error {
  border-color: var(--danger, #ef4444) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 2px 8px 2px 10px;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1.4;
  user-select: none;
  animation: tag-chip-pop 0.15s ease-out;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

@keyframes tag-chip-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.tag-chip:hover {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.4);
}

.tag-chip-label {
  cursor: pointer;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: var(--primary, #2563eb);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

.tag-chip-remove:hover {
  opacity: 1;
  color: var(--danger, #ef4444);
  transform: scale(1.2);
}

.tag-input-field {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main, #0f172a);
  flex: 1 1 120px;
  min-width: 100px;
  padding: 4px 0;
  margin: 0;
}

.tag-input-field::placeholder {
  color: var(--text-muted, #94a3b8);
  font-size: 0.825rem;
}

.tag-input-counter {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  margin-left: auto;
  align-self: center;
  padding-left: 6px;
  flex-shrink: 0;
  user-select: none;
}

.tag-input-counter.is-full {
  color: var(--warning, #f59e0b);
}

.tag-input-error {
  font-size: 0.775rem;
  color: var(--danger, #ef4444);
  font-weight: 500;
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
}

.tag-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
}

.tag-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.825rem;
  cursor: pointer;
  color: var(--text-main, #1e293b);
  transition: background 0.12s;
}

.tag-autocomplete-item:hover,
.tag-autocomplete-item.active {
  background: var(--bg-hover, #f1f5f9);
  color: var(--primary, #2563eb);
}

.tag-autocomplete-item-count {
  font-size: 0.725rem;
  color: var(--text-muted, #94a3b8);
}

/* =============================================================
   APPLICATION TOAST & MODAL DIALOG SYSTEM (ZERO NATIVE ALERTS)
   ============================================================= */
.app-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  width: 380px;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  animation: appToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.2s, transform 0.2s;
  color: var(--text-main, #0f172a);
}

.app-toast.toast-hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

.app-toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-toast.toast-success .app-toast-icon { color: #16a34a; }
.app-toast.toast-error .app-toast-icon { color: #dc2626; }
.app-toast.toast-warning .app-toast-icon { color: #d97706; }
.app-toast.toast-info .app-toast-icon { color: var(--primary, #2563eb); }

.app-toast.toast-success { border-left: 4px solid #16a34a; }
.app-toast.toast-error { border-left: 4px solid #dc2626; }
.app-toast.toast-warning { border-left: 4px solid #d97706; }
.app-toast.toast-info { border-left: 4px solid var(--primary, #2563eb); }

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

.app-toast-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin-bottom: 2px;
}

.app-toast-message {
  font-size: 0.825rem;
  color: var(--text-secondary, #475569);
  line-height: 1.4;
  word-break: break-word;
}

.app-toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--text-muted, #94a3b8);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.app-toast-close:hover {
  color: var(--text-main, #0f172a);
  background: var(--bg-hover, #f1f5f9);
}

@keyframes appToastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* DIALOG OVERLAY & MODAL */
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: appDialogOverlayIn 0.2s ease-out forwards;
  transition: opacity 0.18s ease-in;
}

.app-dialog-overlay.dialog-hide {
  opacity: 0;
}

.app-dialog-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 16px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  animation: appDialogCardIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.app-dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-body-secondary, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-dialog-card.dialog-danger .app-dialog-icon {
  background: #fef2f2;
}

.app-dialog-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin: 0;
}

.app-dialog-body {
  color: var(--text-secondary, #475569);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.app-dialog-body p {
  margin: 0;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #dc2626 !important;
  font-weight: 600;
}

.btn-danger:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

@keyframes appDialogOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes appDialogCardIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}




.joined-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: #16a34a;
  color: #ffffff;
  border: 1px solid #16a34a;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.joined-badge svg {
  color: #ffffff !important;
}

/* POST SINGLE IMAGE BOX */
.post-single-image-box {
  margin-bottom: 16px;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.post-single-image-box img {
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  display: block;
}

/* FEED POST CLICKABLE ELEMENTS (CURSOR ONLY, NO TEXT RESTYLING) */
.post-card-christxp .post-content,
.post-card-christxp .post-single-image-box,
.post-card-christxp .carousel-slide,
.article-editorial-card .article-excerpt,
.article-editorial-card .post-single-image-box,
.card:not(.post-detail-card) .post-content,
.card:not(.post-detail-card) .article-excerpt,
.card:not(.post-detail-card) .post-single-image-box {
  cursor: pointer;
}
.post-content-detail { cursor: default !important; }
