/* ===== CATHOLICVIBES CSS ===== */
/* Palette: Papal purple accent, Liturgical gold pop, warm aubergine-black background */

:root {
  --bg-primary: #14091f;
  --bg-secondary: #1c0e2b;
  --bg-card: #251438;
  --bg-card-hover: #2d1a44;
  --bg-input: #180b24;
  --accent: #7e22ce;
  --accent-light: #a855f7;
  --accent-glow: rgba(126, 34, 206, 0.25);
  --accent-yellow: #d4af37;
  --accent-pink: #be185d;
  --text-primary: #f2ecf7;
  --text-secondary: #a08cc0;
  --text-muted: #6b5a85;
  --border: #3a2050;
  --border-light: #4a2a63;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(126, 34, 206, 0.3);
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --navbar-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--accent-yellow); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ===== TURBO PROGRESS BAR ===== */
/* Replaces the browser's default loading spinner with a branded gradient bar */
.turbo-progress-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-yellow) 100%);
  box-shadow: 0 0 8px rgba(126, 34, 206, 0.6);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--navbar-h);
  background: rgba(13, 13, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; gap: 1rem;
}

.nav-brand a {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--text-primary);
}
.brand-icon { font-size: 1.4rem; filter: drop-shadow(0 0 8px var(--accent)); }
.brand-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 50%; filter: drop-shadow(0 0 6px var(--accent)); vertical-align: middle; }
.brand-text { background: linear-gradient(135deg, var(--accent-light), var(--accent-yellow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-beta {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em;
  background: rgba(126,34,206,0.18);
  border: 1px solid rgba(126,34,206,0.45);
  color: #c084fc;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.25rem;
  line-height: 1;
}

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0.4rem 0.9rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 500;
  transition: all 0.2s; text-decoration: none;
}
.nav-item i { font-size: 1.1rem; }
.nav-item:hover, .nav-item.active { color: var(--accent-light); background: var(--accent-glow); }
.nav-item.active { color: var(--accent-yellow); }

.nav-user { display: flex; align-items: center; gap: 0.75rem; }
.church-badge {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 0.3rem 0.7rem; border-radius: var(--radius-full);
  font-size: 0.8rem; color: var(--text-secondary);
}
.church-mini-logo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.user-menu { position: relative; cursor: pointer; }
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent); transition: 0.2s;
}
.nav-avatar:hover { border-color: var(--accent-yellow); }
.user-dropdown {
  position: absolute; top: calc(100% + 0.5rem); right: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem; min-width: 180px; box-shadow: var(--shadow);
  display: none; flex-direction: column; z-index: 100;
  /* bridge the gap so mouse can reach dropdown without losing hover */
  margin-top: -0.5rem; padding-top: 1rem;
}
.user-dropdown.open { display: flex; }
.dropdown-name { font-weight: 600; padding: 0.5rem 0.75rem; color: var(--text-primary); }
.dropdown-username { font-size: 0.8rem; padding: 0 0.75rem 0.5rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.user-dropdown a {
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); color: var(--text-secondary);
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem;
}
.user-dropdown a:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.main-content { margin-top: var(--navbar-h); min-height: calc(100vh - var(--navbar-h)); }

/* ===== LAYOUT ===== */
.page-layout {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 260px 1fr 260px;
  gap: 1.5rem; padding: 1.5rem;
}
.feed-main { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.feed-error-banner {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35);
  color: #fca5a5; border-radius: 12px; padding: 0.75rem 1rem;
  font-size: 0.9rem; animation: fadeIn 0.2s ease;
}
.feed-error-banner i:first-child { color: #ef4444; flex-shrink: 0; }
.feed-error-banner span { flex: 1; }
.feed-error-banner button {
  background: none; border: none; color: #fca5a5; cursor: pointer;
  padding: 0.2rem 0.4rem; opacity: 0.7; transition: opacity 0.15s;
}
.feed-error-banner button:hover { opacity: 1; }
.feed-main-centered { max-width: 680px; margin: 0 auto; width: 100%; padding: 1.5rem; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.sidebar-title {
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.25rem;
}
.sidebar-link:hover { background: var(--bg-card-hover); color: var(--accent-light); }

.user-profile-mini { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.profile-avatar-lg { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.profile-name { font-weight: 600; color: var(--text-primary); }
.profile-username { font-size: 0.8rem; color: var(--text-secondary); }
.church-tag-link {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 0.4rem 0.75rem;
  font-size: 0.85rem; color: var(--text-secondary);
}
.church-tag-link img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.trending-mini-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(190,24,93,0.1));
  border: 1px solid rgba(212,175,55,0.2); border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.trending-emoji { font-size: 1.5rem; }
.trending-mini-title { font-weight: 600; font-size: 0.9rem; }
.trending-mini-sub { font-size: 0.78rem; color: var(--text-secondary); }

.church-profile-mini {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem; border-radius: var(--radius-sm);
}
.church-profile-mini:hover { background: var(--bg-card-hover); }
.church-mini-logo-lg { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.church-mini-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.church-badges-row { display: flex; gap: 0.25rem; }
.badge-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-primary); border: 1px solid var(--border); font-size: 0.85rem;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  display: flex; align-items: center; gap: 0.4rem;
}
.form-group input, .form-group textarea, .form-group select {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.7rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; transition: 0.2s;
  width: 100%;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group select option { background: var(--bg-card); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}
.btn-primary:hover { filter: brightness(1.15); box-shadow: var(--shadow-glow); color: white; transform: translateY(-1px); }
.btn-primary-sm {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white; text-decoration: none; border: none; cursor: pointer; font-family: inherit;
  transition: filter 0.15s, transform 0.15s;
}
.btn-primary-sm:hover { filter: brightness(1.15); transform: translateY(-1px); color: white; }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* ===== ALERTS ===== */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem;
}
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }

/* ===== PROFILE EDIT PAGE ===== */
.pe-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.25rem 1rem 6rem;
}

/* Header row */
.pe-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.pe-back {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
.pe-back:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pe-title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.25rem; font-weight: 700;
  color: var(--text-primary); margin: 0;
}
.pe-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.pe-alert { margin-bottom: 1rem; }

/* Cards */
.pe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 0.25rem;
  margin-bottom: 1rem;
}
.pe-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(126,34,206,0.2);
  display: flex; align-items: center; gap: 0.4rem;
}

/* Avatar card — centered column layout */
.pe-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.1rem;
  text-align: center;
}
.pe-avatar-ring {
  display: block;
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
  cursor: pointer;
}
.pe-avatar-ring img {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--accent);
  display: block;
}
/* Small camera badge in corner — always visible, never hides the photo */
.pe-avatar-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.6rem;
  pointer-events: none;
}
.pe-avatar-info {
  display: flex; flex-direction: column; gap: 0.15rem;
}
.pe-avatar-name {
  font-weight: 600; font-size: 0.95rem;
  color: var(--text-primary);
}
.pe-avatar-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Bio textarea */
.pe-bio { width: 100%; resize: vertical; min-height: 76px; }
.pe-bio-count {
  display: block; text-align: right;
  font-size: 0.73rem; color: var(--text-muted);
  margin-top: 0.2rem;
}
.pe-optional { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }

/* Save button row */
.pe-actions { margin-top: 0.25rem; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .pe-wrap { padding: 0.75rem 0 7rem; }
  .pe-header { padding: 0 0.875rem; }
  .pe-alert  { margin: 0 0.875rem 0.875rem; }

  /* Full-bleed cards on mobile — like native settings rows */
  .pe-card {
    border-radius: 0;
    border-left: none; border-right: none;
    margin-bottom: 0.625rem;
    padding: 1rem 0.875rem 0.25rem;
  }
  .pe-avatar-card {
    border-radius: 0;
    border-left: none; border-right: none;
    padding: 1rem 0.875rem;
  }
  .pe-actions { padding: 0 0.875rem; }
}

/* ===== SHARED FORM SECTION STYLES (register + profile) ===== */
.reg-section { margin-bottom: 1.5rem; }
.reg-section-title {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent, #7e22ce);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(126,34,206,0.2);
}

