/* ==========================================================
   SANCTUARY — Modern Faith-Tech Design System
   A premium, Apple/Stripe-inspired design for church platforms
   ========================================================== */

/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* --- Colors --- */
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-dark: #0f172a;
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --ot-color: #3b82f6;
  --nt-color: #e11d48;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-medium: #cbd5e1;
  --color-blue: #3b82f6;
  --color-pink: #ec4899;
  --color-cyan: #06b6d4;
  --color-orange: #f97316;
  --color-green: #10b981;
  --color-red: #ef4444;
  --color-yellow: #eab308;

  /* --- Shadows (soft, layered) --- */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.03);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);

  /* --- Radii --- */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  /* --- Surface aliases (for new modules) --- */
  --surface: var(--bg-card);
  --surface-1: var(--bg-subtle);

  /* --- Transitions --- */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Typography --- */
  --font-serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;

}

/* ========== Keyframes ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes scalePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

/* ========== Noise Overlay (hidden) ========== */
#luxe-noise-overlay {
  display: none;
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.24); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.35); }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: radial-gradient(ellipse at top center, rgba(79,70,229,0.015), transparent 70%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
}

/* ========== Header ========== */
header {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.03em;
  transition: opacity var(--transition);
  color: var(--primary);
  white-space: nowrap;
}

.site-title:hover {
  opacity: 0.8;
}

.version-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-selector label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.version-selector select {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.version-selector select:hover {
  border-color: var(--primary-light);
}

.version-selector select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.version-selector select option {
  background: var(--bg-card);
  color: var(--text);
}

.breadcrumb {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 10px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow: hidden;
}

.breadcrumb:empty {
  display: none;
  padding: 0;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

.breadcrumb .current {
  color: var(--primary);
  font-weight: 600;
}

/* ========== Main ========== */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* ========== Loading ========== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--text-light);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
  box-shadow: none;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hidden {
  display: none !important;
}

/* ========== Home View - Book Grid ========== */
.testament-section {
  margin-bottom: 56px;
  animation: fadeIn 0.5s ease both;
}

.testament-header {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
  padding-bottom: 0;
}

.testament-header::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  border-radius: 2px;
}

.testament-header.old::after {
  background: var(--ot-color);
}

.testament-header.new::after {
  background: var(--nt-color);
}

.testament-header.old {
  color: var(--text);
}

.testament-header.new {
  color: var(--text);
}

.category-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.4s ease both;
}

.books-grid > .book-card:nth-child(1) { animation-delay: 0s; }
.books-grid > .book-card:nth-child(2) { animation-delay: 0.02s; }
.books-grid > .book-card:nth-child(3) { animation-delay: 0.04s; }
.books-grid > .book-card:nth-child(4) { animation-delay: 0.06s; }
.books-grid > .book-card:nth-child(5) { animation-delay: 0.08s; }
.books-grid > .book-card:nth-child(6) { animation-delay: 0.1s; }
.books-grid > .book-card:nth-child(7) { animation-delay: 0.12s; }
.books-grid > .book-card:nth-child(8) { animation-delay: 0.14s; }
.books-grid > .book-card:nth-child(9) { animation-delay: 0.16s; }
.books-grid > .book-card:nth-child(10) { animation-delay: 0.18s; }
.books-grid > .book-card:nth-child(n+11) { animation-delay: 0.2s; }

.book-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  opacity: 0.3;
  transition: opacity var(--transition);
}

.book-card.old::before {
  background: var(--ot-color);
}

.book-card.new::before {
  background: var(--nt-color);
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.book-card:hover::before {
  opacity: 1;
}

.book-card.old:hover {
  background: linear-gradient(135deg, rgba(59,130,246,0.03) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 12px rgba(59,130,246,0.08);
}

.book-card.new:hover {
  background: linear-gradient(135deg, rgba(225,29,72,0.03) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 12px rgba(225,29,72,0.08);
}

.book-card .book-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: var(--text);
}

.book-card .book-chapters {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========== Book Detail View ========== */
.book-detail {
  max-width: 900px;
}

.book-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  animation: fadeIn 0.4s ease both;
}

.book-info h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}

.book-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.book-summary {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-light);
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.chapters-section h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--text);
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.chapter-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.chapter-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ========== Chapter View ========== */
.chapter-view {
  max-width: 740px;
}

.chapter-header {
  margin-bottom: 28px;
}

.chapter-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.chapter-header .chapter-context {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.chapter-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chapter-nav-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-medium);
}

.chapter-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.verses-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 40px 44px;
  overflow-x: hidden;
}

.verse-item {
  padding: 8px 0;
  padding-left: 8px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1.85;
  margin-bottom: 0;
  border-radius: 4px;
  border-left: 2px solid transparent;
}

.verse-item:hover {
  background: rgba(79,70,229,0.03);
  border-left-color: rgba(79,70,229,0.3);
}

.verse-item .verse-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  vertical-align: super;
  margin-right: 4px;
  cursor: pointer;
  display: inline;
  line-height: 1;
}

.verse-item .verse-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
}

.verse-item.has-note {
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

/* ========== Red-Letter Words of Jesus ========== */
.verse-item.red-letter .verse-text {
  color: #c41e3a;
}

/* ========== Section Headings ========== */
.section-heading {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-dark);
  padding: 20px 0 6px 0;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.section-heading:first-child {
  padding-top: 4px;
}

/* ========== Verse Modal ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl), inset 0 3px 0 0 var(--primary);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 36px;
  animation: modalIn 0.25s ease;
}

.modal-content::before {
  display: none;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--text);
  background: var(--border);
  border-color: var(--border-medium);
}

.modal-verse-ref {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.modal-verse-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 2px solid var(--primary);
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.context-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-top: 2px solid rgba(79,70,229,0.3);
}

.context-card .context-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 4px;
}

.context-card .context-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.life-application-section {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  margin-bottom: 20px;
}

.life-application-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.life-application-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  background: rgba(79, 70, 229, 0.03);
  border-left: 2px solid var(--primary);
  padding: 14px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.multi-verse-breakdown-verses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  max-height: 300px;
  overflow-y: auto;
}

.breakdown-verse-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.6;
}

.breakdown-verse-num {
  font-weight: 700;
  color: var(--primary);
  min-width: 24px;
  flex-shrink: 0;
}

.breakdown-verse-text {
  color: var(--text);
}

.notes-section {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.notes-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notes-section textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-card);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.notes-section textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 6px rgba(79,70,229,0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 14px rgba(79,70,229,0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,70,229,0.04);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  font-weight: 600;
}

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

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

.note-saved {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}

.note-saved.show {
  opacity: 1;
}

/* ========== Error State ========== */
.error-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.error-message h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.error-message p {
  margin-bottom: 16px;
}

.error-message .btn {
  display: inline-block;
}

/* ========== Footer ========== */
footer {
  background: var(--bg-subtle);
  color: var(--text-muted);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.8rem;
  margin-top: auto;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-note {
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.7;
}

/* ========== Offline Banner ========== */
.offline-banner {
  background: #e74c3c;
  color: white;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ========== Nav Bar ========== */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-group {
  position: relative;
}

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-light);
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-trigger:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.nav-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.nav-standalone {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-light);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-standalone:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 200;
}

.nav-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  z-index: 1;
}

/* First dropdown: left-align to avoid clipping */
.nav-group:first-child .nav-menu {
  left: 0;
  transform: translateX(0) translateY(4px);
}

.nav-group:first-child .nav-menu::before {
  left: 24px;
  transform: rotate(45deg);
}

.nav-group:first-child .nav-menu.open {
  transform: translateX(0) translateY(0);
}

.nav-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}

.nav-menu-item:hover {
  background: rgba(79,70,229,0.05);
}

.nav-menu-item:active {
  background: rgba(79,70,229,0.1);
}

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

.nav-menu-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  margin-top: 2px;
  transition: color var(--transition);
}

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

.nav-menu-label {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text);
}

.nav-menu-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

/* ========== Header Utilities ========== */
.header-utils {
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: all var(--transition);
}

.search-bar:focus-within {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  width: 180px;
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  background: transparent;
  border: none;
  color: var(--text-light);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: color var(--transition);
}

.search-bar button:hover {
  color: var(--text);
}

.search-bar:focus-within button {
  color: var(--primary);
}

.header-util-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text-light);
  text-decoration: none;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
  flex-shrink: 0;
}

.header-util-btn:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.header-util-btn svg {
  flex-shrink: 0;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-sans);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.header-profile-btn {
  font-size: 1.25rem;
  line-height: 1;
}

/* Mobile hamburger - hidden on desktop */
.mobile-menu-btn {
  display: none;
}

/* ========== Mobile Menu ========== */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid var(--border);
}

.mobile-menu.open {
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-nav-section {
  padding: 8px 24px;
}

.mobile-nav-section + .mobile-nav-section {
  border-top: 1px solid var(--border-light);
}

.mobile-nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  font-family: var(--font-sans);
}

.mobile-nav-item {
  display: block;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.mobile-nav-item:hover {
  background: var(--bg-subtle);
}

/* ========== Verse of the Day ========== */
.votd-card {
  background: linear-gradient(135deg, rgba(79,70,229,0.05) 0%, rgba(245,158,11,0.05) 100%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 36px 40px;
  margin-bottom: 32px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), var(--shadow);
}

.votd-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.votd-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(79,70,229,0.06), transparent 60%);
  pointer-events: none;
}

.votd-card:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), var(--shadow-xl);
}

.votd-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  display: inline-block;
  margin-bottom: 14px;
}

.votd-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.85;
  margin-bottom: 14px;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
}

.votd-ref {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

/* ========== Progress Stats ========== */
.progress-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.progress-stats-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--text);
}

.progress-stats-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.progress-bar-lg {
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.progress-bar-fill-lg {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent-light));
  border-radius: 5px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill-lg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* ========== Org Welcome Banner ========== */
.org-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(79,70,229,0.06) 0%, rgba(99,102,241,0.02) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  gap: 16px;
}

.org-welcome-banner-icon {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79,70,229,0.08);
  border-radius: 50%;
  flex-shrink: 0;
}

.org-welcome-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.org-welcome-banner-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.org-welcome-banner-btn:hover {
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
  transform: translateY(-1px);
}

.book-progress-bar {
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.book-progress-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.chapter-btn.read {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.25);
  color: var(--primary);
  position: relative;
}

.chapter-btn.read::after {
  content: '\2713';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.55rem;
  color: var(--primary);
  opacity: 0.7;
}

.chapter-btn.read:hover {
  background: var(--primary);
  color: white;
}

/* ========== Reading Toolbar ========== */
.reading-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.toolbar-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--text);
  transition: all var(--transition);
}

.toolbar-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.toolbar-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.font-size-display {
  font-size: 0.8rem;
  color: var(--text);
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

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

/* ========== Keyword Highlighting ========== */
.highlight-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.highlight-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
}

.highlight-bar input::placeholder {
  color: var(--text-muted);
}

.match-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

mark.highlight {
  background: rgba(251,191,36,0.25);
  color: inherit;
  padding: 1px 3px;
  border-radius: 3px;
}

/* ========== Audio Player ========== */
.audio-section {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.audio-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.audio-section audio {
  flex: 1;
  min-width: 0;
  height: 36px;
  width: 100%;
}

.audio-attribution {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ========== Map View ========== */
.map-toggle-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.map-panel {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

#chapter-map {
  height: 350px;
  width: 100%;
}

/* ========== Bookmarks ========== */
.verse-item.has-bookmark {
  border-right: 2px solid var(--accent);
  padding-right: 9px;
}

.bookmark-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: all var(--transition);
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bookmark-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bookmark-toggle.active {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.bookmarks-view {
  max-width: 800px;
}

.bookmarks-view h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.bookmarks-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.bookmarks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bookmark-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.bookmark-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79,70,229,0.2);
  border-left-color: var(--accent);
}

.bookmark-card-body {
  flex: 1;
}

.bookmark-ref {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.bookmark-text {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.bookmark-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.bookmark-remove:hover {
  color: #e74c3c;
}

/* ========== Search Results ========== */
.search-view {
  max-width: 800px;
}

.search-view h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.search-info {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.search-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.search-result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79,70,229,0.2);
}

.result-ref {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.result-text {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.search-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.search-bolls-only {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  box-shadow: var(--shadow);
}

/* ========== Study Tags ========== */
.tags-section {
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 16px;
}

.tags-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 2px solid var(--tag-color, var(--primary));
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  color: var(--text-light);
  box-shadow: var(--shadow-xs);
}

.tag-chip:hover {
  border-color: var(--tag-color, var(--primary));
  color: var(--tag-color, var(--primary));
  transform: translateY(-1px);
}

.tag-chip.active {
  background: var(--tag-color, var(--primary));
  border-color: var(--tag-color, var(--primary));
  color: white;
}

.verse-tag-dots {
  display: inline-flex;
  gap: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.tags-view {
  max-width: 800px;
}

.tags-view h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.tag-browse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  border-left: 2px solid var(--tag-color, var(--primary));
}

.tag-browse-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79,70,229,0.2);
}

.tag-browse-card .tag-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-browse-card .tag-name {
  font-weight: 600;
  font-size: 1rem;
}

.tag-browse-card .tag-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tagged-verses-view {
  max-width: 800px;
}

.tagged-verses-view h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.tagged-info {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.tagged-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tagged-verse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.tagged-verse-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79,70,229,0.2);
}

.tagged-ref {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.tagged-text {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.tagged-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ========== Parallel/Compare View ========== */
.compare-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-light);
  transition: all var(--transition);
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.parallel-container {
  margin-top: 20px;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.parallel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.parallel-header h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

.parallel-selectors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.parallel-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
}

.parallel-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.parallel-column {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
}

.parallel-column h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 8px;
}

.parallel-column p {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

/* ========== Reading Plans - Browse Page ========== */
.plans-page {
  max-width: 900px;
}

.plans-page h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--text);
}

.plans-page .plans-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.plan-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: 0.3;
  transition: opacity var(--transition);
}

.plan-card:hover::before {
  opacity: 1;
}

.plan-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: transparent;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.plan-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  margin: 0;
}

.plan-duration-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-light);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  border: 1px solid var(--border-light);
}

.plan-card-body {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.plan-card-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

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

.plan-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.plan-status-badge.not-started {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.plan-status-badge.in-progress {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.plan-status-badge.paused {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.plan-status-badge.completed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.plan-action-btn {
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: var(--primary);
  color: white;
}

.plan-action-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.plan-action-btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.plan-action-btn.secondary:hover {
  background: rgba(79, 70, 229, 0.08);
}

/* ========== Reading Plans - Detail Page ========== */
.plan-detail {
  max-width: 800px;
}

.plan-detail-header {
  margin-bottom: 24px;
}

.plan-detail-header h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.plan-detail-header p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.plan-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.plan-today-highlight {
  background: var(--primary-dark);
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.plan-today-highlight .today-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: 8px;
}

.plan-today-highlight .today-day {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.plan-today-highlight .today-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-today-highlight .chapter-link {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition);
  cursor: pointer;
}

.plan-today-highlight .chapter-link:hover {
  background: rgba(255,255,255,0.35);
}

.plan-today-highlight .today-mark-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.plan-today-highlight .today-mark-btn:hover {
  background: rgba(255,255,255,0.35);
}

.plan-today-highlight .today-mark-btn.completed {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
}

.plan-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.plan-calendar-grid .calendar-header {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

.plan-calendar-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.plan-calendar-cell:hover {
  background: var(--bg);
}

.plan-calendar-cell.completed {
  background: var(--primary);
  color: white;
}

.plan-calendar-cell.today {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  font-weight: 700;
  color: var(--primary);
}

.plan-calendar-cell.today.completed {
  color: white;
}

.plan-day-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.plan-day-list-header {
  padding: 16px 20px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
}

.plan-day-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.plan-day-item:last-child {
  border-bottom: none;
}

.plan-day-item:hover {
  background: rgba(79, 70, 229, 0.03);
}

.plan-day-item.completed {
  background: rgba(79, 70, 229, 0.04);
}

.plan-day-item.today {
  background: rgba(79, 70, 229, 0.06);
  border-left: 2px solid var(--primary);
  padding-left: 17px;
}

.plan-day-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  background: transparent;
  padding: 0;
  color: white;
  font-size: 0.7rem;
}

.plan-day-checkbox:hover {
  border-color: var(--primary);
}

.plan-day-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.plan-day-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 48px;
}

.plan-day-chapters {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.plan-day-chapters a {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all var(--transition);
}

.plan-day-chapters a:hover {
  background: rgba(79, 70, 229, 0.08);
}

.plan-day-item.completed .plan-day-chapters a {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ========== Reading Plans - Home Page Card ========== */
.todays-reading-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.todays-reading-card .reading-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.todays-reading-card .reading-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.todays-reading-card .reading-plan-name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.todays-reading-card .reading-day-info {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.todays-reading-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.todays-reading-chapters a {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.todays-reading-chapters a:hover {
  background: var(--primary);
  color: white;
}

.todays-reading-mark-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.todays-reading-mark-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.todays-reading-mark-btn.completed {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.todays-reading-prompt {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

.todays-reading-prompt a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.todays-reading-prompt a:hover {
  text-decoration: underline;
}

/* ========== Bible Map Page ========== */
.map-page {
  max-width: 100%;
}

.map-page h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--text);
}

.map-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.map-filter-bar select,
.map-filter-bar input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}

.map-filter-bar select:focus,
.map-filter-bar input:focus {
  border-color: var(--primary);
}

.map-filter-bar input {
  flex: 1;
  min-width: 150px;
}

.map-filter-bar input::placeholder {
  color: var(--text-muted);
}

.map-testament-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.map-testament-toggle button {
  background: var(--bg);
  border: none;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  border-right: 1px solid var(--border);
}

.map-testament-toggle button:last-child {
  border-right: none;
}

.map-testament-toggle button:hover {
  background: var(--border-light);
}

.map-testament-toggle button.active {
  background: var(--primary);
  color: white;
}

.map-location-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

#bible-map {
  height: calc(100vh - 280px);
  min-height: 400px;
  width: 100%;
}

.map-popup h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
}

.map-popup .popup-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 8px;
  line-height: 1.4;
}

.map-popup .popup-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.map-popup .popup-chapters a {
  display: inline-block;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.map-popup .popup-chapters a:hover {
  background: var(--primary);
  color: white;
}

/* ========== Custom Plans - Create Plan Form ========== */
.create-plan-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

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

.form-required {
  color: #e74c3c;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.form-input[type="number"] {
  max-width: 160px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ========== Book Picker ========== */
.book-picker {
  margin-top: 12px;
}

.book-picker-section {
  margin-bottom: 20px;
}

.book-picker-section .testament-header {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.book-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.book-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.book-chip:hover {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.04);
}

.book-chip.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.book-chip-count {
  font-size: 0.72rem;
  opacity: 0.6;
}

.book-chip.selected .book-chip-count {
  opacity: 0.85;
}

.picker-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.picker-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ========== Plan Preview ========== */
.plan-preview {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 16px;
  border: 1px solid var(--border-light);
}

.plan-preview h4,
.plan-preview h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--text);
}

.preview-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.preview-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.preview-summary span {
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  font-weight: 500;
}

.preview-books {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.6;
}

.preview-days {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-day {
  font-size: 0.85rem;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.preview-day:last-child {
  border-bottom: none;
}

.preview-more {
  color: var(--text-muted);
  font-style: italic;
}

.preview-error {
  color: #e74c3c;
  font-size: 0.9rem;
}

.import-preview {
  max-width: 700px;
}

.import-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ========== Create Plan Button ========== */
.plans-page-actions {
  margin-bottom: 20px;
}

.create-plan-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.create-plan-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

/* ========== Share Panel ========== */
.share-panel {
  padding: 4px 0;
}

.share-panel h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: var(--text);
}

.share-panel p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.share-field {
  margin-bottom: 16px;
}

.share-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-link-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  outline: none;
  min-width: 0;
}

.copy-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========== Custom Plan Badge & Actions ========== */
.custom-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.plan-card-custom-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.plan-share-btn {
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--primary);
  cursor: pointer;
  padding: 2px 0;
  transition: color var(--transition);
}

.plan-share-btn:hover {
  color: var(--primary-dark);
}

.plan-delete-btn {
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 0;
  transition: color var(--transition);
}

.plan-delete-btn:hover {
  color: #e74c3c;
}

.plan-delete-btn-detail {
  color: var(--text-muted);
  border-color: var(--text-muted);
}

.plan-delete-btn-detail:hover {
  color: #e74c3c;
  border-color: #e74c3c;
}

/* ========== Original Language Word Study ========== */
.original-lang-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
  overflow: hidden;
}

.original-lang-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  transition: background var(--transition);
}

.original-lang-toggle:hover {
  background: var(--border-light);
}

.original-lang-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.original-lang-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.original-lang-toggle.expanded .original-lang-chevron {
  transform: rotate(180deg);
}

.original-lang-body {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.olang-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--text-light);
  font-size: 0.88rem;
}

.olang-loading .spinner {
  width: 20px;
  height: 20px;
  margin-bottom: 0;
}

.olang-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.olang-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.original-lang-table {
  width: 100%;
  border-collapse: collapse;
}

.original-lang-table thead th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  padding: 6px 10px 8px;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}

.original-lang-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.original-lang-table tbody tr:last-child td {
  border-bottom: none;
}

.original-lang-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.04);
}

.olang-word {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  unicode-bidi: isolate;
}

.olang-word[dir="rtl"] {
  text-align: right;
  font-size: 1.2rem;
}

.olang-translit {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.88rem;
}

.olang-pronounce {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.olang-meaning {
  font-weight: 500;
  color: var(--text);
  font-size: 0.88rem;
}

.olang-full-verse {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.olang-verse-block {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.olang-verse-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
}

.olang-verse-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
}

.olang-verse-text[dir="rtl"] {
  font-size: 1.15rem;
  text-align: right;
}

/* ========== Footnotes & Cross-References ========== */
.footnotes-section {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  margin-bottom: 20px;
}

.footnotes-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footnotes-content {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text);
}

.footnotes-content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.footnotes-content a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.footnotes-content i {
  font-style: italic;
  color: var(--text-light);
}

/* ========== Topical Guide ========== */
.topical-view {
  max-width: 900px;
}

.topical-view h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--text);
}

.topical-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.topical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.topic-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.topic-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--topic-color, var(--primary));
}

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

.topic-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.topic-card-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.topic-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.topic-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.topic-detail {
  max-width: 800px;
}

.topic-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.topic-header-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.topic-header-info h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 6px;
  color: var(--text);
}

.topic-header-info p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.5;
}

.topic-verses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-verse-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}

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

.topic-verse-ref {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.topic-verse-text {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

.topic-error {
  color: var(--text-light);
  font-style: italic;
  padding: 24px 0;
}

/* ========== Character Profiles ========== */
.character-view {
  max-width: 900px;
}

.character-view h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--text);
}

.character-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.character-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.character-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--character-color, var(--primary));
}

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

.character-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

.character-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.character-card-title {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
}

.character-card-era {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Character Detail Page */
.character-detail {
  max-width: 800px;
}

.character-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}

.character-header-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.character-header-info h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 4px;
  color: var(--text);
}

.character-header-title {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 2px;
}

