/* ============================================================
   GATHER — Design System
   One consistent scale for spacing, type, radius, and color.
   ============================================================ */

/* ===== TOKENS ===== */
:root {
  /* Brand */
  --primary:        #1E2F49;
  --primary-hover:  #253a5c;
  --secondary:      #C8953C;
  --secondary-hover:#d4a54f;

  /* Neutrals */
  --bg:             #FFFFFF;
  --bg-soft:        #f7f8fa;
  --bg-muted:       #eef0f4;
  --border:         #dde1e9;
  --border-strong:  #c8cdd8;

  /* Text */
  --text:           #141820;
  --text-sub:       #4b5563;
  --text-muted:     #8a92a0;

  /* Semantic */
  --danger:         #dc2626;
  --danger-bg:      #fef2f2;
  --success:        #16a34a;
  --success-bg:     #f0fdf4;
  --warning:        #b45309;
  --warning-bg:     #fffbeb;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.13), 0 2px 6px rgba(0,0,0,0.06);

  /* Radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  22px;
  --r-pill:999px;

  /* Layout */
  --nav-h:  62px;
  --page-max:  960px;
  --page-max-wide: 1160px;

  /* Type */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Motion */
  --ease: 0.18s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; overflow-y: scroll; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--primary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; z-index: 9999;
  transition: opacity 0.4s ease;
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-logo { display: flex; align-items: center; gap: 14px; }
.loading-brand {
  font-family: var(--font-serif);
  font-size: 34px; font-weight: 700;
  color: white; letter-spacing: -0.3px;
}
.loading-spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SPINNER ===== */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(30,47,73,0.12);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  display: inline-block; flex-shrink: 0;
}
.spinner-sm  { width: 15px; height: 15px; border-width: 2px; }
.spinner-white { border-color: rgba(255,255,255,0.25); border-top-color: white; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9000; pointer-events: none;
}
.toast {
  padding: 13px 18px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: white;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideInRight 0.28s ease;
  max-width: 340px;
  pointer-events: all;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===== PASSWORD TOGGLE ===== */
.password-field {
  position: relative;
}
.password-field .form-input {
  padding-right: 44px;
}
.pwd-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  line-height: 0;
}
.pwd-toggle:hover { color: var(--text); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 8000; backdrop-filter: blur(3px);
}
.modal-container {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 8001; padding: 20px;
  pointer-events: none;
}
.modal-container:not(.hidden) { pointer-events: all; }
.modal {
  background: var(--bg);
  border-radius: var(--r-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);   opacity: 1; }
}
.modal-header {
  padding: 22px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
  transition: background var(--ease);
}
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-body   { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 22px;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; line-height: 1;
  transition: all var(--ease);
  cursor: pointer; border: none; outline: none;
  white-space: nowrap; flex-shrink: 0;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary  { background: var(--primary);   color: white; }
.btn-primary:hover:not(:disabled)  { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover:not(:disabled) { background: var(--secondary-hover); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--primary); }
.nav-right .btn-outline:hover:not(:disabled),
.landing-nav-actions .btn-outline:hover:not(:disabled) { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.5); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; }
.btn-tell-friend { background: var(--secondary); color: white; padding: 7px 14px; font-size: 13px; }
.btn-tell-friend:hover:not(:disabled) { background: #b5812e; }
.btn-ghost   { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled)   { background: var(--bg-muted); color: var(--text); }
.btn-sm  { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg  { padding: 13px 26px; font-size: 15px; border-radius: var(--r-md); }
.btn-full { width: 100%; }

/* ===== FORMS ===== */
.form-grid { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--text); letter-spacing: 0.01em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--text);
  background: var(--bg);
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,47,73,0.07);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.form-error {
  font-size: 13px; color: var(--danger); font-weight: 500;
  padding: 9px 12px; background: var(--danger-bg);
  border-radius: var(--r-sm); border-left: 3px solid var(--danger);
}
.forgot-link {
  font-size: 13px; color: var(--primary); font-weight: 500;
  text-align: right; display: block; margin-top: 5px;
}
.forgot-link:hover { text-decoration: underline; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.badge-primary  { background: rgba(30,47,73,0.09); color: var(--primary); }
.badge-secondary{ background: rgba(200,149,60,0.15); color: #8a6020; }
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.status-active   { background: var(--success-bg); color: var(--success); }
.status-answered { background: rgba(200,149,60,0.13); color: #8a6020; }

/* ===== AVATAR ===== */
.avatar {
  border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
  background: var(--primary);
  flex-shrink: 0; letter-spacing: 0.02em;
}
.avatar-placeholder {
  background: linear-gradient(135deg, var(--primary) 0%, #2d4a72 100%);
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-md { width: 46px; height: 46px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 88px; height: 88px; font-size: 30px; }

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-muted); border-radius: var(--r-md);
  width: fit-content; max-width: 100%;
}
.tab-btn {
  padding: 7px 18px; border-radius: calc(var(--r-md) - 1px);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: all var(--ease);
}
.tab-btn.active {
  background: var(--bg); color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.tab-btn:hover:not(.active) { color: var(--text); }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted); background: var(--bg);
  transition: all var(--ease);
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.45; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; line-height: 1.6; max-width: 320px; margin: 0 auto; }

/* ===== CARD BASE ===== */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--primary);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 12px rgba(0,0,0,0.2);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700;
  color: white; flex-shrink: 0;
  letter-spacing: -0.2px;
}
.nav-links {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
}
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.65);
  transition: all var(--ease);
}
.nav-link:hover { background: rgba(255,255,255,0.09); color: white; }
.nav-link.active { background: rgba(255,255,255,0.12); color: var(--secondary); }
.nav-link-icon { display: flex; align-items: center; }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--secondary); color: white;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
}
.nav-badge.hidden { display: none; }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--secondary); color: white;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--r-pill);
  margin-left: 6px; vertical-align: middle;
}