/* Avatar styles used by register page */
.avatar-upload-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.75rem; margin-bottom: 1.75rem;
}
.avatar-preview-ring { position: relative; width: 96px; height: 96px; cursor: pointer; }
.avatar-preview-ring img {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--accent, #7e22ce); display: block;
}
.avatar-edit-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  color: #fff; font-size: 0.7rem; font-weight: 600; gap: 3px;
}
.avatar-preview-ring:hover .avatar-edit-overlay { opacity: 1; }
.avatar-edit-overlay i { font-size: 1.1rem; }
.avatar-placeholder-icon {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--bg-input, #3a2050); border: 3px solid var(--accent, #7e22ce);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted, #888); font-size: 2.2rem;
}
.avatar-upload-hint { font-size: 0.78rem; color: var(--text-muted, #888); text-align: center; }
.avatar-upload-hint span { color: var(--accent, #7e22ce); font-weight: 500; }

/* Select used by profile (form-select kept for church pages) */
.form-select {
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--bg-input, #251438);
  border: 1px solid var(--border, #3a2050);
  border-radius: 10px;
  color: var(--text, #f2ecf7);
  font-family: 'Inter', sans-serif; font-size: 0.93rem;
  appearance: none; -webkit-appearance: none;
  cursor: pointer; transition: border-color 0.2s;
}
.form-select:focus {
  outline: none; border-color: var(--accent, #7e22ce);
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(126,34,206,0.2));
}
.form-select option { background: #251438; color: var(--text, #f2ecf7); }

/* ===== AUTH DOWNLOAD BUTTON ===== */
.auth-dl-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}
.auth-dl-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  background: rgba(13, 13, 20, 0.88);
  border: 1px solid rgba(126, 34, 206, 0.45);
  border-radius: var(--radius-full);
  color: #c084fc;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.auth-dl-link i.fa-android { font-size: 1.05rem; color: #4ade80; }
.auth-dl-link:hover {
  background: rgba(126, 34, 206, 0.22);
  border-color: var(--accent);
  color: #c084fc;
  box-shadow: 0 4px 18px rgba(126, 34, 206, 0.3);
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .auth-dl-link span { display: none; }          /* icon-only on very small screens */
  .auth-dl-link { padding: 0.55rem 0.65rem; }
}

/* ===== AUTH ===== */
.auth-body { background: var(--bg-primary); display: flex; align-items: flex-start; justify-content: center; min-height: 100vh; overflow-y: auto; padding: 2rem 1rem; }
.auth-container {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  width: 100%; max-width: 480px; padding: 0;
  margin: auto;
}
.auth-brand { text-align: center; }
.auth-logo img { width: 80px; height: 80px; object-fit: contain; border-radius: 50%; filter: drop-shadow(0 0 20px var(--accent)); }
.psc-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 50%; vertical-align: middle; }
.auth-logo {
  font-size: 3.5rem; display: block; margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 20px var(--accent));
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.auth-brand h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; background: linear-gradient(135deg, var(--accent-light), var(--accent-yellow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-brand p { color: var(--text-secondary); margin-top: 0.25rem; }
.auth-card {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; box-shadow: var(--shadow);
}
.auth-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin-bottom: 1.5rem; }
.auth-switch { text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; }
.input-with-toggle { position: relative; }
.input-with-toggle input { width: 100%; padding-right: 2.8rem; }
.pw-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0.2rem; display: flex; align-items: center; transition: color 0.2s; }
.pw-toggle:hover { color: var(--accent); }
.auth-bg-shapes { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.shape { position: absolute; font-size: 4rem; opacity: 0.04; animation: drift 15s ease-in-out infinite; }
.shape-1 { top: 10%; left: 5%; animation-delay: 0s; }
.shape-2 { top: 20%; right: 10%; animation-delay: 3s; font-size: 3rem; }
.shape-3 { bottom: 20%; left: 15%; animation-delay: 6s; font-size: 5rem; }
.shape-4 { bottom: 10%; right: 5%; animation-delay: 9s; }
@keyframes drift { 0%,100%{transform:translateY(0) rotate(0)} 33%{transform:translateY(-20px) rotate(5deg)} 66%{transform:translateY(10px) rotate(-3deg)} }

/* ===== CREATE POST ===== */
.create-post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.create-post-header { display: flex; align-items: center; gap: 0.75rem; }
.create-post-trigger {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 0.6rem 1.2rem;
  color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 0.9rem;
}
.create-post-trigger:hover { border-color: var(--accent); color: var(--text-secondary); }
.create-post-label { display: flex; flex-direction: column; gap: 0.15rem; }
.create-post-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.create-post-sub { font-size: 0.8rem; color: var(--text-muted); }
.create-post-form { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.post-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  font-family: var(--font-body); font-size: 0.95rem; resize: none;
}
.post-textarea:focus { outline: none; border-color: var(--accent); }
.create-post-actions {
  display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem;
}
.media-btn {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer;
  color: var(--text-secondary); font-size: 0.9rem; padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.media-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.media-preview { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.media-preview img, .media-preview video { max-width: 120px; max-height: 80px; border-radius: var(--radius-sm); object-fit: cover; }

/* ===== POST CARD ===== */
.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: border-color 0.2s;
}
.post-card:hover { border-color: var(--border-light); }
.post-header {
  display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem;
}
.post-header-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.post-church-link {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(126,34,206,0.1); border: 1px solid rgba(126,34,206,0.25);
  border-radius: var(--radius-full); padding: 0.25rem 0.6rem;
  font-size: 0.8rem; font-weight: 600; color: var(--accent-light);
  min-width: 0; overflow: hidden;
}
.post-church-logo { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-church-name { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-author-info { display: flex; align-items: center; gap: 0.5rem; }
.post-author-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.post-author-name { font-weight: 600; font-size: 0.9rem; display: block; }
.post-author-username { font-size: 0.78rem; color: var(--text-muted); }
.member-type-badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.68rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; letter-spacing: 0.02em; }
.official-badge { background: linear-gradient(135deg,rgba(126,34,206,0.25),rgba(59,130,246,0.2)); color: #93c5fd; border: 1px solid rgba(99,179,237,0.3); }
.global-announcement-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: linear-gradient(135deg,rgba(126,34,206,0.18),rgba(59,130,246,0.14));
  border: 1px solid rgba(126,34,206,0.35); border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem; font-size: 0.78rem; font-weight: 700;
  color: #c084fc; letter-spacing: 0.01em;
}
.post-card--global { border-left: 3px solid rgba(126,34,206,0.5); }
.post-meta-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.post-time { font-size: 0.78rem; color: var(--text-muted); }
.trending-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full); white-space: nowrap;
}
.milestone-badge { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); white-space: nowrap; color: #fff; }
.milestone-badge-likes  { background: linear-gradient(135deg, #be185d, #ef4444); }
.milestone-badge-shares { background: linear-gradient(135deg, #3b82f6, #7e22ce); }
.post-content { margin-bottom: 0.75rem; font-size: 0.95rem; line-height: 1.7; }

/* ===== MEDIA GRID ===== */
.post-media-grid {
  display: grid; gap: 2px;
  border-radius: var(--radius-sm); overflow: hidden;
  margin: 0.75rem 0;
  position: relative;
}
.media-caption-overlay {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  background: linear-gradient(to bottom, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%);
  color: #fff;
  padding: 0.65rem 0.85rem 1.4rem;
  font-size: 0.92rem; font-weight: 500; line-height: 1.45;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
/* Caption input in create post form */
.caption-input-row {
  margin-top: 0.5rem;
  animation: fadeSlideDown 0.2s ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.caption-field {
  width: 100%; padding: 0.55rem 0.85rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.88rem; outline: none; transition: border-color 0.2s;
}
.caption-field:focus { border-color: var(--accent); }
.post-media-grid.count-1 { grid-template-columns: 1fr; }
.post-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 .media-item:first-child { grid-column: 1 / -1; }
.post-media-grid.count-4 { grid-template-columns: 1fr 1fr; }

.media-item {
  position: relative; overflow: hidden;
  background: var(--bg-input); cursor: pointer;
}
.media-item img {
  width: 100%; height: 210px; object-fit: cover; display: block;
  transition: transform 0.25s;
}
.media-item:hover img { transform: scale(1.04); }
.post-media-grid.count-1 .media-item img { height: auto; max-height: 460px; object-fit: contain; background: var(--bg-primary); }
.post-media-grid.count-3 .media-item:first-child img { height: 260px; }
.media-item video { width: 100%; display: block; max-height: 420px; background: #000; }

.media-more-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.62);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem; font-weight: 700;
  font-family: var(--font-display); pointer-events: none;
}

/* Create post preview (smaller thumbnails) */
.post-media-preview { margin-top: 0.75rem; }
.post-media-preview .media-item img { height: 100px; object-fit: cover; }
.post-media-preview .post-media-grid.count-1 .media-item img { height: 160px; max-height: 160px; object-fit: contain; }
.post-media-preview .media-item video { max-height: 160px; }

/* Media action buttons row */
.media-action-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.media-count-badge {
  font-size: 0.78rem; color: var(--accent-light);
  background: var(--accent-glow); border: 1px solid rgba(126,34,206,0.3);
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full); font-weight: 600;
}
.media-clear-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.78rem; padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm); font-family: var(--font-body); transition: color 0.2s;
}
.media-clear-btn:hover { color: var(--danger); }

.post-actions {
  display: flex; align-items: center; gap: 0.25rem;
  padding-top: 0.75rem; border-top: 1px solid var(--border);
}
.action-btn {
  display: flex; align-items: center; gap: 0.35rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 0.85rem; padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm); transition: all 0.2s; font-family: var(--font-body);
}
.action-btn:hover { background: var(--bg-card-hover); }
.like-btn:hover { color: var(--accent-pink); background: rgba(190,24,93,0.1); }
.like-btn.liked { color: var(--accent-pink); }
.share-btn:hover { color: var(--success); background: rgba(34,197,94,0.1); }
.memory-btn:hover { color: var(--accent-yellow); background: rgba(212,175,55,0.1); }
.memory-btn.saved { color: var(--accent-yellow); }
.chat-btn:hover { color: var(--accent-light); background: var(--accent-glow); }
.delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.comment-toggle-btn:hover { color: #60a5fa; background: rgba(96,165,250,0.1); }

/* ===== COMMENTS ===== */
.comments-section { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.comments-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.comment { display: flex; gap: 0.6rem; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-body { background: var(--bg-input); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; flex: 1; }
.comment-author { font-weight: 600; font-size: 0.82rem; margin-right: 0.5rem; }
.comment-body p { font-size: 0.88rem; color: var(--text-secondary); }
.comment-form { display: flex; gap: 0.5rem; }
.comment-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.5rem 0.9rem; border-radius: var(--radius-full);
  font-size: 0.88rem;
}
.comment-input:focus { outline: none; border-color: var(--accent); }
.comment-submit {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ===== PAGE HEADER ===== */
.page-header-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin-bottom: 0.5rem;
}
.page-header-icon { font-size: 2.5rem; }
.page-header-card h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; margin-bottom: 0.2rem; }
.page-header-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== TRENDING SIDEBAR ===== */
.leaderboard-item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm); margin-bottom: 0.25rem; color: var(--text-secondary);
}
.leaderboard-item:hover { background: var(--bg-card-hover); }
.leaderboard-rank {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
  background: var(--bg-input); color: var(--text-muted);
}
.rank-1 { background: linear-gradient(135deg, #d4af37, #f59e0b); color: #000; }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #000; }
.rank-3 { background: linear-gradient(135deg, #cd7c2b, #a85a1e); color: #fff; }
.leaderboard-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-size: 0.85rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-score { font-size: 0.75rem; color: var(--text-muted); }
.leaderboard-badge { font-size: 1.1rem; }

.how-it-works { display: flex; flex-direction: column; gap: 0.6rem; }
.how-step { display: flex; align-items: center; gap: 0.75rem; font-size: 0.88rem; color: var(--text-secondary); }
.how-step span { font-size: 1.2rem; }

/* ===== CHURCH PROFILE ===== */
.church-profile-page { min-height: 100vh; }
.church-cover {
  height: 240px; background-size: cover; background-position: center;
  background-color: var(--bg-card); position: relative;
}
.church-cover-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(13,13,20,0.9) 0%, transparent 60%); }
.church-header-card {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 1.5rem; position: relative; z-index: 1; margin-top: -4rem;
}
.church-header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: flex-start; gap: 1.5rem;
}
.church-logo-lg {
  width: 90px; height: 90px; border-radius: 16px; object-fit: cover;
  border: 3px solid var(--accent); flex-shrink: 0;
}
.church-header-info { flex: 1; }
.church-name-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.church-name-row h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.verified-badge { background: var(--accent); color: white; font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); }
.church-username { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.5rem; }
.church-desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.75rem; }
.church-stats { display: flex; gap: 1.5rem; margin-bottom: 0.75rem; font-size: 0.9rem; color: var(--text-secondary); }
.church-stats strong { color: var(--text-primary); font-weight: 700; }
.church-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge-full {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius-full); padding: 0.25rem 0.7rem; font-size: 0.82rem;
}
.badge-icon { font-size: 1rem; }
.badge-name { color: var(--accent-yellow); font-weight: 600; }
.church-header-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.member-tag { display: flex; align-items: center; gap: 0.4rem; color: var(--success); font-size: 0.9rem; font-weight: 600; }
.follow-btn { min-width: 140px; justify-content: center; }

.members-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.member-chip { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); }
.member-chip img { width: 100%; height: 100%; object-fit: cover; }
.more-members {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); color: var(--text-muted); font-size: 0.75rem; font-weight: 600;
}

/* ===== CHAT ===== */
.chat-layout {
  display: flex; height: calc(100vh - var(--navbar-h));
  background: var(--bg-primary);
}
.chat-sidebar {
  width: 300px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--bg-secondary); display: flex; flex-direction: column;
  overflow-y: auto;
}
.chat-sidebar-header {
  display: flex; gap: 0.25rem; padding: 0.75rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-secondary); z-index: 10;
}
.sidebar-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
  background: transparent; color: var(--text-muted); transition: 0.2s;
}
.sidebar-tab:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.sidebar-tab.active { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(126,34,206,0.3); }
.sidebar-church-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.chat-list { padding: 0.5rem; flex: 1; overflow-y: auto; }
.chat-empty-list { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.chat-empty-list small { display: block; margin-top: 0.5rem; }
.chat-list-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem;
  border-radius: var(--radius-sm); margin-bottom: 0.25rem; transition: 0.2s; position: relative;
}
.chat-list-item:hover { background: var(--bg-card-hover); }
.chat-list-item.active { background: var(--accent-glow); border: 1px solid rgba(126,34,206,0.3); }
/* Avatar with online dot */
.chat-item-avatar-wrap { position: relative; flex-shrink: 0; width: 40px; height: 40px; }
.chat-item-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-item-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-secondary); background: #4a4a6a;
}
.chat-item-dot.online { background: #22c55e; }
.chat-item-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); display: block; }
.chat-item-sub { font-size: 0.78rem; color: var(--text-muted); }
.chat-item-church { font-size: 0.72rem; color: var(--accent); display: block; margin-top: 1px; }
.chat-item-church i { font-size: 0.65rem; margin-right: 2px; }
/* Churches tab */
.church-tab-list { display: flex; flex-direction: column; gap: 0.4rem; }
.church-tab-card {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm); text-decoration: none; transition: 0.2s;
}
.church-tab-card:hover { background: var(--bg-card-hover); }
.church-tab-logo { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.church-tab-info { flex: 1; min-width: 0; }
.church-tab-name { display: block; font-weight: 600; font-size: 0.88rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.church-tab-sub { font-size: 0.75rem; color: var(--text-muted); }
.church-tab-arrow { color: var(--text-muted); font-size: 0.7rem; flex-shrink: 0; }
/* Church page member search + list */
.member-search-wrap {
  position: relative; margin-bottom: 0.75rem;
}
.member-search-icon {
  position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.78rem; pointer-events: none;
}
.member-search-input {
  width: 100%; padding: 0.45rem 0.75rem 0.45rem 2rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.85rem; outline: none; transition: border-color 0.2s;
  box-sizing: border-box;
}
.member-search-input:focus { border-color: var(--accent); }
.member-search-input::placeholder { color: var(--text-muted); }
.church-members-list { display: flex; flex-direction: column; gap: 0.25rem; overflow-y: auto; max-height: 420px; }
.members-locked {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem; padding: 1.5rem 1rem; color: var(--text-muted);
  font-size: 0.85rem; text-align: center;
}
.members-locked i { font-size: 1.4rem; opacity: 0.6; }
/* Desktop: keep members aside in the right column even though it comes first in DOM */
@media (min-width: 1025px) {
  .church-members-aside { grid-column: 3; grid-row: 1; }
  .page-layout:has(.church-members-aside) .feed-main { grid-column: 1 / 3; grid-row: 1; }
}
.church-member-row {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.25rem; border-radius: var(--radius-sm);
  background: none; border: none; width: 100%; text-align: left; transition: 0.15s;
}
.church-member-row:hover { background: var(--bg-card-hover); }
.church-member-self { opacity: 0.55; cursor: default; }
.church-member-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.church-member-info { flex: 1; min-width: 0; }
.church-member-name { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.church-member-sub { font-size: 0.75rem; color: var(--text-muted); }
.church-member-chat-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent-glow); color: var(--accent); font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: 0.15s;
}
.church-member-chat-btn:hover { background: var(--accent); color: #fff; }
.friend-req-badge {
  width: 20px; height: 20px; border-radius: 50%; background: var(--danger);
  color: white; font-size: 0.7rem; font-weight: 700; display: flex;
  align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0;
}

.chat-window { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-empty-window { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1rem; color: var(--text-muted); }
.chat-empty-icon { font-size: 4rem; opacity: 0.3; }
.chat-empty-window h3 { font-family: var(--font-display); color: var(--text-secondary); }
.chat-empty-window p { font-size: 0.88rem; }

.chat-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary); display: flex; align-items: center; gap: 0.75rem;
}
.chat-header-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-header-name { font-weight: 700; font-size: 1rem; }
.chat-header-sub { font-size: 0.8rem; color: var(--text-muted); }

.friend-request-banner {
  padding: 0.85rem 1.25rem; background: rgba(126,34,206,0.08);
  border-bottom: 1px solid rgba(126,34,206,0.2);
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.friend-req-msg { display: flex; align-items: center; gap: 0.65rem; flex: 1; min-width: 0; }
.friend-req-icon { font-size: 1.4rem; flex-shrink: 0; }
.friend-req-msg p { font-size: 0.88rem; color: var(--text-secondary); margin: 0; line-height: 1.4; }
.friend-req-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.friend-request-pending-notice {
  padding: 0.75rem 1.5rem; background: rgba(245,158,11,0.08);
  border-bottom: 1px solid rgba(245,158,11,0.2); color: var(--warn);
  font-size: 0.88rem; display: flex; align-items: center; gap: 0.5rem;
}
.friend-request-declined-notice {
  padding: 0.75rem 1.5rem; background: rgba(239,68,68,0.08);
  border-bottom: 1px solid rgba(239,68,68,0.2); color: var(--danger);
  font-size: 0.88rem; display: flex; align-items: center; gap: 0.5rem;
}

.messages-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.messages-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.9rem; }
.message-bubble { display: flex; align-items: flex-end; gap: 0.5rem; max-width: 70%; }
.message-bubble.sent { align-self: flex-end; flex-direction: row-reverse; }
.message-bubble.received { align-self: flex-start; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-content { background: var(--bg-card); border-radius: 12px; padding: 0.6rem 0.9rem; border: 1px solid var(--border); }
.message-bubble.sent .msg-content { background: linear-gradient(135deg, var(--accent), var(--accent-light)); border-color: transparent; }
.msg-content p { font-size: 0.9rem; color: var(--text-primary); }
.message-bubble.sent .msg-content p { color: white; }
.msg-time { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }
.message-bubble.sent .msg-time { color: rgba(255,255,255,0.65); }
.msg-ticks { display: inline-flex; align-items: center; flex-shrink: 0; }
.msg-ticks i { font-size: 0.68rem; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.msg-ticks[data-status="read"] i { color: #7dd3fc; }

.message-form {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg-secondary);
  display: flex; gap: 0.75rem; align-items: flex-end;
}
.message-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.7rem 1.1rem; border-radius: var(--radius-full);
  font-size: 0.95rem;
}
.message-input:focus { outline: none; border-color: var(--accent); }
.message-send-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent);
  border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: 0.2s;
}
.message-send-btn:hover { background: var(--accent-light); transform: scale(1.05); }

