/* === Design Tokens === */
:root {
  --page-bg: #F0F4F9;
  --card-bg: #FFFFFF;
  --card-bg-hover: #F6F8FB;
  --rail-bg: #FFFFFF;

  --accent: #2D6BE4;
  --accent-dark: #1E4FAF;
  --accent-light: #EBF1FD;
  --accent-soft: #F5F8FE;

  --blue: #3B82F6;
  --sky: #38BDF8;
  --teal: #0EA5E9;
  --orange: #F97316;
  --green: #22C55E;
  --rose: #F43F5E;
  --purple: #8B5CF6;
  --amber: #F59E0B;
  --indigo: #4F46E5;

  --text: #0F1D35;
  --text-secondary: #5A6A85;
  --text-muted: #94A3BB;

  --border: #E9EDF4;
  --border-light: #F1F4F9;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 14px;
  --radius-pill: 8px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.65;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #B8C9E0; border-radius: 3px; }

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* === App Layout === */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === Sidebar Navigation === */
.sidebar-nav {
  width: 240px;
  background: var(--rail-bg);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

/* Sidebar community header */
.sidebar-community {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 28px;
}

.sidebar-community-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-community-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-community-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Sidebar section labels */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 6px;
  margin-top: 20px;
}

.sidebar-section-label:first-of-type {
  margin-top: 0;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  position: relative;
}

.rail-indicator {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  position: relative;
}

.nav-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-label {
  white-space: nowrap;
}

.nav-badge {
  margin-left: auto;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  line-height: 1.5;
}

/* Sidebar categories */
.sidebar-categories {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-cat-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-cat-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-cat-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-cat-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.rail-nav--bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.nav-user-info {
  flex: 1;
  min-width: 0;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: capitalize;
}

.nav-user-settings {
  color: var(--text-muted);
  transition: color 0.15s;
  flex-shrink: 0;
}

.nav-user-settings:hover {
  color: var(--accent);
}

/* === Avatar === */
.avatar {
  border-radius: 32%;
  background: linear-gradient(145deg, var(--g1, var(--accent)), var(--g2, var(--sky)));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.avatar-22 { width: 22px; height: 22px; font-size: 8px; }
.avatar-26 { width: 26px; height: 26px; font-size: 9px; }
.avatar-30 { width: 30px; height: 30px; font-size: 10px; }
.avatar-32 { width: 32px; height: 32px; font-size: 11px; }
.avatar-36 { width: 36px; height: 36px; font-size: 12px; }
.avatar-40 { width: 40px; height: 40px; font-size: 14px; }
.avatar-44 { width: 44px; height: 44px; font-size: 15px; }
.avatar-80 { width: 80px; height: 80px; font-size: 28px; }
.avatar-120 { width: 120px; height: 120px; font-size: 42px; }
.avatar-48 { width: 48px; height: 48px; font-size: 16px; }
.avatar-64 { width: 64px; height: 64px; font-size: 20px; }
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  position: absolute;
  top: 0;
  left: 0;
}
.avatar.ring {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(45,107,228,0.25);
}

/* === Main Area === */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === Header === */
.app-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Mobile header elements — hidden on desktop */
.header-mobile-left { display: none; }
.mobile-search-btn { display: none !important; }
.mobile-search-bar { display: none; }

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 9px 16px 9px 42px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--page-bg);
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: rgba(45,107,228,0.3);
  box-shadow: 0 0 0 3px rgba(45,107,228,0.07);
  background: var(--card-bg);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-avatars {
  display: flex;
  margin-right: 8px;
}
.header-avatar-item { margin-left: -8px; }
.header-avatar-item:first-child { margin-left: 0; }
.header-avatar-more {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-left: -8px;
  border: 2px solid #fff;
}

.icon-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.icon-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* === Notification Bell & Dropdown === */
.notif-wrap {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  border: 2px solid var(--card-bg);
  box-sizing: border-box;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 450px;
  max-height: 480px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notifFadeIn 0.12s ease;
}
.notif-dropdown.hidden { display: none; }
@keyframes notifFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 600;
}
.notif-dropdown-header a {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.notif-dropdown-header a:hover {
  text-decoration: underline;
}
.notif-dropdown-body {
  overflow-y: auto;
  flex: 1;
}
.notif-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-light);
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background: var(--page-bg);
}
.notif-item.unread {
  background: color-mix(in srgb, var(--accent) 5%, var(--card-bg));
}
.notif-item.unread:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--card-bg));
}
.notif-item-content {
  flex: 1;
  min-width: 0;
}
.notif-item-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.notif-item-preview {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.notif-item-dot-wrap {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.notif-item-dot-wrap:hover {
  background: color-mix(in srgb, var(--text) 12%, transparent);
}
.notif-dot-tooltip {
  position: fixed;
  background: var(--text);
  color: var(--card-bg);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.12s;
}
.notif-dot-tooltip.visible {
  opacity: 1;
}
.notif-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: opacity 0.15s;
}
.notif-item-dot.unread {
  background: var(--accent);
}
.notif-item-dot.read {
  background: transparent;
  border: 2px solid var(--text-muted);
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  opacity: 0;
}
.notif-item:hover .notif-item-dot.read {
  opacity: 1;
}
.notif-item .avatar-level-wrap {
  flex-shrink: 0;
}
.notif-item .avatar-level {
  width: 16px;
  height: 16px;
  font-size: 9px;
  bottom: -2px;
  right: -2px;
  border-width: 1.5px;
}
@media (max-width: 768px) {
  .notif-dropdown {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 56px);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* === User Menu Dropdown === */
.user-menu-wrap {
  position: relative;
}

.user-menu-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 32%;
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
}
.user-menu-trigger:hover { opacity: 0.85; }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 200;
  padding: 6px;
  animation: userMenuFadeIn 0.12s ease;
}
.user-menu-dropdown.hidden { display: none; }

@keyframes userMenuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
}

.user-menu-info { min-width: 0; }

.user-menu-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
.user-menu-item:hover {
  background: var(--page-bg);
}
.user-menu-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.user-menu-item-danger { color: var(--rose); }
.user-menu-item-danger svg { color: var(--rose); }
.user-menu-item-danger:hover { background: #fef2f2; }

/* === Community Switcher === */
.community-switcher-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.community-home-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 0 8px 0 0;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  color: var(--text);
}

.community-switcher-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.12s;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 2px;
}
.community-switcher-trigger:hover {
  background: var(--page-bg);
  color: var(--text);
  border-color: var(--text-muted);
}

.header-community-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  color: white;
}
.header-community-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-community-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.community-switcher-chevron {
  display: none;
}

.community-switcher-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 200;
  padding: 6px;
  animation: userMenuFadeIn 0.12s ease;
}
.community-switcher-dropdown.hidden { display: none; }

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

.community-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
.community-switcher-item:hover {
  background: var(--page-bg);
}
.community-switcher-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.community-switcher-item-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  color: white;
}
.community-switcher-item-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.community-switcher-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.community-switcher-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.community-switcher-action {
  color: var(--text-secondary);
}

/* === Content Area === */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 60px;
}

.content-flex {
  display: flex;
  gap: 28px;
  width: 100%;
}

.content-flex--no-sidebar .main-content {
  max-width: 100%;
}

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

/* === Category Pills === */
.category-sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.pill-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.category-sort-row .pill-tabs {
  margin-bottom: 0;
  flex: 1;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-block;
}
.cat-pill:hover { border-color: #D4DCE8; color: var(--text); }
.cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Sort Dropdown === */
.sort-dropdown {
  position: relative;
}

.sort-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sort-toggle:hover { border-color: #D4DCE8; color: var(--text); }

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  min-width: 180px;
  z-index: 50;
}

.sort-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.12s ease;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}
.sort-option:hover { background: var(--accent-light); color: var(--accent); }
.sort-option.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* === Compose Box === */
/* === Compose Box === */
.compose-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 90;
  transition: opacity 0.2s ease;
}
.compose-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  transition: all 0.2s ease;
  position: relative;
}
.compose-box.compose-box--expanded {
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.compose-box:not(.compose-box--expanded):hover { border-color: #D4DCE8; }

.compose-collapsed {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.compose-placeholder {
  flex: 1;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.compose-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compose-icon-btn:hover { background: var(--accent-light); color: var(--accent); }

.hidden { display: none !important; }

/* Compose expanded form */
.compose-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.compose-form-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}
.compose-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}
.compose-close-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

.compose-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0 0 10px 0;
  background: none;
  font-family: inherit;
}
.compose-title-input::placeholder { color: var(--text-muted); font-weight: 500; }

.compose-content-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  padding: 0;
  background: none;
  font-family: inherit;
  min-height: 24px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.compose-content-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.compose-content-input a {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* Compose attachments strip */
.compose-attachments {
  position: relative;
  margin: 14px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
}
.compose-att-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 2px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.compose-att-strip::-webkit-scrollbar { display: none; }

.compose-att-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.compose-att-arrow:hover { border-color: var(--accent); color: var(--accent); }
.compose-att-arrow--left { left: -6px; }
.compose-att-arrow--right { right: -6px; }

/* Attachment thumbnail items */
.compose-att-item {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: grab;
}
.compose-att-item:active { cursor: grabbing; }
.compose-att-item.dragging { opacity: 0.5; }
.compose-att-item.drag-over { border-color: var(--accent); border-width: 2px; }

.compose-att-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compose-att-item--video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
}
.compose-att-item--video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}
.compose-att-item--video .compose-att-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.compose-att-item--video .compose-att-play svg { margin-left: 2px; }

.compose-att-item--file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
}
.compose-att-item--file .att-filename {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
}

.compose-att-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 2;
}
.compose-att-remove:hover { background: rgba(220,50,50,0.9); }

/* Compose toolbar */
.compose-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  margin-top: 14px;
  gap: 12px;
}
.compose-toolbar-left {
  display: flex;
  gap: 2px;
}
.compose-tool-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  position: relative;
}
.compose-tool-btn:hover { background: var(--accent-light); color: var(--accent); }
.compose-tool-btn::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.compose-tool-btn:hover::after { opacity: 1; }