/* Mobile nav */
.mobile-nav-toggle {
  display: none; background: none; border: none;
  color: rgba(255,255,255,0.8); font-size: 22px; padding: 4px;
}
.mobile-nav {
  display: none;
  position: fixed; inset: 0; top: var(--nav-h);
  background: var(--primary);
  z-index: 999; padding: 16px;
  flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 500;
  color: rgba(255,255,255,0.75);
  transition: all var(--ease);
}
.mobile-nav-link:hover { background: rgba(255,255,255,0.08); color: white; }
.mobile-nav-link.active { background: rgba(255,255,255,0.1); color: var(--secondary); }

/* ============================================================
   PAGE LAYOUT — shared scaffold for inner pages
   ============================================================ */
.page-layout {
  padding-top: var(--nav-h);
  min-height: 100vh;
  background: var(--bg-soft);
}
.page-container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 36px 24px;
}
.page-container-wide {
  max-width: var(--page-max-wide);
  margin: 0 auto;
  padding: 36px 24px;
}

/* Every inner page header — consistent across all pages */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-header-text {}
.page-title {
  font-size: 22px; font-weight: 800;
  color: var(--primary); letter-spacing: -0.3px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 14px; color: var(--text-muted);
  margin-top: 3px; line-height: 1.5;
}

/* ============================================================
   LANDING / AUTH PAGES (fixed 50/50 split — never resizes)
   ============================================================ */

/* The whole page is exactly one viewport tall. Nothing can push it taller. */
.landing-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.landing-nav {
  height: var(--nav-h);
  flex-shrink: 0;
  background: var(--primary);
  display: flex; align-items: center;
  padding: 0 32px;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 12px rgba(0,0,0,0.2);
}
.landing-nav-brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700;
  color: white; letter-spacing: -0.2px;
}
.landing-nav-actions { display: flex; gap: 10px; }

/* The hero fills exactly the remaining height. Each half scrolls on its own. */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0; /* critical — prevents grid from blowing out of its flex parent */
}

/* Left: navy panel, content centered, scrolls internally if viewport is very short */
.landing-hero-left {
  background: var(--primary);
  overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 52px 48px;
}
.landing-hero-content { max-width: 420px; width: 100%; }