.character-header-era {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.character-section {
  margin-bottom: 32px;
}

.character-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.character-bio {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  box-shadow: var(--shadow);
}

.character-timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.character-event {
  position: relative;
  padding: 12px 0 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.character-event-dot {
  position: absolute;
  left: -31px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  flex-shrink: 0;
}

.character-event-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.character-event-desc {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.character-event-ref {
  font-size: 0.82rem;
  color: var(--primary);
  cursor: pointer;
  transition: color var(--transition);
}

.character-event-ref:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.character-verses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.character-lessons {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.character-lessons li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

.character-lessons li::before {
  content: '\2022';
  position: absolute;
  left: 8px;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1.5;
}

/* ========== Ministry Hub ========== */
.ministry-view {
  max-width: 900px;
}

.ministry-view h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--text);
}

.ministry-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.ministry-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 12px;
}

.ministry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.ministry-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.ministry-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ministry-color, var(--primary));
}

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

.ministry-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

.ministry-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.ministry-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
}

.ministry-card-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.ministry-badge-joined {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ministry-gate-back {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: none;
}

.ministry-gate-back:hover {
  color: var(--primary);
  text-decoration: underline;
}

.ministry-badge-events {
  background: var(--bg);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

/* Ministry Hub Header */
.ministry-hub {
  max-width: 900px;
}

.ministry-hub-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.ministry-hub-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.ministry-hub-info {
  flex: 1;
}

.ministry-hub-info h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 4px;
}

.ministry-hub-info p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

.ministry-join-btn {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.ministry-join-btn:hover {
  opacity: 0.9;
  box-shadow: var(--shadow);
}

.ministry-join-btn.ministry-joined {
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border);
}

/* Tab Bar */
.ministry-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ministry-tab-bar::-webkit-scrollbar {
  display: none;
}

.ministry-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
  border-radius: 6px 6px 0 0;
}

.ministry-tab:hover {
  color: var(--text);
  background: rgba(0,0,0,0.03);
}

.ministry-tab-active {
  color: var(--ministry-color, var(--primary));
  border-bottom-color: var(--ministry-color, var(--primary));
  font-weight: 600;
  background: rgba(79, 70, 229, 0.04);
}

.ministry-tab-icon {
  font-size: 1rem;
}

/* Feed Form & Items */
.ministry-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ministry-feed-form {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.ministry-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.ministry-input:focus {
  outline: none;
  border-color: var(--ministry-color, var(--primary));
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ministry-input textarea,
textarea.ministry-input {
  resize: vertical;
  min-height: 60px;
}

.ministry-form-row {
  display: flex;
  gap: 10px;
}

.ministry-form-row .ministry-input {
  flex: 1;
}

.ministry-submit-btn {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  align-self: flex-end;
}

.ministry-submit-btn:hover {
  opacity: 0.9;
  box-shadow: var(--shadow);
}

.ministry-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ministry-feed-item {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.ministry-feed-item:hover {
  box-shadow: var(--shadow);
}

.ministry-feed-pinned {
  border-left: 2px solid var(--ministry-color, var(--primary));
}

.ministry-feed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ministry-feed-avatar {
  font-size: 1.3rem;
  line-height: 1;
}

.ministry-feed-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.ministry-feed-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.ministry-pinned-badge {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ministry-feed-body {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ministry-feed-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ministry-action-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}

.ministry-action-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.ministry-action-delete:hover {
  color: #e74c3c;
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.ministry-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 32px 16px;
}

.ministry-feed-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  margin: 8px 0;
}

/* Events */
.ministry-event-card {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.ministry-event-card:hover {
  box-shadow: var(--shadow);
}

.ministry-event-date-badge {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.ministry-event-month {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ministry-event-day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.ministry-event-info {
  flex: 1;
}

.ministry-event-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 4px;
}

.ministry-event-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 8px;
}

.ministry-event-details {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ministry-rsvp-row {
  display: flex;
  gap: 8px;
}

.ministry-rsvp-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}

.ministry-rsvp-btn:hover {
  border-color: var(--ministry-color, var(--primary));
  color: var(--ministry-color, var(--primary));
}

.ministry-rsvp-btn.ministry-rsvp-active {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  border-color: var(--ministry-color, var(--primary));
}

.ministry-rsvp-btn.ministry-rsvp-not.ministry-rsvp-active {
  background: #95a5a6;
  border-color: #95a5a6;
}

/* Prayer */
.ministry-prayed-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}

.ministry-prayed-btn:hover {
  border-color: var(--ministry-color, var(--primary));
  color: var(--ministry-color, var(--primary));
}

.ministry-prayed-btn.ministry-prayed-active {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  border-color: var(--ministry-color, var(--primary));
}

/* Teaching */
.ministry-teaching-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.ministry-link {
  display: inline-block;
  color: var(--primary);
  font-size: 0.85rem;
  margin-top: 8px;
  word-break: break-all;
  text-decoration: none;
}

.ministry-link:hover {
  text-decoration: underline;
}

/* Resources */
.ministry-resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

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

.ministry-resource-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.ministry-resource-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.ministry-resource-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Chat */
.ministry-chat {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ministry-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ministry-chat-empty {
  margin: auto;
}

.ministry-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 80%;
}

.ministry-chat-own {
  align-self: flex-end;
}

.ministry-chat-avatar {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.ministry-chat-bubble {
  background: var(--bg);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  max-width: 100%;
}

.ministry-chat-own .ministry-chat-bubble {
  background: var(--ministry-color, var(--primary));
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.ministry-chat-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.ministry-chat-own .ministry-chat-sender {
  color: rgba(255,255,255,0.8);
}

.ministry-chat-text {
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.ministry-chat-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.ministry-chat-own .ministry-chat-time {
  color: rgba(255,255,255,0.7);
}

.ministry-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.ministry-chat-input {
  flex: 1;
}

.ministry-chat-send {
  flex-shrink: 0;
  align-self: center;
}

/* About */
.ministry-about {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ministry-about-section {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.ministry-about-section h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.ministry-about-section p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.ministry-leaders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ministry-leader-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
}

.ministry-leader-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.ministry-leader-role {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.ministry-leader-contact {
  display: flex;
  gap: 16px;
}

.ministry-leader-contact a {
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
}

.ministry-leader-contact a:hover {
  text-decoration: underline;
}

.ministry-about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.ministry-stat-card {
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 8px;
}

.ministry-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ministry-color, var(--primary));
}

.ministry-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Ministry Responsive */
@media (max-width: 768px) {
  .ministry-grid {
    grid-template-columns: 1fr;
  }

  .ministry-hub-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .ministry-tab-label {
    display: none;
  }

  .ministry-tab-icon {
    font-size: 1.3rem;
  }

  .ministry-tab {
    padding: 10px 14px;
  }

  .ministry-event-card {
    flex-direction: column;
  }

  .ministry-event-date-badge {
    flex-direction: row;
    gap: 6px;
    padding: 8px 14px;
    min-width: auto;
  }

  .ministry-event-day {
    font-size: 1.1rem;
  }

  .ministry-about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .ministry-chat {
    height: 400px;
  }

  .ministry-form-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .ministry-card {
    padding: 18px;
  }

  .ministry-hub-header {
    padding: 18px;
  }

  .ministry-feed-form {
    padding: 14px;
  }

  .ministry-feed-item {
    padding: 14px;
  }

  .ministry-event-card {
    padding: 14px;
  }

  .ministry-chat {
    height: 350px;
  }

  .ministry-about-section {
    padding: 18px;
  }

  .ministry-leader-contact {
    flex-direction: column;
    gap: 4px;
  }
}

/* ========== Organization Gate ========== */
.org-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 24px;
}

.org-gate-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.org-gate-card-wide {
  max-width: 520px;
}

.org-gate-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.org-gate-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 8px;
}

.org-gate-subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.org-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.org-gate-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.org-gate-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.org-gate-input-error {
  border-color: #d32f2f;
}

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

.org-gate-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.org-gate-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.org-gate-error {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 8px;
}

.org-gate-back-link {
  color: var(--primary);
  text-decoration: none;
}

/* ========== Profile Form ========== */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  margin-top: 20px;
}

.profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.profile-form-label .required {
  color: #d32f2f;
}

/* ========== Profile Selector ========== */
.profile-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.profile-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.profile-select-card:hover {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.04);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.profile-select-card.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.profile-select-card.create-new {
  border-style: dashed;
  border-color: var(--border);
  color: var(--text-muted);
}

.profile-select-card.create-new:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.profile-select-avatar {
  font-size: 2.5rem;
  line-height: 1;
}

.profile-select-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  word-break: break-word;
}

.profile-select-card.create-new .profile-select-avatar {
  font-size: 2rem;
  color: var(--text-muted);
}

.profile-select-card.create-new .profile-select-name {
  color: var(--text-muted);
}

.profile-password-prompt {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-password-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.profile-form-divider {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* ========== Avatar Grid ========== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
}

.avatar-option:hover {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.08);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.12);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

/* ========== Profile Page ========== */
.profile-page {
  max-width: 600px;
  margin: 32px auto;
  padding: 0 24px;
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 32px;
}

.profile-header {
  text-align: center;
  margin-bottom: 32px;
}

.profile-avatar-large {
  font-size: 4rem;
  margin-bottom: 12px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 8px;
}

.profile-role-badge {
  display: inline-block;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-bio {
  margin-top: 12px;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.profile-edit-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

/* ========== Profile Stats ========== */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== Profile Ministries ========== */
.profile-ministries {
  margin-bottom: 24px;
}

.profile-ministries-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.profile-ministry-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-left: 2px solid var(--ministry-color, var(--primary));
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  transition: all var(--transition);
}

.profile-ministry-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.profile-ministry-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.profile-ministry-name {
  font-weight: 500;
}

/* ========== Privacy Toggles ========== */
.profile-privacy {
  margin-bottom: 24px;
}

.profile-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-privacy-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.toggle-label {
  font-size: 0.95rem;
  color: var(--text);
}

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

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

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

/* ========== Profile Actions ========== */
.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.profile-action-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  font-family: var(--font-sans);
}

.profile-edit-btn {
  background: var(--primary);
  color: white;
}

.profile-edit-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.profile-logout-btn {
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border);
}

.profile-logout-btn:hover {
  background: var(--border-light);
  color: var(--text);
}

.profile-cancel-btn {
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border);
}

.profile-cancel-btn:hover {
  background: var(--border-light);
}

.profile-form-actions {
  display: flex;
  gap: 12px;
}

.profile-form-actions .org-gate-btn {
  flex: 1;
}

.profile-form-actions .profile-cancel-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== User Bar ========== */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: rgba(0,0,0,0.04);
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.user-bar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: opacity var(--transition);
}

.user-bar-profile:hover {
  opacity: 0.85;
}

.user-bar-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.user-bar-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-bar-role {
  font-size: 0.75rem;
  background: rgba(79,70,229,0.08);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.user-bar-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 5px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
}

.user-bar-logout:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text);
  border-color: var(--primary);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .header-inner {
    padding: 12px 16px;
    gap: 8px;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .nav-bar {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .search-bar input {
    width: 0;
    padding: 0;
    transition: width 0.2s ease, padding 0.2s ease;
  }

  .search-bar.expanded input {
    width: 140px;
    padding: 6px 12px;
  }

  .version-selector label {
    display: none;
  }

  .mobile-nav-section {
    padding: 8px 16px;
  }

  .user-bar {
    padding: 8px 16px;
  }

  main {
    padding: 20px 16px;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  .book-info {
    padding: 20px;
  }

  .book-info h2 {
    font-size: 1.5rem;
  }

  .book-meta {
    grid-template-columns: 1fr;
  }

  .chapters-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  }

  .verses-list {
    padding: 24px;
  }

  .modal-content {
    padding: 24px;
    max-height: 90vh;
  }

  .context-grid {
    grid-template-columns: 1fr;
  }

  .chapter-header h2 {
    font-size: 1.4rem;
  }

  .reading-toolbar {
    gap: 8px;
  }

  .toolbar-right {
    margin-left: 0;
    width: 100%;
  }

  .parallel-columns {
    grid-template-columns: 1fr;
  }

  #chapter-map {
    height: 250px;
  }

  .tags-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .topical-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    padding: 18px;
  }

  .topic-header-icon {
    font-size: 2rem;
  }

  .topic-header-info h2 {
    font-size: 1.4rem;
  }

  .topic-verse-card {
    padding: 14px 16px;
  }

  .topic-verse-text {
    font-size: 0.88rem;
  }

  .character-grid {
    grid-template-columns: 1fr;
  }

  .character-card {
    padding: 18px;
  }

  .character-header-icon {
    font-size: 2rem;
  }

  .character-header-info h2 {
    font-size: 1.4rem;
  }

  .character-bio {
    padding: 18px;
    font-size: 0.9rem;
  }

  .character-event-desc {
    font-size: 0.9rem;
  }

  .votd-card {
    padding: 20px;
  }

  #bible-map {
    height: calc(100vh - 320px);
    min-height: 300px;
  }

  .map-filter-bar {
    gap: 8px;
  }

  .map-filter-bar select,
  .map-filter-bar input {
    width: 100%;
    flex: 1 1 100%;
  }

  .map-testament-toggle {
    width: 100%;
  }

  .map-testament-toggle button {
    flex: 1;
  }

  .map-location-count {
    width: 100%;
    text-align: center;
    margin-left: 0;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-detail-header h2 {
    font-size: 1.4rem;
  }

  .plan-today-highlight {
    padding: 20px;
  }

  .plan-day-item {
    padding: 10px 16px;
  }

  .book-chip-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .create-plan-form {
    padding: 20px;
  }

  .picker-count {
    margin-left: 0;
    width: 100%;
  }

  .share-link-row {
    flex-direction: column;
  }

  .share-link-input {
    width: 100%;
  }

  .original-lang-table .olang-pronounce-col,
  .original-lang-table .olang-pronounce {
    display: none;
  }

  .olang-word {
    font-size: 1rem;
  }

  .olang-word[dir="rtl"] {
    font-size: 1.1rem;
  }

  .olang-translit,
  .olang-meaning {
    font-size: 0.82rem;
  }

  .original-lang-table thead th {
    font-size: 0.65rem;
  }

  .footnotes-content {
    font-size: 0.85rem;
  }

  .profile-select-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }

  .avatar-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .org-gate-card {
    padding: 32px 24px;
  }

  .profile-card {
    padding: 28px 20px;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-form-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .modal {
    padding: 8px;
  }

  .modal-content {
    padding: 16px;
  }

  .audio-section {
    flex-direction: column;
    align-items: stretch;
  }

  .verses-list {
    padding: 14px;
  }

  .verse-item {
    padding: 8px 6px;
  }

  .book-info {
    padding: 16px;
  }

  .reading-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .highlight-bar {
    padding: 6px 10px;
  }

  .votd-card {
    padding: 16px;
  }

  .chapter-nav-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .context-grid {
    grid-template-columns: 1fr;
  }

  .book-chip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .create-plan-form {
    padding: 16px;
  }

  .plan-card {
    padding: 18px;
  }

  .plan-calendar-grid {
    padding: 12px;
    gap: 3px;
  }

  .plan-calendar-cell {
    font-size: 0.65rem;
  }

  .plan-today-highlight {
    padding: 16px;
  }

  .todays-reading-card {
    padding: 18px 20px;
  }

  #bible-map {
    height: calc(100vh - 340px);
    min-height: 250px;
  }

  .map-filter-bar {
    padding: 8px 10px;
  }

  .map-page h2 {
    font-size: 1.4rem;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .org-gate-card {
    padding: 24px 16px;
  }

  .org-gate-title {
    font-size: 1.25rem;
  }

  .profile-page {
    padding: 0 12px;
    margin: 16px auto;
  }

  .profile-card {
    padding: 24px 16px;
  }

  .profile-avatar-large {
    font-size: 3rem;
  }

  .profile-name {
    font-size: 1.35rem;
  }
}

/* ========== Selection Mode ========== */
.verses-list.select-mode .verse-item {
  padding-left: 36px;
  position: relative;
  user-select: none;
}

.verses-list.select-mode .verse-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  transition: all var(--transition);
}

.verses-list.select-mode .verse-item.selected::before {
  background: var(--primary);
  border-color: var(--primary);
}

.verses-list.select-mode .verse-item.selected::after {
  content: '\2713';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}

.verses-list.select-mode .verse-item.selected {
  background: rgba(79, 70, 229, 0.08);
}

.verses-list.select-mode .verse-item:hover {
  background: rgba(79, 70, 229, 0.04);
}

/* ========== Selection Floating Bar ========== */
.selection-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 150;
  transition: bottom 0.3s ease;
  max-width: calc(100vw - 32px);
}

.selection-bar.visible {
  bottom: 24px;
}

.selection-count {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.selection-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.selection-bar .btn-primary {
  background: var(--primary-light);
  padding: 6px 14px;
  font-size: 0.8rem;
}

.selection-bar .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.selection-bar .btn-ghost {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.3);
  padding: 6px 14px;
  font-size: 0.8rem;
}

.selection-bar .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* ========== Compare View ========== */
.compare-view {
  max-width: 1100px;
}

.back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--primary-dark);
}

.compare-header {
  margin-bottom: 20px;
}

.compare-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
}

/* ========== Version Picker ========== */
.version-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.version-pick {
  display: flex;
  align-items: center;
  gap: 4px;
}

.version-pick-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.version-pick-select:focus {
  border-color: var(--primary);
}

.version-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
  line-height: 1;
}

.version-remove:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}

.version-add-btn {
  white-space: nowrap;
}

/* ========== Compare Grid ========== */
.compare-grid {
  display: grid;
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.compare-corner {
  background: var(--bg-card);
  padding: 12px 16px;
}

.compare-col-header {
  background: var(--bg-card);
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  text-align: center;
  border-bottom: 2px solid var(--primary);
}

.compare-row-header {
  background: var(--bg-card);
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: flex-start;
}

.compare-cell {
  background: var(--bg-card);
  padding: 14px 16px;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

.compare-cell em {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== Compare View Responsive ========== */
@media (max-width: 768px) {
  .compare-header h2 {
    font-size: 1.3rem;
  }

  .version-picker-row {
    gap: 8px;
    padding: 10px 12px;
  }

  .version-pick-select {
    font-size: 0.78rem;
    padding: 5px 8px;
  }

  .compare-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    border: none;
  }

  .compare-corner {
    display: none;
  }

  .compare-col-header {
    display: none;
  }

  .compare-row-header {
    background: var(--bg);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: none;
  }

  .compare-cell {
    border-radius: 0;
    border: 1px solid var(--border-light);
    border-top: none;
    padding: 12px 14px;
  }

  .compare-cell:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .compare-cell::before {
    content: attr(data-version);
    display: block;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 6px;
  }

  .selection-bar {
    left: 16px;
    right: 16px;
    transform: none;
    max-width: none;
    padding: 10px 16px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .selection-bar.visible {
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .compare-header h2 {
    font-size: 1.1rem;
  }

  .version-pick-select {
    font-size: 0.75rem;
    max-width: 140px;
  }

  .compare-cell {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .selection-bar {
    padding: 8px 12px;
    gap: 8px;
    font-size: 0.8rem;
  }
}

/* ========== Prayer Board ========== */

.prayer-board-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.prayer-board-header {
  text-align: center;
  margin-bottom: 24px;
}

.prayer-board-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 4px;
}

.prayer-board-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.prayer-board-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.prayer-board-form-row select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

.prayer-board-form-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
  white-space: nowrap;
  cursor: pointer;
}

.prayer-board-audience-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.prayer-board-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px;
}

.prayer-board-tab {
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  border-radius: 6px 6px 0 0;
}

.prayer-board-tab:hover {
  color: var(--text);
  background: rgba(0,0,0,0.02);
}

.prayer-board-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

.prayer-board-answered {
  border-left: 2px solid var(--accent-light);
}

.prayer-board-praise-report {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
}

.prayer-board-praise-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.prayer-board-praise-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.prayer-board-praise-form {
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prayer-board-praise-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
  min-height: 60px;
}

.prayer-board-praise-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.prayer-board-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.prayer-board-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 16px;
}

.prayer-board-detail-back:hover {
  text-decoration: underline;
}

.prayer-board-comments-section {
  margin-top: 24px;
}

.prayer-board-comments-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.prayer-board-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.prayer-board-comment {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
}

.prayer-board-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.prayer-board-comment-avatar {
  font-size: 1.1rem;
  line-height: 1;
}

.prayer-board-comment-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.prayer-board-comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.prayer-board-comment-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.prayer-board-comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
}

.prayer-board-comment-delete:hover {
  color: #c0392b;
}

.prayer-board-comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prayer-board-answered-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .prayer-board-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .prayer-board-form-row select {
    width: 100%;
  }

  .prayer-board-tabs {
    gap: 0;
  }

  .prayer-board-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.82rem;
  }
}

/* ========== Pastoral Care Tags ========== */

.pastoral-care-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pastoral-care-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pastoral-care-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 0;
}

.pastoral-care-filter-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}

.pastoral-care-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pastoral-care-filter-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 600px) {
  .pastoral-care-filters {
    gap: 4px;
  }

  .pastoral-care-filter-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
  }
}

/* ========== Org Events ========== */

.org-events-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.org-events-header {
  text-align: center;
  margin-bottom: 24px;
}

.org-events-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 4px;
}

.org-events-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.org-events-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px;
}

.org-events-tab {
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  border-radius: 6px 6px 0 0;
}

.org-events-tab:hover {
  color: var(--text);
  background: rgba(0,0,0,0.02);
}

.org-events-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

.org-event-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* Detail */

.org-events-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.org-events-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 16px;
}

.org-events-detail-back:hover {
  text-decoration: underline;
}

/* Attendees */

.org-events-attendees {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.org-events-attendees-section {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.org-events-attendees-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.org-events-attendees-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.org-events-attendee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
  padding: 4px 0;
}

/* Comments */

.org-events-comments-section {
  margin-top: 24px;
}

.org-events-comments-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.org-events-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.org-events-comment {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
}

.org-events-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.org-events-comment-avatar {
  font-size: 1.1rem;
  line-height: 1;
}

.org-events-comment-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.org-events-comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.org-events-comment-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.org-events-comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
}

.org-events-comment-delete:hover {
  color: #c0392b;
}

.org-events-comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 600px) {
  .org-events-tabs {
    gap: 0;
  }

  .org-events-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  .org-events-attendees {
    flex-direction: column;
    gap: 12px;
  }

  .org-events-attendees-section {
    min-width: 0;
  }

  .org-event-card-footer {
    flex-wrap: wrap;
  }
}

/* ========== Mobile Touch Feedback ========== */
@media (max-width: 768px) {
  .book-card:active,
  .plan-card:active,
  .topic-card:active,
  .character-card:active,
  .ministry-card:active,
  .bookmark-card:active,
  .search-result-card:active,
  .tagged-verse-card:active,
  .topic-verse-card:active,
  .tag-browse-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-xs);
  }

  .btn:active,
  .chapter-btn:active,
  .plan-action-btn:active,
  .ministry-join-btn:active,
  .ministry-submit-btn:active,
  .org-gate-btn:active,
  .create-plan-btn:active {
    transform: scale(0.97);
  }

  .verse-item:active {
    background: rgba(79, 70, 229, 0.1);
  }
}

/* ========== Achievements & Badges ========== */

.achievement-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 320px;
}

.achievement-toast-visible {
  transform: translateX(0);
}

.achievement-toast-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.achievement-toast-content {
  min-width: 0;
}

.achievement-toast-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 2px;
}

.achievement-toast-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.profile-achievements {
  margin-top: 4px;
}

.achievement-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.achievement-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.achievement-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.achievement-progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.achievement-streak-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.achievement-streak-flame {
  font-size: 1.4rem;
  line-height: 1;
}

.achievement-streak-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.achievement-streak-label {
  font-size: 0.9rem;
  color: var(--text-light);
}

.achievement-streak-best {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

.achievement-cat-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.achievement-cat-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.achievement-cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.achievement-cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.achievement-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--transition);
}