.compose-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.compose-category-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--card-bg);
  cursor: pointer;
  min-width: 120px;
  height: 40px;
  margin-right: 18px;
}
.compose-category-select:focus { border-color: var(--accent); outline: none; }
.compose-publish-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  height: 40px;
  border-radius: 10px;
}
.compose-publish-btn.disabled {
  background: var(--border);
  color: var(--text-muted);
  pointer-events: none;
}
.compose-error {
  width: 100%;
  order: -1;
  font-size: 13px;
  color: #dc3545;
  text-align: right;
  padding: 0 2px;
}

/* Post attachments in feed */
/* Post card body with thumbnail */
.post-card-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.post-card-text {
  flex: 1;
  min-width: 0;
}
.post-card-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.post-card-thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-thumb-play svg { margin-left: 2px; }

/* Post detail attachments — horizontal strip */
.post-detail-att-wrap {
  margin-top: 20px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}
.post-detail-attachments {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.post-detail-attachments::-webkit-scrollbar { display: none; }

.att-scroll-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.att-scroll-arrow:hover { border-color: var(--text-muted); color: var(--text); }

.post-detail-att {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-detail-att:hover { opacity: 0.85; }

.post-detail-att--video {
  width: 210px;
  background: #1a1a2e;
}
.post-detail-att--video img,
.post-detail-att--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.att-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.att-play-icon svg { margin-left: 2px; }
.post-detail-att--video:hover .att-play-icon { background: rgba(0,0,0,0.7); }

.post-detail-att--file {
  border: 1px solid var(--border);
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
}
.post-detail-att--file:hover { border-color: var(--accent); opacity: 1; }
.att-file-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Level Badge === */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.level-badge--blue { background: var(--accent); }
.level-badge--green { background: var(--green); }
.level-badge--orange { background: var(--orange); }

/* Level badge on avatar */
.avatar-level-wrap {
  position: relative;
  flex-shrink: 0;
}
.avatar-level {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-bg);
  line-height: 1;
}
.avatar-level--blue { background: var(--accent); }
.avatar-level--green { background: var(--green); }
.avatar-level--orange { background: var(--orange); }

/* Post time category link */
.post-time-dot {
  margin: 0 4px;
  color: var(--text-muted);
}
.post-time-cat {
  color: var(--text-muted);
  transition: color 0.15s;
}
.post-time-cat:hover {
  color: var(--accent);
}

/* === Pill Badge === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--pill-color, var(--accent)) 14%, transparent);
  color: var(--pill-color, var(--accent));
}
.pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pill-color, var(--accent));
}
.pill-sm { font-size: 10px; padding: 2px 8px; }
.pill-sm::before { width: 4px; height: 4px; }

/* === Post Card === */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px 24px 16px;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.2s ease;
  animation: slideUp 0.35s ease both;
}
.post-card:hover {
  border-color: #D4DCE8;
}

.pin-badge {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.post-header {
  display: flex;
  gap: 12px;
}

.post-meta { flex: 1; }

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-author { font-weight: 700; font-size: 14px; }
.post-author--link { color: inherit; text-decoration: none; }
.post-author--link:hover { color: var(--accent); }

.post-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

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

.post-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  transition: color 0.15s;
  margin-top: 14px;
}

.post-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.post-action-btn:hover { background: var(--accent-soft); color: var(--accent); }
.post-action-btn.liked {
  color: var(--rose);
}
.post-action-sm { font-size: 12px; padding: 5px 10px; }

/* Post more button */
.post-more-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}
.post-more-btn:hover { background: var(--accent-light); color: var(--text-secondary); }

/* Commenter mini-avatars */
.commenter-avatars {
  display: flex;
  margin-left: 4px;
}
.commenter-avatars .avatar { margin-left: -6px; border: 1.5px solid #fff; }
.commenter-avatars .avatar:first-child { margin-left: 0; }

/* Last comment time */
.last-comment-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 30px;
}
.last-comment-time--unread {
  color: var(--green);
  font-weight: 600;
}

/* === Post Detail === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

/* Sticky Post Header */
.post-sticky-header-wrap {
  position: sticky;
  top: -28px;
  z-index: 200;
  height: 0;
  overflow: visible;
}
.post-sticky-header {
  display: none;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.post-sticky-header.visible {
  display: flex;
}
.post-sticky-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}
.post-sticky-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-sticky-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.post-detail-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 28px 18px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  position: relative;
}

.post-detail-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.35;
  margin-bottom: 16px;
  margin-top: 18px;
}

.post-detail-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
}
.post-detail-body p { margin-bottom: 12px; }
.post-detail-body a,
.comment-bubble-body a {
  color: var(--accent);
  text-decoration: underline;
}
.post-detail-body a:hover,
.comment-bubble-body a:hover {
  text-decoration: none;
}

/* === Comments — Bubble Layout === */
.comments-section {
  margin-bottom: 24px;
}

.comment-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.comment-row--reply {
  margin-bottom: 10px;
}

.comment-avatar-col {
  flex-shrink: 0;
}

.comment-bubble-col {
  flex: 1;
  min-width: 0;
}

.comment-bubble {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.comment-bubble--highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
  animation: comment-highlight-fade 2s ease-out forwards;
}
@keyframes comment-highlight-fade {
  0%, 50% { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
  100% { border-color: var(--border); box-shadow: none; }
}

.comment-bubble--reply {
  background: var(--card-bg);
}

.comment-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-bubble-meta {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.comment-author { font-weight: 600; font-size: 13px; }
.comment-author--link { color: inherit; text-decoration: none; }
.comment-author--link:hover { color: var(--accent); }

.comment-time-sep {
  margin: 0 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.comment-time { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.comment-bubble-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  word-wrap: break-word;
}
.comment-bubble-body p { margin-bottom: 4px; }
.comment-bubble-body p:last-child { margin-bottom: 0; }

.comment-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.comment-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.comment-pinned-badge svg { color: var(--accent); }

/* Comment menu (3 dots) */
.comment-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.comment-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}
.comment-menu-trigger:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

.comment-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 6px;
  z-index: 100;
  animation: userMenuFadeIn 0.12s ease;
}
.comment-menu.hidden { display: none; }

/* Below-bubble actions: like + reply */
.comment-below-actions {
  display: flex;
  gap: 16px;
  padding: 4px 0 0 14px;
  font-size: 12px;
}

.comment-below-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.comment-below-btn:hover { color: var(--text); }
.comment-below-btn.liked { color: var(--rose); }
.comment-below-btn.liked:hover { color: var(--rose); }
.like-group {
  display: inline-flex;
  align-items: center;
}
.comment-below-btn--like { padding-right: 2px; }
.comment-below-btn--count { padding-left: 2px; }

/* Replies nested under parent */
.comment-replies {
  margin-top: 8px;
  padding-left: 0;
}

/* Inline edit */

/* Reply form info bar */
.comment-form-reply-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--accent-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
}
.comment-form-reply-info.hidden { display: none; }

.comment-form-cancel-reply {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.comment-form-cancel-reply:hover { text-decoration: underline; }

/* === Comment Compose (Bubble) === */
.comment-compose {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
}
.comment-compose > .comment-avatar-col {
  padding-top: 7px;
}
.comment-compose > .comment-avatar-col[style*="display: none"] + .comment-compose-body {
  /* Edit mode: remove top margin when avatar is hidden */
}
.comment-bubble-col > .comment-compose {
  margin-top: 0;
}
.comment-compose-body {
  flex: 1;
  min-width: 0;
}
.comment-compose-bubble {
  background: var(--card-bg, #fff);
  border-radius: 20px;
  padding: 8px 14px;
  border: 1px solid var(--border);
}
.comment-compose-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}
.comment-compose-input {
  flex: 1;
  min-width: 60%;
  min-height: 24px;
  padding: 4px 0;
}
.comment-compose-icons {
  display: flex;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}
.comment-compose-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.comment-compose-icon-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}
.comment-compose-attachments {
  margin-top: 8px;
}
.comment-compose-attachments.hidden { display: none; }
.comment-compose-actions {
  display: none;
  padding: 8px 0 0;
}
.comment-compose-actions.visible { display: block; }
.comment-compose-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}
.comment-compose .compose-error {
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 6px;
}
.comment-compose .compose-error.hidden { display: none; }

/* Comment attachment display (in bubble) */
.comment-att-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.comment-att {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.comment-att--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comment-att--video {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-att--video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}
.comment-att--video .att-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-att--file {
  background: var(--bg-secondary, #f0f2f5);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 80px;
  padding: 8px 12px;
  height: auto;
}
.comment-att--file .att-file-name {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Right Sidebar === */
.right-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === Community Info Box === */
.community-info-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.community-info-cover {
  height: 150px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  position: relative;
}

.community-info-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.community-info-cover-placeholder:hover {
  color: #fff;
}

.community-info-body {
  padding: 16px 20px 20px;
}

.community-info-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.community-info-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
}

.community-info-desc-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.community-info-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.community-info-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.15s;
}
.community-info-link:hover { opacity: 0.8; }

.community-info-stats {
  display: flex;
  gap: 0;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.community-stat {
  flex: 1;
  text-align: center;
}

.community-stat-value {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.community-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.community-info-avatars {
  display: flex;
  margin-bottom: 14px;
}
.community-info-avatars .avatar { margin-left: -6px; border: 2px solid #fff; }
.community-info-avatars .avatar:first-child { margin-left: 0; }

.community-invite-btn {
  display: block;
  width: 100%;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.community-invite-btn:hover { border-color: var(--accent); color: var(--accent); }
a.community-invite-btn { text-decoration: none; }

.checklist-progress {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  position: relative;
  --progress: 0%;
}
.checklist-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), var(--border-light) var(--progress));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
}
.checklist-progress span {
  position: relative;
  z-index: 1;
}

.checklist-title {
  font-size: 14px;
  font-weight: 700;
}

.checklist-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease;
}
.checklist-item:hover { background: var(--accent-soft); }

.checklist-item.completed {
  color: var(--text-muted);
  text-decoration: line-through;
}

.checklist-icon {
  flex-shrink: 0;
}
.checklist-icon--done { color: var(--green); }
.checklist-icon--pending { color: var(--text-muted); }

/* === Admin Onboarding Card === */
.onboarding-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  margin-bottom: 18px;
}

.onboarding-header {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.onboarding-collapse-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.onboarding-card.collapsed .onboarding-collapse-btn {
  transform: rotate(-90deg);
}

.onboarding-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.onboarding-card.collapsed .onboarding-items {
  display: none;
}

/* === Onboarding Video Modal === */
#modal-onboarding-video {
  background: rgba(0, 0, 0, 0.85);
}