.landing-tagline {
  font-size: 11px; font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin-bottom: 18px;
}
.landing-headline {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 700; color: white;
  line-height: 1.15; margin-bottom: 20px;
}
.landing-verse {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px; color: rgba(255,255,255,0.68);
  line-height: 1.75; margin-bottom: 6px;
}
.landing-verse-ref {
  font-size: 13px; color: var(--secondary);
  font-weight: 600; margin-bottom: 32px;
}
.landing-features { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; }
.landing-feature { display: flex; align-items: flex-start; gap: 13px; }
.landing-feature-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(200,149,60,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--secondary);
}
.landing-feature h4 { font-size: 14px; font-weight: 700; color: white; margin-bottom: 2px; }
.landing-feature p  { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* Right: white panel, form fills it top-to-bottom, scrolls internally */
.landing-hero-right {
  background: var(--bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 52px 56px;
  border-left: 1px solid var(--border);
}

/* Form area — no card, no shadow, no border-radius; the panel IS the container */
.auth-panel-title {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 700;
  color: var(--primary); margin-bottom: 4px;
  line-height: 1.2;
}
.auth-panel-sub {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 28px; line-height: 1.5;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-divider span { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.auth-switch {
  text-align: center; margin-top: 16px;
  font-size: 14px; color: var(--text-muted);
}
.auth-switch a { color: var(--primary); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* Keep max width so the form doesn't stretch on wide screens */
.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  align-self: center;
  margin-top: auto;
  margin-bottom: auto;
}

/* Verify email */
.verify-page {
  min-height: 100vh; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.verify-card {
  background: var(--bg); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 52px 44px;
  max-width: 420px; width: 100%; text-align: center;
  border: 1px solid var(--border);
}
.verify-icon  { font-size: 56px; margin-bottom: 20px; }
.verify-title { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.verify-text  { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }

/* ============================================================
   HOME PAGE — TABS
   ============================================================ */
.home-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.home-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: none; border: none;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.home-tab:hover { color: var(--primary); }
.home-tab.active {
  color: var(--primary);
  border-bottom-color: var(--secondary);
}
.home-tab-icon {
  display: flex; align-items: center;
  color: inherit;
}
.home-tab-panels { outline: none; }
.home-tab-panel { display: none; }
.home-tab-panel.active { display: block; }

/* Legacy section styles kept for compatibility */
.home-section { margin-bottom: 52px; outline: none; }
.home-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.home-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.2px;
}
.home-section-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.home-section-icon.audio { background: rgba(200,149,60,0.14); }
.home-section-icon.video { background: rgba(30,47,73,0.09); }
.home-section-icon.docs  { background: rgba(22,163,74,0.09); }

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  outline: none;
}
.media-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.media-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.media-thumbnail {
  width: 100%; aspect-ratio: 16/9;
  background: var(--primary);
  position: relative; overflow: hidden;
}
.media-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.media-thumbnail-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: rgba(255,255,255,0.3);
}
.media-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.28);
  opacity: 0; transition: opacity var(--ease);
}
.media-card:hover .media-play-overlay { opacity: 1; }
.media-play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--primary); box-shadow: var(--shadow-md);
}
.media-featured-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--secondary); color: white;
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-pill);
}
.media-info { padding: 13px 15px; }
.media-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.media-desc  {
  font-size: 13px; color: var(--text-muted); margin-bottom: 9px;
  line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.media-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}

/* Video modal */
.video-player-wrap {
  width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 16px;
}
.video-player-wrap iframe { width: 100%; height: 100%; border: none; }