.achievement-badge.earned {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.achievement-badge.earned:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.achievement-badge.locked {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.achievement-badge-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.achievement-badge-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.achievement-badge.locked .achievement-badge-name {
  color: var(--text-muted);
}

/* Achievement dark-mode overrides (inside dark section below) covered by variable cascade */

@media (max-width: 600px) {
  .achievement-toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
    transform: translateY(calc(100% + 40px));
  }
  .achievement-toast-visible {
    transform: translateY(0);
  }
  .achievement-badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }
  .achievement-badge-icon {
    font-size: 1.5rem;
  }
  .achievement-badge-name {
    font-size: 0.68rem;
  }
  .achievement-cat-tab {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .achievement-streak-count {
    font-size: 1.3rem;
  }
}

/* ========== Dark Mode ========== */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-subtle: #334155;
  --bg-dark: #020617;
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --text-muted: #7c8db5;
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --accent: #fbbf24;
  --accent-light: #fcd34d;
  --ot-color: #60a5fa;
  --nt-color: #fb7185;
  --border: #334155;
  --border-light: #1e293b;
  --border-medium: #475569;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.6);
}

[data-theme="dark"] body {
  background: #0f172a;
  background-image: radial-gradient(ellipse at top center, rgba(129,140,248,0.02), transparent 70%);
}

[data-theme="dark"] header {
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .site-title {
  color: #e0e7ff;
}

[data-theme="dark"] footer {
  background: var(--bg-card);
}

[data-theme="dark"] header::after {
  opacity: 0.6;
}

[data-theme="dark"] footer::before {
  opacity: 0.6;
}

[data-theme="dark"] mark.highlight {
  background: rgba(251,191,36,0.2);
  color: #fcd34d;
}

[data-theme="dark"] .toggle-slider::before {
  background: var(--text-muted);
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(2,6,23,0.7);
}

[data-theme="dark"] .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl), inset 0 3px 0 0 var(--primary);
}

[data-theme="dark"] .modal-close {
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
}

[data-theme="dark"] .modal-close:hover {
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
}

[data-theme="dark"] .achievement-badge.locked {
  opacity: 0.3;
}

[data-theme="dark"] .achievement-toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

[data-theme="dark"] .achievement-streak-display {
  background: var(--bg-card);
  border-color: var(--border);
}

/* ========== Dark Mode — Cards ========== */
[data-theme="dark"] .book-card,
[data-theme="dark"] .bookmark-card,
[data-theme="dark"] .search-result-card,
[data-theme="dark"] .tagged-verse-card,
[data-theme="dark"] .tag-browse-card,
[data-theme="dark"] .progress-stats-card,
[data-theme="dark"] .book-info,
[data-theme="dark"] .audio-section,
[data-theme="dark"] .context-card {
  background: var(--bg-card);
  border-color: var(--border);
  border-top: 2px solid rgba(129,140,248,0.3);
}

[data-theme="dark"] .book-card:hover,
[data-theme="dark"] .bookmark-card:hover,
[data-theme="dark"] .search-result-card:hover,
[data-theme="dark"] .tagged-verse-card:hover,
[data-theme="dark"] .tag-browse-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .verses-list {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .verse-item:hover {
  background: rgba(99,102,241,0.08);
  border-left-color: rgba(129,140,248,0.4);
}

[data-theme="dark"] .verse-item.red-letter .verse-text {
  color: #f87171;
}

/* ========== Dark Mode — Visual Enhancements ========== */
[data-theme="dark"] .votd-card {
  background: linear-gradient(135deg, rgba(129,140,248,0.06) 0%, rgba(251,191,36,0.04) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow);
}

[data-theme="dark"] .votd-card::before {
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

[data-theme="dark"] .votd-card::after {
  background: radial-gradient(circle at 80% 20%, rgba(129,140,248,0.05), transparent 60%);
}

[data-theme="dark"] .votd-card:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-xl);
}

[data-theme="dark"] .progress-bar-fill-lg {
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent-light));
}

[data-theme="dark"] .progress-bar-fill-lg::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

[data-theme="dark"] .book-card.old:hover {
  background: linear-gradient(135deg, rgba(96,165,250,0.05) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 12px rgba(96,165,250,0.12);
}

[data-theme="dark"] .book-card.new:hover {
  background: linear-gradient(135deg, rgba(251,113,133,0.05) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 12px rgba(251,113,133,0.12);
}

[data-theme="dark"] .org-welcome-banner {
  background: linear-gradient(135deg, rgba(129,140,248,0.08) 0%, rgba(99,102,241,0.03) 100%);
  border-color: var(--border);
  border-left-color: var(--primary);
}

[data-theme="dark"] .org-welcome-banner-icon {
  background: rgba(129,140,248,0.12);
}

[data-theme="dark"] .org-welcome-banner-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #0f172a;
}

/* ========== Dark Mode — Buttons ========== */
[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0f172a;
  font-weight: 600;
}

[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}

[data-theme="dark"] .btn-ghost {
  background: transparent;
  border-color: var(--border-medium);
  color: var(--text-light);
}

[data-theme="dark"] .btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,0.08);
}

[data-theme="dark"] .chapter-btn {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .chapter-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #0f172a;
}

[data-theme="dark"] .chapter-btn.read {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.3);
  color: var(--primary-light);
}