#modal-onboarding-video .modal-box--video {
  width: 1100px;
  max-width: 92vw;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  padding: 0;
  box-shadow: 0 20px 80px rgba(0,0,0,.4);
}

.video-modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
  padding: 0;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.onboarding-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.onboarding-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes shake-attention {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(1px); }
}
.shake-attention .post-card { animation: shake-attention 0.5s ease-in-out; }

/* === Invite Link Box === */
.invite-description {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.invite-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.invite-link-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--border-light);
  outline: none;
}

.invite-link-input:focus {
  border-color: var(--accent);
}

.invite-copy-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Invite Email Form === */
.invite-email-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.invite-email-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
}

.invite-email-input:focus {
  border-color: var(--accent);
}

.invite-form-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.invite-form-success {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

/* === Invite Rows === */
.invite-rows {
  display: flex;
  flex-direction: column;
}

.invite-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  animation: slideUp 0.35s ease both;
}

.invite-row:last-child {
  margin-bottom: 0;
}

.invite-row-left {
  min-width: 0;
  flex: 1;
}

.invite-row-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

.invite-row-sep {
  color: var(--text-muted);
}

.invite-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.invite-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.invite-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.invite-badge--accepted {
  background: #dcfce7;
  color: #166534;
}

.invite-badge--revoked {
  background: var(--bg-alt);
  color: var(--text-muted);
}

.invite-row-right .btn-small {
  padding: 7px 16px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .invite-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .invite-row-right {
    width: 100%;
  }
}

/* === Bulk Import === */
.bulk-import-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-import-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.bulk-import-drop.drag-over {
  border-color: var(--accent);
  background: rgba(45, 107, 228, 0.04);
}