/* Document list */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--bg);
  cursor: pointer; transition: all var(--ease);
  box-shadow: var(--shadow-xs);
}
.doc-item:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.doc-icon {
  width: 44px; height: 44px; border-radius: 9px;
  background: rgba(22,163,74,0.09); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.doc-info  { flex: 1; min-width: 0; }
.doc-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.doc-meta  { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.doc-action { flex-shrink: 0; }

/* ============================================================
   PRAYERS
   ============================================================ */
.prayers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.prayer-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  transition: all var(--ease);
  box-shadow: var(--shadow-xs);
}
.prayer-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.prayer-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}
.prayer-title { font-size: 15px; font-weight: 700; color: var(--primary); line-height: 1.3; }
.prayer-desc {
  font-size: 13px; color: var(--text-sub);
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px; line-height: 1.6;
}
.prayer-shared-by {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  padding: 8px 0 6px;
}
.prayer-shared-by .avatar { flex-shrink: 0; }
.prayer-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
  padding-top: 10px; border-top: 1px solid var(--border);
  margin-top: 4px;
}
.prayer-images {
  display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.prayer-thumb {
  width: 58px; height: 58px; border-radius: var(--r-sm);
  object-fit: cover; border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.prayer-actions {
  display: flex; gap: 6px; margin-top: 12px; flex-wrap: nowrap;
}
.badge.pray-toggle-btn {
  cursor: pointer; transition: opacity var(--ease);
}
.badge.pray-toggle-btn:hover { opacity: 0.75; }

/* Image slider */
.image-slider {
  position: relative; width: 100%;
  aspect-ratio: 4/3; border-radius: var(--r-md);
  overflow: hidden; background: var(--bg-muted);
}
.slider-track { display: flex; transition: transform 0.32s ease; height: 100%; }
.slider-slide  { min-width: 100%; height: 100%; }
.slider-slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; z-index: 2; transition: background var(--ease);
}
.slider-btn:hover { background: rgba(0,0,0,0.65); }
.slider-btn-prev { left: 10px; }
.slider-btn-next { right: 10px; }
.slider-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.slider-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.45); transition: background var(--ease);
}
.slider-dot.active { background: white; }

/* ============================================================
   MESSAGES
   ============================================================ */