/* ========== Dark Mode — Form Inputs ========== */
[data-theme="dark"] .notes-section textarea {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .notes-section textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ========== Dark Mode — Reading Toolbar ========== */
[data-theme="dark"] .reading-toolbar,
[data-theme="dark"] .highlight-bar {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .toolbar-btn {
  background: transparent;
  border-color: var(--border);
}

[data-theme="dark"] .toolbar-btn.active {
  background: var(--primary);
  color: #0f172a;
  border-color: var(--primary);
}

/* ========== Dark Mode — Tags ========== */
[data-theme="dark"] .tag-chip {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  border-left: 2px solid var(--tag-color, var(--primary));
}

[data-theme="dark"] .tag-chip:hover {
  border-color: var(--primary);
}

/* ========== Dark Mode — Verse of the Day ========== */
/* Enhanced styles in "Dark Mode — Visual Enhancements" above */

[data-theme="dark"] .votd-label {
  color: var(--primary);
}

/* ========== Dark Mode — Progress Bars ========== */
[data-theme="dark"] .progress-bar-lg {
  background: var(--bg-subtle);
}

/* Enhanced fill style in "Dark Mode — Visual Enhancements" above */

/* ========== Dark Mode — Notification Badge ========== */
[data-theme="dark"] .notification-badge {
  background: var(--primary);
  color: #0f172a;
}

/* ========== Dark Mode — Nav Bar ========== */
[data-theme="dark"] .nav-trigger:hover,
[data-theme="dark"] .nav-standalone:hover {
  background: rgba(99,102,241,0.1);
  color: var(--primary-light);
}

[data-theme="dark"] .nav-menu {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .nav-menu::before {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .nav-menu-item:hover {
  background: rgba(99,102,241,0.1);
}

[data-theme="dark"] .header-util-btn:hover {
  color: var(--primary-light);
  background: rgba(99,102,241,0.1);
}

[data-theme="dark"] .mobile-menu {
  border-top-color: var(--border);
}

[data-theme="dark"] .mobile-nav-section + .mobile-nav-section {
  border-top-color: var(--border);
}

[data-theme="dark"] .mobile-nav-item:hover {
  background: rgba(99,102,241,0.08);
}

/* ========== Dark Mode — Search Bar ========== */
[data-theme="dark"] .search-bar {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ========== Dark Mode — Profile ========== */
[data-theme="dark"] .profile-card,
[data-theme="dark"] .org-gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

[data-theme="dark"] .org-gate-input,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .ministry-input {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .org-gate-input:focus,
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .ministry-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ========== Dark Mode — Plans ========== */
[data-theme="dark"] .plan-card,
[data-theme="dark"] .todays-reading-card,
[data-theme="dark"] .plan-calendar-grid,
[data-theme="dark"] .plan-day-list,
[data-theme="dark"] .create-plan-form {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .plan-today-highlight {
  background: var(--primary-dark);
}

[data-theme="dark"] .plan-day-item:hover {
  background: rgba(99,102,241,0.04);
}

[data-theme="dark"] .plan-day-item.today {
  background: rgba(99,102,241,0.08);
}

/* ========== Dark Mode — Ministry ========== */
[data-theme="dark"] .ministry-card,
[data-theme="dark"] .ministry-hub-header,
[data-theme="dark"] .ministry-feed-form,
[data-theme="dark"] .ministry-feed-item,
[data-theme="dark"] .ministry-event-card,
[data-theme="dark"] .ministry-about-section,
[data-theme="dark"] .ministry-resource-card,
[data-theme="dark"] .ministry-chat {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .topic-card,
[data-theme="dark"] .character-card,
[data-theme="dark"] .topic-verse-card,
[data-theme="dark"] .character-bio {
  background: var(--bg-card);
}

/* ========== Dark Mode — Admin ========== */
[data-theme="dark"] .admin-header {
  background: var(--primary-dark);
}

[data-theme="dark"] .admin-tabs {
  background: var(--bg-card);
}

[data-theme="dark"] .admin-stat-card,
[data-theme="dark"] .admin-overview-section,
[data-theme="dark"] .admin-member-card,
[data-theme="dark"] .admin-chat-list-item,
[data-theme="dark"] .admin-create-chat {
  background: var(--bg-card);
}

[data-theme="dark"] .admin-role-row,
[data-theme="dark"] .admin-activity-item {
  background: var(--bg-subtle);
}

[data-theme="dark"] .admin-members-search,
[data-theme="dark"] .admin-members-filter,
[data-theme="dark"] .admin-news-category-select {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .admin-role-badge-admin { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .admin-role-badge-staff { background: #172554; color: #93c5fd; }
[data-theme="dark"] .admin-role-badge-pastor { background: #3b0764; color: #d8b4fe; }
[data-theme="dark"] .admin-role-badge-leader { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .admin-role-badge-member { background: #052e16; color: #86efac; }
[data-theme="dark"] .admin-role-badge-student { background: #1e1b4b; color: #c7d2fe; }
[data-theme="dark"] .admin-role-badge-guest { background: #1e293b; color: var(--text-muted); }

/* ========== Dark Mode — Prayer & Events ========== */
[data-theme="dark"] .prayer-board-comment,
[data-theme="dark"] .prayer-board-comment-form,
[data-theme="dark"] .org-events-comment,
[data-theme="dark"] .org-events-comment-form,
[data-theme="dark"] .org-events-attendees-section {
  background: var(--bg-card);
  border-color: var(--border);
}

/* ========== Dark Mode — Selection Bar ========== */
[data-theme="dark"] .selection-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* ========== High Contrast Mode ========== */
[data-high-contrast] {
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-subtle: #111111;
  --bg-dark: #000000;
  --text: #ffffff;
  --text-light: #e0e0e0;
  --text-muted: #cccccc;
  --border: #666666;
  --border-light: #444444;
  --border-medium: #888888;
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --accent: #fbbf24;
  --ot-color: #60a5fa;
  --nt-color: #fb7185;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;
}

[data-high-contrast] .book-card,
[data-high-contrast] .chapter-btn {
  border: 2px solid var(--border);
}

[data-high-contrast] .book-card::before {
  width: 4px;
  opacity: 1;
}

[data-high-contrast] a {
  text-decoration: underline;
}

/* ========== Reduced Motion ========== */
[data-reduced-motion] *,
[data-reduced-motion] *::before,
[data-reduced-motion] *::after {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

/* ========== Dyslexia-Friendly Font ========== */
[data-dyslexia-font] {
  --font-serif: 'Comic Sans MS', 'OpenDyslexic', sans-serif;
  --font-sans: 'Comic Sans MS', 'OpenDyslexic', sans-serif;
}

/* ========== Reading Focus Overlay ========== */
.reading-focus-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9998;
}

.reading-focus-overlay::before,
.reading-focus-overlay::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 9998;
}

.reading-focus-overlay::before {
  top: 0;
  height: var(--focus-top, 40%);
}

.reading-focus-overlay::after {
  top: calc(var(--focus-top, 40%) + 80px);
  bottom: 0;
  height: auto;
}

/* ========== Accessibility Panel ========== */
.a11y-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  padding: 20px;
  transform: translateY(-8px);
  opacity: 0;
  animation: a11yPanelIn 0.2s ease forwards;
}

@keyframes a11yPanelIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.a11y-panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.a11y-group {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.a11y-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.a11y-group-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.a11y-slider {
  width: 100%;
  margin-top: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.a11y-slider-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
  text-align: right;
}

.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.a11y-toggle-label {
  font-size: 0.88rem;
  color: var(--text);
}

/* Theme toggle button styling */
#theme-toggle-btn {
  font-size: 1.3rem;
  line-height: 1;
}

#a11y-toggle-btn {
  font-size: 1.3rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .a11y-panel {
    right: 8px;
    left: 8px;
    width: auto;
    top: 56px;
  }
}

/* ========== Admin Dashboard ========== */

.admin-dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.admin-header {
  background: var(--primary);
  color: white;
  padding: 28px 32px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.admin-header-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.admin-header-subtitle {
  font-size: 0.92rem;
  opacity: 0.85;
}

/* Admin Tabs */

.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.admin-tab:hover {
  background: var(--border-light);
  color: var(--text);
}

.admin-tab-active {
  background: var(--primary);
  color: white;
}

.admin-tab-active:hover {
  background: var(--primary-light);
  color: white;
}

.admin-tab-icon {
  font-size: 1.05rem;
}

/* Admin Stats Grid */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.admin-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.admin-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Admin Overview Grid */

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.admin-overview-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.admin-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

.admin-role-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--border-light);
  border-radius: var(--radius);
}

.admin-role-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.admin-role-count {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 2px 10px;
  border-radius: 20px;
}

/* Admin Activity List */

.admin-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-activity-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--border-light);
  transition: var(--transition);
}

.admin-activity-clickable {
  cursor: pointer;
}

.admin-activity-clickable:hover {
  background: var(--border);
}

.admin-activity-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

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

.admin-activity-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.admin-activity-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}

.admin-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 16px 0;
  text-align: center;
}

/* Admin Members */

.admin-members-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-members-search {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
}

.admin-members-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.admin-members-filter {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.admin-members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-member-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.admin-member-card:hover {
  box-shadow: var(--shadow);
}

.admin-member-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}

.admin-member-avatar {
  font-size: 1.8rem;
  flex-shrink: 0;
}

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

.admin-member-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.admin-role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-role-badge-admin { background: #fee2e2; color: #991b1b; }
.admin-role-badge-staff { background: #dbeafe; color: #1e40af; }
.admin-role-badge-pastor { background: #f3e8ff; color: #6b21a8; }
.admin-role-badge-leader { background: #fef3c7; color: #92400e; }
.admin-role-badge-member { background: #d1fae5; color: #065f46; }
.admin-role-badge-student { background: #e0e7ff; color: #3730a3; }
.admin-role-badge-guest { background: var(--bg-subtle); color: var(--text-light); }

.admin-member-expand {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  transition: var(--transition);
}

.admin-member-expand:hover {
  color: var(--primary);
}

.admin-member-details {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-light);
}

.admin-member-contact {
  padding: 12px 0;
}

.admin-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.88rem;
}

.admin-contact-row a {
  color: var(--primary);
  text-decoration: none;
}

.admin-contact-row a:hover {
  text-decoration: underline;
}

.admin-contact-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.admin-contact-none {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

.admin-member-bio {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
}

.admin-member-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.admin-member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-ministry-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--border-light);
  border: 1px solid var(--accent);
  color: var(--text);
}

.admin-leadership-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 500;
}

.admin-member-joined {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* Admin News */

.admin-news-section,
.admin-member-news-section {
  max-width: 700px;
  margin: 0 auto;
}

.admin-form-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.admin-news-form-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}

.admin-news-category-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.admin-news-source {
  font-size: 0.78rem;
  color: var(--accent);
  margin-left: 6px;
}

.admin-news-category-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  margin-left: auto;
}

.admin-news-cat-general { background: #e0e7ff; color: #3730a3; }
.admin-news-cat-ministry { background: #d1fae5; color: #065f46; }
.admin-news-cat-member { background: #fef3c7; color: #92400e; }

.admin-news-delete {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  margin-top: 6px;
  transition: var(--transition);
}

.admin-news-delete:hover {
  text-decoration: underline;
}

/* Admin Chats */

.admin-chat-section {
  max-width: 700px;
  margin: 0 auto;
}

.admin-chat-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-btn-secondary {
  background: var(--bg-card);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.admin-btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.admin-chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-chat-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.admin-chat-list-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.admin-chat-list-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.admin-chat-list-info {
  flex: 1;
  min-width: 0;
}

.admin-chat-list-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.admin-chat-list-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.admin-chat-list-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-chat-list-count {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--primary);
  color: white;
  padding: 1px 7px;
  border-radius: 20px;
}

/* Admin Create Chat */

.admin-create-chat {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.admin-back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 16px;
  transition: var(--transition);
}

.admin-back-link:hover {
  color: var(--primary-light);
}

.admin-participant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.admin-participant-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.admin-participant-option:hover {
  background: var(--border-light);
}

.admin-participant-avatar {
  font-size: 1.3rem;
}

.admin-participant-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

/* Admin Chat View */

.admin-chat-view {
  max-width: 700px;
  margin: 0 auto;
}

.admin-chat-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.admin-chat-view-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

/* Admin New Members */

.admin-new-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-new-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.admin-new-member-avatar {
  font-size: 1.3rem;
}

.admin-new-member-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.admin-new-member-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Admin Dark Mode — extended overrides */

[data-theme="dark"] .admin-stat-number {
  color: var(--primary-light);
}

[data-theme="dark"] .admin-stat-card:hover {
  border-color: rgba(99,102,241,0.3);
}

[data-theme="dark"] .admin-new-member-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

[data-theme="dark"] .admin-ministry-tag {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .admin-leadership-tag {
  background: rgba(254, 243, 199, 0.15);
  color: #fcd34d;
}

[data-theme="dark"] .admin-news-cat-general { background: rgba(224, 231, 255, 0.15); color: #a5b4fc; }
[data-theme="dark"] .admin-news-cat-ministry { background: rgba(209, 250, 229, 0.15); color: #6ee7b7; }
[data-theme="dark"] .admin-news-cat-member { background: rgba(254, 243, 199, 0.15); color: #fcd34d; }

/* Admin Responsive */

@media (max-width: 768px) {
  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-header {
    padding: 20px;
  }

  .admin-header-title {
    font-size: 1.3rem;
  }

  .admin-tabs {
    gap: 2px;
    padding: 3px;
  }

  .admin-tab {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .admin-tab-label {
    display: none;
  }

  .admin-tab-icon {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .admin-dashboard {
    padding: 12px 8px;
  }

  .admin-header {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .admin-header-title {
    font-size: 1.15rem;
  }

  .admin-members-controls {
    flex-direction: column;
  }

  .admin-chat-actions {
    flex-direction: column;
  }

  .admin-member-header {
    padding: 12px;
  }

  .admin-stat-number {
    font-size: 1.6rem;
  }

  .admin-news-form-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ========== Ministry Leaders Section ========== */

.ministry-leaders-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ministry-leaders-restricted-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.ministry-leaders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ministry-leaders-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.ministry-leaders-panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.ministry-leaders-goals {
  min-height: 120px;
  margin-bottom: 10px;
}

/* Budget */

.ministry-leaders-budget-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ministry-leaders-budget-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ministry-leaders-budget-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  min-width: 100px;
}

.ministry-leaders-budget-row input {
  flex: 1;
  max-width: 180px;
}

.ministry-leaders-budget-bar {
  height: 10px;
  background: var(--border-light);
  border-radius: 20px;
  overflow: hidden;
}

.ministry-leaders-budget-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 20px;
  transition: width 0.4s ease;
}

.ministry-leaders-budget-summary {
  font-size: 0.82rem;
  color: var(--text-light);
}

.ministry-leaders-budget-summary strong {
  color: var(--accent);
}

/* Roster */

.ministry-leaders-roster-group {
  margin-bottom: 16px;
}

.ministry-leaders-roster-group:last-child {
  margin-bottom: 0;
}

.ministry-leaders-roster-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ministry-leaders-roster-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ministry-leaders-roster-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--border-light);
  transition: var(--transition);
}

.ministry-leaders-roster-card:hover {
  background: var(--border);
}

.ministry-leaders-roster-leader {
  border-left: 3px solid #f59e0b;
}

.ministry-leaders-roster-avatar {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.ministry-leaders-roster-info {
  flex: 1;
  min-width: 0;
}

.ministry-leaders-roster-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.ministry-leaders-roster-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ministry-leaders-roster-contact {
  font-size: 1.1rem;
  text-decoration: none;
  padding: 4px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.ministry-leaders-roster-contact:hover {
  background: rgba(0,0,0,0.05);
}

/* Leader Notes */

.ministry-leaders-notes-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.ministry-leaders-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ministry-leaders-note-item {
  background: var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
}

.ministry-leaders-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ministry-leaders-note-avatar {
  font-size: 1.1rem;
}

.ministry-leaders-note-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.ministry-leaders-note-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.ministry-leaders-note-delete {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.ministry-leaders-note-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

.ministry-leaders-note-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Quick Stats in leaders */

.ministry-leaders-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
}

/* Dark mode for leaders section */

[data-theme="dark"] .ministry-leaders-restricted-banner {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.12) 0%, rgba(253, 230, 138, 0.08) 100%);
  color: #fcd34d;
}

[data-theme="dark"] .ministry-leaders-roster-card {
  background: rgba(255,255,255,0.04);
}

[data-theme="dark"] .ministry-leaders-roster-card:hover {
  background: rgba(255,255,255,0.07);
}

[data-theme="dark"] .ministry-leaders-roster-leader {
  border-left-color: #f59e0b;
}

[data-theme="dark"] .ministry-leaders-note-item {
  background: rgba(255,255,255,0.04);
}

[data-theme="dark"] .ministry-leaders-budget-bar {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .ministry-leaders-roster-contact:hover {
  background: rgba(255,255,255,0.08);
}

/* Responsive for leaders */

@media (max-width: 768px) {
  .ministry-leaders-grid {
    grid-template-columns: 1fr;
  }

  .ministry-leaders-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .ministry-leaders-budget-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ministry-leaders-budget-row label {
    min-width: unset;
  }

  .ministry-leaders-budget-row input {
    max-width: 100%;
  }

  .ministry-leaders-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== Leader Chats ========== */

.leaders-chat-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.leaders-create-chat-inline {
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: 100%;
}

.leaders-chat-back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 12px;
  display: inline-block;
  transition: var(--transition);
}

.leaders-chat-back-btn:hover {
  color: var(--primary-light);
}

.leaders-chat-view-inline {
  max-width: 100%;
  margin: 0;
}

.leaders-chat-view-info {
  flex: 1;
  min-width: 0;
}

.leaders-chat-view-participants {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaders-chat-edit-btn,
.leaders-chat-delete-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: var(--transition);
  flex-shrink: 0;
}

.leaders-chat-edit-btn:hover {
  background: rgba(0,0,0,0.05);
}

.leaders-chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .leaders-chat-edit-btn:hover {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .leaders-chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

@media (max-width: 480px) {
  .leaders-chat-actions {
    flex-direction: column;
  }
}

/* ===== Role Checkbox Grid ===== */
.role-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.role-checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.92rem;
}

.role-checkbox-option:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

.role-checkbox-option input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.role-checkbox-option.checked {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.role-checkbox-protected {
  font-size: 0.75rem;
  opacity: 0.6;
}

.role-password-field {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: roleFieldFadeIn 0.2s ease;
}

.role-password-field .role-password-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.role-password-field input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--bg-main);
  color: var(--text-primary);
  box-sizing: border-box;
}

.profile-form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

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

[data-theme="dark"] .role-checkbox-option {
  background: var(--bg-card);
}

[data-theme="dark"] .role-checkbox-option:hover {
  background: rgba(79, 70, 229, 0.1);
}

[data-theme="dark"] .role-checkbox-option.checked {
  background: rgba(79, 70, 229, 0.15);
}

[data-theme="dark"] .role-password-field {
  background: rgba(79, 70, 229, 0.08);
}

@media (max-width: 480px) {
  .role-checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== Weekly Scripture Card ========== */

.weekly-scripture-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.weekly-scripture-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.weekly-scripture-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin-bottom: 12px;
}

.weekly-scripture-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.weekly-scripture-ref {
  display: inline-block;
  color: #fff;
  background: rgba(255,255,255,0.18);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}

.weekly-scripture-ref:hover {
  background: rgba(255,255,255,0.3);
}

.weekly-scripture-meta {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 10px;
}

/* ========== Sermon Cards (Home) ========== */

.sermons-home-section {
  margin-bottom: 20px;
}

.sermons-home-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.sermon-home-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
  transition: box-shadow var(--transition), transform var(--transition);
}

.sermon-home-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sermon-home-header {
  margin-bottom: 8px;
}

.sermon-home-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.sermon-home-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sermon-home-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sermon-scripture-link {
  display: inline-block;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.sermon-scripture-link:hover {
  background: var(--accent);
  color: #fff;
}

.sermon-home-summary {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ========== Admin Sermons Tab ========== */

.admin-weekly-scripture-section {
  margin-bottom: 28px;
}

.admin-weekly-scripture-preview {
  background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, rgba(6,95,70,0.06) 100%);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 14px;
}

.admin-ws-preview-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
}

.admin-ws-preview-ref {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-ws-theme {
  display: inline-block;
  background: rgba(245,158,11,0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

.admin-ws-preview-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.admin-sermon-form-details {
  margin-bottom: 16px;
}

.admin-sermon-form-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary);
  padding: 8px 0;
  user-select: none;
}

.admin-sermon-form-details summary:hover {
  color: var(--accent);
}

.admin-sermon-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
}

.admin-sermon-scripture-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-sermon-select {
  flex: 2;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.admin-sermon-input-sm {
  flex: 1;
  min-width: 60px;
  max-width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.admin-sermon-remove-ref-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.admin-sermon-remove-ref-btn:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}

.admin-sermon-add-ref-btn {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--border);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.admin-sermon-add-ref-btn:hover {
  background: rgba(245,158,11,0.06);
  border-color: var(--accent);
}

.admin-sermon-refs-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 4px;
}

.admin-sermon-section {
  margin-bottom: 20px;
}

.admin-sermon-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-sermon-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
}

.admin-sermon-card-header {
  margin-bottom: 8px;
}

.admin-sermon-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.admin-sermon-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-sermon-card-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-sermon-card-summary {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 8px;
}

.admin-sermon-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-sermon-edit-btn,
.admin-sermon-delete-btn,
.admin-sermon-cancel-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.admin-sermon-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-sermon-delete-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.admin-sermon-cancel-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ========== Dark Mode — Sermons ========== */

[data-theme="dark"] .weekly-scripture-card {
  background: linear-gradient(135deg, rgba(79,70,229,0.1) 0%, rgba(79,70,229,0.06) 100%);
  border: 1px solid var(--border);
}

[data-theme="dark"] .sermon-home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

[data-theme="dark"] .sermon-scripture-link {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.2);
}

[data-theme="dark"] .admin-weekly-scripture-preview {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.2);
}

[data-theme="dark"] .admin-sermon-card {
  background: var(--bg-card);
}

[data-theme="dark"] .admin-sermon-select,
[data-theme="dark"] .admin-sermon-input-sm {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: var(--text);
}

[data-theme="dark"] .admin-sermon-form-details summary {
  color: #93c5fd;
}

[data-theme="dark"] .admin-sermon-add-ref-btn {
  border-color: rgba(255,255,255,0.15);
}

/* ========== Responsive — Sermons ========== */

@media (max-width: 600px) {
  .weekly-scripture-card {
    padding: 18px 16px;
  }

  .weekly-scripture-text {
    font-size: 1rem;
  }

  .sermon-home-card {
    padding: 14px 14px;
  }

  .admin-sermon-scripture-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-sermon-select {
    min-width: 100%;
  }

  .admin-sermon-input-sm {
    max-width: 100%;
  }
}

/* ========== Platform Landing ========== */

.platform-landing {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.platform-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.platform-hero-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.platform-hero-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.platform-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
}

.platform-section {
  margin-bottom: 2.5rem;
}

.platform-section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

.platform-search-bar {
  margin-bottom: 1rem;
}

.platform-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background: var(--bg-card);
  color: var(--text);
}

.platform-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.platform-church-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.platform-church-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.platform-church-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.platform-church-card-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.platform-church-card-info {
  flex: 1;
}

.platform-church-card-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.platform-church-card-tagline {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

.platform-church-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.platform-church-card-arrow {
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
}

.platform-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* Platform Register Form */

.platform-register-form {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.platform-form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.platform-form-group {
  flex: 1;
}

.platform-form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.platform-form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background: var(--bg-card);
  color: var(--text);
}

.platform-form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.platform-form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.platform-form-hint-error {
  color: #ef4444;
}

.platform-form-color {
  width: 60px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
}

.platform-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.platform-emoji-option {
  font-size: 1.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-card);
  transition: all 0.15s;
}

.platform-emoji-option.selected {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.1);
}

.platform-form-error {
  color: #ef4444;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.platform-register-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

.platform-footer-links {
  text-align: center;
  padding: 2rem 0;
}

.platform-admin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.platform-admin-link:hover {
  color: var(--primary);
}

/* Platform Admin Dashboard */

.platform-admin-dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
}

.platform-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.platform-admin-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
}

.platform-admin-actions {
  display: flex;
  gap: 0.5rem;
}

.platform-admin-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

.platform-admin-btn-secondary {
  background: var(--text-light);
}

.platform-admin-btn-secondary:hover {
  background: var(--text);
}

.platform-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.platform-admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.platform-admin-table th,
.platform-admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.platform-admin-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
}

.platform-admin-table-emoji {
  font-size: 1.5rem;
  width: 50px;
}

.platform-admin-table-actions {
  display: flex;
  gap: 0.4rem;
}

.platform-admin-action-btn {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}

.platform-admin-action-btn:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.06);
}

.platform-status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.platform-status-active {
  background: #dcfce7;
  color: #166534;
}

.platform-status-inactive {
  background: #fef2f2;
  color: #991b1b;
}

/* Org Gate Tagline */
.org-gate-tagline {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* ========== Groups ========== */

.groups-directory {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.groups-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.groups-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
}

.groups-create-btn {
  text-decoration: none;
}

.groups-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.groups-search {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.groups-search:focus {
  outline: none;
  border-color: var(--primary);
}

.groups-category-filter {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.groups-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.groups-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.groups-card-category {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.groups-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.groups-card-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  flex: 1;
  margin-bottom: 0.75rem;
}

.groups-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.groups-card-leader {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.groups-card-actions {
  display: flex;
  gap: 0.5rem;
}

.groups-card-view-btn {
  padding: 0.45rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.groups-card-view-btn:hover {
  background: #0f2a4a;
}

.groups-card-join-btn,
.groups-card-leave-btn {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

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

.groups-card-join-btn:hover {
  background: var(--primary-dark);
}

.groups-card-join-btn:disabled {
  background: var(--border-medium);
  cursor: not-allowed;
}

.groups-card-leave-btn {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.groups-card-leave-btn:hover {
  background: #fee2e2;
}

/* Group Detail */

.group-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

.group-detail-header {
  margin-bottom: 1rem;
}

.group-detail-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0.5rem 0;
}

.group-detail-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.group-detail-content {
  min-height: 200px;
}

.group-overview {
  padding: 1rem 0;
}

.group-overview-desc {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.group-overview-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.group-overview-detail {
  font-size: 0.95rem;
  color: var(--text-light);
}

.group-overview-actions {
  margin-top: 1rem;
}

/* Group Chat */

.group-chat {
  display: flex;
  flex-direction: column;
  height: 500px;
}

.group-chat .ministry-chat-messages {
  flex: 1;
  overflow-y: auto;
}

/* Group Prayers */

.group-prayers {
  padding: 0.5rem 0;
}

.group-prayer-form {
  margin-bottom: 1.5rem;
}

.group-prayer-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-prayer-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.group-prayer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.group-prayer-avatar {
  font-size: 1.5rem;
}

.group-prayer-author {
  font-weight: 600;
  color: var(--text);
}

.group-prayer-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

.group-prayer-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.group-prayer-actions {
  display: flex;
  gap: 0.5rem;
}

.group-pray-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.group-pray-btn:hover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.08);
}

.group-pray-btn.prayed {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

/* Group Members */

.group-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.group-member-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
}

.group-member-avatar {
  font-size: 1.5rem;
}

.group-member-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.group-member-role {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.group-member-remove {
  width: 28px;
  height: 28px;
  border: 1px solid #fecaca;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Admin Groups */

.admin-groups-section {
  padding: 0.5rem 0;
}

.admin-groups-header {
  margin-bottom: 1rem;
}

.admin-group-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.admin-group-card-header {
  margin-bottom: 0.5rem;
}

.admin-group-card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.admin-group-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Group Create Form */

.group-create-form {
  padding: 1rem 0;
}

/* ========== Giving ========== */

.giving-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

.giving-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.giving-title {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  color: var(--primary);
}

.giving-nav-links {
  display: flex;
  gap: 1rem;
}

.giving-nav-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.giving-nav-link:hover {
  text-decoration: underline;
}

/* Giving Form */

.giving-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.giving-form-title {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.giving-form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.giving-amount-input-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.giving-currency-symbol {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-right: 0.5rem;
}

.giving-amount-input {
  flex: 1;
  font-size: 2rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.giving-amount-input:focus {
  outline: none;
  border-color: var(--primary);
}

.giving-fund-select {
  margin-bottom: 1.25rem;
}

.giving-frequency-options {
  margin-bottom: 1.25rem;
}

.giving-payment-method {
  margin-bottom: 1.25rem;
}

.giving-frequency-btns {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.giving-freq-btn,
.giving-method-btn {
  flex: 1;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.giving-freq-btn.active,
.giving-method-btn.active {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary);
}

.giving-submit-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 1rem;
  font-size: 1.1rem;
}

/* Giving Confirmation */

.giving-confirm {
  text-align: center;
  padding: 3rem 1.5rem;
}

.giving-confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.giving-confirm-title {
  font-family: var(--font-sans);
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.giving-confirm-text {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.giving-confirm-detail {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.giving-confirm-note {
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.giving-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.giving-confirm-actions a {
  text-decoration: none;
}

/* Giving History */

.giving-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.giving-history-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.giving-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.giving-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.giving-history-fund {
  font-weight: 600;
  color: var(--text);
}

.giving-history-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.giving-history-note {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 0.15rem;
}

.giving-history-amount {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  white-space: nowrap;
}

.giving-view-all {
  display: block;
  text-align: center;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  margin-top: 0.75rem;
}

.giving-recent {
  margin-top: 1.5rem;
}

.giving-section-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.giving-statement-link {
  text-align: center;
  padding: 1rem 0;
}

/* Giving Statement */

.giving-statement {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.giving-statement-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.giving-statement-org {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.giving-statement-period {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.giving-statement-donor {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

.giving-statement-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.giving-statement-table th,
.giving-statement-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.giving-statement-table th {
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg-subtle);
}

.giving-statement-amount-col {
  text-align: right;
}

.giving-statement-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
}

.giving-statement-totals {
  border-top: 2px solid var(--border);
  padding-top: 1rem;
  margin-bottom: 1.5rem;
}

.giving-statement-totals h4 {
  margin-bottom: 0.75rem;
  color: var(--text-light);
}

.giving-statement-fund-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.giving-statement-grand-total {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  font-weight: 700;
  font-size: 1.1rem;
  border-top: 2px solid var(--primary);
  margin-top: 0.5rem;
  color: var(--primary);
}

.giving-statement-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.giving-statement-footer button {
  margin-top: 0.75rem;
}

/* Giving Chart */

.giving-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 200px;
  padding: 1rem 0;
}

.giving-chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.giving-chart-bar {
  width: 100%;
  max-width: 40px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}

.giving-chart-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Admin Finance */

.admin-finances-overview {
  padding: 0.5rem 0;
}

.admin-fund-progress {
  margin-bottom: 1rem;
}

.admin-fund-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.admin-fund-name {
  font-weight: 600;
  color: var(--text);
}

.admin-fund-total {
  color: var(--text-light);
}

.admin-fund-progress-bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.admin-fund-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 5px;
  transition: width 0.3s;
}

.admin-fund-list {
  margin-top: 0.75rem;
}

.admin-fund-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-fund-goal {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* Admin Pledge */

.admin-pledge-list {
  margin-top: 1rem;
}

.admin-pledge-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.admin-pledge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-pledge-dates {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-pledge-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.admin-pledge-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ========== Dark Mode for New Components ========== */

[data-theme="dark"] .platform-landing,
[data-theme="dark"] .platform-admin-dashboard {
  color: var(--text);
}

[data-theme="dark"] .platform-hero-title,
[data-theme="dark"] .platform-section-title,
[data-theme="dark"] .platform-admin-title {
  color: var(--text);
}

[data-theme="dark"] .platform-hero-subtitle {
  color: var(--text-muted);
}

[data-theme="dark"] .platform-church-card,
[data-theme="dark"] .platform-register-form {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .platform-church-card:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .platform-church-card-name,
[data-theme="dark"] .groups-card-name,
[data-theme="dark"] .giving-history-fund,
[data-theme="dark"] .group-prayer-author {
  color: var(--text);
}

[data-theme="dark"] .platform-search-input,
[data-theme="dark"] .platform-form-input,
[data-theme="dark"] .groups-search,
[data-theme="dark"] .groups-category-filter,
[data-theme="dark"] .giving-amount-input {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .platform-admin-table {
  background: var(--bg-card);
}

[data-theme="dark"] .platform-admin-table th {
  background: rgba(255,255,255,0.04);
  color: var(--text-light);
}

[data-theme="dark"] .platform-admin-table td {
  border-color: var(--border);
}

[data-theme="dark"] .groups-card,
[data-theme="dark"] .giving-form,
[data-theme="dark"] .giving-statement {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .groups-card:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .giving-history-item,
[data-theme="dark"] .group-prayer-item,
[data-theme="dark"] .group-member-row,
[data-theme="dark"] .admin-group-card,
[data-theme="dark"] .admin-pledge-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .groups-card-desc,
[data-theme="dark"] .group-overview-desc,
[data-theme="dark"] .group-prayer-text,
[data-theme="dark"] .giving-confirm-text {
  color: var(--text-light);
}

[data-theme="dark"] .giving-freq-btn,
[data-theme="dark"] .giving-method-btn,
[data-theme="dark"] .group-pray-btn {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .giving-freq-btn.active,
[data-theme="dark"] .giving-method-btn.active,
[data-theme="dark"] .group-pray-btn.prayed {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--primary);
  color: var(--accent);
}

[data-theme="dark"] .platform-admin-action-btn,
[data-theme="dark"] .platform-emoji-option {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .giving-statement-header {
  border-color: var(--border);
}

[data-theme="dark"] .giving-statement-table th {
  background: rgba(255,255,255,0.04);
  color: var(--text-light);
}

[data-theme="dark"] .giving-statement-table td {
  border-color: var(--border);
}

[data-theme="dark"] .giving-statement-totals {
  border-color: var(--border);
}

[data-theme="dark"] .giving-statement-grand-total {
  border-color: var(--primary);
  color: var(--text);
}

[data-theme="dark"] .admin-fund-progress-bar {
  background: var(--border);
}

[data-theme="dark"] .giving-chart-bar {
  background: var(--accent);
}

[data-theme="dark"] .groups-title,
[data-theme="dark"] .group-detail-title,
[data-theme="dark"] .giving-title,
[data-theme="dark"] .giving-form-title,
[data-theme="dark"] .giving-confirm-title,
[data-theme="dark"] .giving-section-title,
[data-theme="dark"] .giving-statement-org {
  color: var(--text);
}

/* ========== Responsive for New Components ========== */

@media (max-width: 768px) {
  .platform-form-row {
    flex-direction: column;
  }

  .platform-hero-title {
    font-size: 1.8rem;
  }

  .groups-grid {
    grid-template-columns: 1fr;
  }

  .groups-filters {
    flex-direction: column;
  }

  .giving-form {
    padding: 1.25rem;
  }

  .giving-amount-input {
    font-size: 1.5rem;
  }

  .giving-frequency-btns {
    flex-direction: column;
  }

  .giving-history-filters {
    flex-direction: column;
  }

  .giving-confirm-actions {
    flex-direction: column;
  }

  .giving-chart {
    height: 150px;
  }

  .platform-admin-table {
    font-size: 0.82rem;
  }

  .platform-admin-table th,
  .platform-admin-table td {
    padding: 0.5rem;
  }

  .group-chat {
    height: 400px;
  }

  .giving-statement {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .platform-landing {
    padding: 1rem;
  }

  .platform-hero {
    padding: 2rem 0.5rem 1.5rem;
  }

  .platform-hero-title {
    font-size: 1.5rem;
  }

  .groups-directory,
  .group-detail,
  .giving-page {
    padding: 1rem;
  }

  .groups-title,
  .giving-title,
  .group-detail-title {
    font-size: 1.3rem;
  }

  .groups-card-actions {
    flex-direction: column;
  }

  .groups-card-view-btn,
  .groups-card-join-btn,
  .groups-card-leave-btn {
    text-align: center;
  }

  .giving-nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .giving-history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .group-detail-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .giving-chart-label {
    font-size: 0.6rem;
  }
}

/* ========== Login Toggle & Username Display ========== */
.org-gate-toggle {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.org-gate-toggle a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.org-gate-toggle a:hover {
  text-decoration: underline;
}

.profile-username {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ========== Staff Dashboard Hub ========== */
.staff-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.staff-action-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 2px solid transparent;
}
.staff-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.staff-action-icon { font-size: 1.75rem; margin-bottom: 10px; display: block; }
.staff-action-label { font-size: 1rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.staff-action-desc { font-size: 0.85rem; color: var(--text-light); }

.staff-chat-preview-item {
  display: flex; gap: 10px; padding: 10px;
  border-radius: var(--radius); background: var(--bg-subtle); margin-bottom: 8px;
}
.staff-chat-preview-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.staff-chat-preview-content { flex: 1; min-width: 0; }
.staff-chat-preview-header { display: flex; justify-content: space-between; margin-bottom: 2px; }
.staff-chat-preview-name { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.staff-chat-preview-time { font-size: 0.75rem; color: var(--text-muted); }
.staff-chat-preview-message {
  font-size: 0.85rem; color: var(--text-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.staff-view-all-link {
  display: inline-block; margin-top: 12px; color: var(--primary);
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.staff-view-all-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .staff-quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .staff-quick-actions-grid { grid-template-columns: 1fr; }
}

/* ========== Staff Messaging ========== */
.staff-messages-page { max-width: 800px; margin: 0 auto; padding: 20px; }
.staff-messages-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.staff-messages-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.staff-messages-actions { display: flex; gap: 10px; }

.staff-msg-list { display: flex; flex-direction: column; gap: 8px; }
.staff-msg-list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: var(--transition); text-decoration: none; color: inherit;
}
.staff-msg-list-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.staff-msg-list-icon { font-size: 1.5rem; flex-shrink: 0; }
.staff-msg-list-info { flex: 1; min-width: 0; }
.staff-msg-list-name { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.staff-msg-list-preview { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-msg-list-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.staff-msg-list-time { font-size: 0.75rem; color: var(--text-muted); }
.staff-msg-list-count { font-size: 0.72rem; font-weight: 600; background: var(--primary); color: white; padding: 1px 7px; border-radius: 20px; }

.staff-chat-page { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 180px); }
.staff-chat-header {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid var(--border);
}
.staff-chat-back-btn { text-decoration: none; color: var(--primary); font-size: 1.2rem; font-weight: 600; flex-shrink: 0; }
.staff-chat-back-btn:hover { color: var(--primary-light); }
.staff-chat-header-info { flex: 1; min-width: 0; }
.staff-chat-header-name { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.staff-chat-header-meta { font-size: 0.8rem; color: var(--text-muted); }
.staff-chat-edit-btn {
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  color: var(--text-muted); padding: 4px 8px; border-radius: var(--radius); transition: var(--transition);
}
.staff-chat-edit-btn:hover { background: var(--bg-subtle); color: var(--text); }

.staff-chat-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg-subtle); }

.staff-chat-input-area {
  padding: 12px; background: var(--bg-card);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: 1px solid var(--border);
}

.staff-create-chat { max-width: 600px; margin: 0 auto; padding: 20px; }
.staff-create-chat-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.staff-participant-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 350px; overflow-y: auto; }
.staff-participant-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg-card); border-radius: var(--radius); cursor: pointer; transition: var(--transition);
}
.staff-participant-option:hover { background: var(--bg-subtle); }
.staff-participant-avatar { font-size: 1.3rem; }
.staff-participant-name { font-size: 0.9rem; font-weight: 500; flex: 1; }

.staff-edit-group { max-width: 600px; margin: 0 auto; padding: 20px; }
.staff-edit-group-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.staff-edit-current-members { margin: 16px 0; }
.staff-edit-member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 6px;
}
.staff-edit-member-info { display: flex; align-items: center; gap: 8px; }
.staff-edit-remove-btn { color: #dc2626; background: none; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.staff-edit-remove-btn:hover { text-decoration: underline; }
.staff-edit-add-section { margin-top: 20px; }
.staff-edit-add-title { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.staff-delete-group-btn {
  margin-top: 24px; background: #dc2626; color: #fff; border: none;
  padding: 10px 20px; border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: 0.9rem;
}
.staff-delete-group-btn:hover { background: #b91c1c; }

@media (max-width: 768px) {
  .staff-chat-page { height: calc(100vh - 140px); }
  .staff-messages-header { flex-direction: column; align-items: flex-start; }
}

/* ========== Mobile Performance ========== */
/* No backdrop-filter needed — using solid backgrounds */

/* ========== Shared Component Styles for New Features ========== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-detail {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light, #e0e7ff);
  color: var(--primary, #4f46e5);
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fecaca; color: #991b1b; }

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted, #6b7280);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.data-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #6b7280);
  background: var(--surface-alt, #f9fafb);
}

.data-table tbody tr:hover {
  background: var(--primary-light, #f0f4ff);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

/* Calendar Grid Styles */
.cal-grid {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-alt, #f9fafb);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.cal-day-header {
  padding: 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}

.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 80px;
  padding: 0.35rem;
  border-right: 1px solid var(--border-color, #e5e7eb);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  cursor: pointer;
  transition: background 0.15s;
}

.cal-cell:hover { background: var(--primary-light, #f0f4ff); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-empty { background: var(--surface-alt, #f9fafb); cursor: default; }
.cal-empty:hover { background: var(--surface-alt, #f9fafb); }

.cal-today {
  background: var(--primary-light, #e0e7ff);
}

.cal-date {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.cal-event-dot {
  font-size: 0.7rem;
  padding: 1px 4px;
  border-radius: 3px;
  color: white;
  margin-bottom: 1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal-event-more {
  font-size: 0.7rem;
  color: var(--text-muted, #6b7280);
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-cell { min-height: 50px; }
  .cal-event-dot { display: none; }
  .section-header-row { flex-direction: column; align-items: flex-start; }
}

/* ========== Engagement Scoring ========== */
.engagement-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.engagement-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; text-align: center; }
.engagement-stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.engagement-stat-label { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
.engagement-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.engagement-bucket-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.engagement-bucket-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.engagement-bucket-icon { font-size: 1.25rem; }
.engagement-bucket-name { font-weight: 700; flex: 1; }
.engagement-bucket-count { font-size: 0.85rem; color: var(--text-light); }
.engagement-mini-member { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; font-size: 0.875rem; }
.engagement-mini-avatar { font-size: 1rem; }
.engagement-mini-name { flex: 1; }
.engagement-mini-score { font-weight: 700; }
.engagement-more { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; }
.engagement-member-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-bottom: 1px solid var(--border); }
.engagement-member-avatar { font-size: 1.5rem; }
.engagement-member-info { flex: 1; }
.engagement-member-name { font-weight: 600; display: block; }
.engagement-member-role { font-size: 0.8rem; color: var(--text-light); }
.engagement-score-bar-wrap { display: flex; align-items: center; gap: 0.5rem; width: 120px; }
.engagement-score-bar-bg { flex: 1; height: 6px; background: var(--surface-1); border-radius: 3px; }
.engagement-score-bar-fill { height: 100%; border-radius: 3px; }
.engagement-score-num { font-weight: 700; font-size: 0.9rem; min-width: 2.5rem; text-align: right; }
.engagement-label-badge { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 20px; white-space: nowrap; }
.smart-lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.smart-list-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.smart-list-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.smart-list-icon { font-size: 1.5rem; flex-shrink: 0; }
.smart-list-name { font-weight: 700; }
.smart-list-desc { font-size: 0.85rem; color: var(--text-light); }
.smart-list-count { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.smart-list-preview { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.smart-list-avatar { font-size: 1.25rem; }
.smart-list-more { font-size: 0.8rem; color: var(--text-light); align-self: center; }
.smart-list-actions { display: flex; gap: 0.5rem; }

/* ========== Automation ========== */
.automation-workflow-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }
.automation-workflow-header { display: flex; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.automation-trigger-icon { font-size: 1.5rem; flex-shrink: 0; }
.automation-workflow-info { flex: 1; min-width: 200px; }
.automation-workflow-name { font-weight: 700; font-size: 1rem; }
.automation-workflow-desc { color: var(--text-light); font-size: 0.875rem; margin-top: 0.2rem; }
.automation-workflow-meta { font-size: 0.8rem; color: var(--text-light); margin-top: 0.4rem; }
.automation-workflow-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.automation-action-steps { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.25rem; }
.automation-step-chip { background: var(--surface-1); border: 1px solid var(--border); border-radius: 20px; padding: 0.2rem 0.6rem; font-size: 0.8rem; }
.automation-trigger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.automation-trigger-option { border: 2px solid var(--border); border-radius: 10px; padding: 0.75rem; cursor: pointer; transition: all 0.15s; }
.automation-trigger-option:hover { border-color: var(--primary); background: var(--primary-light, #eff6ff); }
.automation-trigger-option.selected { border-color: var(--primary); background: var(--primary-light, #eff6ff); }
.automation-trigger-opt-icon { font-size: 1.25rem; display: block; margin-bottom: 0.25rem; }
.automation-trigger-opt-label { font-weight: 600; font-size: 0.875rem; display: block; }
.automation-trigger-opt-desc { font-size: 0.75rem; color: var(--text-light); }
.automation-action-block { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 0.75rem; }
.automation-action-block-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 0.5rem; }
.automation-log-list { }
.automation-log-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-bottom: 1px solid var(--border); }
.automation-log-info { flex: 1; }
.automation-log-name { font-weight: 600; font-size: 0.9rem; }
.automation-log-meta { font-size: 0.8rem; color: var(--text-light); }
.automation-log-time { font-size: 0.8rem; color: var(--text-light); white-space: nowrap; }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: #d1d5db; border-radius: 20px; cursor: pointer; transition: background 0.2s; }
.toggle-switch input:checked + .toggle-track { background: var(--primary, #4f46e5); }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(16px); }

/* ========== Two-Way SMS ========== */
.sms-inbox-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 180px); min-height: 500px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.sms-sidebar { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sms-sidebar-header { padding: 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sms-sidebar-title { font-weight: 700; }
.sms-unread-badge { background: var(--primary); color: #fff; border-radius: 20px; padding: 0.1rem 0.5rem; font-size: 0.75rem; font-weight: 700; }
.sms-search-wrap { padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); }
.sms-conv-list { flex: 1; overflow-y: auto; }
.sms-conv-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 0.75rem; transition: background 0.1s; }
.sms-conv-item:hover, .sms-conv-item.active { background: var(--surface-1); }
.sms-conv-item.unread .sms-conv-name { font-weight: 700; }
.sms-conv-avatar { font-size: 1.5rem; flex-shrink: 0; }
.sms-conv-info { flex: 1; min-width: 0; }
.sms-conv-name-row { display: flex; justify-content: space-between; align-items: center; }
.sms-conv-name { font-weight: 500; font-size: 0.9rem; }
.sms-conv-time { font-size: 0.75rem; color: var(--text-light); white-space: nowrap; }
.sms-conv-preview-row { display: flex; justify-content: space-between; align-items: center; }
.sms-conv-preview { font-size: 0.8rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sms-unread-dot { background: var(--primary); color: #fff; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
.sms-label-chip { font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 10px; margin-top: 0.25rem; display: inline-block; }
.sms-chat-area { display: flex; flex-direction: column; }
.sms-chat-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.75rem; background: var(--surface); }
.sms-messages-area { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.sms-bubble-row { display: flex; }
.sms-bubble-row.sms-bubble-outbound { justify-content: flex-end; }
.sms-bubble { max-width: 70%; }
.sms-bubble-text { border-radius: 16px; padding: 0.6rem 0.9rem; font-size: 0.9rem; line-height: 1.5; }
.sms-bubble-inbound .sms-bubble-text { background: var(--surface-1); border-bottom-left-radius: 4px; }
.sms-bubble-outbound .sms-bubble-text { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.sms-bubble-sender { font-size: 0.75rem; color: var(--text-light); display: block; margin-bottom: 0.2rem; }
.sms-bubble-time { font-size: 0.7rem; color: var(--text-light); margin-top: 0.2rem; text-align: right; }
.sms-input-area { padding: 0.75rem 1rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; align-items: flex-end; }
.sms-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-light); text-align: center; padding: 2rem; }

/* ========== Pledge Campaigns ========== */
.pledge-campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.pledge-campaign-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.pledge-card-past { opacity: 0.7; }
.pledge-card-category { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); margin-bottom: 0.25rem; }
.pledge-card-name { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.5rem; }
.pledge-card-desc { font-size: 0.875rem; color: var(--text-light); margin-bottom: 1rem; }
.pledge-progress-section { margin-bottom: 0.75rem; }
.pledge-progress-bar-bg { height: 8px; background: var(--surface-1); border-radius: 4px; }
.pledge-progress-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.pledge-progress-labels { display: flex; justify-content: space-between; font-size: 0.8rem; margin-top: 0.4rem; color: var(--text-light); }
.pledge-raised { font-weight: 600; color: var(--primary); }
.pledge-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-light); margin-top: 0.5rem; flex-wrap: wrap; }

/* ========== Communication History ========== */
.ch-profile-header { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1.5rem; }
.ch-timeline { position: relative; padding-left: 2rem; }
.ch-entry { position: relative; padding-bottom: 1.25rem; }
.ch-entry::before { content: ''; position: absolute; left: -1.5rem; top: 1.5rem; bottom: 0; width: 2px; background: var(--border); }
.ch-entry:last-child::before { display: none; }
.ch-entry-dot { position: absolute; left: -2rem; top: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; border: 2px solid var(--surface); }
.ch-entry-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.ch-entry-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.ch-entry-type { font-size: 0.75rem; letter-spacing: 0.05em; }
.ch-entry-dir { font-size: 0.75rem; color: var(--text-light); }
.ch-entry-subject { font-weight: 600; margin-bottom: 0.25rem; }
.ch-entry-body { font-size: 0.875rem; color: var(--text-light); }
.ch-entry-footer { font-size: 0.75rem; color: var(--text-light); margin-top: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }

/* ========== Livestream ========== */
.livestream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.livestream-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.livestream-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.livestream-card-thumbnail { aspect-ratio: 16/9; background: linear-gradient(135deg, #1e3a5f, #0d9488); position: relative; display: flex; align-items: center; justify-content: center; }
.livestream-card-platform-icon { font-size: 3rem; color: rgba(255,255,255,0.3); }
.livestream-status-badge { position: absolute; top: 0.75rem; left: 0.75rem; color: #fff; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.livestream-viewers-badge { position: absolute; bottom: 0.75rem; right: 0.75rem; background: rgba(0,0,0,0.6); color: #fff; padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.75rem; }
.livestream-card-body { padding: 1rem; }
.livestream-card-title { font-weight: 700; margin-bottom: 0.25rem; font-size: 0.95rem; }
.livestream-card-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.5rem; }
.livestream-card-tags { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.livestream-card-admin-btns { padding: 0.5rem 1rem 0.75rem; display: flex; gap: 0.5rem; border-top: 1px solid var(--border); }
.livestream-embed-container { position: relative; padding-top: 56.25%; background: #000; }
.livestream-embed-iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.live-dot-pulse { width: 10px; height: 10px; background: #dc2626; border-radius: 50%; animation: pulse-ring 1.5s infinite; display: inline-block; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); } 70% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }

/* ========== Event Ticketing ========== */
.ticketing-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.ticket-event-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ticket-event-card-banner { height: 100px; display: flex; align-items: center; justify-content: center; }
.ticket-event-card-body { padding: 1.25rem; }
.ticket-capacity-bar-bg { height: 6px; background: var(--surface-1); border-radius: 3px; margin-bottom: 0.4rem; }

/* ========== Report Builder ========== */
.reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.report-card-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.report-source-icon { font-size: 1.5rem; }
.report-card-name { font-weight: 700; }
.report-card-desc { font-size: 0.875rem; color: var(--text-light); margin-bottom: 0.75rem; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.report-table th { text-align: left; padding: 0.6rem 0.75rem; background: var(--surface-1); border-bottom: 2px solid var(--border); font-weight: 600; white-space: nowrap; }
.report-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.report-table tbody tr:hover { background: var(--surface-1); }
.report-filter-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }

/* ========== Shared modal improvements ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-card { background: var(--surface); border-radius: 16px; padding: 1.75rem; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-title { margin: 0 0 1.25rem; font-size: 1.2rem; font-weight: 700; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.3rem; }

/* ========== Page titles ========== */
.page-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.25rem; }
.page-subtitle { color: var(--text-light); font-size: 0.9rem; margin: 0 0 1.5rem; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .engagement-stats-row { grid-template-columns: repeat(2, 1fr); }
  .sms-inbox-layout { grid-template-columns: 1fr; }
  .sms-sidebar { height: 300px; }
  .engagement-member-row { flex-wrap: wrap; }
  .engagement-score-bar-wrap { width: 80px; }
  .livestream-grid, .ticketing-events-grid, .pledge-campaigns-grid { grid-template-columns: 1fr; }
  .reports-grid, .smart-lists-grid { grid-template-columns: 1fr; }
}

/* ========== Utility: Card ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* ========== Utility: Tab Bar ========== */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  flex: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--bg-card);
  color: var(--text);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ========== Utility: Empty State ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-light);
  gap: 0.75rem;
}

.empty-state-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.empty-state-desc {
  font-size: 0.875rem;
  max-width: 340px;
}

/* ========== Utility: Badge ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary { background: rgba(79,70,229,0.12); color: var(--primary); }
.badge-green { background: rgba(16,185,129,0.12); color: #059669; }
.badge-red { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-yellow { background: rgba(234,179,8,0.12); color: #b45309; }
.badge-blue { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-gray { background: var(--bg-subtle); color: var(--text-light); }

/* ========== Dark Mode: New Modules ========== */
[data-theme="dark"] .tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
}

[data-theme="dark"] .sms-chat-header,
[data-theme="dark"] .sms-inbox-layout {
  background: var(--bg-card);
}

[data-theme="dark"] .sms-conv-item:hover,
[data-theme="dark"] .sms-conv-item.active {
  background: var(--bg-subtle);
}

[data-theme="dark"] .sms-bubble-inbound .sms-bubble-text {
  background: var(--bg-subtle);
  color: var(--text);
}

[data-theme="dark"] .engagement-stat-card,
[data-theme="dark"] .engagement-bucket-card,
[data-theme="dark"] .smart-list-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .automation-workflow-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .automation-step-chip,
[data-theme="dark"] .automation-action-block {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .automation-trigger-option:hover,
[data-theme="dark"] .automation-trigger-option.selected {
  background: rgba(129,140,248,0.1);
  border-color: var(--primary);
}

[data-theme="dark"] .pledge-campaign-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .pledge-progress-bar-bg,
[data-theme="dark"] .ticket-capacity-bar-bg {
  background: var(--bg-subtle);
}

[data-theme="dark"] .ch-entry-card,
[data-theme="dark"] .ch-profile-header {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .ch-entry::before {
  background: var(--border);
}

[data-theme="dark"] .ch-entry-dot {
  border-color: var(--bg-card);
}

[data-theme="dark"] .livestream-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .livestream-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

[data-theme="dark"] .ticket-event-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .report-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .report-table th {
  background: var(--bg-subtle);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .report-table td {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .report-table tbody tr:hover {
  background: var(--bg-subtle);
}

[data-theme="dark"] .modal-card {
  background: var(--bg-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

[data-theme="dark"] .card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .tab-bar {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .tab-btn:hover {
  background: var(--bg-card);
  color: var(--text);
}

[data-theme="dark"] .badge-primary { background: rgba(129,140,248,0.15); color: var(--primary); }
[data-theme="dark"] .badge-green { background: rgba(16,185,129,0.15); color: #34d399; }
[data-theme="dark"] .badge-red { background: rgba(239,68,68,0.15); color: #f87171; }
[data-theme="dark"] .badge-yellow { background: rgba(234,179,8,0.15); color: #fcd34d; }
[data-theme="dark"] .badge-blue { background: rgba(96,165,250,0.15); color: #60a5fa; }
[data-theme="dark"] .badge-gray { background: var(--bg-subtle); color: var(--text-light); }

[data-theme="dark"] .btn-outline {
  color: var(--primary);
  border-color: var(--primary);
}

[data-theme="dark"] .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

[data-theme="dark"] .toggle-track {
  background: #475569;
}

/* ========== Enhanced Module Visual Polish ========== */

/* Engagement score bars — color by tier */
.engagement-score-bar-fill[data-score="champion"] { background: linear-gradient(90deg, #10b981, #34d399); }
.engagement-score-bar-fill[data-score="engaged"] { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.engagement-score-bar-fill[data-score="growing"] { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.engagement-score-bar-fill[data-score="at-risk"] { background: linear-gradient(90deg, #ef4444, #f87171); }
.engagement-score-bar-fill[data-score="inactive"] { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

/* Livestream live badge pulse */
.livestream-status-badge[data-status="live"] {
  background: #dc2626;
  animation: pulse-bg 2s infinite;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Report table hover highlight */
.report-table tbody tr {
  transition: background var(--transition);
}

/* Smooth progress bars */
.pledge-progress-bar-fill,
.engagement-score-bar-fill {
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ticket event card banner gradient variety */
.ticket-event-card-banner { background: linear-gradient(135deg, #4f46e5, #7c3aed); }

/* SMS unread count bubble */
.sms-unread-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}

/* Automation step chips subtle gradient on hover */
.automation-step-chip:hover {
  background: rgba(79,70,229,0.08);
  border-color: var(--primary);
  color: var(--primary);
  cursor: default;
}

/* Smart list card subtle top border accent */
.smart-list-card {
  border-top: 3px solid var(--primary);
}

/* Engagement bucket card accent */
.engagement-bucket-card {
  transition: box-shadow var(--transition), transform var(--transition);
}

.engagement-bucket-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ================================================================
   ORG CUSTOMIZER
   ================================================================ */

.cust-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ── Two-column grid: main + preview ── */
.cust-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

.cust-single-col {
  max-width: 760px;
}

/* ── Section card ── */
.cust-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.cust-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.cust-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cust-section-header-row .cust-section-title { margin-bottom: 0; }

.cust-group-actions {
  display: flex;
  gap: 0.4rem;
}

/* ── Form layout ── */
.cust-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cust-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cust-field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Emoji picker ── */
.cust-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.cust-emoji-btn {
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}

.cust-emoji-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.cust-emoji-btn.selected {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Color inputs ── */
.cust-color-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.cust-color-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cust-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cust-color-swatch {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-subtle);
  box-shadow: var(--shadow-sm);
}

.cust-color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.cust-color-swatch::-webkit-color-swatch { border-radius: 6px; border: none; }

.cust-hex-input {
  width: 90px;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
}

/* ── Radio cards (font / theme) ── */
.cust-radio-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cust-radio-card {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.cust-radio-card:hover {
  border-color: var(--primary);
  background: var(--bg-subtle);
}

.cust-radio-card.selected {
  border-color: var(--primary);
  background: var(--bg-subtle);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.cust-radio-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.cust-radio-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Live Preview panel ── */
.cust-preview-panel {
  position: sticky;
  top: 80px;
}

.cust-preview-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cust-preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.cust-preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  color: #fff;
  transition: background var(--transition-slow);
}

.cust-preview-logo { font-size: 1.5rem; }

.cust-preview-name {
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.cust-preview-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-card);
}

.cust-preview-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cust-preview-btn {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: background var(--transition-slow);
}

.cust-preview-btn-outline {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border: 2px solid;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-slow);
}

.cust-preview-font {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  transition: font-family var(--transition);
}

.cust-preview-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* ── Banner options ── */
.cust-banner-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cust-banner-option {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cust-banner-option:hover { border-color: var(--primary); }
.cust-banner-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.cust-banner-preview {
  height: 50px;
  border-radius: var(--radius);
}

.cust-banner-gradient { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.cust-banner-solid    { background: var(--primary); }
.cust-banner-dark     { background: #0f172a; }
.cust-banner-scripture{ background: linear-gradient(135deg, #fef3c7, #fde68a); }

.cust-banner-label { font-size: 0.8rem; font-weight: 600; }
.cust-banner-desc  { font-size: 0.72rem; color: var(--text-muted); }

/* ── Toggle list ── */
.cust-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cust-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.cust-toggle-row:last-child { border-bottom: none; }

.cust-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cust-toggle-label { font-weight: 600; font-size: 0.9rem; }
.cust-toggle-desc  { font-size: 0.8rem; color: var(--text-muted); }

/* ── Features module grid ── */
.cust-features-intro {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.cust-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.cust-module-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  transition: background var(--transition), border-color var(--transition);
}

.cust-module-card:hover { background: var(--bg-card); border-color: var(--border-medium); }

.cust-module-icon { font-size: 1.1rem; flex-shrink: 0; }

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

.cust-module-name {
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dashboard widget list ── */
.cust-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cust-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.cust-widget-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

.cust-widget-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.cust-widget-row:hover { box-shadow: var(--shadow-sm); }

.cust-widget-inactive {
  background: var(--bg-subtle);
  opacity: 0.75;
}

.cust-widget-icon { font-size: 1.1rem; flex-shrink: 0; }

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

.cust-widget-name {
  font-weight: 600;
  font-size: 0.875rem;
  display: block;
}

.cust-widget-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.cust-widget-controls {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.cust-widget-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.cust-widget-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.cust-widget-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cust-widget-remove:hover:not(:disabled) {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.cust-widget-add:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Dark mode overrides ── */
[data-theme="dark"] .cust-section {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .cust-emoji-btn {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .cust-radio-card {
  border-color: var(--border);
}

[data-theme="dark"] .cust-radio-card:hover,
[data-theme="dark"] .cust-radio-card.selected {
  background: var(--bg-subtle);
}

[data-theme="dark"] .cust-preview-body {
  background: var(--bg-card);
}

[data-theme="dark"] .cust-module-card {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .cust-module-card:hover {
  background: var(--bg-card);
}

[data-theme="dark"] .cust-widget-row {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .cust-widget-inactive {
  background: var(--bg-subtle);
}

[data-theme="dark"] .cust-widget-btn {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .cust-hex-input {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .cust-features-intro {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .cust-banner-option {
  border-color: var(--border);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .cust-grid { grid-template-columns: 1fr; }
  .cust-preview-panel { position: static; }
  .cust-dashboard-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cust-form-row { grid-template-columns: 1fr; }
  .cust-radio-grid { flex-direction: column; }
  .cust-module-grid { grid-template-columns: 1fr; }
  .cust-banner-options { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   AESTHETIC UPGRADE PACK
   ========================================================== */

/* ── 1. Page Transitions ── */
.page-transition {
  animation: pageSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 2. Card Hover Micro-interactions ── */
.card, .hub-card {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease;
}
.card:hover, .hub-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px -6px rgba(99,102,241,0.2), 0 4px 16px -4px rgba(236,72,153,0.08), 0 0 0 1px rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.25);
}
.card:active, .hub-card:active {
  transform: translateY(-1px) scale(1);
}

/* ── 3. Gradient Mesh Backgrounds ── */
.gradient-mesh {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.gradient-mesh::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: 60vw; height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,0.06) 0%, transparent 70%);
  animation: meshFloat 20s ease-in-out infinite;
}
.gradient-mesh::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -15%;
  width: 50vw; height: 50vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%);
  animation: meshFloat 25s ease-in-out infinite reverse;
}
@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ── 4. Skeleton Loading States ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, rgba(148,163,184,0.12) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 10px; border-radius: 6px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-title { height: 24px; width: 45%; margin-bottom: 16px; border-radius: 8px; }
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ── 5. Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-lg);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 360px;
  backdrop-filter: blur(12px);
}
.toast.success { background: rgba(16,185,129,0.95); }
.toast.error { background: rgba(239,68,68,0.95); }
.toast.info { background: rgba(59,130,246,0.95); }
.toast.warning { background: rgba(245,158,11,0.95); }
.toast-exit { animation: toastSlideOut 0.3s ease-in both; }
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px) scale(0.9); }
}

/* ── 6. Typography Upgrades ── */
.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-title-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-subtitle {
  font-size: 0.925rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── 7. Better Empty States ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeIn 0.5s ease both;
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  filter: grayscale(0.2);
  animation: emptyBounce 2s ease-in-out infinite;
}
@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.empty-state-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  max-width: 360px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* ── 8. Scroll-triggered Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ── 9. Animated Stat Counters ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b, #10b981);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity 0.3s, background-position 0.6s;
}
.stat-card:hover::before { opacity: 1; background-position: 100% 0; }
.stat-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 24px rgba(99,102,241,0.12); }
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── 10. Dark Mode Polish ── */
[data-theme="dark"] {
  --bg: #0c0f1a;
  --bg-card: #151929;
  --bg-subtle: #1a1f36;
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --text-muted: #64748b;
  --border: #262d45;
  --border-light: #1e2540;
  --border-medium: #334155;
}
[data-theme="dark"] header {
  background: rgba(12,15,26,0.8);
  border-bottom-color: rgba(38,45,69,0.6);
}
[data-theme="dark"] .card:hover,
[data-theme="dark"] .hub-card:hover {
  box-shadow: 0 12px 28px -8px rgba(99,102,241,0.15), 0 0 0 1px rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.25);
}
[data-theme="dark"] .stat-card::before {
  background: linear-gradient(90deg, #6366f1, #a78bfa);
}
[data-theme="dark"] .gradient-mesh::before {
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
}
[data-theme="dark"] .gradient-mesh::after {
  background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%);
}
[data-theme="dark"] body {
  background-image: radial-gradient(ellipse at top center, rgba(99,102,241,0.04), transparent 60%);
}
[data-theme="dark"] .toast {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ── 11. Confetti Celebration ── */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  z-index: 99998;
  pointer-events: none;
  animation: confettiFall 2.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(-100px) rotate(0deg) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.3); }
}

/* ── 12. Hub Pages ── */
.hub-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.hub-header {
  margin-bottom: 2.5rem;
  text-align: center;
}
.hub-header .page-title {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.hub-header .page-subtitle {
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}
.hub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s;
}
.hub-card:hover::before {
  opacity: 1;
}
.hub-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(99,102,241,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.hub-card:nth-child(6n+1) .hub-card-icon { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05)); }
.hub-card:nth-child(6n+2) .hub-card-icon { background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(236,72,153,0.05)); }
.hub-card:nth-child(6n+3) .hub-card-icon { background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05)); }
.hub-card:nth-child(6n+4) .hub-card-icon { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); }
.hub-card:nth-child(6n+5) .hub-card-icon { background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(14,165,233,0.05)); }
.hub-card:nth-child(6n+6) .hub-card-icon { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05)); }
.hub-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.hub-card-desc {
  font-size: 0.83rem;
  color: var(--text-light);
  line-height: 1.45;
}
[data-theme="dark"] .hub-card-icon {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.08));
}

/* ── 13. Bottom Tab Bar (Mobile) ── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0.25rem 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-tab-bar-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}
.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.4rem 0.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  min-width: 0;
  text-align: center;
}
.mobile-tab svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
.mobile-tab.active, .mobile-tab:hover {
  color: var(--primary);
}
[data-theme="dark"] .mobile-tab-bar {
  background: rgba(12,15,26,0.92);
  border-top-color: var(--border);
}

@media (max-width: 768px) {
  .mobile-tab-bar { display: block; }
  body { padding-bottom: 72px; }
  .nav-bar { display: none !important; }
}

/* ── Button Enhancements ── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn-primary {
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(79,70,229,0.35);
}


/* ==========================================================
   CHURCH PERSONALIZATION SYSTEM
   ========================================================== */

/* ── Church Homepage ── */
.church-home { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem 3rem; }

.church-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.church-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.25;
}
.church-hero-content {
  position: relative; z-index: 1;
  padding: 3rem 2rem;
  max-width: 640px;
}
.church-hero-logo {
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  margin: 0 auto 1rem;
  background: rgba(255,255,255,0.15);
  padding: 8px;
  backdrop-filter: blur(8px);
}
.church-hero-name {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.church-hero-tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.church-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: rgba(255,255,255,0.95);
  color: var(--primary-dark);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.church-hero-cta:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

/* ── Service Times ── */
.service-times-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.service-time-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}
.service-time-row:last-child { border-bottom: none; }
.service-time-day {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 100px;
  color: var(--text);
}
.service-time-time {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
}
.service-time-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Pastor Welcome ── */
.pastor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.pastor-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--primary);
  box-shadow: 0 4px 12px rgba(79,70,229,0.15);
}
.pastor-avatar-placeholder {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.8rem;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.pastor-message {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-light);
  font-style: italic;
}

/* ── Social Links ── */
.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}
.social-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ── Featured Content ── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -8px rgba(79,70,229,0.12);
  border-color: rgba(79,70,229,0.2);
}
.featured-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

/* ── Onboarding ── */
.onboard-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.onboard-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: pageSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.onboard-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 2rem;
  text-align: center;
}
.onboard-body { padding: 2rem; }
.onboard-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--radius);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.onboard-step:hover { background: var(--bg-subtle); }
.onboard-step:last-child { border-bottom: none; }
.onboard-step-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.onboard-step.done .onboard-step-icon {
  background: #10b981;
  color: #fff;
}

/* ── Theme Presets ── */
.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.theme-preset-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.theme-preset-card:hover, .theme-preset-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.theme-preset-swatch {
  height: 48px;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

/* ── Dark mode extras for personalization ── */
[data-theme="dark"] .church-hero { box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
[data-theme="dark"] .social-link { background: var(--bg-card); }
[data-theme="dark"] .onboard-card { border: 1px solid var(--border); }

@media (max-width: 640px) {
  .church-hero-name { font-size: 1.6rem; }
  .church-hero-content { padding: 2rem 1.25rem; }
  .church-hero { min-height: 240px; }
  .pastor-card { flex-direction: column; align-items: center; text-align: center; }
}

/* ==========================================================
   ADVANCED CHURCH CUSTOMIZATION STYLES
   ========================================================== */

/* ── Header Style Variants ── */
[data-header-style="transparent"] header {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-header-style="transparent"] header::after { display: none; }
[data-header-style="solid"] header {
  background: var(--primary) !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-header-style="solid"] .site-title,
[data-header-style="solid"] .nav-trigger,
[data-header-style="solid"] .nav-standalone,
[data-header-style="solid"] .header-util-btn { color: #fff !important; }
[data-header-style="gradient"] header {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
}
[data-header-style="gradient"] .site-title,
[data-header-style="gradient"] .nav-trigger,
[data-header-style="gradient"] .nav-standalone,
[data-header-style="gradient"] .header-util-btn { color: #fff !important; }
[data-header-style="gradient"] header::after { display: none; }

/* ── Card Style Variants ── */
[data-card-style="sharp"] .card,
[data-card-style="sharp"] .hub-card,
[data-card-style="sharp"] .service-times-card,
[data-card-style="sharp"] .pastor-card,
[data-card-style="sharp"] .featured-card { border-radius: 0 !important; }

[data-card-style="floating"] .card,
[data-card-style="floating"] .hub-card,
[data-card-style="floating"] .service-times-card,
[data-card-style="floating"] .pastor-card,
[data-card-style="floating"] .featured-card {
  border: none !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04) !important;
}
[data-card-style="floating"] .card:hover,
[data-card-style="floating"] .hub-card:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06) !important;
}

[data-card-style="flat"] .card,
[data-card-style="flat"] .hub-card,
[data-card-style="flat"] .service-times-card,
[data-card-style="flat"] .pastor-card,
[data-card-style="flat"] .featured-card {
  border: none !important;
  box-shadow: none !important;
  background: var(--bg-subtle) !important;
}

/* ── Button Style Variants ── */
[data-btn-style="pill"] .btn { border-radius: 9999px !important; }
[data-btn-style="square"] .btn { border-radius: 0 !important; }
[data-btn-style="outlined"] .btn-primary {
  background: transparent !important;
  border: 2px solid var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}
[data-btn-style="outlined"] .btn-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

/* ── Page Background Image ── */
body[data-has-bg-image] {
  background-image: var(--page-bg-image) !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body[data-has-bg-image]::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: var(--page-bg-overlay, 0.88);
  z-index: -1;
  pointer-events: none;
}

/* ── Section Backgrounds ── */
.church-section {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.church-section[data-section-bg] {
  background-size: cover;
  background-position: center;
}
.church-section-overlay {
  position: absolute; inset: 0;
  background: var(--bg);
  opacity: 0.85;
  pointer-events: none;
}

/* ── Photo Gallery ── */
.church-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.church-gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.church-gallery-img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.gallery-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}
.gallery-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ── Custom CSS Textarea ── */
.custom-css-editor {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  width: 100%;
  min-height: 200px;
  resize: vertical;
  tab-size: 2;
}

/* ── Style Picker Cards ── */
.style-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.style-picker-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.style-picker-card:hover { border-color: var(--primary-light); }
.style-picker-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
  background: rgba(79,70,229,0.03);
}
.style-picker-preview {
  height: 40px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.style-picker-label {
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Section Reorder ── */
.section-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.section-order-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.section-order-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.1rem;
}
.section-order-label { flex: 1; font-weight: 600; font-size: 0.9rem; }
.section-order-btns { display: flex; gap: 0.25rem; }

@media (max-width: 640px) {
  .church-gallery { grid-template-columns: repeat(2, 1fr); }
  .style-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   MOBILE POLISH — Complete Responsive Overhaul
   ========================================================== */

/* ── 768px: Tablet & Small Desktop ── */
@media (max-width: 768px) {

  /* Header cleanup */
  .header-inner { padding: 8px 12px; gap: 6px; }
  .site-title { font-size: 1rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  .site-title img { height: 26px !important; }
  .version-selector { display: none; }
  .search-bar { order: 10; }
  #a11y-toggle-btn { display: none; }

  /* Hide desktop nav, show mobile tab bar */
  .nav-bar { display: none !important; }
  .mobile-tab-bar { display: block; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Hide old mobile hamburger menu since we have bottom tabs now */
  .mobile-menu-btn { display: none !important; }
  .mobile-menu { display: none !important; }

  /* Main content spacing */
  main { padding: 12px; }
  #content { min-height: calc(100vh - 160px); }

  /* Back button mobile */
  .global-back-btn { margin: 0.5rem 0 0 0.5rem !important; font-size: 0.78rem !important; padding: 0.3rem 0.7rem !important; }

  /* Hub pages */
  .hub-page { padding: 1.25rem 0.75rem 2rem; }
  .hub-header { margin-bottom: 1.5rem; }
  .hub-header .page-title { font-size: 1.6rem; }
  .hub-header .page-subtitle { font-size: 0.875rem; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .hub-card { padding: 1rem; gap: 0.5rem; }
  .hub-card-icon { width: 40px; height: 40px; font-size: 1.25rem; }
  .hub-card-title { font-size: 0.88rem; }
  .hub-card-desc { font-size: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  /* Church homepage */
  .church-home { padding: 0 0.75rem 2rem; }
  .church-hero { min-height: 220px; border-radius: var(--radius-lg); margin-bottom: 1.25rem; }
  .church-hero-content { padding: 1.75rem 1.25rem; }
  .church-hero-name { font-size: 1.5rem; }
  .church-hero-tagline { font-size: 0.9rem; }
  .church-hero-logo { width: 56px; height: 56px; }
  .church-hero-cta { padding: 0.6rem 1.25rem; font-size: 0.85rem; }

  /* Service times card */
  .service-time-row { flex-wrap: wrap; gap: 0.5rem; }
  .service-time-day { min-width: 80px; font-size: 0.82rem; }
  .service-time-label { margin-left: 0; width: 100%; padding-left: 80px; margin-top: -0.25rem; }

  /* Pastor card */
  .pastor-card { flex-direction: column; align-items: center; text-align: center; padding: 1.25rem; gap: 1rem; }
  .pastor-avatar, .pastor-avatar-placeholder { width: 64px; height: 64px; }

  /* Cards general */
  .card { border-radius: var(--radius); }

  /* Stat cards */
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.5rem; }

  /* Featured grid */
  .featured-grid { grid-template-columns: 1fr; }

  /* Social links */
  .social-links { justify-content: center; }
  .social-link { padding: 0.4rem 0.75rem; font-size: 0.78rem; }

  /* Meet the Staff */
  .church-section [style*="grid-template-columns: repeat(auto-fill, minmax(320px"] {
    grid-template-columns: 1fr !important;
  }

  /* Section headers */
  .section-header-row, .page-header { flex-direction: column; gap: 0.75rem; align-items: flex-start !important; }
  .section-header-row .btn, .page-header .btn { align-self: flex-start; }

  /* Page title sizing */
  .page-title { font-size: 1.4rem; }
  .page-subtitle { font-size: 0.82rem; }

  /* Modal */
  .modal-overlay { padding: 0.75rem; }
  .modal-card { max-width: 100% !important; max-height: 90vh; overflow-y: auto; border-radius: var(--radius-lg) !important; }
  .modal-content { padding: 1.25rem; max-height: 85vh; }

  /* Forms */
  .org-gate-card { margin: 0.5rem; padding: 1.5rem; }
  .org-gate-card-wide { margin: 0.5rem; }
  .org-gate-icon { font-size: 2.5rem; }
  .org-gate-title { font-size: 1.3rem; }

  /* Profile page */
  .profile-page { padding: 0; }
  .profile-card { padding: 1.25rem; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }

  /* Tables scroll horizontally */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Gallery */
  .church-gallery { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }

  /* Breadcrumb */
  .breadcrumb { padding: 6px 12px; font-size: 0.75rem; }

  /* User bar */
  .user-bar { padding: 6px 12px; font-size: 0.82rem; }
  .user-bar-avatar { font-size: 1rem; }

  /* Toast */
  .toast-container { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); right: 0.75rem; left: 0.75rem; }
  .toast { max-width: 100%; font-size: 0.82rem; }

  /* Customizer tabs scroll */
  .cust-tabs, .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 0; }
  .cust-tab, .tab-btn { white-space: nowrap; flex-shrink: 0; font-size: 0.78rem; padding: 0.6rem 0.75rem; }

  /* Onboarding */
  .onboard-card { max-width: 100%; }
  .onboard-header { padding: 1.5rem; }
  .onboard-header h2 { font-size: 1.2rem; }
  .onboard-body { padding: 1.25rem; }
}

/* ── 480px: Small Phones ── */
@media (max-width: 480px) {

  .header-inner { padding: 6px 10px; }
  .site-title { font-size: 0.9rem; max-width: 120px; }
  .header-util-btn { width: 32px; height: 32px; }
  .header-util-btn svg { width: 14px; height: 14px; }

  main { padding: 8px; }

  /* Hub pages — single column */
  .hub-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .hub-card { flex-direction: row; align-items: center; padding: 0.85rem; }
  .hub-card-icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .hub-card-desc { display: none; }
  .hub-header .page-title { font-size: 1.35rem; }

  /* Church homepage */
  .church-hero { min-height: 180px; border-radius: var(--radius); }
  .church-hero-name { font-size: 1.25rem; }
  .church-hero-tagline { font-size: 0.82rem; margin-bottom: 1rem; }
  .church-hero-logo { width: 48px; height: 48px; }

  /* Quick actions — 3 columns */
  .church-home [style*="grid-template-columns: repeat(auto-fill, minmax(100px"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* Cards tighter */
  .card { padding: 1rem; }
  .section-container { padding: 0; }

  /* Buttons */
  .btn { padding: 0.5rem 0.85rem; font-size: 0.82rem; }
  .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

  /* Modal */
  .modal-overlay { padding: 0.5rem; }
  .modal-card { border-radius: var(--radius) !important; }

  /* Login */
  .org-gate { min-height: auto; padding: 1rem; }
  .org-gate-card { padding: 1.25rem; border-radius: var(--radius-lg); }
  .org-gate-title { font-size: 1.15rem; }
  .org-gate-subtitle { font-size: 0.82rem; }

  /* Profile */
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .profile-avatar-large { font-size: 2.5rem; }

  /* Staff cards single column */
  [style*="grid-template-columns: repeat(auto-fill, minmax(320px"] {
    grid-template-columns: 1fr !important;
  }

  /* Gallery */
  .church-gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-lightbox img { max-width: 95vw; max-height: 80vh; }

  /* Bottom tab bar */
  .mobile-tab-bar-inner { padding: 0 0.25rem; }
  .mobile-tab { font-size: 0.6rem; padding: 0.35rem 0.4rem; }
  .mobile-tab svg { width: 20px; height: 20px; }

  /* Toasts above tab bar */
  .toast-container { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toast { padding: 0.65rem 1rem; font-size: 0.78rem; }

  /* Style picker */
  .style-picker-grid { grid-template-columns: repeat(2, 1fr); }

  /* Form grids go single column */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 360px: Extra Small ── */
@media (max-width: 360px) {
  .site-title { font-size: 0.82rem; max-width: 100px; }
  .hub-header .page-title { font-size: 1.15rem; }
  .church-hero-name { font-size: 1.1rem; }
  .church-hero { min-height: 160px; }
  .mobile-tab { font-size: 0.55rem; padding: 0.3rem 0.25rem; }
  .mobile-tab svg { width: 18px; height: 18px; }
}

/* ── Touch Improvements ── */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .nav-menu-item { min-height: 48px; }
  .mobile-tab { min-height: 48px; }
  .hub-card { min-height: 64px; }

  /* Remove hover-only effects that don't work on touch */
  .card:hover, .hub-card:hover { transform: none; }
  .hub-card::before { display: none; }
  .stat-card::before { opacity: 1; }

  /* Active state instead of hover */
  .card:active, .hub-card:active { transform: scale(0.98); opacity: 0.9; }
  .btn:active { transform: scale(0.97); }

  /* Disable confetti animation on touch (performance) */
  .confetti-piece { animation-duration: 1.5s; }
}

/* ── Safe Area (notch phones) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-tab-bar { padding-bottom: env(safe-area-inset-bottom); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ── Landscape Phone ── */
@media (max-height: 500px) and (orientation: landscape) {
  .church-hero { min-height: 160px; }
  .church-hero-content { padding: 1rem; }
  .church-hero-name { font-size: 1.2rem; }
  .org-gate { min-height: auto; padding: 0.5rem; }
  .onboard-card { max-height: 90vh; overflow-y: auto; }
}


/* ==========================================================
   FUTURISTIC DESIGN SYSTEM UPGRADE
   ========================================================== */

/* ── 1. Glassmorphic Cards ── */
.card, .hub-card, .service-times-card, .pastor-card, .featured-card, .stat-card {
  background: rgba(255,255,255,0.65) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
}
[data-theme="dark"] .card,
[data-theme="dark"] .hub-card,
[data-theme="dark"] .service-times-card,
[data-theme="dark"] .pastor-card,
[data-theme="dark"] .featured-card,
[data-theme="dark"] .stat-card {
  background: rgba(21,25,41,0.65) !important;
  border: 1px solid rgba(99,102,241,0.12) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ── 2. Animated Gradient Borders ── */
/* Hover: vibrant gradient glow + lift */
.card::before, .hub-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(236,72,153,0.08), rgba(245,158,11,0.1), rgba(16,185,129,0.08));
  background-size: 200% 200%;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.35s ease, background-position 0.6s ease;
  background-position: 0% 0%;
}
.card:hover::before, .hub-card:hover::before {
  opacity: 1;
  background-position: 100% 100%;
}
.card, .hub-card {
  position: relative;
  z-index: 0;
}
/* rotateBorder removed — replaced with soft gradient hover */

/* ── 3. Neon Glow Accents ── */
.btn-primary {
  box-shadow: 0 0 20px rgba(79,70,229,0.3), 0 2px 8px rgba(79,70,229,0.2) !important;
}
.btn-primary:hover {
  box-shadow: 0 0 32px rgba(79,70,229,0.45), 0 4px 16px rgba(79,70,229,0.3) !important;
}
.hub-card:hover {
  box-shadow: 0 8px 32px rgba(79,70,229,0.15), 0 0 16px rgba(79,70,229,0.08) !important;
}
[data-theme="dark"] .btn-primary {
  box-shadow: 0 0 24px rgba(99,102,241,0.4), 0 2px 12px rgba(99,102,241,0.25) !important;
}
[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 0 40px rgba(99,102,241,0.55), 0 4px 20px rgba(99,102,241,0.35) !important;
}
[data-theme="dark"] .hub-card:hover {
  box-shadow: 0 8px 40px rgba(99,102,241,0.2), 0 0 20px rgba(139,92,246,0.12) !important;
}

/* Neon focus rings */
input:focus, select:focus, textarea:focus, .org-gate-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.2), 0 0 16px rgba(79,70,229,0.1);
  border-color: var(--primary) !important;
}

/* ── 4. Grain/Noise Texture ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  mix-blend-mode: overlay;
}
[data-theme="dark"] body::after { opacity: 0.04; }

/* ── 5. Floating Orb Background (Upgraded) ── */
.gradient-mesh::before {
  width: 70vw !important;
  height: 70vw !important;
  background: radial-gradient(circle, rgba(79,70,229,0.08) 0%, rgba(139,92,246,0.04) 40%, transparent 70%) !important;
  animation: orbFloat1 22s ease-in-out infinite !important;
  filter: blur(60px);
}
.gradient-mesh::after {
  width: 60vw !important;
  height: 60vw !important;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, rgba(236,72,153,0.03) 40%, transparent 70%) !important;
  animation: orbFloat2 28s ease-in-out infinite !important;
  filter: blur(60px);
}
/* Third orb via box-shadow trick */
.gradient-mesh {
  overflow: visible !important;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(5vw, -8vh) scale(1.1) rotate(45deg); }
  50% { transform: translate(-3vw, 5vh) scale(0.9) rotate(90deg); }
  75% { transform: translate(8vw, 2vh) scale(1.05) rotate(135deg); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(-6vw, 6vh) scale(1.08) rotate(-60deg); }
  66% { transform: translate(4vw, -4vh) scale(0.92) rotate(-120deg); }
}

/* ── 6. Magnetic Hover / 3D Tilt (CSS-only approximation) ── */
.hub-card, .featured-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}
.hub-card:hover {
  transform: translateY(-4px) rotateX(2deg) rotateY(-2deg) !important;
}
.featured-card:hover {
  transform: translateY(-3px) rotateX(1deg) rotateY(-1deg) !important;
}

/* ── 7. Staggered Entrance Animations ── */
.page-transition .hub-card,
.page-transition .card,
.page-transition .reveal {
  animation: staggerFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.page-transition > :nth-child(1) { animation-delay: 0s; }
.page-transition > :nth-child(2) { animation-delay: 0.06s; }
.page-transition > :nth-child(3) { animation-delay: 0.12s; }
.page-transition > :nth-child(4) { animation-delay: 0.18s; }
.page-transition > :nth-child(5) { animation-delay: 0.24s; }
.page-transition > :nth-child(6) { animation-delay: 0.30s; }
.page-transition > :nth-child(7) { animation-delay: 0.36s; }
.page-transition > :nth-child(8) { animation-delay: 0.42s; }
.page-transition .hub-grid .hub-card:nth-child(1) { animation-delay: 0.05s; }
.page-transition .hub-grid .hub-card:nth-child(2) { animation-delay: 0.1s; }
.page-transition .hub-grid .hub-card:nth-child(3) { animation-delay: 0.15s; }
.page-transition .hub-grid .hub-card:nth-child(4) { animation-delay: 0.2s; }
.page-transition .hub-grid .hub-card:nth-child(5) { animation-delay: 0.25s; }
.page-transition .hub-grid .hub-card:nth-child(6) { animation-delay: 0.3s; }
.page-transition .hub-grid .hub-card:nth-child(7) { animation-delay: 0.35s; }
.page-transition .hub-grid .hub-card:nth-child(8) { animation-delay: 0.4s; }
.page-transition .hub-grid .hub-card:nth-child(9) { animation-delay: 0.45s; }
.page-transition .hub-grid .hub-card:nth-child(10) { animation-delay: 0.5s; }
@keyframes staggerFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 8. Smooth Number Morphing (CSS) ── */
.stat-value, [data-count-to] {
  font-variant-numeric: tabular-nums;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 9. Ripple Click Effect ── */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* ── 10. Typewriter (for hero) ── */
.typewriter {
  overflow: hidden;
  border-right: 2px solid rgba(255,255,255,0.8);
  white-space: nowrap;
  animation: typewrite 2.5s steps(40) 0.5s both, blink 0.75s step-end infinite;
  max-width: fit-content;
  margin: 0 auto;
}
@keyframes typewrite {
  from { max-width: 0; }
  to { max-width: 100%; }
}
@keyframes blink {
  50% { border-color: transparent; }
}

/* ── 11. Bento Grid (Homepage) ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(120px, auto);
  gap: 1rem;
}
.bento-item { border-radius: var(--radius-lg); overflow: hidden; }
.bento-wide { grid-column: span 2; }
.bento-tall { grid-row: span 2; }
.bento-feature { grid-column: span 2; grid-row: span 2; }
@media (max-width: 768px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-feature { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 480px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide, .bento-feature { grid-column: span 1; }
}

/* ── 12. Gradient Mesh Cards ── */
/* Vibrant gradient mesh cards */
.hub-card:nth-child(6n+1) { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(99,102,241,0.08)) !important; border-left: 3px solid #6366f1; }
.hub-card:nth-child(6n+2) { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(236,72,153,0.08)) !important; border-left: 3px solid #ec4899; }
.hub-card:nth-child(6n+3) { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(16,185,129,0.08)) !important; border-left: 3px solid #10b981; }
.hub-card:nth-child(6n+4) { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(245,158,11,0.08)) !important; border-left: 3px solid #f59e0b; }
.hub-card:nth-child(6n+5) { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(14,165,233,0.08)) !important; border-left: 3px solid #0ea5e9; }
.hub-card:nth-child(6n+6) { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(139,92,246,0.08)) !important; border-left: 3px solid #8b5cf6; }

.hub-card:nth-child(6n+1):hover { box-shadow: 0 12px 32px rgba(99,102,241,0.2), 0 0 0 1px rgba(99,102,241,0.15) !important; }
.hub-card:nth-child(6n+2):hover { box-shadow: 0 12px 32px rgba(236,72,153,0.2), 0 0 0 1px rgba(236,72,153,0.15) !important; }
.hub-card:nth-child(6n+3):hover { box-shadow: 0 12px 32px rgba(16,185,129,0.2), 0 0 0 1px rgba(16,185,129,0.15) !important; }
.hub-card:nth-child(6n+4):hover { box-shadow: 0 12px 32px rgba(245,158,11,0.2), 0 0 0 1px rgba(245,158,11,0.15) !important; }
.hub-card:nth-child(6n+5):hover { box-shadow: 0 12px 32px rgba(14,165,233,0.2), 0 0 0 1px rgba(14,165,233,0.15) !important; }
.hub-card:nth-child(6n+6):hover { box-shadow: 0 12px 32px rgba(139,92,246,0.2), 0 0 0 1px rgba(139,92,246,0.15) !important; }

[data-theme="dark"] .hub-card:nth-child(6n+1) { background: linear-gradient(135deg, rgba(21,25,41,0.7), rgba(99,102,241,0.12)) !important; }
[data-theme="dark"] .hub-card:nth-child(6n+2) { background: linear-gradient(135deg, rgba(21,25,41,0.7), rgba(236,72,153,0.12)) !important; }
[data-theme="dark"] .hub-card:nth-child(6n+3) { background: linear-gradient(135deg, rgba(21,25,41,0.7), rgba(16,185,129,0.12)) !important; }
[data-theme="dark"] .hub-card:nth-child(6n+4) { background: linear-gradient(135deg, rgba(21,25,41,0.7), rgba(245,158,11,0.12)) !important; }
[data-theme="dark"] .hub-card:nth-child(6n+5) { background: linear-gradient(135deg, rgba(21,25,41,0.7), rgba(14,165,233,0.12)) !important; }
[data-theme="dark"] .hub-card:nth-child(6n+6) { background: linear-gradient(135deg, rgba(21,25,41,0.7), rgba(139,92,246,0.12)) !important; }

/* ── 13. Animated Icons ── */
.hub-card-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}
.hub-card:hover .hub-card-icon {
  transform: scale(1.25) rotate(-8deg);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.mobile-tab:active svg {
  animation: iconBounce 0.3s ease;
}
@keyframes iconBounce {
  0% { transform: scale(1); }
  40% { transform: scale(0.85); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── 14. Scroll Progress Bar ── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(79,70,229,0.4);
}

/* ── 15. Particle Effect Container ── */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: particleDrift linear infinite;
}
.hero-cross {
  position: absolute;
  color: rgba(255,255,255,0.2);
  pointer-events: none;
  animation: crossFloat linear infinite;
  text-shadow: 0 0 10px rgba(255,255,255,0.12);
  line-height: 1;
}
@keyframes particleDrift {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-300px) translateX(40px); opacity: 0; }
}
@keyframes crossFloat {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(-400px) translateX(25px) rotate(20deg); opacity: 0; }
}

/* ── Upgraded Buttons ── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
  pointer-events: none;
}

/* ── Upgraded Header ── */
header {
  background: rgba(255,255,255,0.55) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.2) !important;
}
[data-theme="dark"] header {
  background: rgba(12,15,26,0.6) !important;
  border-bottom: 1px solid rgba(99,102,241,0.1) !important;
}

/* ── Upgraded Input Fields ── */
.org-gate-input, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}
[data-theme="dark"] .org-gate-input,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(21,25,41,0.6);
  border-color: rgba(99,102,241,0.15);
}

/* ── Upgraded Badge Pills ── */
.badge {
  backdrop-filter: blur(8px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Subtle Glow on Active Mobile Tab ── */
.mobile-tab.active {
  position: relative;
}
.mobile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(99,102,241,0.5);
}
.mobile-tab.active svg {
  filter: drop-shadow(0 0 4px rgba(99,102,241,0.3));
}

/* ── Hero Glow Ring ── */
.church-hero::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
  animation: heroGlow 6s ease-in-out infinite;
}
@keyframes heroGlow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* ── Disable heavy animations for reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .typewriter { max-width: 100%; border-right: none; }
  .particle, .confetti-piece { display: none; }
}


/* ==========================================================
   FUTURISTIC EFFECTS — MOBILE FIXES
   ========================================================== */

@media (max-width: 768px) {

  /* Tone down glassmorphism blur for performance */
  .card, .hub-card, .service-times-card, .pastor-card, .featured-card, .stat-card {
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
  }

  /* Disable animated gradient borders on mobile (GPU heavy) */
  .card::before, .hub-card::before {
    display: none !important;
  }

  /* Disable 3D tilt on mobile */
  .hub-card:hover, .featured-card:hover {
    transform: none !important;
  }

  /* Smaller orbs, less blur for performance */
  .gradient-mesh::before {
    width: 80vw !important;
    height: 80vw !important;
    filter: blur(40px) !important;
  }
  .gradient-mesh::after {
    width: 70vw !important;
    height: 70vw !important;
    filter: blur(40px) !important;
  }

  /* Reduce grain opacity on mobile */
  body::after { opacity: 0.015 !important; }

  /* Scroll progress bar thinner */
  #scroll-progress { height: 2px; }

  /* Typewriter — just show it, don't animate (can overflow) */
  .typewriter {
    animation: none !important;
    border-right: none !important;
    white-space: normal !important;
    overflow: visible !important;
    max-width: 100% !important;
  }

  /* Hero glow ring smaller */
  .church-hero::after {
    width: 150%;
    height: 150%;
  }

  /* Particles fewer and smaller */
  .particle:nth-child(n+10) { display: none; }
  .particle { width: 2px !important; height: 2px !important; }

  /* Staggered entrance — faster on mobile */
  .page-transition .hub-card,
  .page-transition .card,
  .page-transition .reveal {
    animation-duration: 0.35s !important;
  }
  .page-transition .hub-grid .hub-card:nth-child(n+5) {
    animation-delay: 0.2s !important;
  }

  /* Neon glow — subtler on mobile */
  .btn-primary {
    box-shadow: 0 0 12px rgba(79,70,229,0.2), 0 2px 6px rgba(79,70,229,0.15) !important;
  }
  .btn-primary:hover {
    box-shadow: 0 0 16px rgba(79,70,229,0.3), 0 2px 8px rgba(79,70,229,0.2) !important;
  }

  /* Ripple smaller */
  .btn .ripple { animation-duration: 0.4s; }

  /* Bento grid — 2 col on tablet */
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-feature { grid-column: span 2; grid-row: span 1; }

  /* Active tab glow smaller */
  .mobile-tab.active::after { width: 16px; height: 2px; }

  /* Toast container above tab bar */
  .toast-container {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Modal glassmorphism */
  .modal-card, .modal-content {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

@media (max-width: 480px) {

  /* Even lighter effects on small phones */
  .card, .hub-card, .service-times-card, .pastor-card, .featured-card, .stat-card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  /* Disable grain entirely on small phones (performance) */
  body::after { display: none !important; }

  /* Gradient mesh smaller */
  .gradient-mesh::before {
    width: 100vw !important;
    height: 100vw !important;
    filter: blur(30px) !important;
  }
  .gradient-mesh::after {
    width: 90vw !important;
    height: 90vw !important;
    filter: blur(30px) !important;
  }

  /* Fewer particles */
  .particle:nth-child(n+6) { display: none; }

  /* Neon glow — minimal on small phones */
  .btn-primary {
    box-shadow: 0 0 8px rgba(79,70,229,0.15), 0 2px 4px rgba(79,70,229,0.1) !important;
  }

  /* Hero particles smaller */
  .hero-particles { opacity: 0.6; }

  /* Staggered entrance — even faster */
  .page-transition .hub-card,
  .page-transition .card {
    animation-duration: 0.25s !important;
  }

  /* Bento single col */
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide, .bento-feature { grid-column: span 1; }

  /* Hub card icon glow removed (too busy on small screens) */
  .hub-card-icon {
    background: rgba(79,70,229,0.08) !important;
  }
}

/* ── Touch devices — disable GPU-heavy hover effects ── */
@media (hover: none) and (pointer: coarse) {
  /* No gradient border rotation */
  .card::before, .hub-card::before { display: none !important; }
  
  /* No 3D tilt */
  .hub-card:hover, .featured-card:hover { transform: none !important; }
  
  /* Simpler card hover */
  .card:hover, .hub-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
    border-color: rgba(79,70,229,0.15) !important;
  }
  
  /* Active press feedback instead */
  .card:active, .hub-card:active, .featured-card:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s !important;
  }
  .btn:active {
    transform: scale(0.96) !important;
    transition: transform 0.1s !important;
  }
  
  /* Disable hero glow animation */
  .church-hero::after { animation: none !important; opacity: 0.3; }
  
  /* Reduce orb animation complexity */
  .gradient-mesh::before { animation-duration: 30s !important; }
  .gradient-mesh::after { animation-duration: 35s !important; }
  
  /* Fewer particles */
  .particle:nth-child(n+8) { display: none; }
}


/* ==========================================================
   UX UPGRADE PACK
   ========================================================== */

/* ── 1. Command Palette (Cmd+K) ── */
.cmd-palette-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: fadeIn 0.15s ease;
}
.cmd-palette {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: cmdSlideDown 0.2s cubic-bezier(0.22,1,0.36,1);
}
@keyframes cmdSlideDown {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.cmd-palette-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.cmd-palette-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  font-family: var(--font-sans);
}
.cmd-palette-input::placeholder { color: var(--text-muted); }
.cmd-palette-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.cmd-palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: var(--text);
}
.cmd-palette-item:hover, .cmd-palette-item.active {
  background: var(--bg-subtle);
}
.cmd-palette-item.active {
  background: rgba(79,70,229,0.08);
}
.cmd-palette-item-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.cmd-palette-item-label { font-weight: 600; font-size: 0.9rem; }
.cmd-palette-item-desc { font-size: 0.75rem; color: var(--text-muted); }
.cmd-palette-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.cmd-palette-footer kbd {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.68rem;
}

/* ── 2. Skeleton Screens ── */
.skeleton-page {
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
.skeleton-hero {
  height: 200px;
  border-radius: var(--radius-xl);
  margin-bottom: 1.5rem;
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

/* ── 3. Route Transition ── */
.page-exit {
  animation: pageSlideOut 0.2s ease both;
}
@keyframes pageSlideOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ── 4. 404 Page ── */
.not-found-page {
  text-align: center;
  padding: 5rem 2rem;
  animation: fadeIn 0.5s ease;
}
.not-found-code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
}

/* ── 7. Keyboard Shortcut Modal ── */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.shortcut-keys {
  display: flex;
  gap: 3px;
}
.shortcut-keys kbd {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ── 8. Session Timeout Warning ── */
.session-warning {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245,158,11,0.95);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 99998;
  box-shadow: 0 8px 24px rgba(245,158,11,0.3);
  animation: fadeIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── 11. What's New Badge ── */
.whats-new-dot {
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: 4px; right: 4px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ── 13. Guided Tooltips ── */
.tooltip-highlight {
  position: relative;
}
.tooltip-highlight::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
  z-index: 100;
}
.tooltip-highlight:hover::after {
  opacity: 1;
}

/* ── 14. Offline Banner Upgrade ── */
.offline-banner {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Skip to Content (Accessibility) ── */
.skip-to-content {
  position: fixed;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 100000;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-to-content:focus { top: 0; }

/* ── Print Styles ── */
@media print {
  header, footer, .mobile-tab-bar, .toast-container, .gradient-mesh,
  .global-back-btn, #scroll-progress, .btn, .nav-bar, .breadcrumb,
  .user-bar, body::after { display: none !important; }
  body { background: #fff !important; color: #000 !important; padding: 0 !important; font-size: 12pt; }
  body::before, body::after { display: none !important; }
  .card, .hub-card, .service-times-card, .pastor-card {
    background: #fff !important;
    backdrop-filter: none !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .church-hero {
    background: #f0f0f0 !important;
    color: #000 !important;
    min-height: auto !important;
    padding: 1rem !important;
  }
  .church-hero-name { font-size: 1.5rem; color: #000 !important; -webkit-text-fill-color: #000 !important; }
  .page-title { font-size: 1.3rem; }
  main { padding: 0 !important; }
  a { color: #000 !important; text-decoration: underline; }
  .hub-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .cmd-palette { max-width: calc(100% - 2rem); border-radius: var(--radius-lg); }
  .cmd-palette-results { max-height: 50vh; }
  .cmd-palette-overlay { padding-top: 10vh; }
  .shortcuts-grid { grid-template-columns: 1fr; }
}


/* ==========================================================
   USABILITY UPGRADE PACK
   ========================================================== */

/* ── 1. Quick Actions FAB ── */
.fab-container {
  position: fixed;
  bottom: 90px;
  right: 1.5rem;
  z-index: 9998;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.5rem;
}
.fab-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(79,70,229,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  position: relative;
}
.fab-btn:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 6px 28px rgba(79,70,229,0.45);
}
.fab-btn.open { transform: rotate(45deg); }
.fab-menu {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
}
.fab-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.fab-action {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem 0.5rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
}
.fab-action:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateX(-4px);
}
.fab-action-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.fab-action:hover .fab-action-icon {
  background: rgba(255,255,255,0.2);
}
@media (max-width: 768px) {
  .fab-container { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); right: 1rem; }
  .fab-btn { width: 48px; height: 48px; font-size: 1.3rem; }
}

/* ── 2. Activity Feed ── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
  animation: fadeIn 0.3s ease both;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 0.875rem; color: var(--text); line-height: 1.4; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── 3. Favorites Bar ── */
.favorites-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}
.favorites-bar::-webkit-scrollbar { display: none; }
.fav-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.fav-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.fav-chip-remove {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  line-height: 1;
}
.fav-chip-remove:hover { color: var(--color-red); }

/* ── 4. Undo Toast ── */
.toast.undo {
  background: rgba(30,41,59,0.95);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast.undo .undo-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.toast.undo .undo-btn:hover { background: rgba(255,255,255,0.25); }

/* ── 5. Auto-save Indicator ── */
.autosave-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  transition: all 0.3s;
}
.autosave-indicator.saving { color: var(--accent); }
.autosave-indicator.saved { color: #10b981; }

/* ── 9. Notification Dropdown ── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  overflow: hidden;
  animation: slideDown 0.2s ease;
  z-index: 200;
  backdrop-filter: blur(16px);
}
.notif-dropdown-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-dropdown-list {
  max-height: 320px;
  overflow-y: auto;
}
.notif-dropdown-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s;
  align-items: flex-start;
}
.notif-dropdown-item:hover { background: var(--bg-subtle); }
.notif-dropdown-item.unread { background: rgba(79,70,229,0.03); }
@media (max-width: 480px) {
  .notif-dropdown { width: calc(100vw - 2rem); right: -60px; }
}

/* ── 11. Announcement Banner ── */
.announcement-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}
.announcement-banner-close {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 1rem;
}
.announcement-banner-close:hover { color: #fff; }

/* ── 13. Name-based Avatar Colors ── */
.avatar-colored {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}


/* ==========================================================
   GET CONNECTED PAGE
   ========================================================== */

.connect-page { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

/* Interest Quiz */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.interest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
  text-align: center;
  background: var(--bg-card);
  user-select: none;
}
.interest-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.interest-card.selected {
  border-color: var(--primary);
  background: rgba(79,70,229,0.06);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.interest-card-icon { font-size: 2rem; }
.interest-card-label { font-weight: 700; font-size: 0.85rem; }

/* Connection Steps */
.connect-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}
.connect-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
}
.connect-step.active { color: var(--primary); }
.connect-step.done { color: #10b981; }
.connect-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
}
.connect-step.active .connect-step-num { background: var(--primary); color: #fff; }
.connect-step.done .connect-step-num { background: #10b981; color: #fff; }
.connect-step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}
.connect-step.done + .connect-step-line { background: #10b981; }

/* Match Cards */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s ease;
}
.match-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.match-card-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.match-card-body { padding: 0 1.25rem 1.25rem; }
.match-score {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}
.match-score.high { background: rgba(16,185,129,0.1); color: #10b981; }
.match-score.medium { background: rgba(245,158,11,0.1); color: #f59e0b; }
.match-score.low { background: rgba(148,163,184,0.1); color: #94a3b8; }

@media (max-width: 480px) {
  .interest-grid { grid-template-columns: repeat(2, 1fr); }
  .connect-steps { flex-wrap: wrap; gap: 0.25rem; }
  .connect-step { padding: 0.4rem 0.75rem; font-size: 0.75rem; }
  .connect-step-line { width: 20px; }
}


/* ==========================================================
   ROLE-BASED FEATURES
   ========================================================== */

/* ── Plan Your Visit ── */
.visit-timeline { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 2rem; }
.visit-timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.visit-step { position: relative; padding: 1rem 0; }
.visit-step-dot { position: absolute; left: -2rem; top: 1.15rem; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }

/* ── Personal Dashboard ── */
.my-dashboard { max-width: 1000px; margin: 0 auto; }
.my-dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.my-dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; backdrop-filter: blur(12px); }
.my-dash-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin: 0 0 1rem; }

/* ── Leader Dashboard ── */
.leader-stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }

/* ── People Manager ── */
.people-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.people-table th { text-align: left; padding: 0.65rem 1rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
.people-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border-light); }
.people-table tr:hover { background: var(--bg-subtle); }

/* ── Activity Log ── */
.audit-item { display: flex; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; }
.audit-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; }

/* ── FAQ ── */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; overflow: hidden; }
.faq-question { padding: 1rem 1.25rem; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.15s; }
.faq-question:hover { background: var(--bg-subtle); }
.faq-answer { padding: 0 1.25rem 1rem; color: var(--text-light); font-size: 0.9rem; line-height: 1.6; display: none; }
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform 0.2s; font-size: 0.8rem; }

/* ── Prayer Journal ── */
.journal-entry { padding: 1rem; border-bottom: 1px solid var(--border-light); }
.journal-entry:last-child { border-bottom: none; }
.journal-date { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

/* ── Role Badge Colors ── */
.role-admin { background: rgba(239,68,68,0.1); color: #ef4444; }
.role-pastor { background: rgba(79,70,229,0.1); color: #4f46e5; }
.role-staff { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.role-leader { background: rgba(245,158,11,0.1); color: #f59e0b; }
.role-member { background: rgba(16,185,129,0.1); color: #10b981; }

/* ── Contact Form ── */
.contact-form { max-width: 480px; margin: 0 auto; }

@media (max-width: 768px) {
  .my-dash-grid { grid-template-columns: 1fr; }
  .leader-stat-row { grid-template-columns: repeat(2, 1fr); }
  .people-table { display: block; overflow-x: auto; }
}
@media (max-width: 480px) {
  .visit-timeline { padding-left: 1.5rem; }
  .visit-step-dot { left: -1.5rem; width: 18px; height: 18px; font-size: 0.6rem; }
}


/* ==========================================================
   SUBTLE FUTURISTIC TOUCHES
   ========================================================== */

/* ── 1. Cursor Glow — soft light follows your mouse ── */
#cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}
#cursor-glow.visible { opacity: 1; }
[data-theme="dark"] #cursor-glow {
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
}

/* ── 2. Shimmer Sweep on card hover ── */
.card::after, .hub-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: skewX(-15deg);
  transition: none;
  pointer-events: none;
  z-index: 1;
}
.card:hover::after, .hub-card:hover::after {
  animation: shimmerSweep 0.8s ease forwards;
}
@keyframes shimmerSweep {
  from { left: -100%; }
  to { left: 150%; }
}
[data-theme="dark"] .card::after,
[data-theme="dark"] .hub-card::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

/* ── 3. Aurora behind header ── */
header::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b, #10b981, #0ea5e9, #6366f1);
  background-size: 300% 100%;
  animation: auroraShift 8s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes auroraShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* Remove the old header::after gradient line */
header::after { display: none !important; }

/* ── 4. Gradient text on section headings ── */
.my-dash-card h3,
.service-times-card h3,
.pastor-card h3 {
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 5. Soft breathing glow on hero CTA button ── */
.church-hero-cta {
  animation: ctaBreath 3s ease-in-out infinite;
}
@keyframes ctaBreath {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
  50% { box-shadow: 0 4px 24px rgba(255,255,255,0.25), 0 0 40px rgba(255,255,255,0.08); }
}

/* ── 6. Subtle line accent on focused inputs ── */
.org-gate-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
  border-image-slice: 1;
  border-radius: var(--radius);
}

/* ── 7. Smooth fade on page title gradient ── */
.page-title-gradient {
  background-size: 200% 200%;
  animation: gradientText 4s ease infinite;
}
@keyframes gradientText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Disable on mobile for performance ── */
@media (hover: none) and (pointer: coarse) {
  #cursor-glow { display: none; }
  .card::after, .hub-card::after { display: none; }
  .church-hero-cta { animation: none; }
  .page-title-gradient { animation: none; }
  header::before { animation-duration: 16s; }
}
@media (prefers-reduced-motion: reduce) {
  #cursor-glow { display: none; }
  header::before { animation: none; }
  .church-hero-cta { animation: none; }
  .page-title-gradient { animation: none; }
}


/* ── The Moed Logo ── */
.site-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#home-link:hover .site-logo-img {
  transform: rotate(-8deg) scale(1.05);
}
.site-title-text {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .site-logo-img {
  filter: brightness(0) invert(1);
}
@media (max-width: 480px) {
  .site-logo-img { width: 30px; height: 30px; }
  .site-title-text { font-size: 0.95rem; }
}


/* ==========================================================
   FUTURISTIC HEADER UPGRADE
   ========================================================== */

/* Bigger, taller header */
header {
  padding: 4px 0 !important;
}
.header-inner {
  padding: 12px 24px !important;
  gap: 20px !important;
}

/* Logo wrapper — make the link a flex container with glow */
#home-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
#home-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.04), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
#home-link:hover::before { opacity: 1; }

/* Logo image — bigger and animated */
.site-logo-img {
  width: 52px !important;
  height: 52px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 8px rgba(99,102,241,0.25));
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1) !important;
  position: relative;
  z-index: 1;
}
#home-link:hover .site-logo-img {
  transform: rotate(-12deg) scale(1.1) !important;
  filter: drop-shadow(0 4px 16px rgba(99,102,241,0.45)) drop-shadow(0 0 12px rgba(245,158,11,0.3));
}

/* Text — much bigger, futuristic font treatment */
.site-title-text {
  font-family: var(--font-display) !important;
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
  line-height: 1 !important;
  background: linear-gradient(135deg, #1e293b 0%, #6366f1 50%, #8b5cf6 100%) !important;
  background-size: 200% 200%;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  position: relative;
  display: inline-block;
  animation: titleGradientShift 6s ease-in-out infinite;
}
@keyframes titleGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Subtitle/tagline below the title */
#home-link::after {
  content: 'The Place Where The Church Meets';
  position: absolute;
  bottom: -2px;
  left: 80px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  white-space: nowrap;
  font-family: var(--font-sans);
  pointer-events: none;
}

/* Wrap title in a column for better layout */
.site-title-text {
  display: flex;
  flex-direction: column;
}

/* Tech accent line beside logo */
#home-link .site-title-text::before {
  content: '';
  display: none;
}

/* Decorative tech corner brackets */
#home-link {
  position: relative;
}

/* Add scanning line effect to the logo */
.site-logo-img {
  position: relative;
}

/* Header gets a more pronounced glassmorphism */
header {
  background: rgba(255,255,255,0.6) !important;
  backdrop-filter: blur(28px) saturate(220%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(220%) !important;
  border-bottom: 1px solid rgba(99,102,241,0.12) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 8px 32px -16px rgba(99,102,241,0.1);
}
[data-theme="dark"] header {
  background: rgba(12,15,26,0.7) !important;
  border-bottom-color: rgba(99,102,241,0.18) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px -16px rgba(0,0,0,0.4);
}

/* Bigger, modern nav links */
.nav-bar {
  gap: 4px !important;
}
.nav-trigger {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  padding: 0.55rem 0.95rem !important;
  border-radius: 10px !important;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1) !important;
  position: relative !important;
}
.nav-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: -1;
}
.nav-trigger:hover {
  color: var(--primary) !important;
  transform: translateY(-1px);
}
.nav-trigger:hover::before { opacity: 1; }

/* Active route indicator */
.nav-trigger.active {
  color: var(--primary) !important;
}
.nav-trigger.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

/* Header utility buttons — modernize */
.header-util-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  background: rgba(99,102,241,0.06) !important;
  border: 1px solid rgba(99,102,241,0.1) !important;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.header-util-btn:hover {
  background: rgba(99,102,241,0.12) !important;
  border-color: rgba(99,102,241,0.25) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.2);
}
.header-util-btn svg { width: 17px !important; height: 17px !important; }

[data-theme="dark"] .header-util-btn {
  background: rgba(99,102,241,0.1) !important;
  border-color: rgba(99,102,241,0.18) !important;
}

/* Search bar — futuristic input */
.search-bar {
  background: rgba(99,102,241,0.05) !important;
  border: 1px solid rgba(99,102,241,0.12) !important;
  border-radius: 10px !important;
  padding: 4px 8px !important;
  transition: all 0.3s ease !important;
}
.search-bar:focus-within {
  background: rgba(99,102,241,0.08) !important;
  border-color: rgba(99,102,241,0.3) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1), 0 0 16px rgba(99,102,241,0.15);
}
.search-bar input {
  font-size: 0.85rem !important;
  font-family: var(--font-sans) !important;
}

/* Mobile header tweaks */
@media (max-width: 768px) {
  .header-inner { padding: 8px 14px !important; gap: 8px !important; }
  .site-logo-img { width: 42px !important; height: 42px !important; }
  .site-title-text { font-size: 1.15rem !important; }
  #home-link::after { display: none; }
  #home-link { padding: 4px 6px; gap: 0.5rem !important; }
}
@media (max-width: 480px) {
  .site-logo-img { width: 36px !important; height: 36px !important; }
  .site-title-text { font-size: 1rem !important; }
}


/* ==========================================================
   HEADER WITH LOGO BACKGROUND PATTERN
   ========================================================== */

/* Layered background: gradient mesh + logo watermark */
header {
  position: sticky;
  top: 0;
  overflow: hidden;
}

/* Hide the header logo overlay — moved to body */
header > .header-bg-logo { display: none; }

/* The actual full Moed logo as page background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('assets/moed-logo.png');
  background-size: min(90vw, 1200px) auto;
  background-repeat: no-repeat;
  background-position: center center;
  opacity: 0.18;
  pointer-events: none;
  z-index: -1;
}
[data-theme="dark"] body::before {
  opacity: 0.2;
  filter: brightness(0) invert(1);
}
@media (max-width: 768px) {
  body::before { background-size: 95vw auto; opacity: 0.15; }
}

/* Gradient mesh inside the header itself */
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(99,102,241,0.12) 0%, transparent 35%),
    radial-gradient(circle at 70% 30%, rgba(245,158,11,0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139,92,246,0.1) 0%, transparent 35%);
  pointer-events: none;
  z-index: 0;
  animation: headerMeshShift 15s ease-in-out infinite;
}
@keyframes headerMeshShift {
  0%, 100% { background-position: 0% 0%, 0% 0%, 0% 0%; }
  50% { background-position: 5% 5%, -3% 2%, 2% -3%; }
}

/* Make header content sit above background layers */
.header-inner { position: relative; z-index: 2; }

/* Aurora line at the bottom of header */
header > .header-aurora {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #ec4899, #f59e0b, #10b981, #6366f1, transparent);
  background-size: 200% 100%;
  animation: auroraSlide 6s linear infinite;
  z-index: 3;
  opacity: 0.8;
}
@keyframes auroraSlide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Floating particles inside header */
.header-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(99,102,241,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: headerParticleDrift linear infinite;
  box-shadow: 0 0 6px rgba(99,102,241,0.6);
}
@keyframes headerParticleDrift {
  0% { transform: translateX(0) translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(60px) translateY(-15px); opacity: 0; }
}

/* Logo gets a soft glow ring behind it */
#home-link {
  position: relative;
}
#home-link .site-logo-img {
  position: relative;
  z-index: 2;
}
#home-link::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: logoGlow 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes logoGlow {
  0%, 100% { opacity: 0.6; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.15); }
}

/* Override the old subtitle ::after */
#home-link::after {
  content: '';
}

/* Tagline as separate element */
.site-tagline {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.65;
  font-family: var(--font-sans);
}

/* Wrap title and tagline */
.site-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  position: relative;
  z-index: 2;
}

[data-theme="dark"] header > .header-bg-logo { opacity: 0.15; filter: brightness(0) invert(1); }
[data-theme="dark"] header::before {
  background:
    radial-gradient(circle at 15% 50%, rgba(99,102,241,0.18) 0%, transparent 35%),
    radial-gradient(circle at 70% 30%, rgba(245,158,11,0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139,92,246,0.15) 0%, transparent 35%);
}

@media (max-width: 768px) {
  header > .header-bg-logo { background-size: 50px 50px; opacity: 0.1; }
  .site-tagline { display: none; }
}
@media (max-width: 480px) {
  header > .header-bg-logo { background-size: 42px 42px; opacity: 0.08; }
}
@media (prefers-reduced-motion: reduce) {
  header > .header-bg-logo, header::before, .header-aurora { animation: none !important; }
  #home-link::after { animation: none !important; }
}


/* ==========================================================
   PRO FEATURES STYLES
   ========================================================== */

/* Reading Streak */
.streak-card {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}
.streak-flame { font-size: 3rem; }
.streak-days { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; }
.streak-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 1rem; }
.streak-day { aspect-ratio: 1; border-radius: 4px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; }
.streak-day.read { background: rgba(255,255,255,0.95); color: #ef4444; }

/* Cross-References */
.crossref-list { display: flex; flex-direction: column; gap: 0.5rem; }
.crossref-item { padding: 0.85rem 1rem; background: var(--bg-subtle); border-left: 3px solid var(--primary); border-radius: var(--radius); cursor: pointer; transition: all 0.15s; }
.crossref-item:hover { background: rgba(99,102,241,0.08); transform: translateX(4px); }
.crossref-ref { font-weight: 700; color: var(--primary); font-size: 0.85rem; }
.crossref-text { font-size: 0.85rem; color: var(--text-light); margin-top: 0.25rem; line-height: 1.5; }

/* Sermon Live Reactions */
.live-reactions-bar { position: fixed; bottom: 100px; right: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9990; }
.reaction-btn { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border: 1px solid var(--border); font-size: 1.5rem; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.1); transition: all 0.2s; }
.reaction-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(99,102,241,0.3); }
.reaction-burst { position: fixed; pointer-events: none; font-size: 2rem; animation: reactionFloat 2s ease-out forwards; z-index: 9999; }
@keyframes reactionFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-200px) scale(2); }
}

/* Anonymous Prayer Wall */
.prayer-wall-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1rem; transition: all 0.2s; }
.prayer-wall-card:hover { border-color: var(--primary-light); }
.prayer-anon-tag { display: inline-block; padding: 2px 8px; background: rgba(139,92,246,0.1); color: #8b5cf6; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 700; }
.prayer-encourage-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.85rem; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-pill); cursor: pointer; font-size: 0.78rem; font-weight: 600; transition: all 0.15s; }
.prayer-encourage-btn:hover { background: rgba(236,72,153,0.1); border-color: rgba(236,72,153,0.3); color: #ec4899; }

/* QR Code */
.qr-container { display: inline-block; padding: 1rem; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); }

/* Voice Bible Player */
.voice-player { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.voice-play-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; font-size: 1.2rem; flex-shrink: 0; transition: all 0.2s; }
.voice-play-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

/* Member Care Alert */
.care-alert { display: flex; gap: 0.85rem; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid #f59e0b; border-radius: var(--radius); margin-bottom: 0.75rem; }
.care-alert.urgent { border-left-color: #ef4444; }
.care-alert-icon { font-size: 1.5rem; flex-shrink: 0; }

/* Mentor Match */
.mentor-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; gap: 1rem; align-items: flex-start; }
.mentor-match-score { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 700; background: rgba(16,185,129,0.1); color: #10b981; }

/* Sermon Notes Editor */
.notes-editor { width: 100%; min-height: 200px; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); font-family: var(--font-sans); font-size: 0.9rem; line-height: 1.6; resize: vertical; }
.notes-autosave { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; }
.notes-autosave.saved { color: #10b981; }

/* Family Devotional Tabs */
.fam-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.fam-tab { padding: 0.4rem 0.85rem; border-radius: var(--radius-pill); background: var(--bg-subtle); border: 1px solid var(--border); cursor: pointer; font-size: 0.82rem; font-weight: 600; }
.fam-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }


/* ==========================================================
   NEXT-LEVEL FEATURES STYLES
   ========================================================== */

/* AI Companion */
.ai-chat { display: flex; flex-direction: column; height: 60vh; min-height: 400px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ai-messages { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.ai-msg { display: flex; gap: 0.75rem; max-width: 85%; animation: fadeIn 0.3s ease; }
.ai-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.ai-msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; font-weight: 700; }
.ai-msg.user .ai-msg-avatar { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.ai-msg-bubble { padding: 0.75rem 1rem; background: var(--bg-subtle); border-radius: var(--radius-lg); font-size: 0.9rem; line-height: 1.5; }
.ai-msg.user .ai-msg-bubble { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.ai-input-row { display: flex; gap: 0.5rem; padding: 0.85rem; border-top: 1px solid var(--border); background: var(--bg-subtle); }
.ai-input { flex: 1; padding: 0.65rem 1rem; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-card); font-size: 0.9rem; }
.ai-typing { display: inline-flex; gap: 3px; padding: 0.5rem 1rem; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: aiTyping 1.4s infinite; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiTyping { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* Smart Search */
.smart-search-input { width: 100%; padding: 1rem 1.25rem; font-size: 1.05rem; border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); transition: all 0.25s; }
.smart-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.1); outline: none; }

/* Growth Timeline */
.growth-timeline { position: relative; padding-left: 2rem; }
.growth-timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, #6366f1, #ec4899, #f59e0b, #10b981); }
.growth-event { position: relative; padding: 1rem 0; }
.growth-event::before { content: ''; position: absolute; left: -2rem; top: 1.25rem; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-card); border: 3px solid var(--primary); box-shadow: 0 0 0 4px var(--bg); }

/* Discipleship Path */
.path-step { display: flex; gap: 1rem; padding: 1rem; background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 0.75rem; transition: all 0.25s; }
.path-step.completed { border-color: #10b981; background: rgba(16,185,129,0.04); }
.path-step.current { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.1); }
.path-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.path-step.completed .path-icon { background: #10b981; color: #fff; }
.path-step.current .path-icon { background: var(--primary); color: #fff; }

/* Memory Verse */
.flashcard { perspective: 1000px; height: 280px; cursor: pointer; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform 0.6s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius-lg); padding: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.flashcard-front { background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff; }
.flashcard-back { background: linear-gradient(135deg, #f59e0b, #ec4899); color: #fff; transform: rotateY(180deg); }

/* 3D Globe */
.globe-container { width: 280px; height: 280px; margin: 2rem auto; position: relative; }
.globe { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #4f46e5, #1e1b4b); box-shadow: inset -20px -20px 60px rgba(0,0,0,0.4), 0 0 60px rgba(99,102,241,0.3); position: relative; animation: globeSpin 30s linear infinite; }
.globe::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background:
  radial-gradient(circle at 20% 35%, rgba(255,255,255,0.15) 1%, transparent 4%),
  radial-gradient(circle at 60% 25%, rgba(255,255,255,0.1) 1%, transparent 4%),
  radial-gradient(circle at 70% 60%, rgba(255,255,255,0.15) 1%, transparent 5%),
  radial-gradient(circle at 35% 70%, rgba(255,255,255,0.1) 1%, transparent 4%);
}
.globe-pin { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 12px #f59e0b; }
@keyframes globeSpin { to { transform: rotate(360deg); } }

/* Live Counter */
.live-counter { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.85rem; background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); border-radius: var(--radius-pill); font-size: 0.82rem; font-weight: 700; color: #10b981; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: livePulse 1.5s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

/* Worship Mode */
.worship-mode { position: fixed; inset: 0; background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%); color: #fff; z-index: 99999; display: flex; flex-direction: column; padding: 2rem; }
.worship-lyrics { flex: 1; overflow-y: auto; text-align: center; font-family: var(--font-display); font-size: 2.5rem; line-height: 1.4; font-weight: 700; padding: 4rem 1rem; }
.worship-close { position: absolute; top: 1rem; right: 1rem; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; }

/* Quotables */
.quotable-canvas { display: block; max-width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.15); }

/* Heatmap */
.heat-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); gap: 4px; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #fff; font-weight: 600; }
.heat-label { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem; }

@media (max-width: 768px) {
  .ai-chat { height: 65vh; }
  .ai-msg { max-width: 95%; }
  .worship-lyrics { font-size: 1.6rem; padding: 2rem 0.5rem; }
  .globe-container { width: 220px; height: 220px; }
}

/* ==========================================================
   POLISH FEATURES STYLES
   ========================================================== */

/* 1. Hub accent colors */
[data-hub="study"] { --hub-accent: #6366f1; --hub-accent-light: rgba(99,102,241,0.08); }
[data-hub="community"] { --hub-accent: #10b981; --hub-accent-light: rgba(16,185,129,0.08); }
[data-hub="engage"] { --hub-accent: #f59e0b; --hub-accent-light: rgba(245,158,11,0.08); }
[data-hub="church-life"] { --hub-accent: #ec4899; --hub-accent-light: rgba(236,72,153,0.08); }
[data-hub="staff"] { --hub-accent: #8b5cf6; --hub-accent-light: rgba(139,92,246,0.08); }
[data-hub] .page-title-gradient {
  background: linear-gradient(135deg, var(--hub-accent), var(--accent)) !important;
  -webkit-background-clip: text;
  background-clip: text;
}
[data-hub] .hub-card:hover { border-color: var(--hub-accent) !important; }

/* 2. Animated layout skeletons */
.skeleton-page.hub-skeleton .skeleton-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem; }
.skeleton-card-tall { height: 180px; border-radius: var(--radius-lg); }
.skeleton-line.full { width: 100%; }

/* 3. Smart empty states */
.smart-empty {
  text-align: center;
  padding: 3.5rem 2rem;
  background: linear-gradient(135deg, var(--bg-subtle), var(--bg-card));
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border);
}
.smart-empty-illust {
  font-size: 5rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: emptyFloat 4s ease-in-out infinite;
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

/* 4. Gradient section dividers */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2rem 0;
  border: none;
}
.section-divider-glow {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), var(--primary), transparent);
  background-size: 200% 100%;
  animation: dividerShimmer 4s linear infinite;
}
@keyframes dividerShimmer {
  to { background-position: 200% 0; }
}

/* 5. Parallax card depth */
.parallax-card { will-change: transform; transition: transform 0.1s linear; }

/* 7. Bulk actions bar */
.bulk-action-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 9990;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(16px);
}
.bulk-action-bar.visible { transform: translateX(-50%) translateY(0); }
.bulk-count {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}

/* 8. Filter chips */
.filter-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.filter-chip-remove { background: none; border: none; color: inherit; cursor: pointer; font-weight: 700; padding: 0; }

/* 11. Onboarding tour */
.tour-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99998;
  pointer-events: none;
}
.tour-spotlight {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.7), 0 0 0 4px rgba(99,102,241,0.5);
  pointer-events: none;
  z-index: 99998;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  max-width: 320px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  z-index: 99999;
  pointer-events: auto;
  animation: fadeIn 0.3s ease;
}
.tour-tooltip h3 { font-family: var(--font-display); margin: 0 0 0.5rem; font-size: 1.05rem; }
.tour-tooltip p { color: var(--text-light); font-size: 0.85rem; line-height: 1.5; margin: 0 0 1rem; }
.tour-actions { display: flex; gap: 0.5rem; justify-content: space-between; align-items: center; }
.tour-progress { font-size: 0.72rem; color: var(--text-muted); }

/* 22. Bottom sheet modals (mobile) */
@media (max-width: 768px) {
  .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
  .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 1.5rem 1.5rem 0 0 !important;
    max-height: 90vh !important;
    animation: bottomSheetSlide 0.35s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
  .modal-card::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0.5rem auto 0.75rem;
  }
}
@keyframes bottomSheetSlide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* 23. Long-press context menu */
.context-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  padding: 0.4rem;
  z-index: 99999;
  min-width: 180px;
  animation: fadeIn 0.15s ease;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.1s;
}
.context-menu-item:hover { background: var(--bg-subtle); }
.context-menu-item.danger { color: #ef4444; }
.context-menu-item.danger:hover { background: rgba(239,68,68,0.08); }
.context-menu-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* 24. Swipe to delete */
.swipeable { position: relative; overflow: hidden; }
.swipe-actions {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  display: flex;
  align-items: center;
  background: #ef4444;
  color: #fff;
  padding: 0 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  transform: translateX(100%);
  transition: transform 0.25s;
}
.swipeable.swiped .swipe-actions { transform: translateX(0); }
.swipeable.swiped .swipe-content { transform: translateX(-100px); }
.swipe-content { transition: transform 0.25s; }

/* 25. Sticky filters */
.sticky-filters {
  position: sticky;
  top: 60px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  z-index: 50;
  margin: -1rem -1rem 1rem;
}
[data-theme="dark"] .sticky-filters { background: rgba(12,15,26,0.85); }

/* 26. Live presence */
.presence-indicator {
  position: relative;
  display: inline-block;
}
.presence-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
}
.presence-dot.away { background: #f59e0b; }
.presence-dot.offline { background: #94a3b8; }
.presence-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; background: var(--bg-subtle); border-radius: var(--radius-pill); font-size: 0.78rem; }

/* 28. Comments */
.comments-list { display: flex; flex-direction: column; gap: 0.75rem; }
.comment-item { display: flex; gap: 0.65rem; }
.comment-bubble { flex: 1; background: var(--bg-subtle); padding: 0.65rem 0.85rem; border-radius: var(--radius-lg); }
.comment-author { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.comment-text { font-size: 0.85rem; color: var(--text-light); margin-top: 0.2rem; line-height: 1.5; }
.comment-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }
.mention { color: var(--primary); font-weight: 700; background: rgba(99,102,241,0.1); padding: 1px 6px; border-radius: 4px; }

/* 31. Trending */
.trending-card {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(236,72,153,0.06));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.trending-rank {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-display);
}

/* Search history dropdown */
.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
}
.search-history-item { padding: 0.5rem 0.85rem; cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.search-history-item:hover { background: var(--bg-subtle); }


/* ==========================================================
   COMPREHENSIVE FEATURES STYLES
   ========================================================== */

/* Receipt / Statement print */
.receipt-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.statement { max-width: 700px; margin: 0 auto; padding: 2rem; background: #fff; color: #000; border: 1px solid #ddd; }
.statement-header { text-align: center; border-bottom: 2px solid #000; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.statement-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.statement-total { display: flex; justify-content: space-between; padding: 1rem 0 0; border-top: 2px solid #000; font-weight: 800; font-size: 1.1rem; margin-top: 1rem; }

/* Resource booking calendar */
.booking-grid { display: grid; grid-template-columns: 100px repeat(7, 1fr); gap: 2px; }
.booking-cell { padding: 0.4rem; border: 1px solid var(--border); min-height: 50px; font-size: 0.7rem; }
.booking-cell.booked { background: rgba(99,102,241,0.15); border-color: var(--primary); cursor: pointer; }
.booking-cell.conflict { background: rgba(239,68,68,0.15); border-color: #ef4444; }
.booking-time { font-weight: 700; background: var(--bg-subtle); }

/* Service planner */
.service-item { display: flex; gap: 0.75rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; }
.service-time { font-family: var(--font-display); font-weight: 800; min-width: 60px; color: var(--primary); }
.service-handle { color: var(--text-muted); cursor: grab; }

/* Email builder */
.email-builder { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; min-height: 500px; }
.email-blocks { background: var(--bg-subtle); border-radius: var(--radius); padding: 0.75rem; }
.email-block-item { padding: 0.6rem 0.85rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; cursor: grab; font-size: 0.85rem; }
.email-canvas { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; min-height: 500px; }

/* Workflow builder */
.workflow-node { padding: 1rem; background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 0.5rem; position: relative; }
.workflow-node.trigger { border-color: #10b981; }
.workflow-node.action { border-color: var(--primary); }
.workflow-arrow { text-align: center; color: var(--text-muted); font-size: 1.5rem; padding: 0.25rem; }

/* Certificate */
.certificate {
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(135deg, #fef3c7, #fff);
  border: 12px double #d97706;
  padding: 4rem 3rem;
  text-align: center;
  font-family: 'Spectral', serif;
}
.cert-title { font-size: 2.5rem; font-weight: 800; color: #92400e; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.cert-recipient { font-size: 2.2rem; font-style: italic; margin: 1.5rem 0; color: #1e293b; }
.cert-detail { font-size: 1.1rem; color: #475569; margin: 0.5rem 0; }
.cert-seal { font-size: 4rem; margin: 1rem 0; }
.cert-signature { display: flex; justify-content: space-around; margin-top: 3rem; }
.cert-sig { border-top: 2px solid #1e293b; padding-top: 0.4rem; min-width: 180px; font-size: 0.85rem; }

/* Photo gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}
.gallery-item {
  aspect-ratio: 1;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Inventory */
.inventory-low { color: #ef4444; font-weight: 700; }
.inventory-ok { color: #10b981; font-weight: 600; }

/* Emergency contacts */
.emergency-card {
  background: linear-gradient(135deg, #fee2e2, #fff);
  border: 2px solid #dc2626;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

/* Public site preview */
.public-site-preview {
  border: 8px solid #1e293b;
  border-radius: 16px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
}