.bulk-import-drop svg {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.bulk-import-drop p {
  margin: 0;
  font-size: 13px;
}

.bulk-import-browse {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

.bulk-import-browse:hover {
  text-decoration: underline;
}

.bulk-import-filename {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.bulk-import-form .btn-primary {
  align-self: flex-start;
}

.bulk-import-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.bulk-import-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.bulk-import-result {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.bulk-import-result .import-summary {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.08);
  color: var(--green);
  margin-bottom: 8px;
}

.bulk-import-result .import-summary.has-errors {
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
}

.bulk-import-result .import-errors {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.06);
  max-height: 200px;
  overflow-y: auto;
}

.bulk-import-result .import-errors p {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--danger);
}

.bulk-import-result .import-errors p:last-child {
  margin-bottom: 0;
}

/* Sidebar Card */
.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trophy-icon { background: linear-gradient(145deg, #FEF3C7, #FDE68A); }
.rules-icon { background: linear-gradient(145deg, #DBEAFE, #BFDBFE); }

.sidebar-card-title { font-weight: 700; font-size: 14px; }
.sidebar-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

.sidebar-card-link {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Leaderboard */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s ease;
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row:hover { background: var(--card-bg-hover); }

.lb-rank {
  font-size: 12px;
  font-weight: 800;
  width: 20px;
  text-align: center;
  color: var(--text-muted);
}

.lb-info { flex: 1; }
.lb-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.lb-name a { color: inherit; text-decoration: none; }
.lb-name a:hover { color: var(--accent); }
.lb-level { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.lb-points {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* Rules */
.rules-card { padding-bottom: 4px; }

.rules-list { padding: 12px 20px 16px; }

.rule-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  align-items: flex-start;
}
.rule-item:last-child { margin-bottom: 0; }

.rule-check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: rgba(45,107,228,0.3);
  box-shadow: 0 0 0 3px rgba(45,107,228,0.07);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

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

.form-select {
  padding-right: 32px;
  appearance: auto;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

/* === Buttons === */
.btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-small { padding: 9px 18px; font-size: 13px; }
.btn-text-cancel {
  background: none;
  border: none;
  padding: 9px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}
.btn-text-cancel:hover { color: var(--text); }

/* === Flash Messages === */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  animation: slideUp 0.3s ease;
}
.flash-success { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid rgba(34,197,94,0.2); }
.flash-error { background: rgba(244,63,94,0.1); color: #be123c; border: 1px solid rgba(244,63,94,0.2); }
.flash-info { background: rgba(45,107,228,0.1); color: var(--accent-dark); border: 1px solid rgba(45,107,228,0.2); }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.feed-pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 24px 0 8px;
}

/* === Sign Page === */
.sign-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
}

.sign-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.sign-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  border: 1px solid var(--border);
  text-align: center;
}

.sign-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  overflow: hidden;
}

.sign-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

.sign-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.sign-form { text-align: left; }

.sign-error {
  background: rgba(244,63,94,0.1);
  color: #be123c;
  border: 1px solid rgba(244,63,94,0.2);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.field-error {
  color: #be123c;
  font-size: 12px;
  margin-top: 4px;
}
.floating-input.has-error,
.form-input.has-error {
  border-color: #F43F5E;
}
.sign-success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid rgba(22,163,74,0.2);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.sign-btn {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

/* === Members Page === */
.members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}

.members-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.members-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}

.members-header .pill-tabs {
  margin-bottom: 0;
}

/* Admin member management toolbar */
.members-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.members-admin-toolbar .pill-tabs {
  margin-bottom: 0;
}
.cat-pill-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  margin-left: 2px;
}
.members-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.members-toolbar-actions .cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.members-toolbar-actions .btn-primary.btn-small {
  padding: 6px 14px;
  font-size: 13px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-pill);
  text-decoration: none;
}

/* Filter panel */
.members-filter-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.members-filter-columns {
  display: flex;
  gap: 24px;
}
.members-filter-col {
  flex: 1;
  min-width: 0;
}
.members-filter-col--border {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}
.members-filter-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}
.members-filter-check,
.members-filter-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  padding: 3px 0;
  cursor: pointer;
}
.members-filter-check input,
.members-filter-radio input {
  accent-color: var(--accent);
}
.members-filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.members-filter-reset {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.members-filter-reset:hover {
  color: var(--text);
}

/* Subscription badge on member cards */
.member-sub-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.member-sub-badge--active { background: var(--green-soft, #e6f9e6); color: var(--green, #22863a); }
.member-sub-badge--trialing { background: var(--accent-soft); color: var(--accent); }
.member-sub-badge--canceled,
.member-sub-badge--expired { background: var(--red-soft, #ffeef0); color: var(--red, #d73a49); }
.member-sub-badge--past_due { background: #fff8e1; color: #f57f17; }

/* Responsive: admin toolbar stacks on mobile */
@media (max-width: 700px) {
  .members-header { flex-direction: column; align-items: flex-start; }
  .members-admin-toolbar { flex-direction: column; align-items: flex-start; }
  .members-toolbar-actions { flex-wrap: wrap; }
  .members-filter-columns { flex-direction: column; gap: 16px; }
  .members-filter-col--border { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
}

.members-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.member-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  transition: all 0.2s ease;
  animation: slideUp 0.35s ease both;
  position: relative;
}
.member-card--admin {
  padding-bottom: 0;
}
.member-card:hover {
  border-color: #D4DCE8;
}

.member-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--card-bg);
}

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

.member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.member-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-role {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.member-role--admin {
  background: rgba(244,63,94,0.1);
  color: var(--rose);
}

.member-role--mod {
  background: rgba(139,92,246,0.1);
  color: var(--purple);
}

.member-role--owner {
  background: rgba(234,179,8,0.12);
  color: #B45309;
}

.member-role--billing {
  background: rgba(16,185,129,0.12);
  color: #047857;
}

.member-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.member-joined {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.member-joined svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.member-admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: calc(100% + 40px);
  margin: 8px -20px 0;
  padding: 10px 18px;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.member-admin-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.member-admin-detail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.member-admin-detail svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Community stat links */
a.community-stat {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
  border-radius: 8px;
}
a.community-stat:hover {
  opacity: 0.7;
}

/* === Member Card Extensions === */
.member-bio {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.member-location svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.member-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--online { background: var(--green); }
.status-dot--away { background: var(--amber); }
.status-dot--offline { background: var(--text-muted); }

/* Clickable member card with stretched link */
.member-card--clickable {
  cursor: pointer;
}
.member-name--link {
  text-decoration: none;
  color: inherit;
}
.member-name--link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}
.member-chat-btn {
  z-index: 1;
}

.member-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  position: absolute;
  top: 14px;
  right: 14px;
}
.member-chat-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* === Messages Page === */
.messages-header {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.messages-header .pill-tabs {
  margin-bottom: 0;
}

.messages-header .msg-search-form {
  margin-left: auto;
}

.messages-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* === Conversation List === */
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.15s ease;
  cursor: pointer;
}
.conversation-item:hover {
  border-color: #D4DCE8;
  background: var(--card-bg-hover);
}
.conversation-item--unread {
  background: var(--accent-soft);
  border-color: rgba(45,107,228,0.15);
}

.conversation-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

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

.conversation-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.conversation-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.conversation-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* === Chat Container === */
.chat-container {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.chat-header-avatar { flex-shrink: 0; }

.chat-header-info { flex: 1; }

.chat-header-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-header-status {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.status-online {
  color: var(--green);
}

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

/* === Chat Messages === */
.chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
}

.chat-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  animation: slideUp 0.2s ease both;
}

.chat-bubble--mine {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble--theirs {
  align-self: flex-start;
  background: var(--page-bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-bubble-content {
  margin-bottom: 4px;
  word-break: break-word;
}

.emoji {
  font-size: 1.5em;
  letter-spacing: 0.06em;
  vertical-align: middle;
  line-height: 1;
}

.chat-bubble-time {
  font-size: 10px;
  opacity: 0.7;
  text-align: right;
}

/* === Chat Compose === */
.chat-compose {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.chat-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-compose-input {
  flex: 1;
  min-height: 22px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.5;
  overflow-y: auto;
  outline: none;
  word-break: break-word;
  background: var(--page-bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.chat-compose-input:focus {
  border-color: var(--accent);
}

.chat-compose-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.chat-compose-icon-btn {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.chat-compose-icon-btn:hover {
  color: var(--text);
  background: var(--page-bg);
}

.chat-compose-send {
  background: var(--accent);
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.chat-compose-send:hover {
  opacity: 0.85;
}

.chat-compose-attachments {
  padding-bottom: 10px;
}

/* === Shared Emoji Picker === */
.emoji-picker-wrap {
  position: relative;
  flex-shrink: 0;
}

.emoji-picker-popover {
  position: fixed;
  z-index: 1000;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  overflow: hidden;
}

emoji-picker {
  --num-columns: 8;
  --emoji-size: 1.4rem;
  --category-emoji-size: 1.2rem;
  --border-color: var(--border);
  --background: var(--card-bg);
  --input-border-color: var(--border);
  --input-font-color: var(--text);
  --input-placeholder-color: var(--text-muted);
  --indicator-color: var(--accent);
  --outline-color: var(--accent);
  height: 320px;
}

/* Chat attachment strip — reuses compose-att-strip/item styles */

/* === Chat Bubble Attachments === */
.chat-bubble-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chat-att {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-att--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-att--file {
  background: var(--bg-secondary, #f0f2f5);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 80px;
  padding: 8px 12px;
  height: auto;
}

.chat-bubble--mine .chat-att--file {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

.chat-att--file .att-file-name {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-bubble--mine .chat-att--file .att-file-name {
  color: rgba(255,255,255,0.7);
}

.chat-bubble--mine .chat-att--file svg {
  stroke: rgba(255,255,255,0.7);
}

/* Links inside chat bubbles */
.chat-bubble--mine .chat-bubble-content a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-bubble--theirs .chat-bubble-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-bubble--theirs .chat-bubble-content a:hover,
.chat-bubble--mine .chat-bubble-content a:hover {
  opacity: 0.8;
}

/* === Leaderboard Page === */
.lb-profile-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.lb-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-profile-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.lb-profile-level {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.lb-progress-wrap {
  width: 100%;
}

.lb-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.lb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--sky));
  border-radius: 5px;
  transition: width 0.5s ease;
}

.lb-progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.lb-section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

/* Levels Grid */
.lb-levels-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}

.lb-level-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.lb-level-item--current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.lb-level-item--unlocked {
  border-color: var(--border);
}

.lb-level-item--locked {
  opacity: 0.6;
}

.lb-level-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-level-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lb-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.lb-level-item--locked .lb-level-badge {
  background: var(--text-muted);
}

.lb-level-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.lb-level-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-level-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
}



/* Leaderboard Tables (3-col grid) */
.lb-tables {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.lb-table-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lb-table-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.lb-table-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s ease;
}
.lb-table-row:last-child { border-bottom: none; }
.lb-table-row:hover { background: var(--card-bg-hover); }

.lb-table-rank {
  font-size: 12px;
  font-weight: 800;
  width: 22px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lb-table-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-table-name a { color: inherit; text-decoration: none; }
.lb-table-name a:hover { color: var(--accent); }

.lb-table-pts {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.lb-table-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Settings Levels */
.settings-levels-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-level-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--page-bg);
}

.settings-level-pts {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 100px;
}

.settings-level-input {
  flex: 1;
  padding: 6px 10px !important;
  font-size: 14px;
}

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

/* === Community Settings === */
.settings-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 56px - 48px);
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 1100px;
  margin: 0 auto;
}

.settings-nav {
  width: 240px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 10px 12px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.12s;
}
.settings-nav-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.settings-nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.settings-nav-item svg {
  flex-shrink: 0;
}

.settings-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.settings-nav-back {
  color: var(--text-muted);
}

.settings-content {
  flex: 1;
  padding: 24px 32px;
}

.settings-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-header h1 {
  font-size: 20px;
  font-weight: 700;
}

/* Settings Stats */
.settings-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.settings-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.settings-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.settings-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Settings Cards */
.settings-card {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border-light);
}
.settings-card:last-child {
  border-bottom: none;
}
.settings-card-header {
  padding: 16px 0 8px;
  border-bottom: none;
}
.settings-card-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.settings-card-body {
  padding: 0 0 16px;
}

/* Settings Info Grid */
.settings-info-grid {
  padding: 4px 0;
}
.settings-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 13px;
}
.settings-info-row:not(:last-child) {
  border-bottom: 1px solid var(--page-bg);
}
.settings-info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.settings-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}

/* Settings Forms */
.settings-form {
  padding: 0;
}
.link-accent {
  color: var(--accent);
  text-decoration: none;
}
.link-accent:hover {
  text-decoration: underline;
}
.settings-name-row {
  display: flex;
  gap: 12px;
}
.settings-form-input[readonly] {
  background: var(--page-bg);
  color: var(--text-muted);
  cursor: default;
}
.settings-form-group {
  margin-bottom: 16px;
}
.settings-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.settings-form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--page-bg);
  transition: border-color 0.15s;
}
.settings-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 107, 228, 0.08);
  background: var(--card-bg);
}
.settings-form-textarea {
  min-height: 80px;
  resize: vertical;
}
.settings-form-input-sm {
  width: auto;
}
.settings-form-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
/* Color picker */
.settings-color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.settings-color-swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
  padding: 0;
}
.settings-color-swatch:hover {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}
.cp-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 100;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cp-dropdown.hidden { display: none; }
.cp-sv {
  position: relative;
  width: 220px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
}
.cp-sv canvas { display: block; border-radius: 8px; }
.cp-sv-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(0,0,0,0.15);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-hue {
  position: relative;
  width: 220px;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
}
.cp-hue canvas { display: block; border-radius: 7px; }
.cp-hue-cursor {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Upload zone */
.settings-upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.settings-upload-zone:hover,
.settings-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.settings-upload-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.settings-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}
.settings-upload-placeholder svg {
  opacity: 0.4;
}
.settings-upload-preview {
  position: relative;
  min-height: 120px;
}
.settings-upload-preview img {
  display: block;
  width: 100%;
  min-height: 120px;
  max-height: 200px;
  object-fit: cover;
}
.settings-upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.settings-upload-remove:hover {
  background: rgba(220,38,38,0.85);
}
.settings-upload-zone-sm {
  max-width: 120px;
}
.settings-upload-zone-sm .settings-upload-placeholder {
  padding: 20px 12px;
}
.settings-upload-preview-logo img {
  max-height: 120px;
  object-fit: contain;
  padding: 8px;
}
.hidden { display: none !important; }

.settings-form-inline {
  padding: 16px 20px;
}
.settings-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-form-row .settings-form-input {
  flex: 1;
}

.settings-image-preview {
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 300px;
}
.settings-image-preview img {
  display: block;
  width: 100%;
  height: auto;
}
.settings-image-logo {
  max-width: 80px;
}

/* Settings Buttons */
.settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.12s;
  white-space: nowrap;
}
.settings-btn-primary {
  background: var(--accent);
  color: #fff;
}
.settings-btn-primary:hover {
  background: #2558c4;
}
.settings-btn-secondary {
  background: var(--page-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.settings-btn-secondary:hover {
  background: var(--border);
}
.settings-btn-danger {
  background: #fef2f2;
  color: var(--rose);
}
.settings-btn-danger:hover {
  background: var(--rose);
  color: #fff;
}
.settings-btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Settings List */
.settings-list {
  padding: 4px 0;
}
.settings-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 13px;
}
.settings-list-item:not(:last-child) {
  border-bottom: 1px solid var(--page-bg);
}
.settings-list-item:hover {
  background: var(--page-bg);
}
.settings-list-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.settings-list-item-name {
  font-weight: 500;
}
.settings-list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.settings-rule-number {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 20px;
}

.settings-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.settings-badge-muted {
  background: var(--page-bg);
  color: var(--text-muted);
}
.settings-badge-green {
  background: #f0fdf4;
  color: #16a34a;
}

.settings-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.settings-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}

.settings-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 8px 0;
}

/* === Settings Page Layout (standalone, no community chrome) === */
.settings-page {
  min-height: 100vh;
  background: var(--page-bg);
}

.settings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.settings-page-header-left {
  display: flex;
  align-items: center;
}

.settings-page-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.settings-page-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.settings-page-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-page-community-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-page-body {
  flex: 1;
  overflow-y: auto;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

code {
  background: var(--page-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--rose);
}

/* === Member Profile === */
.mp-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.mp-main {
  min-width: 0;
}
.mp-activities {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mp-section-header .mp-section-title {
  margin-bottom: 0;
}
.mp-section-header .member-manage-btn {
  position: static;
}
.mp-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.mp-user-comments {
  border-top: 1px solid var(--border-light);
  padding: 24px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.mp-user-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.mp-user-comment-body {
  min-width: 0;
  flex: 1;
}

.mp-user-comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.mp-user-comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mp-user-comment-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.mp-user-comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mp-feed-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* Comment cards in member profile */
.mp-comment-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}
.mp-comment-card:hover {
  border-color: #D4DCE8;
}

.mp-comment-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.mp-comment-context a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.mp-comment-context a:hover {
  text-decoration: underline;
}

.mp-comment-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.mp-comment-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.mp-comment-likes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Activity card (comment-in-context) */
.mp-activity-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}
.mp-activity-card:hover {
  border-color: #D4DCE8;
}

.mp-activity-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.mp-activity-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mp-activity-action {
  font-size: 13px;
  color: var(--text-muted);
}

.mp-activity-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.mp-activity-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 10px;
  transition: background 0.15s ease;
}
.mp-activity-context:hover {
  background: var(--accent-light);
}
.mp-activity-context svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
}

.mp-activity-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.mp-activity-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Profile sidebar */
.mp-sidebar {
}

.mp-profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
}

.mp-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}

.mp-avatar-wrap .avatar {
  width: 120px;
  height: 120px;
  font-size: 42px;
}

.mp-avatar-initials {
  font-size: 42px;
  font-weight: 700;
}

.mp-level-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  border: 2.5px solid var(--card-bg);
}
.mp-level-badge.level-badge--blue { background: var(--accent); }
.mp-level-badge.level-badge--green { background: var(--green); }
.mp-level-badge.level-badge--orange { background: var(--amber); }

.mp-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.mp-role-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mp-level-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.mp-bio {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: left;
}

.mp-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.mp-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.mp-info-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}