/* ===== GIST ROOM (GROUP CHAT) ===== */
.new-gist-room-btn {
  display: flex; align-items: center; gap: 0.55rem;
  width: 100%; margin-bottom: 0.35rem; box-sizing: border-box;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(135deg, rgba(126,34,206,0.18), rgba(126,34,206,0.09));
  border: 1px solid rgba(126,34,206,0.3); border-radius: 10px;
  color: var(--accent, #7e22ce); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.15s, border-color 0.15s;
}
.new-gist-room-btn:hover { background: linear-gradient(135deg, rgba(126,34,206,0.28), rgba(126,34,206,0.16)); border-color: var(--accent); }

.chat-item-group-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #7e22ce, #6b21a8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.95rem; flex-shrink: 0;
}
.chat-header-group-icon { width: 38px; height: 38px; font-size: 1rem; }

.msg-sender-name {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: var(--accent, #7e22ce); margin-bottom: 0.12rem;
}
.msg-sender-church { font-weight: 400; opacity: 0.75; font-size: 0.68rem; }

/* Gist Room creation modal */
.gist-room-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.6); display: flex; align-items: flex-end;
}
.gist-room-modal-inner {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--bg-card, #251438); border-radius: 20px 20px 0 0;
  max-height: 90vh; display: flex; flex-direction: column;
  animation: grSlideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes grSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.gist-room-modal-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
  flex-shrink: 0;
}
.gist-room-modal-header h2 {
  flex: 1; font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.05rem; font-weight: 700; margin: 0;
}
.gr-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-secondary, #1c0e2b); border: none;
  color: var(--text-secondary, #aaa); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.gr-icon-btn:hover { background: var(--bg-hover, #222236); color: var(--text-primary, #f2ecf7); }
.gr-next-btn {
  padding: 0.38rem 1rem; background: var(--accent, #7e22ce);
  border: none; border-radius: 20px; color: #fff;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.gr-next-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.gr-next-btn:not(:disabled):hover { background: #6b21a8; }

.gr-chips {
  display: flex; gap: 0.45rem; padding: 0.55rem 0.9rem;
  flex-wrap: wrap; flex-shrink: 0; min-height: 0;
}
.gr-chips:empty { padding: 0; }
.gr-chip {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0.55rem 0.28rem 0.35rem;
  background: rgba(126,34,206,0.18); border: 1px solid rgba(126,34,206,0.3);
  border-radius: 20px; font-size: 0.82rem; color: var(--accent-light, #c084fc); white-space: nowrap;
}
.gr-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.gr-chip-remove { background: none; border: none; color: rgba(167,139,250,0.7); font-size: 0.68rem; cursor: pointer; padding: 0; line-height: 1; }

.gr-search-wrap { padding: 0.55rem 0.9rem; flex-shrink: 0; }
.gr-search {
  width: 100%; padding: 0.52rem 1rem;
  background: var(--bg-input, #1e1e30); border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 20px; color: var(--text-primary, #f2ecf7); font-size: 0.88rem; outline: none;
}
.gr-search:focus { border-color: var(--accent, #7e22ce); }

.gr-friends-list { flex: 1; overflow-y: auto; padding: 0.25rem 0; }
.gr-friend-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.9rem; cursor: pointer; transition: background 0.12s;
}
.gr-friend-item:hover { background: rgba(255,255,255,0.04); }
.gr-friend-item.selected { background: rgba(126,34,206,0.1); }
.gr-friend-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.gr-friend-info { flex: 1; min-width: 0; }
.gr-friend-name { font-size: 0.9rem; font-weight: 600; display: block; }
.gr-friend-sub  { font-size: 0.78rem; color: var(--text-muted, #888); }
.gr-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border, rgba(255,255,255,0.18));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: transparent; transition: background 0.15s, border-color 0.15s;
}
.gr-friend-item.selected .gr-check { background: var(--accent, #7e22ce); border-color: var(--accent, #7e22ce); color: #fff; }

.gr-member-preview {
  display: flex; gap: 0.65rem; padding: 0.9rem 0.9rem 0.55rem;
  overflow-x: auto; flex-shrink: 0;
}
.gr-member-av { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex-shrink: 0; width: 52px; }
.gr-member-av img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent, #7e22ce); }
.gr-member-av span { font-size: 0.68rem; color: var(--text-secondary, #aaa); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 52px; }

.gr-name-wrap {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.9rem 1.5rem; flex-shrink: 0;
}
.gr-group-av {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #7e22ce, #6b21a8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.25rem; flex-shrink: 0;
}
.gr-name-input {
  flex: 1; background: none; border: none;
  border-bottom: 2px solid var(--accent, #7e22ce);
  color: var(--text-primary, #f2ecf7); font-size: 1rem;
  padding: 0.4rem 0.2rem; outline: none; font-family: inherit;
}
.gr-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted, #888); font-size: 0.88rem; }

/* Gist Room info panel */
.gist-info-panel {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.6); display: flex; align-items: flex-end;
}
.gist-info-inner {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--bg-card, #251438); border-radius: 20px 20px 0 0;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: grSlideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.gist-info-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.07)); flex-shrink: 0;
}
.gist-info-header h2 {
  flex: 1; font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.05rem; font-weight: 700; margin: 0;
}
.gist-info-body { flex: 1; overflow-y: auto; }
.gist-info-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.45rem; padding: 1.5rem 1rem 1rem;
}
.gist-info-hero-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #7e22ce, #6b21a8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.7rem;
}
.gist-info-hero-name {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.15rem; font-weight: 700; text-align: center;
}
.gist-info-hero-sub { font-size: 0.82rem; color: var(--text-muted, #888); }
.gist-info-section-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--accent, #7e22ce);
  padding: 0.65rem 0.9rem 0.3rem;
}
.gist-info-member {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
}
.gist-info-member:last-child { border-bottom: none; }
.gist-info-member img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.gist-info-member-info { flex: 1; min-width: 0; }
.gist-info-member-name { font-size: 0.9rem; font-weight: 600; display: block; }
.gist-info-member-sub  { font-size: 0.78rem; color: var(--text-muted, #888); }
.gist-info-admin-badge {
  font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.55rem;
  background: rgba(126,34,206,0.2); border: 1px solid rgba(126,34,206,0.4);
  border-radius: 20px; color: var(--accent, #7e22ce); white-space: nowrap;
}
.gist-add-member-wrap { padding: 0 0.9rem 0.5rem; }
.gist-add-member-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%; padding: 0.75rem; border-radius: 12px;
  background: rgba(126,34,206,0.12); border: 1px solid rgba(126,34,206,0.35);
  color: var(--accent, #7e22ce); font-size: 0.93rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.gist-add-member-btn:hover { background: rgba(126,34,206,0.22); }
.gist-leave-wrap { padding: 0.5rem 0.9rem 2rem; }
.gist-leave-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%; padding: 0.8rem; border-radius: 12px;
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35);
  color: #ef4444; font-size: 0.93rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.gist-leave-btn:hover { background: rgba(239,68,68,0.22); }

/* Clickable group header */
.chat-header-group-btn {
  display: flex; align-items: center; gap: 0.75rem;
  background: none; border: none; cursor: pointer;
  color: inherit; text-align: left; padding: 0; flex: 1; min-width: 0;
}

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: calc(100vh - var(--navbar-h)); }
.admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-secondary);
  border-right: 1px solid var(--border); padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.admin-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  color: var(--accent-light); padding: 0.5rem 0.75rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.admin-nav-link {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.9rem;
}
.admin-nav-link:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.admin-nav-link.active { background: var(--accent-glow); color: var(--accent-light); border: 1px solid rgba(126,34,206,0.3); }
.admin-main { flex: 1; padding: 1.5rem; overflow-y: auto; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.admin-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.admin-badge {
  background: var(--accent-glow); border: 1px solid rgba(126,34,206,0.3);
  color: var(--accent-light); padding: 0.4rem 0.9rem; border-radius: var(--radius-full); font-size: 0.85rem;
}
.total-count { color: var(--text-muted); font-size: 0.9rem; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-users .stat-icon { background: rgba(96,165,250,0.15); color: #60a5fa; }
.stat-churches .stat-icon { background: rgba(126,34,206,0.15); color: var(--accent-light); }
.stat-posts .stat-icon { background: rgba(212,175,55,0.15); color: var(--accent-yellow); }
.stat-number { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.admin-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.admin-see-all { display: block; text-align: center; padding: 0.6rem; font-size: 0.85rem; color: var(--accent-light); border-top: 1px solid var(--border); margin-top: 0.75rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 0.75rem; font-size: 0.88rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-card-hover); }
.row-banned td { opacity: 0.6; }
.row-deleted td { opacity: 0.5; }
.post-content-cell { max-width: 250px; }

.status-pill {
  padding: 0.2rem 0.65rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600;
}
.status-active { background: rgba(34,197,94,0.15); color: var(--success); }
.status-inactive { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-banned { background: rgba(239,68,68,0.2); color: #fca5a5; }
.role-pill { padding: 0.2rem 0.65rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }
.role-admin { background: rgba(212,175,55,0.15); color: var(--accent-yellow); }
.role-student { background: rgba(126,34,206,0.15); color: var(--accent-light); }

.actions-cell { display: flex; gap: 0.25rem; align-items: center; }
.btn-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; transition: 0.2s;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.1); }
.btn-icon-success:hover { border-color: var(--success); color: var(--success); background: rgba(34,197,94,0.1); }
.btn-icon-warn:hover { border-color: var(--warn); color: var(--warn); background: rgba(245,158,11,0.1); }
.btn-icon-success { color: var(--success); }

.inline-form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; background: var(--bg-input); border-radius: var(--radius-sm); flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 120px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.88rem; }

/* ===== RESPONSIVE ===== */
/* ===== TABLET (769px – 1024px) ===== */
@media (max-width: 1024px) {
  .page-layout { grid-template-columns: 220px 1fr; gap: 1rem; padding: 1rem; }
  .sidebar-right { display: none; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .church-cover { height: 200px; }
  .live-stream-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .broadcast-container, .watch-container { max-width: 100%; }
  /* tablet: stack video above chat, give chat a fixed height */
  .live-watch-page { grid-template-columns: 1fr; gap: 0.75rem; }
  .lwp-chat-col { height: 380px; position: static; }
}
/* ===== NOTIFICATION BELL ===== */
.notif-bell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--text-secondary); transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.notif-bell i { font-size: 1.1rem; }
.notif-bell:hover { color: var(--accent-light); background: var(--accent-glow); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger); color: #fff;
  font-size: 0.62rem; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: var(--radius-full); padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary); line-height: 1;
}

/* ===== NOTIFICATIONS PAGE ===== */
.notif-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.notif-page-title {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem;
}
.notif-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notif-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  text-decoration: none; color: inherit; transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.notif-item:hover { border-color: var(--border-light); background: var(--bg-card-hover); color: inherit; }
.notif-item.unread { border-left: 3px solid var(--accent-light); }
.notif-icon-wrap { flex-shrink: 0; }
.notif-type-icon { font-size: 1.5rem; display: block; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); margin-bottom: 0.2rem; }
.notif-msg { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.2rem; }
.notif-time { font-size: 0.75rem; color: var(--text-muted); }
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-light); flex-shrink: 0;
}

/* ===== CHAT UNREAD BADGE ===== */
.nav-chat-link { position: relative; }
.chat-nav-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 700;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary); line-height: 1;
  pointer-events: none;
}
/* Hide badge when count is 0 regardless of display property */
.chat-nav-badge:empty,
.chat-item-unread-badge:empty,
.mob-badge:empty { display: none !important; }
.chat-item-unread-badge {
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  border-radius: var(--radius-full); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; line-height: 1;
}

/* ===== ADVERTISEMENTS ===== */
.ad-slider-card { padding: 0.75rem !important; }
.ad-slider-feed { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1rem; }
.ad-slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.ad-sponsored-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.ad-slider { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-secondary); height: 260px; }
.ad-slide { display: none; width: 100%; height: 100%; }
.ad-slide.active { display: flex; align-items: center; justify-content: center; animation: adFadeIn 0.5s ease; }
@keyframes adFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ad-slide-img { width: 100%; height: 100%; display: block; object-fit: contain; background: var(--bg-secondary); }
.ad-slide-caption { font-size: 0.8rem; font-weight: 500; padding: 0.45rem 0.6rem; background: var(--bg-secondary); border-radius: 0 0 10px 10px; }
.ad-dots { display: flex; justify-content: center; gap: 5px; margin-top: 0.5rem; }
.ad-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background 0.2s; }
.ad-dot.active { background: var(--accent); }
.advertise-btn { font-size: 0.85rem; }
/* Ad flyer drop zone */
.ad-flyer-drop { border: 2px dashed var(--border); border-radius: 10px; padding: 2rem 1rem; text-align: center; cursor: pointer; transition: border-color 0.2s; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.ad-flyer-drop:hover { border-color: var(--accent); }
.ad-flyer-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.ad-flyer-placeholder i { font-size: 2.5rem; color: var(--accent); opacity: 0.6; }
.ad-flyer-placeholder p { margin: 0; font-size: 0.9rem; }
.ad-flyer-placeholder small { font-size: 0.75rem; }

/* ===== LIVE STREAM ===== */
.live-dot-sm {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; animation: livePulse 1.2s infinite;
  margin-right: 4px; vertical-align: middle;
}
.live-dot-lg {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: #ef4444; animation: livePulse 1.2s infinite;
  margin-right: 6px; vertical-align: middle;
}
.live-nav-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; animation: livePulse 1.2s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}
.live-badge-card {
  display: inline-flex; align-items: center; gap: 4px;
  background: #ef4444; color: #fff; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.05em; padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}
.live-stream-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.live-stream-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-decoration: none;
  color: inherit; transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.live-stream-card:hover { border-color: #ef4444; transform: translateY(-2px); color: inherit; }
.live-stream-thumb {
  position: relative; background: #111; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
}
.live-thumb-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 3px solid #ef4444;
}
.live-stream-thumb .live-badge-card { position: absolute; top: 8px; left: 8px; }
.live-viewer-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7); color: #fff; font-size: 0.75rem;
  padding: 0.15rem 0.5rem; border-radius: var(--radius-full);
}
.live-stream-info { padding: 0.75rem 1rem; }
.live-stream-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); margin-bottom: 0.25rem; }
.live-stream-meta  { font-size: 0.8rem; color: var(--text-secondary); }

/* Broadcast + Watch pages */
.broadcast-container { max-width: 720px; margin: 0 auto; }
.broadcast-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }
.broadcast-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.camera-preview-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; margin: 1rem 0; }
.camera-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  color: var(--text-muted); background: #0a0a12;
}
.broadcast-video { width: 100%; height: 100%; object-fit: cover; display: none; }
.broadcast-video-live { display: block !important; border-radius: var(--radius); }
.broadcast-setup-btns { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.broadcast-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 1rem; }
.broadcast-hint i { margin-right: 4px; }