.messages-layout {
  display: grid; grid-template-columns: 280px 1fr;
  height: calc(100vh - var(--nav-h) - 72px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden; background: var(--bg);
  box-shadow: var(--shadow-sm);
}
.messages-sidebar { border-right: 1px solid var(--border); overflow-y: auto; background: var(--bg-soft); }
.messages-sidebar-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px; font-weight: 700; color: var(--primary);
}
.conversation-item {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; cursor: pointer;
  transition: background var(--ease);
  border-bottom: 1px solid var(--border);
}
.conversation-item:hover  { background: var(--bg); }
.conversation-item.active { background: rgba(30,47,73,0.05); }
.conversation-info { flex: 1; min-width: 0; }
.conversation-name { font-size: 14px; font-weight: 600; color: var(--text); }
.conversation-last { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-last.conv-unread-preview { color: var(--primary); font-weight: 600; }
.conv-unread-dot {
  position: absolute; bottom: 0; right: 0;
  width: 11px; height: 11px;
  background: var(--secondary); border-radius: 50%;
  border: 2px solid white;
}
.conv-unread-dot.hidden { display: none; }

.chat-area   { display: flex; flex-direction: column; overflow: hidden; }
.chat-back-btn {
  display: none;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--primary); padding: 4px 6px; flex-shrink: 0;
}
.chat-header {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; background: var(--bg);
  flex-shrink: 0;
}
.chat-header-name { font-size: 14px; font-weight: 700; color: var(--primary); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-msg { max-width: 68%; display: flex; flex-direction: column; gap: 3px; }
.chat-msg-mine   { align-self: flex-end; align-items: flex-end; }
.chat-msg-theirs { align-self: flex-start; }
.chat-bubble {
  padding: 9px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
}
.chat-msg-mine   .chat-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-msg-theirs .chat-bubble { background: var(--bg-muted); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg-time   { font-size: 11px; color: var(--text-muted); padding: 0 3px; }
.chat-msg-action { font-size: 11px; color: var(--text-muted); cursor: pointer; margin-right: 6px; }
.chat-msg-action:hover { color: var(--primary); }
.chat-edit-input {
  width: 100%; padding: 6px 8px;
  background: rgba(255,255,255,0.15); color: inherit;
  border: 1.5px solid rgba(255,255,255,0.4); border-radius: 8px;
  font-size: 14px; line-height: 1.5; font-family: var(--font-sans);
  resize: none; outline: none; box-sizing: border-box;
}
.chat-msg-theirs .chat-edit-input {
  background: white; color: var(--text);
  border-color: var(--border);
}
.chat-edit-actions { display: flex; gap: 6px; margin-top: 6px; }
.chat-input-area {
  padding: 12px 14px; border-top: 1px solid var(--border);
  background: var(--bg); display: flex; gap: 10px; align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1; padding: 9px 14px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 14px; resize: none; outline: none;
  max-height: 120px; transition: border-color var(--ease);
  font-family: var(--font-sans); line-height: 1.5;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; transition: background var(--ease);
}
.chat-send-btn:hover { background: var(--primary-hover); }

/* ============================================================
   FRIENDS
   ============================================================ */
/* Friends page header row: title left, search right */
.friends-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.friends-search-wrap { position: relative; flex: 0 0 340px; }
.friends-search { display: flex; gap: 8px; }
.friends-search .form-input { flex: 1; }

/* Floating search dropdown */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  z-index: 200; max-height: 400px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.search-dropdown.hidden { display: none; }
.search-dropdown-empty {
  padding: 16px; text-align: center;
  font-size: 14px; color: var(--text-muted);
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-info { flex: 1; }
.search-result-name { font-size: 14px; font-weight: 600; color: var(--text); }

@media (max-width: 600px) {
  .friends-page-header { flex-direction: column; }
  .friends-search-wrap { flex: 1 1 100%; }
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.friend-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 22px 18px;
  text-align: center; transition: box-shadow var(--ease);
  box-shadow: var(--shadow-xs);
}
.friend-card:hover { box-shadow: var(--shadow-sm); }
.friend-card-avatar  { margin: 0 auto 12px; }
.friend-card-name    { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.friend-card-info    { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.friend-card-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.invite-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 13px;
  box-shadow: var(--shadow-xs);
}
.invite-info { flex: 1; min-width: 0; }
.invite-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.invite-meta { font-size: 12px; color: var(--text-muted); }
.invite-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-header-card {
  background: var(--primary);
  border-radius: var(--r-lg);
  padding: 30px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 22px;
  position: relative; overflow: hidden;
}
.profile-header-card::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(200,149,60,0.12);
}
.profile-avatar-wrap { position: relative; }
.profile-avatar-change {
  position: absolute; bottom: 0; right: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--secondary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.profile-info { flex: 1; }
.profile-name  { font-size: 22px; font-weight: 800; color: white; margin-bottom: 4px; letter-spacing: -0.2px; }
.profile-email { font-size: 13px; color: rgba(255,255,255,0.65); margin-bottom: 10px; }
.profile-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(200,149,60,0.2); color: var(--secondary);
  font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: var(--r-pill);
  border: 1px solid rgba(200,149,60,0.35);
}

.profile-sections    { display: flex; flex-direction: column; gap: 14px; }
.profile-section-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.profile-section-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--primary);
}
.profile-section-body { padding: 0 18px; }
.profile-detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.profile-detail-row:last-child { border-bottom: none; }
.profile-detail-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.profile-detail-value { font-size: 14px; font-weight: 600; color: var(--text); }

.profile-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: opacity var(--ease);
}
.profile-setting-row:last-child { border-bottom: none; }
.profile-setting-row:hover { opacity: 0.7; }
.profile-setting-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.profile-setting-icon { font-size: 17px; }
.profile-setting-arrow { color: var(--text-muted); font-size: 18px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-nav {
  display: flex; gap: 3px; margin-bottom: 22px;
  padding: 3px; background: var(--bg-muted);
  border-radius: var(--r-md); flex-wrap: wrap;
}
.admin-tab {
  flex: 1; min-width: 90px; padding: 9px 14px;
  border-radius: calc(var(--r-md) - 1px);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); text-align: center;
  transition: all var(--ease);
}
.admin-tab.active { background: var(--bg); color: var(--primary); box-shadow: var(--shadow-xs); }
.admin-tab:hover:not(.active) { color: var(--text); }
.admin-section        { display: none; }
.admin-section.active { display: block; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
}
.admin-item-thumb {
  width: 76px; height: 52px; border-radius: var(--r-sm);
  background: var(--primary); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); font-size: 20px;
}
.admin-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-item-info  { flex: 1; min-width: 0; }
.admin-item-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.admin-item-meta  { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.admin-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-drag-handle {
  color: var(--text-muted); font-size: 18px; cursor: grab; padding: 4px; flex-shrink: 0;
}
.admin-drag-handle:active { cursor: grabbing; }
.draggable.dragging { opacity: 0.4; }
.drag-over { border: 2px dashed var(--secondary) !important; }

/* ============================================================
   SHARE / FRIEND SELECT MODAL
   ============================================================ */
.friends-select-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 280px; overflow-y: auto;
}
.friends-select-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--ease);
}
.friends-select-item:hover { background: var(--bg-soft); }
.friends-select-item input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary);
}

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 28px; text-align: center;
  cursor: pointer; transition: all var(--ease);
  background: var(--bg-soft);
}
.file-upload-area:hover { border-color: var(--primary); background: rgba(30,47,73,0.03); }
.file-upload-icon { font-size: 30px; margin-bottom: 10px; color: var(--text-muted); }
.file-upload-text { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.file-upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.file-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg); margin-top: 10px;
}
.file-preview-name   { flex: 1; font-size: 13px; color: var(--text); }
.file-preview-remove { color: var(--danger); cursor: pointer; font-size: 16px; }
.images-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px; margin-top: 10px;
}
.images-preview-item {
  position: relative; aspect-ratio: 1;
  border-radius: var(--r-sm); overflow: hidden;
}
.images-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.images-preview-remove {
  position: absolute; top: 3px; right: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .landing-hero { grid-template-columns: 1fr; }
  .landing-hero-left { padding: 56px 28px 40px; }
  .landing-hero-right { padding: 40px 24px; }
  /* Mobile messages: full-width panel switching */
  .messages-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - var(--nav-h) - 100px);
    position: relative;
  }
  /* Sidebar shows by default on mobile */
  .messages-sidebar {
    display: flex; flex-direction: column;
    position: absolute; inset: 0; z-index: 2;
    background: var(--bg-soft);
  }
  /* Chat area hidden until a friend is selected */
  .chat-area {
    position: absolute; inset: 0; z-index: 1;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    background: var(--bg);
  }
  /* When a chat is open: hide sidebar, show chat */
  .messages-layout.mobile-chat-open .messages-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .messages-layout.mobile-chat-open .chat-area {
    transform: translateX(0);
    z-index: 3;
  }
  /* Back button visible only on mobile */
  .chat-back-btn { display: flex; }
  .chat-header-name { font-size: 15px; }
}