.mp-social {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.mp-social-link {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--page-bg);
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.mp-social-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.mp-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.mp-follow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}
.mp-follow-btn:hover {
  background: var(--accent-light);
}
.mp-follow-btn.active {
  background: var(--accent);
  color: #fff;
}
.mp-follow-btn.active:hover {
  opacity: 0.9;
}
.mp-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  text-decoration: none;
}
.mp-chat-btn:hover {
  opacity: 0.9;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .right-sidebar { display: none; }
  .members-grid { grid-template-columns: 1fr; }
  .lb-tables { grid-template-columns: 1fr; }
  .settings-nav { width: 200px; }
  .mp-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Hide desktop-only header parts, show mobile */
  .app-header > .header-left { display: none; }
  .about-header { padding: 0 12px; }

  .app-header {
    padding: 10px 12px;
    gap: 8px;
  }

  /* Mobile left: hamburger + community logo */
  .header-mobile-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
  }
  .mobile-community-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
    color: var(--text);
  }
  .mobile-community-link .header-community-logo {
    width: 32px;
    height: 32px;
    font-size: 14px;
    flex-shrink: 0;
  }
  .mobile-community-link .header-community-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Show mobile search icon in header-right */
  .mobile-search-btn { display: flex !important; }

  /* Mobile search bar (full-width row below) */
  .mobile-search-bar {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    padding-top: 8px;
  }
  .mobile-search-bar.hidden { display: none; }
  .mobile-search-bar .search-input {
    padding-right: 36px;
  }
  .mobile-search-close {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-30%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Sidebar as mobile drawer overlay */
  .sidebar-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    background: var(--card-bg);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar-nav.mobile-open {
    display: flex;
    transform: translateX(0);
  }

  /* Backdrop */
  .mobile-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }
  .mobile-sidebar-backdrop.active {
    display: block;
  }

  .content-area { padding: 16px; }
  .settings-layout { flex-direction: column; }
  .settings-nav {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px;
    gap: 0;
  }
  .settings-nav-title { display: none; }
  .settings-nav-divider { display: none; }
  .settings-content { padding: 16px; }
  .settings-form-row { flex-direction: column; align-items: stretch; }
  .settings-page-body { padding: 16px; }
  .settings-page-header { padding: 12px 16px; }
  .settings-page-community-name { font-size: 13px; }
}

/* === Account Settings — Toggle Switch === */
.toggle-switch {
  width: 44px;
  height: 24px;
  background: #D1D5DB;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-switch.active {
  background: var(--green);
}
.toggle-knob {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch.active .toggle-knob {
  transform: translateX(20px);
}

/* === Account Settings — Radio Group (Segmented) === */
.radio-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.radio-group-item {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.radio-group-item:last-child {
  border-right: none;
}
.radio-group-item:hover {
  background: var(--page-bg);
}
.radio-group-item.active {
  background: var(--accent);
  color: #fff;
}

/* === Account Settings — On/Off Buttons === */
.onoff-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.onoff-item {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: none;
  cursor: pointer;
  transition: all 0.12s;
}
.onoff-item:first-child {
  border-right: 1px solid var(--border);
}
.onoff-item:hover {
  background: var(--page-bg);
}
.onoff-item.active {
  background: var(--accent);
  color: #fff;
}

/* === Account Settings — Notification Rows === */
.notif-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}
.notif-toggle-row:not(:last-child) {
  border-bottom: 1px solid var(--border-light);
}
.notif-toggle-info {
  flex: 1;
  min-width: 0;
}
.notif-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.notif-toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === Account Settings — Community Accordion === */
.notif-community {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.notif-community:last-child {
  margin-bottom: 0;
}
.notif-community-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.12s;
  border-radius: var(--radius-md);
}
.notif-community-header:hover {
  background: var(--page-bg);
}
.notif-community-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notif-community-name {
  font-size: 14px;
  font-weight: 600;
}
.notif-community-header .chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.notif-community-header.open .chevron {
  transform: rotate(180deg);
}
.notif-community-body {
  padding: 0 20px 16px;
}

/* === Account Settings — Social Inputs === */
.social-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.social-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.social-input-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  background: var(--page-bg);
  border-radius: 8px;
}
.social-input-row .settings-form-input {
  flex: 1;
}

/* === Account Settings — Avatar Upload === */
.avatar-upload-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar-upload-current {
  width: 64px;
  height: 64px;
  border-radius: 32%;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.avatar-upload-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

/* === Search Page === */
mark {
  background: #FEF3C7;
  padding: 1px 2px;
  border-radius: 2px;
  color: inherit;
}
.search-page {
}
.search-page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.search-result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.search-result-card .post-header {
  margin-bottom: 8px;
}
.search-result-card .post-title {
  font-size: 15px;
  margin-bottom: 4px;
}
.search-result-card .post-body {
  font-size: 13px;
  margin-bottom: 8px;
}
.search-comment-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.search-comment-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.search-comment {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
}
.search-comment-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.search-comment-author {
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.search-comment-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === Message Search === */
.msg-search-form {
  position: relative;
}
.msg-search-form .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.msg-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.msg-search-input:focus {
  border-color: var(--accent);
}
.msg-search-results {
  display: flex;
  flex-direction: column;
}
.msg-search-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.msg-search-result:hover {
  background: var(--card-bg-hover);
}
.msg-search-result-body {
  flex: 1;
  min-width: 0;
}
.msg-search-result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.msg-search-result-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.msg-search-result-time {
  font-size: 11px;
  color: var(--text-muted);
}
.msg-search-result-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.msg-search-result-you {
  color: var(--text-muted);
  font-weight: 500;
}

/* ===================================================================
   Pricing & Payouts (Settings)
   =================================================================== */

/* --- Model selector --- */
.pricing-model-selector {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--card-bg);
}
.pricing-model-option {
  flex: 1;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--border);
  transition: background .15s;
}
.pricing-model-option:last-child { border-right: none; }
.pricing-model-option:hover { background: #FAFBFC; }
.pricing-model-option input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin: 0;
}
.pricing-model-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}
.pricing-model-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* --- Currency selector --- */
.pricing-currency-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.pricing-currency-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.pricing-currency-options {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.pricing-currency-option {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pricing-currency-option:last-child { border-right: none; }
.pricing-currency-option input { display: none; }
.pricing-currency-option.active {
  background: var(--accent);
  color: #fff;
}

/* --- Save button --- */
.pricing-save-btn {
  padding: 10px 28px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  background: #E5E7EB;
  color: var(--text-secondary);
}
.pricing-save-btn--unsaved {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pricing-save-btn--saved {
  background: var(--card-bg);
  color: #22C55E;
  border-color: #D1D5DB;
}
.pricing-save-btn--error {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FCA5A5;
}
.pricing-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Pricing config sections --- */
.pricing-config { margin-bottom: 24px; }
.pricing-config.hidden { display: none; }

/* --- Price row --- */
.pricing-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #F9FAFB;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background .15s;
  border: 1px solid transparent;
}
.pricing-price-row:hover { background: #F3F4F6; }
.pricing-price-row--free { cursor: default; }
.pricing-price-row--free:hover { background: #F9FAFB; }
.pricing-price-text {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}
.pricing-tier-card .pricing-price-row {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 12px;
  gap: 6px;
}
.pricing-tier-card .pricing-price-row:hover {
  background: none;
}
.pricing-tier-card .pricing-price-row:hover .pricing-price-text {
  text-decoration: underline;
}
.pricing-tier-card .pricing-price-text {
  font-size: 14px;
  color: var(--text-primary);
}
.pricing-tier-card .pricing-price-row svg {
  color: var(--text-secondary);
}
.pricing-tier-card .pricing-price-row--free .pricing-price-text {
  color: var(--text-secondary);
}
.pricing-tier-card .pricing-price-row--free:hover .pricing-price-text {
  text-decoration: none;
}
.pricing-tier-card .pricing-price-row--free svg {
  color: var(--text-secondary);
}

/* --- Trial toggle --- */
.pricing-trial-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text-primary);
}

/* --- Toggle switch (shared) --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #D1D5DB;
  border-radius: 24px;
  transition: .2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch--sm { width: 36px; height: 20px; }
.toggle-switch--sm .toggle-slider::before {
  height: 14px;
  width: 14px;
}
.toggle-switch--sm input:checked + .toggle-slider::before { transform: translateX(16px); }

/* --- Tier cards grid --- */
.pricing-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.pricing-tier-card {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: opacity .2s;
}
.pricing-tier-card--disabled {
  opacity: 0.45;
}
.pricing-tier-card--disabled > *:not(.pricing-tier-header) {
  pointer-events: none;
}
.pricing-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pricing-tier-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

/* --- Benefits list --- */
.pricing-benefit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.pricing-benefit-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-primary);
}
.pricing-benefit-list li::before {
  content: "\2022";
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
}
.pricing-benefit-list li {
  cursor: pointer;
  transition: background .1s;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 0 -6px;
}
.pricing-benefit-list li:hover {
  background: rgba(0,0,0,.04);
}
.pricing-benefit-list li.dragging {
  opacity: 0.4;
}
.pricing-benefit-list li.drag-over {
  border-top: 2px solid var(--accent);
  padding-top: 2px;
}
.modal-btn-delete {
  background: none;
  border: none;
  color: #DC2626;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 16px;
}
.modal-btn-delete:hover { color: #B91C1C; }
.modal-actions-spacer { flex: 1; }

/* --- Add benefit link --- */
.pricing-add-benefit {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
  margin-top: auto;
}
.pricing-add-benefit:hover { text-decoration: underline; }

/* --- Modals (shared) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  position: relative;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-community-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  overflow: hidden;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.modal-community-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--text-primary);
  text-align: center;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.modal-btn-cancel {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 16px;
}
.modal-btn-cancel:hover { color: var(--text-primary); }
.modal-btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 28px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .15s;
}
.modal-btn-primary:hover { background: var(--accent-dark); }
.modal-btn-primary:disabled,
.modal-btn-primary--disabled {
  background: #E5E7EB;
  color: #9CA3AF;
  cursor: not-allowed;
  pointer-events: none;
}
.modal-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}
.modal-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.modal-char-count {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Price modal specifics --- */
.price-input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.price-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  height: 48px;
  background: #fff;
}
.price-input-wrap:focus-within { border-color: var(--accent); }
.price-input-prefix {
  font-size: 15px;
  color: var(--text-secondary);
  margin-right: 8px;
  font-weight: 500;
}
.price-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  min-width: 0;
}
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.price-input[type="number"] { -moz-appearance: textfield; }
.price-input-suffix {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 8px;
}
.price-discount-badge {
  background: #22C55E;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  margin-left: 8px;
}
.price-discount-badge.hidden { display: none; }
.price-tip {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.4;
}
.price-frequency-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.price-frequency-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
}
.price-frequency-option input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin: 0;
}

