/* Community / club hub — aligned with site tokens from main.css */

.community-hub {
  --ch-primary: var(--primary-color, #8A2BE2);
  --ch-primary-dark: var(--primary-color-dark, #6A1B9A);
  --ch-primary-soft: var(--primary-color-light, #E6D5FA);
  --ch-border: var(--border-color, #D1C4E9);
  --ch-card: var(--card-bg, #fff);
  --ch-bg: var(--bg-color, #fcfcfd);
  --ch-input: var(--color-background-input, #f6f6f6);
  --ch-muted: var(--muted-foreground, #6b7280);
  --ch-foreground: var(--foreground, #1a1a1a);

  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  font-family: var(--font-family, Montserrat, system-ui, sans-serif);
}

.community-hub.max-w-6xl {
  max-width: 72rem;
}

.ch-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
  padding: 0.75rem 0.85rem;
  background: var(--ch-card);
  border: 1px solid var(--ch-border);
  border-radius: 1rem;
  box-shadow: var(--md-elevation-1, 0 1px 2px rgba(45, 55, 72, 0.08));
}

.ch-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  color: var(--ch-foreground);
  text-decoration: none;
  border-radius: 0.75rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ch-back:hover {
  background: var(--ch-primary-soft);
  color: var(--ch-primary);
}

.ch-back:active {
  transform: scale(0.96);
}

.ch-header-main {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1;
  min-width: 0;
}

.ch-avatar {
  width: 56px;
  height: 56px;
  border-radius: 0.875rem;
  object-fit: cover;
  background: var(--ch-input);
  border: 1px solid var(--ch-border);
  flex-shrink: 0;
}

.ch-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--ch-primary);
  background: var(--ch-primary-soft);
}

.ch-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  color: var(--ch-foreground);
  font-family: var(--font-heading, Montserrat, sans-serif);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-subtitle {
  font-size: 0.875rem;
  color: var(--ch-muted);
  margin-top: 0.15rem;
}

.ch-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ch-tabs {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  padding: 0.35rem;
  margin: 0.75rem 0 1rem;
  -webkit-overflow-scrolling: touch;
  background: var(--ch-card);
  border: 1px solid var(--ch-border);
  border-radius: 1rem;
  box-shadow: var(--md-elevation-1, 0 1px 2px rgba(45, 55, 72, 0.08));
}

.ch-tab {
  border: 0;
  background: transparent;
  padding: 0.7rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ch-muted);
  border-radius: 0.75rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.ch-tab:hover {
  color: var(--ch-primary);
  background: var(--ch-primary-soft);
}

.ch-tab:active {
  transform: scale(0.97);
}

.ch-tab.is-active {
  color: #fff;
  background: var(--ch-primary);
  box-shadow: 0 6px 16px rgba(138, 43, 226, 0.28);
}

.community-hub .ch-soon {
  margin-left: 4px;
}

.ch-panel { display: none; }
.ch-panel.is-active { display: block; }

.ch-threads-layout {
  display: block;
}

.ch-thread-list,
.ch-thread-list-full,
.ch-thread-chat {
  border: 1px solid var(--ch-border);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--ch-card);
  display: flex;
  flex-direction: column;
  box-shadow: var(--md-elevation-1, 0 1px 3px rgba(45, 55, 72, 0.06));
}

.ch-thread-list-full {
  max-height: none;
  min-height: 0;
}

.ch-thread-link {
  display: block;
  padding: 1rem 1.1rem 1rem calc(1.1rem - 3px);
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  min-height: 44px;
}

.ch-thread-link:hover {
  background: var(--ch-bg);
  border-left-color: var(--ch-primary);
}

.ch-thread-link:active {
  transform: scale(0.995);
}

.ch-thread-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ch-foreground);
  font-family: var(--font-heading, Montserrat, sans-serif);
  letter-spacing: -0.01em;
}

.ch-thread-list-toolbar {
  padding: 0.85rem;
  border-bottom: 1px solid var(--ch-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--ch-bg);
}

.ch-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
}

.ch-search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  color: var(--ch-muted);
  pointer-events: none;
}

.ch-search {
  width: 100%;
  border: 1px solid var(--ch-border);
  border-radius: 999px;
  padding: 0.55rem 2.1rem 0.55rem 2.35rem;
  background: var(--ch-card);
  font-size: 0.875rem;
  color: var(--ch-foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ch-search::placeholder {
  color: var(--ch-muted);
}

.ch-search:focus {
  outline: none;
  border-color: var(--ch-primary);
  box-shadow: var(--focus-ring, 0 0 0 3px var(--ch-primary-soft, #E6D5FA));
}

.ch-search-clear {
  position: absolute;
  right: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ch-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.ch-search-clear:hover {
  background: var(--ch-primary-soft);
  color: var(--ch-primary);
}

.ch-threads-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.ch-thread-item {
  border-bottom: 1px solid var(--ch-border);
  cursor: default;
  padding: 0;
}

.ch-thread-item:last-child {
  border-bottom: 0;
}

.ch-thread-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.ch-thread-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ch-thread-time {
  font-size: 0.75rem;
  color: var(--ch-muted);
}

.ch-thread-desc-line {
  font-size: 0.8rem;
  color: var(--ch-muted);
  margin-top: 0.15rem;
}

.ch-thread-preview {
  font-size: 0.875rem;
  color: var(--ch-muted);
  margin-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-badge {
  background: var(--ch-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  font-weight: 700;
}

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


.ch-reaction,
.ch-reaction-add {
  border: 1px solid var(--ch-border);
  background: var(--ch-card);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.ch-reaction.is-mine {
  border-color: var(--ch-primary);
  background: var(--ch-primary-soft);
  color: var(--ch-primary);
}

/* Prefer site .btn when present; keep fallbacks */
.ch-btn-primary,
.community-hub .btn-primary.ch-btn-fallback {
  background: var(--ch-primary);
  color: #fff;
  border: 0;
  border-radius: 0.625rem;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

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

.ch-btn-sm { padding: 0.375rem 0.625rem; font-size: 0.85rem; }

.ch-btn-ghost {
  background: transparent;
  border: 1px solid var(--ch-border);
  border-radius: 0.625rem;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  color: var(--ch-foreground);
}

.ch-btn-ghost:hover {
  background: var(--ch-primary-soft);
  border-color: var(--ch-primary);
  color: var(--ch-primary);
}

.ch-panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}

.ch-panel-toolbar h2 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-heading, Montserrat, sans-serif);
  font-weight: 700;
  color: var(--ch-foreground);
}

.ch-clubs-search {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.ch-feed-list,
.ch-market-list {
  display: grid;
  gap: 0.75rem;
}

.ch-card {
  border: 1px solid var(--ch-border);
  border-radius: 0.75rem;
  padding: 0.875rem;
  background: var(--ch-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ch-card a {
  color: var(--ch-primary);
  text-decoration: none;
  font-weight: 600;
}

.ch-card a:hover {
  text-decoration: underline;
}

/* ─── Clubs feed cards ─── */
.ch-clubs-list {
  display: grid;
  gap: 0.85rem;
}

.ch-club-card {
  display: flex;
  align-items: stretch;
  gap: 0.95rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--ch-border);
  border-radius: 1rem;
  background: var(--ch-card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--md-elevation-1, 0 1px 2px rgba(45, 55, 72, 0.08));
  transition:
    border-color 0.15s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease,
    background 0.15s ease;
  min-height: 88px;
}

.ch-club-card:hover {
  border-color: color-mix(in srgb, var(--ch-primary) 45%, var(--ch-border));
  box-shadow: 0 10px 28px rgba(138, 43, 226, 0.12);
  transform: translateY(-1px);
  background: linear-gradient(180deg, #fff 0%, #fbf8ff 100%);
}

.ch-club-card:active {
  transform: translateY(0) scale(0.995);
}

.ch-club-card__avatar-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--ch-primary-soft);
  border: 1px solid var(--ch-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.ch-club-card__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch-club-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ch-club-card__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ch-club-card__title {
  font-family: var(--font-heading, Montserrat, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ch-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.01em;
}

.ch-club-card__pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.ch-club-card__pill i {
  font-size: 0.7rem;
}

.ch-club-card__pill--public {
  background: rgba(138, 43, 226, 0.1);
  color: var(--ch-primary);
}

.ch-club-card__pill--private {
  background: rgba(225, 29, 72, 0.1);
  color: #be123c;
}

.ch-club-card__desc {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ch-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-club-card__desc--muted {
  opacity: 0.75;
  font-style: italic;
}

.ch-club-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.2rem;
}

.ch-club-card__members {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ch-muted);
}

.ch-club-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ch-primary);
}

.ch-club-card:hover .ch-club-card__cta {
  gap: 0.4rem;
}

.ch-empty,
.ch-empty-soft {
  padding: 1.5rem;
  text-align: center;
  color: var(--ch-muted);
}

.ch-clubs-list > .ch-empty {
  padding: 2.25rem 1.25rem;
  border: 1px dashed var(--ch-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff 0%, #faf7ff 100%);
}

.ch-soon-block {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--ch-border);
  border-radius: 0.75rem;
  background: var(--ch-bg);
}

.ch-soon-badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 0.75rem;
}

.ch-modal {
  --ch-primary: var(--primary-color, #8A2BE2);
  --ch-primary-dark: var(--primary-color-dark, #6A1B9A);
  --ch-primary-soft: var(--primary-color-light, #E6D5FA);
  --ch-border: var(--border-color, #D1C4E9);
  --ch-card: var(--card-bg, #fff);
  --ch-input: var(--color-background-input, #f6f6f6);
  --ch-muted: var(--muted-foreground, #6b7280);
  --ch-foreground: var(--foreground, #1a1a1a);

  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  background: rgba(45, 55, 72, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Above #appSidebar (z-index: 999999999) */
  z-index: 1000000000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.ch-modal[hidden] { display: none !important; }

.ch-modal.is-open {
  display: flex !important;
  animation: ch-modal-fade 0.18s ease;
}

@keyframes ch-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

body.ch-modal-open #appSidebar,
body.ch-modal-open #appSidebarBackdrop,
body.ch-modal-open #appSidebarToggle {
  z-index: 1 !important;
  pointer-events: none;
}

.ch-modal-card {
  background: var(--ch-card, #fff);
  border: 1px solid var(--ch-border, #D1C4E9);
  border-radius: 1.15rem;
  padding: 0;
  width: min(520px, 100%);
  max-height: min(88vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow:
    0 28px 72px rgba(74, 20, 140, 0.22),
    0 8px 24px rgba(45, 55, 72, 0.12);
  transform-origin: center;
  animation: ch-modal-pop 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes ch-modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.ch-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--ch-border, #eee);
  background: linear-gradient(180deg, #fbf8ff 0%, #fff 100%);
  flex-shrink: 0;
}

.ch-modal-head-text {
  min-width: 0;
}

.ch-modal-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ch-primary, #8A2BE2);
}

.ch-modal-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading, Montserrat, sans-serif);
  color: var(--ch-foreground, #1a1a1a);
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.ch-modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ch-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid var(--ch-border);
  transition: background 0.15s ease, color 0.15s ease;
}

.ch-modal-close:hover {
  background: var(--ch-primary-soft);
  color: var(--ch-primary);
}

.ch-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.ch-field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.ch-field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ch-foreground, #1a1a1a);
}

.ch-field-optional {
  font-weight: 500;
  color: var(--ch-muted);
  font-size: 0.75rem;
}

.ch-modal-card label.ch-field,
.ch-modal-card .ch-field {
  display: grid;
  gap: 0.4rem;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.ch-modal-card input,
.ch-modal-card textarea,
.ch-field input,
.ch-field textarea {
  border: 1px solid var(--ch-border, #D1C4E9);
  border-radius: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ch-modal-card textarea,
.ch-field textarea {
  resize: vertical;
  min-height: 88px;
}

.ch-modal-card input:focus,
.ch-modal-card textarea:focus,
.ch-field input:focus,
.ch-field textarea:focus {
  outline: none;
  border-color: var(--ch-primary, #8A2BE2);
  box-shadow: var(--focus-ring, 0 0 0 3px var(--ch-primary-soft, #E6D5FA));
}

.ch-modal-card input::placeholder,
.ch-modal-card textarea::placeholder {
  color: #9ca3af;
}

.ch-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--ch-border);
  border-radius: 0.9rem;
  background: #faf7ff;
  cursor: pointer;
}

.ch-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--ch-primary);
  flex-shrink: 0;
}

.ch-check span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.ch-check strong {
  font-size: 0.92rem;
  color: var(--ch-foreground);
}

.ch-check small {
  font-size: 0.78rem;
  color: var(--ch-muted);
}

.ch-privacy-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--ch-border);
  border-radius: 0.9rem;
  background: #faf7ff;
}

.ch-privacy-toggle span {
  font-size: 0.85rem;
  color: var(--ch-muted);
  transition: color 0.15s ease;
}

.ch-privacy-toggle span.is-active {
  color: var(--ch-foreground);
  font-weight: 700;
}

.ch-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: var(--ch-border, #D1C4E9);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background-color 0.2s ease;
}

.ch-toggle-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ch-toggle-switch.is-active {
  background: var(--ch-primary, #8A2BE2);
}

.ch-toggle-switch.is-active::before {
  transform: translateX(20px);
}

.ch-club-avatar-picker {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ch-club-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  object-fit: cover;
  border: 1px solid var(--ch-border);
  background: var(--ch-input);
}

.ch-club-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px dashed var(--ch-border);
  background: #fff;
  color: var(--ch-primary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ch-club-avatar-btn:hover {
  background: var(--ch-primary-soft);
  border-color: var(--ch-primary);
}

.ch-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
  border-top: 1px solid var(--ch-border, #eee);
  margin: 0;
  padding: 0.9rem 1.25rem 1.1rem;
  background: #fff;
}

.ch-modal-card--members .ch-members-scroll {
  margin: 0.75rem 1rem 1rem;
  padding: 0;
}

.ch-members-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ch-border, #D1C4E9);
  border-radius: 1rem;
  background: var(--ch-card, #fff);
  box-shadow: var(--md-elevation-1, 0 1px 3px rgba(45, 55, 72, 0.06));
  -webkit-overflow-scrolling: touch;
}

.ch-member-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem 0.65rem calc(0.85rem - 3px);
  min-height: 44px;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--ch-border, #D1C4E9);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.ch-member-item:last-child {
  border-bottom: 0;
}

.ch-member-item:hover {
  background: var(--ch-bg, #fcfcfd);
  border-left-color: var(--ch-primary, #8A2BE2);
}

.ch-member-item:active {
  transform: scale(0.995);
}

.ch-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--ch-input, #f6f6f6);
  border: 1px solid var(--ch-border, #D1C4E9);
  flex-shrink: 0;
}

.ch-member-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ch-member-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ch-foreground, #1a1a1a);
  font-family: var(--font-heading, Montserrat, sans-serif);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-member-role {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--ch-primary, #8A2BE2);
  font-weight: 600;
}

.ch-feed-list,
.ch-market-list {
  display: grid;
  gap: 0.75rem;
}

.ch-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ch-panel-toolbar h2 {
  margin: 0;
}

.community-hub .btn,
.ch-modal .btn {
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-heading, Montserrat, sans-serif);
  min-height: 44px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.community-hub .btn-primary,
.ch-modal .btn-primary {
  background: var(--ch-primary, #7f58ff);
  border-color: transparent;
  color: #fff;
}

.community-hub .btn-primary:hover,
.ch-modal .btn-primary:hover {
  background: var(--ch-primary-dark, #6b48d6);
  border-color: transparent;
  color: #fff;
}

.community-hub .btn-outline-secondary,
.ch-modal .btn-outline-secondary {
  background: #fff;
  border: 1.5px solid #e7e2f7;
  color: #1c0a47;
}

.community-hub .btn-outline-secondary:hover,
.ch-modal .btn-outline-secondary:hover {
  background: #f5f2ff;
  border-color: var(--ch-primary, #7f58ff);
  color: #1c0a47;
}

.ch-reaction-picker {
  position: fixed;
  z-index: 1000000001;
  background: var(--ch-card);
  border: 1px solid var(--ch-border);
  border-radius: 0.75rem;
  padding: 6px;
  display: flex;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ch-reaction-picker[hidden] { display: none !important; }

.ch-reaction-picker button {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 0.375rem;
}

.ch-reaction-picker button:hover {
  background: var(--ch-primary-soft);
}

.ch-search-results {
  max-height: 260px;
  overflow: auto;
  border-bottom: 1px solid var(--ch-border);
  background: var(--ch-card);
}

.ch-search-hit {
  display: block;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.4;
  border-bottom: 1px solid var(--ch-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.ch-search-hit:last-child {
  border-bottom: 0;
}

.ch-search-hit:hover {
  background: var(--ch-bg);
}

.ch-search-hit strong {
  color: var(--ch-primary);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .community-hub .ch-tab,
  .community-hub .ch-back,
  .community-hub .ch-thread-link,
  .community-hub .ch-member-item,
  .community-hub .ch-reaction {
    transition: none !important;
    transform: none !important;
  }
}

.nav-link-soon {
  opacity: 0.75;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 800px) {
  .community-hub { padding: 0.75rem 0.75rem 2rem; }
  .ch-thread-chat { min-height: 50vh; max-height: none; }
  .ch-title { font-size: 1.25rem; }

  .ch-club-card {
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .ch-club-card__avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: 0.9rem;
  }

  .ch-club-card__pill span,
  .ch-club-card__pill {
    font-size: 0.64rem;
  }

  .ch-modal-card {
    width: 100%;
    max-height: min(92dvh, 760px);
    border-radius: 1rem 1rem 0.75rem 0.75rem;
  }

  .ch-modal {
    align-items: flex-end;
    padding: 0.5rem;
  }
}