@media (max-width: 768px) {
  /* ── Nav ── */
  .nav-links { display: none; }
  .mobile-nav-toggle { display: flex; }
  .landing-nav { padding: 0 16px; }

  /* ── Auth / Landing pages ── */
  /* Unlock height so the form can scroll naturally on small screens */
  .landing-page { height: auto; min-height: 100vh; overflow: visible; }
  /* Hide the decorative hero panel — the form is all that matters on mobile */
  .landing-hero-left { display: none; }
  .landing-hero {
    grid-template-columns: 1fr;
    flex: none;
    min-height: calc(100vh - var(--nav-h));
  }
  .landing-hero-right {
    padding: 36px 20px 48px;
    border-left: none;
    min-height: calc(100vh - var(--nav-h));
    overflow-y: visible;
  }
  .auth-form-wrap { max-width: 100%; }

  /* ── Inner pages ── */
  .page-container, .page-container-wide { padding: 20px 16px; }
  .page-title { font-size: 20px; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-header .btn { align-self: flex-start; }

  /* ── Profile ── */
  .profile-header-card { flex-direction: column; text-align: center; }

  /* ── Friends ── */
  .friends-page-header { flex-direction: column; gap: 12px; }
  .friends-search { flex-direction: column; }
  .friends-grid { grid-template-columns: 1fr 1fr; }
  .invite-card { flex-wrap: wrap; }
  .invite-actions { width: 100%; justify-content: flex-end; }

  /* ── Content grid ── */
  .media-grid { grid-template-columns: 1fr 1fr; }
  .prayers-grid { grid-template-columns: 1fr; }

  /* ── Auth card (legacy) ── */
  .auth-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  /* ── Auth pages ── */
  .landing-hero-right { padding: 28px 16px 40px; }
  .auth-panel-title { font-size: 22px; }

  /* ── Content grids ── */
  .media-grid   { grid-template-columns: 1fr; }
  .friends-grid { grid-template-columns: 1fr; }

  /* ── Admin ── */
  .admin-item { flex-wrap: wrap; }

  /* ── Prayers ── */
  .prayer-actions { gap: 4px; }
  .prayer-actions .btn-sm { padding: 5px 10px; font-size: 12px; }

  /* ── Home tabs ── */
  .home-tabs { overflow-x: auto; flex-wrap: nowrap; }

  /* ── Friends tab row ── */
  #friends-tabs { flex-wrap: wrap; }
}