/* --- Payouts --- */
.payouts-not-connected {
  text-align: center;
  padding: 60px 0;
}
.payouts-connect-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .15s;
}
.payouts-connect-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.payouts-connected { margin-top: 8px; }
.payouts-balance-row {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 32px;
}
.payouts-balance-box {
  padding: 24px 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  min-width: 200px;
}
.payouts-balance-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}
.payouts-balance-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.payouts-earnings-breakdown {
  flex: 1;
  padding-top: 4px;
}
.payouts-earnings-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
}
.payouts-earnings-line--fee {
  color: var(--text-muted);
}
.payouts-earnings-line--net {
  font-weight: 600;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 8px;
}
.payouts-empty {
  font-size: 15px;
  color: var(--text-muted);
}
.payouts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.payouts-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.payouts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text-primary);
}
.payouts-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.payouts-status--pending { background: #FEF3C7; color: #92400E; }
.payouts-status--paid { background: #D1FAE5; color: #065F46; }
.payouts-status--failed { background: #FEE2E2; color: #991B1B; }
.payouts-settings-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.payouts-settings-icon:hover { color: var(--text-primary); }

/* --- Payout modal specifics --- */
.payout-modal-owner { margin-bottom: 20px; }
.payout-modal-owner-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.payout-modal-owner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.payout-modal-owner-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.payout-modal-country { margin-bottom: 8px; }
.payout-modal-country-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.payout-modal-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  appearance: auto;
}
.payout-modal-select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-outline {
  background: var(--card-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-light);
}

/* === About Layout === */
.about-layout {
  min-height: 100vh;
  background: var(--page-bg);
}
.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.about-header-btn {
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease;
}
.about-header-btn:hover {
  background: var(--accent-dark);
}
.about-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}
.about-content-flex {
  display: flex;
  gap: 24px;
}
.about-main-content {
  flex: 1;
  min-width: 0;
}

/* === About Page === */
.about-page {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
}
.about-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
}
.about-media-gallery {
  margin-bottom: 20px;
}
.about-media-main {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--page-bg);
}
.about-media-main img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.about-media-main--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}
.about-media-main--empty:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.about-media-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.about-media-thumb {
  position: relative;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.about-media-thumb.active {
  border-color: var(--accent);
}
.about-media-thumb:hover {
  border-color: var(--accent);
}
.about-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about-media-thumb-video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  color: var(--text-muted);
}
.about-media-thumb-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  background: none;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.about-media-thumb-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.about-media-thumb-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  text-decoration: none;
  z-index: 2;
}
.about-media-thumb:hover .about-media-thumb-delete {
  opacity: 1;
}
.about-media-thumb-delete:hover {
  background: rgba(220,38,38,0.85);
}
/* Lightbox (universal) */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.hidden {
  display: none;
}
.lightbox-topbar {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10001;
}
.lightbox-close,
.lightbox-download {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  opacity: 0.7;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
}
.lightbox-close:hover,
.lightbox-download:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}
.lightbox-download.hidden {
  display: none;
}
.lightbox-filename {
  position: absolute;
  top: 20px;
  left: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-filename.hidden {
  display: none;
}
.lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 85vh;
}
.lightbox-img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
.lightbox-pdf {
  width: 80vw;
  height: 85vh;
  border: none;
  border-radius: 8px;
  background: #fff;
}
.lightbox-video {
  width: min(80vw, 960px);
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  background: #000;
}
.lightbox-no-preview {
  background: #fff;
  border-radius: 16px;
  padding: 48px 56px;
  text-align: center;
  max-width: 440px;
  width: 100%;
}
.lightbox-no-preview-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.lightbox-no-preview-filename {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  word-break: break-all;
}
.lightbox-no-preview-download {
  display: block;
  background:var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}
.lightbox-no-preview-download:hover {
  background: var(--accent-dark);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.lightbox-nav:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}
.lightbox-nav--prev {
  left: 16px;
}
.lightbox-nav--next {
  right: 16px;
}
.lightbox-nav.hidden {
  display: none;
}
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  user-select: none;
}
.about-meta-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.about-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.about-meta-author {
  display: flex;
  align-items: center;
  gap: 6px;
}
.about-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}
.about-description-empty {
  color: var(--text-muted);
  font-style: italic;
}
.about-cta-mobile {
  display: none;
  margin-top: 24px;
}

/* === CTA Button === */
.about-cta-btn {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  display: block;
  text-align: center;
}
.about-cta-btn:hover {
  background: var(--accent-dark);
}

/* === Payment Modal === */
.payment-modal-header {
  text-align: center;
  margin-bottom: 4px;
}
.payment-section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.payment-billing-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  position: relative;
}
.payment-billing-option {
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  position: relative;
}
.payment-billing-option:first-of-type {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.payment-billing-option:last-of-type {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.payment-billing-option input { display: none; }
.payment-billing-option + .payment-billing-option {
  border-left: 1.5px solid var(--border);
}
.payment-billing-option.active {
  background: var(--accent-soft, rgba(59,130,246,0.06));
}
.payment-billing-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.payment-billing-name::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-block;
  flex-shrink: 0;
}
.payment-billing-option.active .payment-billing-name::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}
.payment-billing-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-left: 22px;
}
.payment-billing-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 22px;
}
.payment-discount-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  z-index: 1;
}
.payment-single-price {
  padding: 12px 0;
  margin-bottom: 16px;
}
.payment-single-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.payment-single-period {
  font-size: 14px;
  color: var(--text-muted);
}
.payment-card-element {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  min-height: 44px;
  background: var(--card-bg);
}
.payment-card-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.payment-terms {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* === Plans Page === */
.plans-header {
  text-align: center;
  margin-bottom: 32px;
}
.plans-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.plans-header p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}
.plans-tiers {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.plan-tier-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  min-width: 260px;
  max-width: 320px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan-tier-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(45, 107, 228, 0.1);
}
.plan-tier-card--popular {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(45, 107, 228, 0.12);
}
.plan-tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.plan-tier-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan-tier-prices {
  text-align: center;
}
.plan-price-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.plan-price-period {
  font-size: 14px;
  color: var(--text-secondary);
}
.plan-tier-price--annual .plan-price-amount {
  font-size: 20px;
  color: var(--text-secondary);
}
.plan-price-discount {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.plan-tier-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
  text-align: left;
}
.plan-tier-benefits li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 7px 0;
  padding-left: 28px;
  position: relative;
}
.plan-tier-benefits li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.plan-tier-benefits li.plan-benefit--excluded {
  color: var(--text-muted);
}
.plan-tier-benefits li.plan-benefit--excluded::before {
  content: "\2717";
  background: var(--border);
  color: var(--text-muted);
}
.plan-tier-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-btn {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.plans-footer {
  text-align: center;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 14px;
}
.plans-footer p {
  margin: 0 0 12px;
}
.plans-back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.plans-back-link:hover {
  text-decoration: underline;
}

/* === Signup/Verify Modals === */
.modal-box--narrow {
  max-width: 420px;
  width: 100%;
  position: relative;
}
.modal-box--wide {
  max-width: 720px;
}
.modal-close-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  z-index: 1001;
}
.modal-close-btn:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: -8px 0 24px;
  text-align: center;
}

/* Floating label fields (Skool-style) */
.floating-field {
  position: relative;
  margin-bottom: 16px;
}
.floating-input {
  width: 100%;
  padding: 20px 14px 8px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  line-height: 1.4;
}
.floating-input:focus {
  border-color: var(--text);
}
.floating-input--disabled {
  background: var(--border-light);
  color: var(--text-secondary);
  cursor: default;
}
.floating-input--disabled:focus {
  border-color: var(--border);
}
.floating-field--password {
  position: relative;
}
.floating-field--password .floating-input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.password-toggle:hover {
  color: var(--text-secondary);
}
.password-toggle .eye-off-icon {
  display: none;
}
.password-toggle.is-visible .eye-icon {
  display: none;
}
.password-toggle.is-visible .eye-off-icon {
  display: block;
}
.floating-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.15s ease;
  background: var(--card-bg);
  padding: 0 4px;
  line-height: 1;
}
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-secondary);
}
.floating-input:focus ~ .floating-label {
  color: var(--text);
}

.form-input--code {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 8px;
  padding: 20px 14px 8px;
}
.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 14px;
  padding-bottom: 14px;
}
.modal-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
}
.modal-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.modal-link:hover {
  text-decoration: underline;
}
.modal-footer-links {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}
.modal-link-sep {
  color: var(--text-muted);
  margin: 0 6px;
}
.modal-error {
  background: #FEF2F2;
  color: #DC2626;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.modal-link-text {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.modal-link-text a {
  color: var(--accent);
  text-decoration: none;
}
.modal-link-text a:hover {
  text-decoration: underline;
}
.modal-success {
  background: #F0FDF4;
  color: #16A34A;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

/* === Category Modal === */
.modal-form-group {
  margin-bottom: 20px;
}
.modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.modal-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 50px 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}
.input-with-counter {
  position: relative;
}
.input-counter {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Modal: radio cards */
.modal-radio-group {
  display: flex;
  gap: 12px;
}
.modal-radio-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-radio-card:hover {
  border-color: var(--text-muted);
}
.modal-radio-card.active {
  border-color: var(--accent);
  background: rgba(45,107,228,0.05);
}
.modal-radio-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.modal-radio-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

/* Modal: sort radio (stacked) */
.modal-sort-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-sort-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  color: var(--text);
}
.modal-sort-option:hover {
  border-color: var(--text-muted);
}
.modal-sort-option.active {
  border-color: var(--accent);
  background: rgba(45,107,228,0.05);
}
.modal-sort-option input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