.live-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid #ef444466;
  border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem;
}
.live-stats { flex: 1; font-size: 0.85rem; color: var(--text-secondary); }
.live-stats i { margin-right: 4px; }

/* ===== LIVE WATCH PAGE ===== */
.live-watch-page {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  align-items: start;
}
.lwp-video-col { display: flex; flex-direction: column; min-width: 0; }
.lwp-video-wrap {
  position: relative; background: #000;
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/9; width: 100%;
}
.lwp-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.lwp-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; color: var(--text-muted);
}
.lwp-placeholder i { font-size: 3.5rem; opacity: 0.35; }
.lwp-placeholder p  { font-size: 0.9rem; }
.stream-ended-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; text-align: center; padding: 1.5rem;
}
.stream-ended-overlay h3 { font-size: 1.1rem; color: var(--text-primary); }
.stream-ended-overlay p  { font-size: 0.85rem; color: var(--text-secondary); }
.lwp-info-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem;
  padding: 0.75rem 0.25rem 0;
}
.lwp-info-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1; }
.lwp-streamer-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lwp-streamer-text { display: flex; flex-direction: column; min-width: 0; }
.lwp-stream-title { font-weight: 700; font-size: 0.97rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lwp-streamer-name { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lwp-info-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.lwp-viewers { font-size: 0.82rem; color: var(--text-secondary); }
.lwp-back-btn {
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0.3rem 0.65rem; border: 1px solid var(--border);
  border-radius: var(--radius-full); transition: color 0.2s, border-color 0.2s;
}
.lwp-back-btn:hover { color: var(--accent-light); border-color: var(--accent-light); }

/* Chat column */
.lwp-chat-col {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  height: calc(100vh - var(--navbar-h) - 3rem);
  position: sticky; top: calc(var(--navbar-h) + 1rem);
}
.lwp-chat-header {
  padding: 0.75rem 1rem; font-weight: 600; font-size: 0.9rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary);
}
.lwp-chat-messages {
  flex: 1; overflow-y: auto; padding: 0.75rem 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.live-chat-msg { font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.live-chat-msg strong { color: var(--accent-light); margin-right: 4px; }
.lwp-chat-input-row {
  display: flex; gap: 0.5rem; padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.lwp-chat-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 0.45rem 0.85rem;
  font-size: 0.85rem; color: var(--text-primary); outline: none;
}
.lwp-chat-input:focus { border-color: var(--accent); }
.lwp-chat-send {
  background: var(--accent); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.2s;
}
.lwp-chat-send:hover { background: var(--accent-light); }

/* Legacy classes kept for broadcast page */
.watch-container { max-width: 720px; margin: 0 auto; }
.watch-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.watch-title { font-weight: 600; font-size: 0.95rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-viewers { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }
.watch-video-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.live-chat-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 1rem; overflow: hidden; }
.live-chat-messages { height: 200px; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.live-chat-input-row { display: flex; gap: 0.5rem; padding: 0.6rem 0.75rem; border-top: 1px solid var(--border); }
.nav-live { position: relative; }
.btn-danger {
  background: #ef4444; color: #fff; border: none;
  padding: 0.5rem 1rem; border-radius: var(--radius-full);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: #dc2626; }

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  /* ----- Layout ----- */
  .page-layout {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    padding-bottom: 5rem; /* room for bottom nav */
    gap: 0.75rem;
  }
  .sidebar-left { display: none; }
  .hide-mobile { display: none !important; }

  /* Right sidebar flows below the feed as a 2-col card grid */
  .sidebar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-content: start;
    width: 100%;
  }
  /* Church members aside: force visible above posts (DOM order puts it first) */
  aside.church-members-aside {
    display: block !important;
    width: 100%;
    grid-column: auto;
  }
  aside.church-members-aside .church-members-list { max-height: 55vh; }
  /* Ad slider and advertise button span full width */
  .sidebar-right .ad-slider-card,
  .sidebar-right .sidebar-card:last-child { grid-column: 1 / -1; }
  /* Tighten sidebar cards on mobile */
  .sidebar-right .sidebar-card { padding: 0.875rem; }
  .main-content { padding-bottom: 0; }

  /* ----- Navbar: hide links (bottom bar replaces them) ----- */
  .nav-links { display: none; }
  .navbar { padding: 0 0.875rem; height: 56px; }
  --navbar-h: 56px;
  .main-content { margin-top: 56px; }
  .church-badge span { display: none; }
  .church-badge { padding: 0.25rem 0.5rem; }
  .nav-avatar { width: 32px; height: 32px; }

  body { overscroll-behavior-y: none; }

  /* ----- Mobile bottom nav bar ----- */
  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1100;
    height: 60px;
    background: rgba(13, 13, 20, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    align-items: stretch;
  }
  .mob-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px;
    color: var(--text-muted); font-size: 0.58rem; font-weight: 500;
    text-decoration: none; position: relative;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-nav-item i { font-size: 1.05rem; }
  .mob-nav-item.active, .mob-nav-item:hover { color: var(--accent-light); }
  .mob-nav-item.active i { filter: drop-shadow(0 0 6px var(--accent)); }
  .mob-badge {
    position: absolute; top: 6px; right: calc(50% - 18px);
    min-width: 16px; height: 16px; padding: 0 3px;
    background: var(--danger); color: #fff; font-size: 0.6rem; font-weight: 700;
    border-radius: var(--radius-full); border: 2px solid var(--bg-primary);
    display: flex; align-items: center; justify-content: center; line-height: 1;
  }

  /* ----- Post cards ----- */
  .post-card { padding: 0.875rem 0.875rem 0.75rem; }
  .post-header { gap: 0.5rem; }
  .post-author-avatar { width: 28px; height: 28px; }
  .post-content { font-size: 0.9rem; }
  .action-btn { padding: 0.55rem 0.6rem; font-size: 0.82rem; gap: 0.25rem; }
  .post-actions { gap: 0.15rem; }

  /* ----- Create post ----- */
  .create-post-card { padding: 0.875rem; }
  .create-post-actions { flex-wrap: wrap; gap: 0.5rem; }
  .media-action-btns { gap: 0.35rem; }
  .media-btn { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

  /* ───── Chat (mobile) ───── */
  .chat-layout {
    flex-direction: column;
    height: calc(100dvh - 56px - 60px);
  }
  .chat-sidebar {
    width: 100%; flex-shrink: 0; height: 100%;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-y: auto;
  }
  .chat-window { flex: 1; min-height: 0; }
  .chat-layout.has-active-chat .chat-sidebar { display: none; }
  .chat-layout.has-active-chat .chat-window {
    display: flex; flex-direction: column; height: 100%; overflow: hidden;
  }

  /* Back button */
  .mobile-back-btn {
    display: inline-flex !important;
    align-items: center; gap: 0.5rem;
    color: var(--accent-light); font-size: 0.9rem; font-weight: 600;
    padding: 0.4rem 0; text-decoration: none;
  }

  /* Chat header: compact */
  .chat-header { padding: 0.6rem 0.85rem; gap: 0.6rem; }
  .chat-header-avatar { width: 36px; height: 36px; }
  .chat-header-name { font-size: 0.95rem; }

  /* Messages: flex-grow fills space between header and input bar */
  /* NO fake padding-bottom — input area is in normal flow, not fixed */
  .messages-container {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 0.75rem 0.65rem;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }
  .chat-layout, .chat-window {
    overscroll-behavior: none;
  }

  /* Bubbles: wider on small screens */
  .message-bubble { max-width: 84%; }
  .msg-content { padding: 0.5rem 0.75rem; border-radius: 14px; }
  .msg-content p { font-size: 0.875rem; line-height: 1.45; }
  .msg-time { font-size: 0.67rem; }
  .msg-avatar { width: 26px; height: 26px; }

  /* Input area: normal flex item — anchors to the bottom of the column */
  /* position:fixed was the bug — it removed the element from flow so the  */
  /* messages container filled the whole window and the bar covered it.     */
  .chat-input-area {
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .chat-input-area .message-form {
    border-top: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
  }
  .chat-input-area .message-send-btn { width: 40px; height: 40px; font-size: 0.85rem; }

  /* Typing indicator inside the bar */
  .chat-input-area #typingIndicator { padding: 0.35rem 0.85rem 0; }

  /* Chat list: bigger touch targets */
  .chat-list { padding: 0.25rem 0.35rem; }
  .chat-list-item { padding: 0.8rem 0.65rem; border-radius: 10px; gap: 0.65rem; }
  .chat-item-avatar-wrap { width: 46px; height: 46px; }
  .chat-item-avatar { width: 46px; height: 46px; }
  .chat-item-dot { width: 11px; height: 11px; }
  .chat-item-name { font-size: 0.88rem; }
  .chat-item-sub { font-size: 0.76rem; }

  /* ----- Church page ----- */
  .church-cover { display: none; }
  .church-header-card { margin-top: 0; }
  .church-header-inner { flex-direction: column; gap: 1rem; }
  .church-logo-lg { width: 72px; height: 72px; }
  .church-name-row h1 { font-size: 1.3rem; }
  .church-stats { gap: 0.75rem; font-size: 0.82rem; flex-wrap: wrap; }
  .church-header-actions { flex-direction: row; flex-wrap: wrap; }
  /* Members card: capped height + scroll */
  .church-members-aside .sidebar-card { max-height: 50vh; overflow-y: auto; }
  aside.church-members-aside .church-members-list { max-height: none; }

  /* ----- Admin ----- */
  .admin-sidebar { width: 56px; }
  .admin-nav-link span { display: none; }
  .admin-brand span { display: none; }
  .admin-main { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* ----- Forms ----- */
  .form-row { grid-template-columns: 1fr; }
  .auth-body { padding: 1rem 0.75rem; }
  .auth-container { padding: 0; }
  .auth-card { padding: 1.25rem; }
  .auth-brand h1 { font-size: 1.8rem; }

  /* ----- Misc ----- */
  .broadcast-setup-btns { flex-direction: column; }
  .live-stream-grid { grid-template-columns: 1fr; }
  .live-header { gap: 0.5rem; }
  .watch-header { gap: 0.5rem; }
  .notif-page-header { flex-wrap: wrap; gap: 0.5rem; }
  .empty-state { padding: 2.5rem 1.25rem; }
  /* ----- Friend request banner (mobile) ----- */
  .friend-request-banner { flex-direction: column; align-items: flex-start; padding: 0.7rem 0.85rem; }
  .friend-req-msg { width: 100%; }
  .friend-req-actions { width: 100%; justify-content: flex-end; }
  .friend-request-pending-notice,
  .friend-request-declined-notice { padding: 0.6rem 0.85rem; font-size: 0.82rem; flex-wrap: wrap; }

  /* ----- Live watch page (mobile full-bleed) ----- */
  .live-watch-page {
    display: flex; flex-direction: column;
    width: 100%; max-width: 100%;
    margin: 0; padding: 0; gap: 0;
    overflow-x: hidden;
  }
  .lwp-video-col { flex-shrink: 0; width: 100%; }
  .lwp-video-wrap {
    border-radius: 0; width: 100%;
    position: sticky; top: 56px; z-index: 50;
  }
  .lwp-info-bar {
    width: 100%; box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
  }
  .lwp-streamer-avatar { width: 34px; height: 34px; }
  .lwp-stream-title { font-size: 0.88rem; }
  .lwp-streamer-name { display: none; }
  .lwp-back-btn { display: none; }
  .lwp-chat-col {
    position: static;
    width: 100%; box-sizing: border-box;
    height: auto;
    flex: 1;
    min-height: 260px;
    border-radius: 0;
    border: none;
    margin-top: 0.75rem;
    padding-bottom: 56px; /* clear fixed mobile bottom nav */
  }
  .lwp-chat-messages {
    max-height: calc(100dvh - 56px - 56px - 56.25vw - 110px);
    min-height: 160px;
    overscroll-behavior: contain;
  }
}

/* ===== SMALL MOBILE (≤ 480px) ===== */
@media (max-width: 480px) {
  .post-church-name { font-size: 0.75rem; }
  .navbar { padding: 0 0.625rem; }
  .nav-brand .brand-text { font-size: 1.1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .action-btn span { display: inline; font-size: 0.72rem; }
  .action-btn { padding: 0.4rem 0.45rem; font-size: 0.78rem; gap: 0.18rem; }
  .post-actions { gap: 0.05rem; }
  .church-stats { gap: 0.5rem; }
  .mobile-bottom-nav { height: 56px; }
  .mob-nav-item { font-size: 0.48rem; gap: 1px; }
  .mob-nav-item i { font-size: 0.95rem; }
}

/* ===== SHARE MODAL ===== */
#shareModal { display: none; position: fixed; inset: 0; z-index: 9990; }
#shareModal.active { display: block; }
.share-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
}
.share-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 0.75rem 1.25rem 2.5rem;
  max-height: 82vh; overflow-y: auto;
  animation: shareSlideUp 0.28s cubic-bezier(.32,1,.56,1);
}
@keyframes shareSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.share-handle {
  width: 40px; height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 0 auto 1rem;
}
.share-title {
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.share-title i { color: #7e22ce; }
/* Preview card */
.share-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.spr-img {
  width: 100%; max-height: 180px;
  object-fit: cover; display: block;
}
.spr-content {
  padding: 0.65rem 0.85rem 0.3rem;
  font-size: 0.9rem; color: var(--text-primary);
  line-height: 1.5;
}
.spr-tag {
  padding: 0 0.85rem 0.35rem;
  font-size: 0.85rem; font-weight: 600;
  color: #7e22ce;
}
.spr-url {
  padding: 0.25rem 0.85rem 0.65rem;
  font-size: 0.75rem; color: var(--text-muted);
}
/* Platform grid */
.share-platforms {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}
.spl-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.3rem;
  padding: 0.7rem 0.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.spl-btn:hover, .spl-btn:active { background: var(--bg-card-hover); transform: scale(0.96); }
.spl-btn i { font-size: 1.5rem; }
#sp-whatsapp i  { color: #25D366; }
#sp-facebook i  { color: #1877F2; }
#sp-twitter i   { color: #f2ecf7; }
#sp-telegram i  { color: #2CA5E0; }
#sp-copy i      { color: #7e22ce; }
@media (max-width: 400px) {
  .share-platforms { grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
  .spl-btn { padding: 0.55rem 0.1rem; font-size: 0.58rem; }
  .spl-btn i { font-size: 1.25rem; }
}

/* ===== PUBLIC POST PAGE ===== */
.post-show-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem 6rem;
}
.post-show-inner {
  width: 100%;
  max-width: 680px;
}
.post-show-cta {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.psc-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a855f7, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
}
.psc-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}
.psc-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.psc-stores {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.psc-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.psc-store-btn:hover { border-color: var(--accent); color: var(--accent-light); }

/* ===== FRIENDS PAGE ===== */
.friends-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1rem 6rem;
}
.friends-header { margin-bottom: 1.25rem; }
.friends-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem; font-weight: 700;
  color: #f2ecf7;
  display: flex; align-items: center; gap: 0.55rem;
}
.friends-title i { color: #7e22ce; }
.friends-count {
  font-size: 0.85rem; font-weight: 600;
  background: rgba(126,34,206,0.18);
  color: #c084fc;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* Empty state */
.friends-empty {
  text-align: center;
  padding: 3.5rem 1rem;
}
.fe-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }
.fe-title { font-size: 1.15rem; font-weight: 600; color: #f2ecf7; margin: 0 0 0.4rem; }
.fe-sub   { color: #a08cc0; font-size: 0.9rem; margin: 0 0 1.25rem; }

/* Friend cards */
.friends-list { display: flex; flex-direction: column; gap: 0.6rem; }

.friend-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #251438;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.friend-card:hover,
.friend-card:active {
  background: #2d1a44;
  border-color: rgba(126,34,206,0.35);
  transform: translateY(-1px);
}

/* Avatar + online dot */
.fc-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 52px; height: 52px;
}
.fc-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.08);
}
.fc-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #251438;
  background: #4a4a6a; /* offline */
}
.fc-dot.online { background: #22c55e; }

/* Text info */
.fc-info {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.fc-name {
  font-weight: 600; font-size: 0.97rem;
  color: #f2ecf7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-username {
  font-size: 0.8rem; color: #a08cc0;
}
.fc-church {
  font-size: 0.78rem; color: #c084fc;
  display: flex; align-items: center; gap: 0.3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-church i { font-size: 0.7rem; }

/* Right side */
.fc-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem;
  flex-shrink: 0;
}
.fc-status {
  font-size: 0.72rem; font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
}
.fc-status.status-online  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.fc-status.status-offline { background: rgba(74,74,106,0.25);  color: #a08cc0; }
.fc-arrow { color: #4a4a6a; font-size: 0.75rem; }

/* ===== CATECHIST PAGES ===== */
.catechist-page {
  max-width: 820px; margin: 2rem auto; padding: 0 1rem;
}
.catechist-upload-page { max-width: 1100px; }
.catechist-upload-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .catechist-upload-layout { grid-template-columns: 1fr; } }

.catechist-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px); padding: 2rem; box-shadow: var(--shadow-card);
}
.catechist-card-header {
  text-align: center; margin-bottom: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.catechist-card-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; margin: 0 auto 1rem;
}
.catechist-card-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.catechist-card-header p  { color: var(--text-muted); font-size: 0.92rem; }

/* Status banners */
.catechist-status-banner {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.5rem;
}
.catechist-status-banner.pending  { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4); }
.catechist-status-banner.approved { background: rgba(34,197,94,0.1);   border: 1px solid rgba(34,197,94,0.4);  }
.catechist-status-banner.rejected { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.4);  }
.tsb-icon { font-size: 1.5rem; }
.catechist-status-banner.pending  .tsb-icon { color: #f59e0b; }
.catechist-status-banner.approved .tsb-icon { color: #22c55e; }
.catechist-status-banner.rejected .tsb-icon { color: #ef4444; }
.tsb-body strong { display: block; font-size: 0.95rem; margin-bottom: 0.25rem; }
.tsb-body p      { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* Application summary */
.catechist-app-summary { background: var(--bg-input); border-radius: 10px; padding: 1rem 1.25rem; }
.catechist-app-summary h3 { font-size: 0.88rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tas-row { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.tas-row:last-child { border-bottom: none; }
.tas-row span { color: var(--text-muted); }
.tas-row strong { color: var(--text-primary); }

/* Alerts */
.catechist-alert {
  padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem;
  font-size: 0.88rem; display: flex; align-items: center; gap: 0.5rem;
}
.catechist-alert.error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.4);  color: #fca5a5; }
.catechist-alert.success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.4);  color: #86efac; }
.catechist-alert.info    { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.4); color: #a5b4fc; }

/* Form elements */
.catechist-form { display: flex; flex-direction: column; gap: 1.25rem; }
.catechist-form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.catechist-label { font-size: 0.88rem; font-weight: 600; color: var(--text-secondary, var(--text-muted)); }
.catechist-input, .catechist-select, .catechist-textarea {
  padding: 0.6rem 0.85rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  color: var(--text-primary); font-size: 0.9rem; font-family: inherit;
  outline: none; transition: border-color 0.2s; box-sizing: border-box; width: 100%;
}
.catechist-input:focus, .catechist-select:focus, .catechist-textarea:focus { border-color: var(--accent); }
.catechist-textarea { resize: vertical; min-height: 80px; }
.catechist-submit-btn { align-self: flex-start; margin-top: 0.5rem; gap: 0.5rem; display: inline-flex; align-items: center; }

/* Radio group */
.catechist-radio-group { display: flex; gap: 0.75rem; }
.catechist-radio-opt { cursor: pointer; }
.catechist-radio-opt input { display: none; }
.catechist-radio-opt span {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1.1rem; border: 2px solid var(--border);
  border-radius: 999px; font-size: 0.88rem; font-weight: 500;
  color: var(--text-muted); transition: 0.15s; cursor: pointer;
}
.catechist-radio-opt input:checked + span {
  border-color: var(--accent); color: var(--accent);
  background: rgba(126,34,206,0.1);
}

/* Video drop zone */
.video-drop-zone {
  display: block;
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 2rem 1rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.video-drop-zone:hover, .video-drop-zone.drag-over {
  border-color: var(--accent); background: rgba(126,34,206,0.05);
}
.video-drop-icon { font-size: 2.2rem; color: var(--accent); margin-bottom: 0.5rem; }
.video-drop-zone p { font-size: 0.9rem; color: var(--text-primary); margin: 0 0 0.25rem; }
.video-drop-zone small { color: var(--text-muted); font-size: 0.78rem; }
.video-duration-badge {
  display: inline-block; margin-top: 0.6rem;
  background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4);
  color: #86efac; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.8rem;
}

/* Upload progress */
.upload-progress-wrap { margin-bottom: 1rem; }
.upload-progress-bar { height: 6px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.upload-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  animation: uploadProg 30s linear forwards;
}
@keyframes uploadProg { from { width: 0% } to { width: 90% } }
.upload-progress-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; display: block; }

/* My videos panel */
.panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.catechist-video-list { display: flex; flex-direction: column; gap: 0.75rem; }
.catechist-video-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem; background: var(--bg-input); border-radius: 10px;
}
.catechist-video-thumb { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #000; }
.catechist-video-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.catechist-video-title { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }
.catechist-video-subject, .catechist-video-dur, .catechist-video-date {
  font-size: 0.78rem; color: var(--text-muted);
}

/* Dropdown Be A Catechist link */
.dropdown-catechist-link { position: relative; }
.dropdown-catechist-badge {
  display: inline-block; margin-left: 0.4rem;
  background: rgba(245,158,11,0.15); color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.4); font-size: 0.65rem;
  font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 999px;
  vertical-align: middle; text-transform: uppercase; letter-spacing: 0.04em;
}

/* Admin status pills */
.status-pill {
  display: inline-block; padding: 0.2rem 0.65rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize;
}
.status-pill.status-pending  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-pill.status-approved { background: rgba(34,197,94,0.12);  color: #22c55e; }
.status-pill.status-rejected { background: rgba(239,68,68,0.12);  color: #f87171; }

/* ===== CLASSROOM ===== */
.classroom-page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 5rem; }

.classroom-hero {
  text-align: center; padding: 2.5rem 1rem 2rem; margin-bottom: 2rem;
}
.classroom-hero-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff;
}
.classroom-hero h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.35rem; }
.classroom-hero p  { color: var(--text-muted); font-size: 0.95rem; }

/* Catechist grid */
.classroom-catechist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem;
}
.classroom-catechist-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem;
  text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.15s;
}
.classroom-catechist-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ctc-avatar-wrap { position: relative; width: fit-content; }
.ctc-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.ctc-verified-dot {
  position: absolute; bottom: 0; right: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.65rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-card);
}
.ctc-info { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.ctc-name     { font-weight: 700; font-size: 0.97rem; color: var(--text-primary); }
.ctc-username { font-size: 0.78rem; color: var(--text-muted); }
.ctc-teaches-at { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-light); margin-top: 0.35rem; }
.ctc-church   { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }
.ctc-church-logo { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.ctc-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.ctc-video-count { font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.ctc-arrow { color: var(--text-muted); font-size: 0.75rem; }

/* Catechist detail header */
.classroom-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--text-muted); text-decoration: none;
  margin-bottom: 1.25rem; transition: color 0.15s;
}
.classroom-back:hover { color: var(--accent); }
.classroom-catechist-header {
  display: flex; align-items: flex-start; gap: 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.5rem; margin-bottom: 1.5rem;
}
.cth-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cth-info { display: flex; flex-direction: column; gap: 0.25rem; }
.cth-info h1 { font-size: 1.3rem; font-weight: 700; }
.cth-username { font-size: 0.82rem; color: var(--text-muted); }
.cth-church {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.83rem; color: var(--text-muted); text-decoration: none; margin-top: 0.1rem;
}
.cth-church:hover { color: var(--accent); }
.cth-church-logo { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.cth-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(126,34,206,0.12); border: 1px solid rgba(126,34,206,0.35);
  color: var(--accent-light); font-size: 0.75rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 999px; margin-top: 0.25rem; width: fit-content;
}

/* Search bar */
.classroom-search-bar {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.cls-search-wrap { position: relative; flex: 1; min-width: 200px; }
.cls-search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.82rem; pointer-events: none;
}
.cls-search-input {
  width: 100%; padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.9rem; outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.cls-search-input:focus { border-color: var(--accent); }
.cls-count { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }

/* Video grid */
.classroom-video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem;
}
.classroom-video-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.15s;
}
.classroom-video-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cvc-thumb-wrap { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.cvc-thumb { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.cvc-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); opacity: 0; transition: opacity 0.2s;
  font-size: 1.8rem; color: #fff; pointer-events: none;
}
.classroom-video-card:hover .cvc-play-overlay { opacity: 1; }
.cvc-duration {
  position: absolute; bottom: 6px; right: 8px;
  background: rgba(0,0,0,0.75); color: #fff; font-size: 0.72rem;
  padding: 0.1rem 0.45rem; border-radius: 4px; font-weight: 600;
}
.cvc-body { padding: 0.85rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.cvc-title   { font-weight: 700; font-size: 0.92rem; color: var(--text-primary); line-height: 1.3; }
.cvc-subject { font-size: 0.78rem; color: var(--accent); font-weight: 500; }
.cvc-desc    { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cvc-date    { font-size: 0.75rem; color: var(--text-muted); margin-top: auto; padding-top: 0.4rem; }
.cvc-watch-btn {
  margin: 0 0.85rem 0.85rem; padding: 0.5rem;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: opacity 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.cvc-watch-btn:hover { opacity: 0.88; }

/* Video Modal */
.lesson-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.lesson-modal-inner {
  background: #000; border-radius: 12px; overflow: hidden;
  width: min(880px, 100%); max-height: 90vh; display: flex; flex-direction: column;
}
.lesson-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: #111;
  font-size: 0.9rem; font-weight: 600; color: #f2ecf7;
}
.lesson-modal-close {
  background: none; border: none; color: #a08cc0; font-size: 1rem;
  cursor: pointer; padding: 0.25rem 0.4rem; transition: color 0.15s;
}
.lesson-modal-close:hover { color: #ef4444; }
.lesson-modal-video { width: 100%; max-height: calc(90vh - 48px - 260px); background: #000; display: block; flex-shrink: 0; }

/* Token + Comments footer */
.lesson-modal-footer {
  background: #111; border-top: 1px solid #251438;
  display: flex; flex-direction: column; flex-shrink: 0; max-height: 260px; min-height: 120px;
}
.lesson-token-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1rem; border-bottom: 1px solid #251438; flex-shrink: 0;
}
.lesson-token-btn {
  background: none; border: 1.5px solid #3a3a5a; border-radius: 999px;
  color: #a0a0c0; padding: 0.28rem 0.85rem; cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; gap: 0.4rem; transition: all 0.15s;
}
.lesson-token-btn.tokened,
.lesson-token-btn:hover { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.1); }
.lesson-badge-pill {
  background: linear-gradient(135deg,#f59e0b,#d97706); color: #000;
  font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.6rem;
  border-radius: 999px; display: inline-flex; align-items: center; gap: 0.3rem;
}
.lesson-comments { flex: 1; overflow-y: auto; padding: 0.5rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 0; }
.lesson-comment-item { display: flex; gap: 0.55rem; align-items: flex-start; }
.lesson-comment-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lesson-comment-body  { flex: 1; min-width: 0; }
.lesson-comment-name  { font-size: 0.76rem; font-weight: 600; color: #c8c8e0; }
.lesson-comment-at    { font-size: 0.7rem; color: #4a4a6a; margin-left: 0.3rem; }
.lesson-comment-text  { font-size: 0.8rem; color: #9090b0; margin-top: 0.1rem; word-break: break-word; }
.lesson-comment-time  { font-size: 0.68rem; color: #4a4a6a; margin-top: 0.1rem; }
.lesson-comment-form  {
  display: flex; gap: 0.5rem; align-items: center;
  padding: 0.45rem 1rem; border-top: 1px solid #251438;
  flex-shrink: 0; background: #0d0d1a;
}
.lesson-comment-input {
  flex: 1; background: #251438; border: 1px solid #3a2050; border-radius: 8px;
  color: #f2ecf7; padding: 0.38rem 0.65rem; font-size: 0.8rem; resize: none;
  min-height: 34px; max-height: 68px; font-family: inherit;
}
.lesson-comment-input:focus { outline: none; border-color: var(--accent); }
.lesson-comment-send {
  background: var(--accent); border: none; border-radius: 8px; color: #fff;
  padding: 0.38rem 0.75rem; cursor: pointer; font-size: 0.82rem; flex-shrink: 0; transition: opacity 0.15s;
}
.lesson-comment-send:hover { opacity: 0.85; }
.lesson-comment-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Card-level token count + badge */
.cvc-stats-row { display: flex; gap: 0.65rem; font-size: 0.74rem; color: var(--text-muted); margin-top: 0.2rem; }
.cvc-badge-pill {
  position: absolute; top: 0.45rem; left: 0.45rem; z-index: 2;
  background: linear-gradient(135deg,#f59e0b,#d97706); color: #000;
  font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.5rem;
  border-radius: 999px; display: inline-flex; align-items: center; gap: 0.25rem;
}

@media (max-width: 600px) {
  .classroom-catechist-grid { grid-template-columns: 1fr 1fr; }
  .classroom-catechist-header { flex-direction: column; }
  .classroom-video-grid { grid-template-columns: 1fr; }
  .lesson-modal-video { max-height: 40vh; }
  .lesson-modal-footer { max-height: 50vh; }
}

/* ===== FEEDBACK PAGE ===== */
.fb-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
}
.fb-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.fb-page-title {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.fb-page-title i {
  font-size: 1.6rem;
  color: #7e22ce;
  margin-top: 0.15rem;
}
.fb-page-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}
.fb-page-title p {
  font-size: 0.85rem;
  color: #6b5a85;
  margin: 0;
}
.fb-beta-pill {
  background: rgba(126,34,206,0.18);
  border: 1px solid rgba(126,34,206,0.4);
  color: #c084fc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* Layout */
.fb-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Card */
.fb-card {
  background: #251438;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.5rem;
}
.fb-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #c084fc;
}
.fb-card-head i { color: #7e22ce; }

/* Alerts */
.fb-alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
}
.fb-alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
}
.fb-alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}

/* Form */
.fb-form { display: flex; flex-direction: column; gap: 1rem; }
.fb-field { display: flex; flex-direction: column; gap: 0.35rem; }
.fb-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fb-input, .fb-textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #e2e8f0;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.fb-input:focus, .fb-textarea:focus {
  outline: none;
  border-color: #7e22ce;
  background: rgba(126,34,206,0.06);
}
.fb-textarea { resize: vertical; min-height: 120px; }
.fb-char-count {
  font-size: 0.76rem;
  color: #6b5a85;
  text-align: right;
  margin-top: -0.15rem;
}

/* Type pills */
.fb-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fb-type-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: #9ca3af;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.fb-type-pill:hover { border-color: #7e22ce; color: #c084fc; }
.fb-type-pill.active {
  background: rgba(126,34,206,0.2);
  border-color: #7e22ce;
  color: #c084fc;
}

/* Submit button */
.fb-submit {
  background: linear-gradient(135deg, #7e22ce, #6b21a8);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.2s, transform 0.1s;
}
.fb-submit:hover { opacity: 0.88; }
.fb-submit:active { transform: scale(0.98); }

/* Type badges */
.fb-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fb-type-feedback   { background: rgba(126,34,206,0.18); color: #c084fc; }
.fb-type-complaint  { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.fb-type-bug_report { background: rgba(245,158,11,0.15); color: #fcd34d; }
.fb-type-suggestion { background: rgba(16,185,129,0.15); color: #6ee7b7; }

/* Status badges */
.fb-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fb-status-pending  { background: rgba(245,158,11,0.15); color: #fcd34d; }
.fb-status-reviewed { background: rgba(59,130,246,0.15); color: #93c5fd; }
.fb-status-resolved { background: rgba(16,185,129,0.15); color: #6ee7b7; }

/* History list */
.fb-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6b5a85;
}
.fb-empty i { font-size: 2rem; margin-bottom: 0.75rem; display: block; opacity: 0.5; }
.fb-history-list { display: flex; flex-direction: column; gap: 1rem; }
.fb-history-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 1rem;
}
.fb-history-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.fb-date { font-size: 0.76rem; color: #6b5a85; }
.fb-history-subject {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #e2e8f0;
}
.fb-history-msg {
  font-size: 0.83rem;
  color: #9ca3af;
  line-height: 1.55;
  max-height: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.fb-admin-reply {
  margin-top: 0.85rem;
  padding: 0.85rem;
  background: rgba(126,34,206,0.07);
  border: 1px solid rgba(126,34,206,0.2);
  border-radius: 10px;
}
.fb-admin-reply-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}
.fb-admin-reply-header i { color: #7e22ce; }
.fb-admin-reply-header strong { color: #c084fc; }
.fb-admin-reply p {
  margin: 0;
  font-size: 0.85rem;
  color: #c084fc;
  line-height: 1.6;
}

/* Admin mobile card list — hidden on desktop */
.fb-admin-mobile-list { display: none; }
.fb-admin-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.fb-admin-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

/* ===== FEEDBACK RESPONSIVE ===== */
@media (max-width: 900px) {
  .fb-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .fb-page { padding: 1rem 0.75rem 5rem; }
  .fb-page-title h1 { font-size: 1.15rem; }
  .fb-card { padding: 1.1rem; }
  .fb-type-pills { gap: 0.4rem; }
  .fb-type-pill { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

  /* Admin feedback: hide table, show mobile cards */
  .admin-table-wrap { display: none; }
  .fb-admin-mobile-list { display: block; }
}