/* === Complete Profile Modal (uncloseable) === */
.modal-box--uncloseable {
  /* No close button, no backdrop dismiss */
}
.avatar-upload-zone {
  cursor: pointer;
}
.avatar-upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  background: var(--page-bg);
  margin: 0 auto;
  overflow: hidden;
  transition: border-color 0.15s;
  font-size: 12px;
  color: var(--text-muted);
}
.avatar-upload-preview:hover {
  border-color: var(--accent);
}
.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.char-counter {
  float: right;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* === Settings About === */
.about-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.about-media-grid .about-media-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--page-bg);
  aspect-ratio: 16/10;
  width: auto;
  height: auto;
  border: none;
  cursor: default;
  flex-shrink: initial;
}
.about-media-grid .about-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-media-grid .about-media-thumb-video {
  background: var(--text);
  color: #fff;
}
.about-media-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  text-decoration: none;
}
.about-media-grid .about-media-thumb:hover .about-media-delete {
  opacity: 1;
}
.about-media-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.about-media-form .form-group {
  flex: 1;
  min-width: 200px;
}

/* === Admin About Editing === */
.about-media-video-inner {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.about-media-video-inner iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.about-media-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  text-decoration: none;
  z-index: 2;
}
.about-media-main:hover .about-media-item-delete {
  opacity: 1;
}
.about-media-item-delete:hover {
  background: rgba(220,38,38,0.85);
}
.about-description--admin {
  position: relative;
  padding-right: 40px;
}
.about-desc-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.about-desc-edit-btn:hover {
  background: var(--page-bg);
  color: var(--text);
}
.about-desc-editor {
  margin-bottom: 20px;
}
.about-desc-textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.7;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.about-desc-textarea:focus {
  border-color: var(--text);
}
.about-desc-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.about-desc-editor-actions {
  display: flex;
  gap: 8px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.about-media-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color 0.15s;
}
.about-media-upload-zone:hover {
  border-color: var(--accent);
}
.about-media-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.about-media-separator {
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
  position: relative;
}
.about-media-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
}
.about-media-separator span {
  position: relative;
  background: var(--card-bg);
  padding: 0 12px;
}
.about-media-file-name {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* === Analytics === */
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.analytics-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
}
.analytics-card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.analytics-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.analytics-section {
  margin-bottom: 32px;
}
.analytics-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}
.analytics-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  position: relative;
}
.analytics-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: pointer;
}
.analytics-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: opacity 0.15s;
}
.analytics-bar--revenue {
  background: var(--accent);
}
.analytics-bar--members {
  background: var(--green);
}
.analytics-bar-group:hover .analytics-bar {
  opacity: 0.8;
}
.analytics-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  position: absolute;
  bottom: -22px;
  white-space: nowrap;
}
.analytics-bar-tooltip {
  display: none;
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translate(-50%, -100%);
  background: var(--text);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.analytics-bar-group:hover .analytics-bar-tooltip {
  display: block;
}
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.analytics-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.analytics-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.analytics-member {
  display: flex;
  align-items: center;
  gap: 8px;
}
.analytics-member-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.analytics-member-name:hover {
  color: var(--accent);
}
.analytics-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.analytics-status--active {
  background: #DCFCE7;
  color: #15803D;
}
.analytics-status--trialing {
  background: #DBEAFE;
  color: #1D4ED8;
}
.analytics-status--canceled {
  background: #FEE2E2;
  color: #B91C1C;
}
.analytics-status--past_due {
  background: #FEF3C7;
  color: #A16207;
}
.analytics-status--expired {
  background: #F3F4F6;
  color: #6B7280;
}
.analytics-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
}

/* === Billing === */
.billing-plan-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.billing-plan-info {
  flex: 1;
}
.billing-plan-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.billing-plan-detail {
  font-size: 13px;
  color: var(--text-muted);
}
.billing-plan-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 6px;
}
.billing-plan-warning {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.1);
  color: #b45309;
  font-size: 13px;
  font-weight: 500;
}
.billing-plan-actions {
  flex-shrink: 0;
}
.billing-method-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.billing-method-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}
.billing-method-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.billing-method-brand {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13px;
}
.billing-method-digits {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
}
.billing-method-expiry {
  color: var(--text-muted);
  font-size: 12px;
}
.billing-payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.billing-payments-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.billing-payments-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.billing-amount {
  font-weight: 600;
}
.billing-invoice-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.billing-invoice-link:hover {
  text-decoration: underline;
}
.billing-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* === Change Plan Modal === */
.plan-tier-card--current {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(45, 107, 228, 0.12);
}
.plan-tier-detail {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
  background: var(--page-bg);
  border-radius: 20px;
  padding: 6px 16px;
  align-self: center;
}
.plan-tier-actions {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
}
.plan-change-btn {
  width: 100%;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}
.plan-change-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* === Badges === */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
  vertical-align: middle;
}
.badge-info {
  background: #dbeafe;
  color: #1e40af;
}
.badge-success {
  background: #dcfce7;
  color: #166534;
}
.badge-warning {
  background: #fef3c7;
  color: #92400e;
}
.badge-muted {
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* === Signup Page === */
.signup-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 40px;
}
.signup-container {
  max-width: 800px;
  width: 100%;
}
.signup-logo {
  height: 40px;
  display: block;
  margin: 0 auto 32px;
}
.signup-hero {
  text-align: center;
  margin-bottom: 48px;
}
.signup-hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
}
.signup-hero p {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.signup-cta-btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.signup-cta-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
.signup-pricing {
  text-align: center;
}
.signup-pricing h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 28px;
}
.signup-pricing-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.signup-footer-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 24px;
}
.create-modal-info {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
}
.create-modal-info a {
  color: var(--accent);
  text-decoration: none;
}
.create-modal-info a:hover {
  text-decoration: underline;
}
.create-modal-counter {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin: -8px 0 16px;
}
.create-modal-terms {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: center;
  line-height: 1.5;
}

/* --- Payment Section --- */
.payment-section {
  margin-bottom: 16px;
}
.payment-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}
.payment-saved-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.payment-card-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}
.payment-card-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg, rgba(37, 99, 235, 0.04));
}
.payment-card-option input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
}
.payment-card-info {
  font-size: 14px;
  color: var(--text);
}
.payment-card-brand {
  font-weight: 600;
}
.payment-card-exp {
  color: var(--text-muted);
  font-size: 13px;
}
.payment-new-card {
  margin-bottom: 16px;
}
#card-element,
#billing-card-element {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.15s;
}
#card-element.StripeElement--focus,
#billing-card-element.StripeElement--focus {
  border-color: var(--accent);
}
#card-element.StripeElement--invalid,
#billing-card-element.StripeElement--invalid {
  border-color: #e74c3c;
}
.payment-card-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 6px;
  min-height: 0;
}
.payment-toggle-link {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
}
.payment-toggle-link:hover {
  text-decoration: underline;
}

/* === Responsive About === */
@media (max-width: 768px) {
  .about-content-flex {
    flex-direction: column;
  }
  .about-content-flex .right-sidebar {
    order: -1;
  }
  .about-cta-mobile {
    display: block;
  }
  .plans-tiers {
    flex-direction: column;
    align-items: center;
  }
  .plan-tier-card {
    max-width: 100%;
  }
  .form-row--half {
    grid-template-columns: 1fr;
  }
  .analytics-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-chart {
    height: 140px;
  }
  .analytics-bar-label {
    font-size: 9px;
  }
  .signup-hero h1 {
    font-size: 24px;
  }
  .signup-pricing-cards {
    flex-direction: column;
    align-items: center;
  }
}

/* === Post Header Actions (bell, dropdown) === */
.post-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.post-header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.post-header-action-btn:hover {
  background: var(--accent-light);
  color: var(--text-secondary);
}
.post-header-action-btn.active {
  color: var(--accent);
}

/* Post Dropdown */
.post-dropdown-wrap {
  position: relative;
}
.post-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 6px;
  z-index: 100;
  animation: userMenuFadeIn 0.12s ease;
}
.post-dropdown.hidden { display: none; }
.post-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
  text-decoration: none;
}
.post-dropdown-item:hover {
  background: var(--page-bg);
}
.post-dropdown-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
}
.post-dropdown-item--danger { color: var(--rose); }
.post-dropdown-item--danger svg { color: var(--rose); }
.post-dropdown-item--danger:hover { background: #fef2f2; }
.post-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* Comments Locked Notice */
.comments-locked-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 24px;
}
.comments-locked-notice svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Scroll to Last Comment Button */
.scroll-to-last-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  z-index: 100;
  transition: opacity 0.2s, transform 0.2s;
}
.scroll-to-last-btn:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.16);
}
.scroll-to-last-btn.hidden {
  display: none;
}

/* Danger Button */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: var(--rose);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-danger:hover { background: #E11D48; }

/* Copy link feedback */
.copy-feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: pop 0.2s ease;
}

/* Edit post compose-box in modal — above modal z-index */
.post-modal-content .compose-overlay {
  z-index: 510;
}
.post-modal-content .compose-box.compose-box--expanded {
  z-index: 520;
  position: relative;
}

/* =====================================================
   Post Detail Modal
   ===================================================== */
.post-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
}
.post-modal-overlay.hidden {
  display: none;
}
.post-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.post-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 920px;
  min-height: 100vh;
  background: var(--page-bg);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  padding: 24px 32px 120px;
}
.post-modal-close {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 510;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
}
.post-modal-close:hover {
  background: rgba(0, 0, 0, 0.65);
}
.post-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Hide back link inside modal */
.post-modal-content .back-link {
  display: none;
}

/* Sticky header in modal: full-width bar with background */
.post-modal-content .post-sticky-header-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  height: auto;
  overflow: visible;
  background: var(--page-bg);
}
.post-modal-content .post-sticky-header {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* Loading spinner for modal */
.post-modal-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

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

@media (max-width: 860px) {
  .post-modal-sheet {
    max-width: 100%;
    padding: 16px 16px 32px;
  }
}

/* =========================================
   Likes Modal
   ========================================= */
.likes-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.likes-modal-overlay.hidden { display: none; }
.likes-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.likes-modal-sheet {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}
.likes-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.likes-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.likes-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.likes-modal-close:hover { color: var(--text); background: var(--card-bg-hover); }
.likes-modal-content {
  overflow-y: auto;
  padding: 8px 0;
}
.likes-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.likes-modal-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  transition: background 0.12s;
}
.likes-modal-user:hover { background: var(--card-bg-hover); }
.likes-modal-user a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.likes-modal-user a:hover { color: var(--accent); }
.likes-modal-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.likes-modal-loading {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Like button split: heart + count */
.post-actions > [id^="snippet-"] {
  display: contents;
}
.post-action-btn--like {
  padding-right: 2px;
}
.post-action-btn--like:hover,
.post-action-btn--count:hover,
.post-action-btn--comments:hover {
  background: transparent;
  color: inherit;
}
.post-action-btn--count {
  padding-left: 2px;
  font-family: inherit;
}

@media (max-width: 480px) {
  .likes-modal-sheet {
    max-width: calc(100% - 32px);
    max-height: 60vh;
  }
}

/* ────────────────────────────────────────
   Communities List Page
   ──────────────────────────────────────── */

.communities-page {
  min-height: 100vh;
  background: var(--bg);
}

.communities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.communities-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.communities-header-logo svg {
  color: var(--accent);
}

.communities-header-btn {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.communities-header-btn:hover { opacity: 0.9; }

.communities-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}

.communities-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.communities-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.community-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.community-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.community-card-cover {
  height: 120px;
  background-size: cover;
  background-position: center;
}
.community-card-cover--gradient {
  background: linear-gradient(145deg, var(--accent), var(--sky));
}

.community-card-body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.community-card-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.community-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-card-info { min-width: 0; }

.community-card-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-card-members {
  font-size: 12px;
  color: var(--text-muted);
}

.community-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
}

.community-card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.communities-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

@media (max-width: 600px) {
  .communities-header { padding: 14px 16px; }
  .communities-content { padding: 24px 16px 40px; }
  .communities-title { font-size: 22px; }
  .communities-grid { grid-template-columns: 1fr; }
}

/* === Member Management Modal === */
.member-manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  z-index: 1;
}
.member-manage-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.modal-box--wide {
  width: 540px;
  max-width: 95vw;
  position: relative;
}

.manage-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: -4px -28px 0;
  padding: 0 28px;
}
.manage-modal-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.manage-modal-tab:hover {
  color: var(--text);
}
.manage-modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.manage-modal-panel {
  padding-top: 20px;
}

.manage-member-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.manage-member-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.manage-member-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.manage-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.manage-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.manage-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.manage-field-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.manage-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--card-bg);
  cursor: pointer;
  width: 100%;
}
.manage-select:focus {
  outline: none;
  border-color: var(--accent);
}

.manage-modal-header-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
}
.manage-modal-header-actions .modal-close-btn {
  position: static;
}
.manage-more-wrap {
  position: relative;
}
.manage-more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.manage-more-btn:hover {
  background: var(--page-bg);
  color: var(--text);
}
.manage-more-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 4px;
  z-index: 50;
}
.manage-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s;
}
.manage-more-item:hover {
  background: var(--page-bg);
}
.manage-more-item--danger {
  color: var(--rose);
}
.manage-more-item--danger:hover {
  background: rgba(244,63,94,0.08);
}
.manage-inline-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.manage-inline-text {
  font-weight: 500;
}
.manage-inline-change {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.manage-inline-change:hover {
  text-decoration: underline;
}
.manage-inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.manage-inline-edit .manage-select {
  width: auto;
  min-width: 120px;
}
.manage-inline-save {
  padding: 4px 12px !important;
  font-size: 12px !important;
}
.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--card-bg);
  color: var(--rose);
  border: 1px solid var(--rose);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-danger-outline:hover {
  background: var(--rose);
  color: #fff;
}

.manage-confirm {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 10;
}
.manage-confirm-content {
  text-align: center;
  padding: 30px;
  max-width: 360px;
}
.manage-confirm-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.manage-confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.manage-confirm-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.manage-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.manage-payments-list {
  max-height: 400px;
  overflow-y: auto;
}
.manage-payment-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.manage-payment-item:last-child {
  border-bottom: none;
}
.manage-payment-date {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 90px;
}
.manage-payment-type {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  text-transform: uppercase;
}
.manage-payment-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-left: auto;
}

/* ─── Plugins ─────────────────────────────────── */
.plugin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plugin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  gap: 16px;
  align-items: center;
}
.plugin-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.plugin-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plugin-card-body { flex: 1; min-width: 0; }
.plugin-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.plugin-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.plugin-card-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-alt, #f1f1f1);
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.plugin-card-badge--on {
  background: #dcfce7;
  color: #16a34a;
}

/* Plugin modal */
.plugin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}
.plugin-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.plugin-modal-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plugin-toggle-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
  text-align: right;
}
.plugin-toggle-text--on {
  color: #16a34a;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.plugin-field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.plugin-modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Link-item list (shared: links, categories, rules) */
.links-list,
.link-item-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: box-shadow .15s, opacity .2s;
}
.link-item:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.link-item.dragging {
  opacity: .4;
}
.link-item-drag {
  cursor: grab;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.link-item-drag:active {
  cursor: grabbing;
}
.link-item-body {
  flex: 1;
  min-width: 0;
}
.link-item-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-item-url {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.link-item-visibility {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.link-item-visibility--public {
  background: #dcfce7;
  color: #16a34a;
}
.link-item-visibility--private {
  background: #fef3c7;
  color: #d97706;
}
.link-item-edit,
.link-item-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.link-item-edit:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.link-item-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}
.link-item-body--inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-item-secondary {
  font-size: 12px;
  color: var(--text-muted);
}
.link-item-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 20px;
  flex-shrink: 0;
}
.link-char-count {
  float: right;
  font-weight: 400;
  color: var(--text-muted);
}

/* Chat button gated */
.mp-chat-btn--gated {
  opacity: .6;
  cursor: pointer;
  border: 1px solid var(--border) !important;
  background: var(--bg) !important;
  color: var(--text-muted) !important;
}
.mp-chat-btn--gated:hover { opacity: .8; }

/* Gate modal */
.gate-modal-body {
  text-align: center;
  padding: 8px 0 0;
}
.gate-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.gate-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.gate-modal-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 20px;
}
.gate-modal-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.gate-modal-btn:hover {
  background: var(--accent-dark);
}

/* ── Webhook plugin ─────────────────────────────── */
.plugin-pro-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1.4;
}
.webhook-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.webhook-url-row .settings-form-input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
  color: var(--text-primary);
}
.webhook-url-row .settings-btn {
  flex-shrink: 0;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.webhook-example {
  display: block;
  background: var(--bg-alt, #f5f5f5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.5;
}
.webhook-help-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}

/* ── Upgrade modal ──────────────────────────────────── */
.upgrade-modal-content {
  max-width: 500px;
  padding: 0;
  text-align: center;
}
.upgrade-modal-top {
  padding: 32px 32px 0;
}
.upgrade-lock-icon {
  margin-bottom: 16px;
}
.upgrade-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}
.upgrade-modal-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.5;
}
.upgrade-compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.upgrade-compare-table thead th {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}
.upgrade-compare-table thead th:first-child {
  text-align: left;
  padding-left: 32px;
}
.upgrade-compare-table__pro {
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}
.upgrade-compare-feature {
  font-size: 14px;
  padding: 12px 16px 12px 32px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.upgrade-compare-value {
  text-align: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-muted);
}
.upgrade-fee--pro {
  color: #16a34a;
  font-weight: 600;
}
.upgrade-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #16a34a;
}
.upgrade-cross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d1d5db;
}
.upgrade-modal-bottom {
  padding: 24px 32px 32px;
}
.upgrade-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  transition: opacity .15s;
}
.upgrade-btn:hover {
  opacity: .9;
}
.upgrade-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.upgrade-price-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.4;
}

/* === Content Reporting === */

/* Reports badge link on feed */
.reports-badge-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  color: var(--rose);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.reports-badge-link:hover {
  background: #FEE2E2;
}
.reports-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--rose);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
}

/* Report rule checkboxes in modal */
.report-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}
.report-rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background .15s;
}
.report-rule-item:hover {
  background: var(--border-light);
}
.report-rule-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* Report cards on reports page */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.report-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: opacity .3s, transform .3s;
}
.report-card.removing {
  opacity: 0;
  transform: translateX(20px);
}
.report-type-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.report-type-badge--post {
  background: var(--accent-light);
  color: var(--accent);
}
.report-type-badge--comment {
  background: #F0FDF4;
  color: var(--green);
}

/* Report card body */
.report-card-body {
  margin-bottom: 16px;
}
.report-deleted-notice {
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
  margin: 0;
}

/* Post report content */
.report-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.report-author-meta {
  display: flex;
  flex-direction: column;
}
.report-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.report-author-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.3;
}
.report-meta-dot {
  margin: 0 4px;
}
.report-post-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
  line-height: 1.4;
}
.report-post-title:hover {
  color: var(--accent);
}
.report-post-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Comment report content */
.report-comment-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.report-comment-context a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.report-comment-context a:hover {
  text-decoration: underline;
}
.report-comment-bubble {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.report-comment-author-col {
  flex-shrink: 0;
}
.report-comment-content {
  flex: 1;
  min-width: 0;
  background: var(--card-bg-hover);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.report-comment-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.report-comment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.report-comment-time {
  font-size: 12px;
  color: var(--text-muted);
}
.report-comment-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Report card footer */
.report-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.report-footer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.report-footer-reporter {
  font-size: 13px;
  font-weight: 600;
  color: var(--rose);
}
.report-footer-rules {
  font-size: 13px;
  color: var(--text-muted);
}
.report-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.report-btn-keep {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.report-btn-keep:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent);
}
.report-btn-delete {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--rose);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.report-btn-delete:hover {
  background: #E11D48;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
}

/* ── Security Settings Rows ── */
.security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}
.security-row--last {
  border-bottom: none;
}
.security-row-info {
  flex: 1;
  min-width: 0;
}
.security-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.security-row-value {
  font-size: 13px;
  color: var(--text-secondary);
}
.security-row-pending {
  font-size: 12px;
  color: var(--amber);
  margin-top: 2px;
}
.security-row-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.security-timezone-select {
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M3 4.5L6 8l3-3.5H3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 260px;
  max-width: 340px;
}
.security-timezone-select:focus {
  outline: none;
  border-color: var(--accent);
}
@media (max-width: 640px) {
  .security-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .security-timezone-select {
    width: 100%;
    max-width: none;
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--success {
  background: var(--green);
}
.toast--error {
  background: var(--rose);
}
