@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;600;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --mint: #c9dfd4;
  --mint-light: #ddeee6;
  --mint-dark: #a8c9b8;
  --navy: #3d3566;
  --navy-hover: #2e2750;
  --text: #2a2a4a;
  --muted: #7a7a9a;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(61, 53, 102, 0.18);
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --error-border: #fca5a5;
}

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

body {
  font-family: 'Lora', Georgia, serif;
  background: var(--mint);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  /* Watermark flower pattern in background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg fill='white' opacity='0.18'%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(0 75 75)'/%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(51 75 75)'/%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(103 75 75)'/%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(154 75 75)'/%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(206 75 75)'/%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(257 75 75)'/%3E%3Cellipse cx='75' cy='54' rx='8' ry='13' transform='rotate(309 75 75)'/%3E%3Ccircle cx='75' cy='75' r='7'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(0 225 225)'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(51 225 225)'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(103 225 225)'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(154 225 225)'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(206 225 225)'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(257 225 225)'/%3E%3Cellipse cx='225' cy='204' rx='8' ry='13' transform='rotate(309 225 225)'/%3E%3Ccircle cx='225' cy='225' r='7'/%3E%3Cellipse cx='235' cy='42' rx='5' ry='9' transform='rotate(0 235 55)'/%3E%3Cellipse cx='235' cy='42' rx='5' ry='9' transform='rotate(60 235 55)'/%3E%3Cellipse cx='235' cy='42' rx='5' ry='9' transform='rotate(120 235 55)'/%3E%3Cellipse cx='235' cy='42' rx='5' ry='9' transform='rotate(180 235 55)'/%3E%3Cellipse cx='235' cy='42' rx='5' ry='9' transform='rotate(240 235 55)'/%3E%3Cellipse cx='235' cy='42' rx='5' ry='9' transform='rotate(300 235 55)'/%3E%3Ccircle cx='235' cy='55' r='4'/%3E%3Cellipse cx='55' cy='222' rx='5' ry='9' transform='rotate(0 55 235)'/%3E%3Cellipse cx='55' cy='222' rx='5' ry='9' transform='rotate(60 55 235)'/%3E%3Cellipse cx='55' cy='222' rx='5' ry='9' transform='rotate(120 55 235)'/%3E%3Cellipse cx='55' cy='222' rx='5' ry='9' transform='rotate(180 55 235)'/%3E%3Cellipse cx='55' cy='222' rx='5' ry='9' transform='rotate(240 55 235)'/%3E%3Cellipse cx='55' cy='222' rx='5' ry='9' transform='rotate(300 55 235)'/%3E%3Ccircle cx='55' cy='235' r='4'/%3E%3Cellipse cx='150' cy='135' rx='4' ry='8' transform='rotate(0 150 148)'/%3E%3Cellipse cx='150' cy='135' rx='4' ry='8' transform='rotate(60 150 148)'/%3E%3Cellipse cx='150' cy='135' rx='4' ry='8' transform='rotate(120 150 148)'/%3E%3Cellipse cx='150' cy='135' rx='4' ry='8' transform='rotate(180 150 148)'/%3E%3Cellipse cx='150' cy='135' rx='4' ry='8' transform='rotate(240 150 148)'/%3E%3Cellipse cx='150' cy='135' rx='4' ry='8' transform='rotate(300 150 148)'/%3E%3Ccircle cx='150' cy='148' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.6);
}

.nav-brand {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

/* ── Hamburger ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger--open span:nth-child(2) { opacity: 0; }
.nav-hamburger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Person icon ── */
.nav-account-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  opacity: 0.65;
  padding: 0.3rem;
  border-radius: 50%;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}
.nav-account-icon:hover { opacity: 1; background: rgba(61,53,102,0.08); }
.nav-account-icon--active { opacity: 1; background: rgba(61,53,102,0.12); }
.nav-account-mobile { display: none; }

.nav-dropdown {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Nav menu ── */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-menu-link {
  text-decoration: none;
  color: var(--navy);
  font-size: 0.92rem;
  font-family: 'Lora', serif;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
  opacity: 0.7;
}

.nav-menu-link:hover {
  background: rgba(61, 53, 102, 0.08);
  opacity: 1;
}

.nav-menu-link.active {
  background: var(--navy);
  color: white;
  opacity: 1;
  font-weight: 600;
}

/* ── Buttons ── */
.btn {
  padding: 0.48rem 1.3rem;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-family: 'Lora', serif;
  text-decoration: none;
  display: inline-block;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.btn-primary {
  background: var(--navy);
  color: white;
  box-shadow: 0 2px 8px rgba(61,53,102,0.22);
}
.btn-primary:hover {
  background: var(--navy-hover);
  box-shadow: 0 4px 14px rgba(61,53,102,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-ghost:hover { background: rgba(61,53,102,0.07); }

.btn-full { width: 100%; text-align: center; padding: 0.72rem; }

/* ── Auth pages ── */
body.auth-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-cover {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-cover .title-script {
  font-family: 'Dancing Script', cursive;
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  display: block;
}

.auth-cover .subtitle {
  display: inline-block;
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: var(--navy);
  border-top: 1.5px solid var(--navy);
  border-bottom: 1.5px solid var(--navy);
  padding: 0.35rem 1.8rem;
  margin-top: 0.6rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 2.4rem 2.2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(61,53,102,0.1), 0 1px 4px rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}

.auth-card h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 1.4rem;
  font-weight: 600;
}

.auth-switch {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}
.auth-switch a { color: var(--navy); font-style: normal; }

.social-buttons { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1rem; }

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Lora', serif;
  font-size: 0.92rem;
  border-radius: 30px;
  border: 1.5px solid #d1ccd8;
  padding: 0.72rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, box-shadow 0.18s;
}

.btn-google { background: #fff; color: #3c4043; }
.btn-google:hover { background: #f8f8f8; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.btn-apple { background: #000; color: #fff; border-color: #000; }
.btn-apple:hover { background: #1a1a1a; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }

.btn-passkey { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-passkey:hover { background: var(--navy-hover); box-shadow: 0 2px 8px rgba(61,53,102,0.25); }
.btn-passkey:disabled { opacity: 0.6; cursor: default; }

/* ── Account page ── */
.account-main { max-width: 640px; margin: 2.5rem auto; padding: 0 1.2rem; }
.account-title { font-family: 'Dancing Script', cursive; font-size: 2.4rem; color: var(--navy); margin-bottom: 1.4rem; }
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 2px 12px rgba(61,53,102,0.06);
}
.account-card h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 0.4rem; }
.account-hint { font-size: 0.88rem; color: var(--muted); margin-bottom: 1rem; }
.passkey-list { list-style: none; padding: 0; margin: 0; }
.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.passkey-meta { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--text); }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.8rem 0;
  gap: 0.75rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; border-top: 1px solid #e0dae8; }

/* ── Form fields ── */
.field { margin-bottom: 1.15rem; }

.field label {
  display: block;
  font-size: 0.87rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.field-checkbox { margin-bottom: 1rem; }
.field-checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 0.87rem;
  color: var(--muted);
}
.field-checkbox input[type="checkbox"] {
  width: auto;
  padding: 0;
  flex-shrink: 0;
}

.field input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.97rem;
  font-family: 'Lora', serif;
  background: rgba(255,255,255,0.8);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(61,53,102,0.1);
}
.field small { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; display: block; }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  font-size: 0.88rem;
}
.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}
.alert-info {
  background: #eef4fb;
  color: #2a5a8a;
  border: 1px solid #b3d0ed;
}

/* ── Pending approval queue (admin only) ── */
.pending-prayers-section {
  max-width: 560px;
  margin: 0 auto 2rem;
}
.pending-prayers-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #7a5c00;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.pending-prayer-card {
  border: 1.5px dashed #ffe082;
  background: #fffde7;
}
.btn-sm {
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
}

/* ── Flower decoration ── */
.flower-row {
  display: flex;
  justify-content: center;
  margin-top: 1.8rem;
  opacity: 0.75;
}

.flower-row svg { width: 260px; height: auto; }

/* ── Home / dashboard ── */
.page-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 62px);
  padding: 3rem 1.5rem;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 2.8rem 2.4rem;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(61,53,102,0.1);
  backdrop-filter: blur(8px);
  text-align: center;
}

.dashboard-card .title-script {
  font-family: 'Dancing Script', cursive;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
}

.scripture-block {
  margin: 1.8rem auto;
  max-width: 380px;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.75;
}

.scripture-block cite {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.divider {
  width: 60px;
  height: 1.5px;
  background: var(--navy);
  margin: 1.4rem auto;
  opacity: 0.4;
}

.dashboard-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Home page ── */
.home-main {
  padding: 2.5rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.home-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.home-title {
  font-family: 'Dancing Script', cursive;
  font-size: 3rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.home-welcome {
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* ── Streak bar ── */
.streak-bar {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.3rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-family: 'Lora', serif;
}

.streak-flame { font-size: 1.1rem; }

.streak-done {
  background: #fef9e7;
  border: 1.5px solid #f5d060;
  color: #7a5a00;
}

.streak-pending {
  background: rgba(255,255,255,0.6);
  border: 1.5px solid var(--border);
  color: var(--muted);
}

.streak-count { font-weight: 600; color: var(--navy); }

.streak-sm { font-size: 0.82rem; padding: 0.45rem 1rem; margin-top: 1.2rem; }

/* ── Weekly calendar strip ── */
.week-calendar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.week-day-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.week-day-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.week-day-num {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.week-day-done .week-day-dot {
  background: #d4edda;
  border-color: #6aab7e;
}

.week-day-done .week-day-num {
  color: #2e7d46;
}

.week-day-today .week-day-dot {
  border-color: var(--navy);
  border-width: 2px;
}

.week-day-today .week-day-num {
  color: var(--navy);
}

.week-day-today.week-day-done .week-day-dot {
  background: #6aab7e;
  border-color: #6aab7e;
}

.week-day-today.week-day-done .week-day-num {
  color: white;
}

/* ── Placeholder pages ── */
.placeholder-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4rem 1.5rem;
}

.placeholder-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 3rem 2.4rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(61,53,102,0.1);
  backdrop-filter: blur(8px);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.placeholder-card h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.placeholder-card p {
  color: var(--muted);
  font-style: italic;
  font-size: 0.97rem;
}

/* ── History page / Month calendar ── */
.history-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.history-header h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: var(--navy);
  margin: 0;
}

.streak-badge-sm {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
}

.month-calendar-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 4px 24px rgba(61,53,102,0.1);
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.month-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
}

.month-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border, #ddd);
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.month-nav-btn:hover {
  background: #f0eef8;
}

.month-nav-btn--disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.month-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 0.4rem;
}

.month-grid-header span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.month-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
}

.month-cell--empty {
  background: transparent;
}

.month-cell-num {
  font-size: 0.82rem;
  color: var(--muted);
}

.month-cell--done .month-cell-num {
  color: #2e7d46;
  font-weight: 600;
}

.month-cell--done {
  background: #d4edda;
  border: 1px solid #6aab7e;
}

.month-cell--today {
  border: 2px solid var(--navy);
}

.month-cell--today .month-cell-num {
  color: var(--navy);
  font-weight: 700;
}

.month-cell--today.month-cell--done {
  background: #6aab7e;
  border-color: #6aab7e;
}

.month-cell--today.month-cell--done .month-cell-num {
  color: white;
}

.month-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  justify-content: center;
}

.legend-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-left: 0.75rem;
}

.legend-dot--done {
  background: #d4edda;
  border: 1px solid #6aab7e;
}

.legend-dot--empty {
  background: transparent;
  border: 1px solid #ccc;
}

/* ── Topics grid ── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
}

.topic-card {
  border-radius: 14px;
  text-decoration: none;
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 14px rgba(0,0,0,0.18);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  height: 210px;
  background-size: cover;
  background-position: center;
}

.topic-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.42) 50%, rgba(0,0,0,0.72) 100%);
  transition: background 0.18s;
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

.topic-card:hover::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.48) 45%, rgba(0,0,0,0.8) 100%);
}

.topic-card-content {
  position: relative;
  z-index: 1;
  padding: 1rem 1.2rem 1.1rem;
}

.topic-name {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}

.topic-desc {
  font-size: 0.79rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.45;
  margin-top: 0.3rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Topic photo backgrounds (home cards + topic headers) ── */
.topic-photo-1 { background-image: url('/images/topics/praising_god.png'); background-position: center center; }
.topic-photo-2 { background-image: url('/images/topics/praying_scripture.png'); background-position: center center; }
.topic-photo-3 { background-image: url('/images/topics/praying_family.png'); background-position: center center; }
.topic-photo-4 { background-image: url('/images/topics/praying_me.png'); background-position: center center; }
.topic-photo-5 { background-image: url('/images/topics/praying_missionaries.png'); background-position: center center; }
.topic-photo-6 { background-image: url('/images/topics/unsaved.png'); background-position: center center; }
.topic-photo-7 { background-image: url('/images/topics/your_church.png'); background-position: center center; }
.topic-photo-8 { background-image: url('/images/topics/praying_neighbors.png'); background-position: center center; }
.topic-photo-9 { background-image: url('/images/topics/others_in_ministry.png'); background-position: center center; }
.topic-photo-10 { background-image: url('/images/topics/praying_friends.png'); background-position: center center; }
.topic-photo-11 { background-image: url('/images/topics/answers_to_prayer.png'); background-position: center top; }

.home-footer-verse {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.home-footer-verse cite {
  display: block;
  margin-top: 0.4rem;
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.88rem;
}

.app-attribution {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted, #999);
  padding: 1.25rem 1rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.app-attribution a {
  color: var(--text-muted, #999);
  text-decoration: underline;
}
.app-attribution a:hover {
  color: var(--navy);
}

/* ── Topic layout (sidebar + main) ── */
.topic-layout {
  display: flex;
  min-height: calc(100vh - 62px);
}

.topic-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(6px);
  border-right: 1px solid rgba(255,255,255,0.6);
  padding: 1.8rem 1rem 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  align-items: stretch;
}

.sidebar-link {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--text);
  transition: background 0.14s;
  line-height: 1.4;
}

.sidebar-link:hover { background: rgba(61,53,102,0.07); }
.sidebar-link.active {
  background: var(--navy);
  color: white;
  font-weight: 600;
}

.sidebar-streak { margin-top: 1.5rem; }

/* ── Topic main content ── */
.topic-main {
  flex: 1;
  padding: 2.2rem 2.4rem 4rem;
  max-width: 740px;
}

.topic-header {
  border-radius: 14px;
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.2);
}

.topic-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.62) 100%);
}

.topic-header-content {
  position: relative;
  z-index: 1;
  padding: 1.4rem 1.8rem;
}

.topic-title {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  font-weight: 700;
  color: white;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.topic-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.88);
  font-style: italic;
  margin-top: 0.25rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

/* ── Prayer cards ── */
.prayers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.prayer-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(61,53,102,0.07);
  backdrop-filter: blur(6px);
}

.prayer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.14s;
}

.prayer-card-header:hover { background: rgba(61,53,102,0.04); }

.prayer-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}

.prayer-title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}

.prayer-ref {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  background: rgba(61,53,102,0.07);
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.prayer-card-title-row--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.prayer-definition-sub {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  background: rgba(61,53,102,0.07);
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  display: inline-block;
}

.prayer-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-edit-prayer {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.14s, background 0.14s;
}
.btn-edit-prayer:hover { color: var(--navy); background: rgba(61,53,102,0.08); }

.btn-delete-prayer {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.14s, background 0.14s;
}
.btn-delete-prayer:hover { color: #b91c1c; background: rgba(185,28,28,0.07); }

.prayer-toggle-icon {
  font-size: 1.3rem;
  color: var(--navy);
  opacity: 0.5;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.prayer-body {
  display: none;
  padding: 0 1.4rem 1.4rem;
  border-top: 1px solid var(--border);
}

/* ── Scripture expansion ── */
.scripture-expand {
  padding: 1.1rem 0 0.75rem;
}

.scripture-expand--extra {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.scripture-extra-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.add-scripture-row {
  padding: 0.5rem 0 0.25rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.5rem;
}

.scripture-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.scripture-quote {
  font-style: italic;
  color: var(--text);
  line-height: 1.75;
  font-size: 1rem;
  border-left: 3px solid var(--mint-dark);
  padding-left: 1rem;
  margin: 0;
}

.scripture-cite {
  display: block;
  margin-top: 0.4rem;
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.88rem;
  padding-left: 1rem;
}

/* ── Prayer text ── */
.prayer-text-block {
  margin-top: 1.1rem;
  padding: 1rem 1.1rem;
  background: rgba(201,223,212,0.25);
  border-radius: 8px;
}

.prayer-text {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--text);
}

/* ── Notes ── */
.notes-section {
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.btn-add-note {
  background: none;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.82rem;
  font-family: 'Lora', serif;
  cursor: pointer;
  transition: background 0.14s;
}
.btn-add-note:hover { background: rgba(61,53,102,0.07); }

.note-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: 'Lora', serif;
  background: rgba(255,255,255,0.8);
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.6;
}
.note-textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(61,53,102,0.1); }

.note-form { margin-bottom: 0.85rem; }

.note-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-sm { padding: 0.3rem 0.9rem; font-size: 0.85rem; }

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.note-item {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.note-content {
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
}

.note-date {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
}

.btn-delete-note {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: color 0.14s;
}
.btn-delete-note:hover { color: #b91c1c; }

.notes-empty {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.topic-nav-row {
  margin-top: 2rem;
}

/* ── Share to Public button ── */
.share-public-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-share-public {
  background: none;
  border: 1.5px solid var(--mint-dark);
  color: var(--navy);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.82rem;
  font-family: 'Lora', serif;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  opacity: 0.8;
}
.btn-share-public:hover {
  background: rgba(168,201,184,0.2);
  border-color: var(--navy);
  opacity: 1;
}

/* ── Public Prayer page ── */
.public-prayer-main {
  padding: 2.5rem 1.5rem 4rem;
  max-width: 760px;
  margin: 0 auto;
}

.public-prayer-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.public-prayer-empty {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 2rem;
}

.public-prayers-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.public-prayer-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(61,53,102,0.07);
  backdrop-filter: blur(6px);
}

.public-prayer-card-header {
  margin-bottom: 0.9rem;
}

.public-prayer-title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.public-prayer-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.public-prayer-author {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.public-prayer-date {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.8;
}

.public-prayer-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  padding: 1rem 1.1rem;
  background: rgba(201,223,212,0.22);
  border-radius: 8px;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.public-prayer-admin-row {
  margin-bottom: 0.75rem;
}

.btn-admin-remove {
  background: none;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  font-family: 'Lora', serif;
  cursor: pointer;
  transition: background 0.14s;
}
.btn-admin-remove:hover { background: #fef2f2; }

/* ── Public reactions ── */
.public-reactions-section {
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  margin-top: 0.5rem;
}

.btn-reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.7);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-family: 'Lora', serif;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-reaction:hover {
  background: rgba(61,53,102,0.07);
  border-color: var(--navy);
}
.btn-reaction--active {
  background: rgba(61,53,102,0.1);
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}

.reaction-count {
  font-size: 0.8rem;
  color: var(--muted, #888);
  font-weight: 400;
  padding-left: 0.25rem;
  border-left: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .topic-layout { flex-direction: column; }
  .topic-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(61,53,102,0.12);
    padding: 0.6rem 1rem;
  }
  .sidebar-label { display: none; }
  .sidebar-streak { display: none; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-link {
    font-size: 0.8rem;
    white-space: nowrap;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(61,53,102,0.18);
    flex-shrink: 0;
  }
  .topic-main { padding: 1.4rem 1rem 3rem; }
  .topics-grid { grid-template-columns: 1fr 1fr; }
  .topic-card { height: 170px; }
  .topic-desc { display: none; }
  .home-main { padding: 1.5rem 1rem 3rem; }
  .nav-menu { display: none; }
  .week-calendar { gap: 0.35rem; }
  .week-day-dot { width: 32px; height: 32px; }
  .week-day-num { font-size: 0.78rem; }

  nav {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .nav-hamburger { display: flex; }
  .nav-account-mobile { display: flex; }
  .nav-dropdown {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    border-top: 1px solid rgba(61,53,102,0.12);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }
  .nav-dropdown--open { display: flex; }
  .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(61,53,102,0.08);
    margin-bottom: 0.5rem;
  }
  .nav-menu-link { border-radius: 8px; padding: 0.55rem 0.9rem; opacity: 0.85; }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
  }
  .nav-links .btn, .nav-links form { width: 100%; text-align: center; }
  .nav-links form .btn { width: 100%; }

  .church-section { margin-bottom: 1rem; }
  .church-section-empty { padding: 0.25rem 0 0.25rem 0.25rem; }

  .ministry-name-sub { display: block; font-size: 0.85rem; font-weight: 400; }
  .ministry-name-sub .ministry-name-sep { display: none; }

  .event-date-sub { display: block; font-size: 0.85rem; font-weight: 400; color: var(--text-muted, #888); }
  .event-date-sub .ministry-name-sep { display: none; }
}

/* ── New Request Button Row ── */
.new-request-row {
  margin: 1.5rem 0 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* ── Church Sections ── */
.church-section {
  margin-bottom: 2rem;
}

.church-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #f0f7f4;
  border-left: 4px solid #4a9e7f;
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.75rem;
}

.church-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2d6a50;
  margin: 0;
}

.church-section-empty {
  color: #999;
  font-style: italic;
  font-size: 0.9rem;
  padding: 0.5rem 0 0.5rem 0.25rem;
}

/* ── Dialog ── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dialog-box {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.4rem;
  color: #2d2d2d;
}

.dialog-field {
  margin-bottom: 1.1rem;
}

.dialog-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.35rem;
}

.dialog-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 7px;
  font-size: 0.97rem;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.dialog-input:focus {
  border-color: #7a5af8;
}

.dialog-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Account page ── */
.account-main {
  max-width: 520px;
  margin: 2.5rem auto;
  padding: 0 1.25rem 4rem;
}

.account-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.account-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(61,53,102,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

.account-title { font-size: 2rem; margin: 0; }

.account-alert {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  text-align: center;
}
.account-alert--success { background: #d4edda; color: #1a6130; }
.account-alert--error   { background: #fde8e8; color: #922; }

.account-card {
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(61,53,102,0.07);
}
.account-card--danger { background: rgba(255,255,255,0.5); }

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.account-card-label {
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.account-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--navy);
  font-family: 'Lora', serif;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.account-edit-btn:hover { opacity: 1; background: rgba(61,53,102,0.08); }

.account-value {
  font-size: 1rem;
  color: var(--navy);
  word-break: break-all;
}

.account-form { margin-top: 0.75rem; }

.account-input-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  margin-top: 0.75rem;
}
.account-input-label:first-child { margin-top: 0; }

.account-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid rgba(61,53,102,0.2);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Lora', serif;
  background: white;
  color: var(--navy);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.account-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(61,53,102,0.1);
}

.account-form-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* ── Family Members ── */
.family-members-section {
  padding: 1.5rem 0 0.5rem;
}

.ministry-section {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.ministry-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  background: var(--surface-alt, #f7f7f7);
  border-bottom: 1px solid var(--border);
}

.ministry-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.ministry-section .prayers-list {
  padding: 0.5rem 1rem;
}

.ministry-need-card {
  border-bottom: 1px solid var(--border);
}
.ministry-need-card:last-child {
  border-bottom: none;
}
.ministry-need-header {
  padding: 0.85rem 1.25rem 0.5rem;
}
.ministry-need-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ministry-need-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.ministry-need-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.need-todo-list {
  margin: 0.5rem 0 0.25rem;
}
.need-todo-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.need-todo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0.15rem 0;
}
.need-todo-checkbox {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  color: var(--text);
  flex-shrink: 0;
}
.need-todo-checkbox--done {
  color: var(--success, #22c55e);
}
.need-todo-text {
  font-size: 0.9rem;
  color: var(--text);
}
.need-todo-text--done {
  text-decoration: line-through;
  color: var(--text-muted, #888);
}
.need-todo-add-row {
  margin-top: 0.5rem;
}
.need-todo-section {
  border-top: 1px solid var(--border);
  padding: 0.85rem 1.25rem 1rem;
  background: var(--surface-alt, #f7f7f7);
}
.ministry-need-requests {
  padding: 0 0.5rem 0.5rem;
}
.ministry-need-add-row {
  padding: 0.25rem 0.75rem 0.5rem;
}

.ministry-name-inline {
  font-weight: 400;
  color: var(--text-muted, #888);
}

.ministry-name-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #888);
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
}

.ministry-name-edit-btn:hover {
  color: var(--primary, #4a7fa5);
}

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  color: var(--primary, #4a7fa5);
  text-decoration: none;
}

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

.family-sub-member {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
}

.family-sub-member:last-child {
  border-bottom: none;
}

.family-sub-member-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.family-sub-member-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.family-sub-member-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.family-sub-member .prayers-list {
  padding: 0.25rem 0;
}

.family-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.family-empty-text {
  color: var(--muted);
  font-style: italic;
  font-size: 1rem;
}

.family-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  padding: 0.5rem 0;
}

.family-member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  cursor: pointer;
}

.family-member-card:hover {
  box-shadow: 0 4px 16px rgba(61,53,102,0.13);
  transform: translateY(-2px);
  border-color: var(--navy);
}

.family-member-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.family-member-name {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

/* ── Church person list rows ── */
.church-person-row .prayer-card-header {
  cursor: default;
}

.church-person-link {
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.church-person-link:hover .prayer-title {
  color: var(--navy);
}

/* ── Family members list (horizontal rows) ── */
.family-members-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.family-members-list .family-member-card {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
}

.family-members-list .missionary-card-wrapper:last-child .family-member-card {
  border-bottom: none;
}

.family-members-list .family-member-card:hover {
  transform: none;
  box-shadow: none;
  background: var(--surface-hover, #f5f4f9);
}

.family-member-photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
}

.family-member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.family-members-list .family-member-name {
  text-align: left;
  font-size: 0.95rem;
}

.family-member-sub {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-member-arrow {
  color: var(--muted);
  font-size: 1.25rem;
  margin-right: 1.25rem;
}

/* ── Missionary card wrapper (for remove button) ── */
.missionary-card-wrapper {
  position: relative;
}

.missionary-remove-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.15);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
}

.missionary-card-wrapper:hover .missionary-remove-btn {
  opacity: 1;
}

.missionary-remove-btn:hover {
  background: var(--danger, #c0392b);
}

/* ── Family member card wrapper (for remove button) ── */
.family-member-card-wrapper {
  position: relative;
}

.family-member-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.15);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
}

.family-member-card-wrapper:hover .family-member-remove-btn {
  opacity: 1;
}

/* ── Church members compact list ── */
.church-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.church-member-row {
  display: flex;
  align-items: center;
  position: relative;
}

.church-member-row-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--navy);
  transition: background 0.15s;
}

.church-member-row-link:hover {
  background: rgba(61,53,102,0.07);
}

.church-member-row-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.church-member-row-avatar--photo {
  object-fit: cover;
  background: none;
}

.church-member-row-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.church-member-row .family-member-remove-btn {
  position: static;
  opacity: 0;
  margin-left: 0.75rem;
}

.church-member-row:hover .family-member-remove-btn {
  opacity: 1;
}

.church-member-rename-btn {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  font-size: 1rem;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
  margin-left: 0.5rem;
}

.church-member-rename-btn:hover {
  background: rgba(61,53,102,0.1);
}

.church-member-row:hover .church-member-rename-btn {
  opacity: 1;
}

.family-member-remove-btn:hover {
  background: var(--danger, #c0392b);
}

.family-member-avatar--photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Archive section ── */
.family-archive-section {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.family-archive-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
}

.family-archive-toggle:hover {
  color: var(--text);
}

.archive-toggle-arrow {
  font-size: 0.85rem;
}

.family-archive-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.family-archive-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.family-archive-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--muted);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.family-archive-avatar--photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
}

.family-archive-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}

.family-archive-date {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Dialog extras ── */
.dialog-body {
  color: var(--text);
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.dialog-body--muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.btn-danger {
  background: var(--danger, #c0392b);
  color: #fff;
  border: none;
}

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

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}

/* ── Missionary photo ── */
.missionary-photo-block {
  text-align: center;
  margin-bottom: 1rem;
}
.missionary-photo {
  width: 170px;
  height: 170px;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* ── Family member photo upload ── */
.member-photo-upload-btn {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  color: #fff;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.member-photo-upload-btn:hover {
  background: rgba(255,255,255,0.3);
}

.topic-header {
  position: relative;
}

/* Answered prayers */
.prayer-card--answered {
  border-left: 3px solid #5a9e6f;
  opacity: 0.92;
}
.prayer-answered-tag {
  display: inline-block;
  background: #d4edda;
  color: #276745;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  margin-right: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}
.answered-prayer-section {
  padding: 0.75rem 0;
  border-top: 1px solid #e8f5ee;
}
.btn-mark-answered {
  background: none;
  border: 1.5px solid #5a9e6f;
  color: #276745;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35em 0.9em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-mark-answered:hover {
  background: #d4edda;
}
.answered-prayer-record {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.answered-prayer-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.answered-badge {
  display: inline-block;
  background: #d4edda;
  color: #276745;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
}
.answered-date {
  font-size: 0.82rem;
  color: #666;
}
.answer-note-text {
  font-size: 0.92rem;
  color: #444;
  margin: 0;
  line-height: 1.5;
  font-style: italic;
}

/* Answered prayers page */
.answered-prayer-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #5a9e6f;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.answered-prayer-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.answered-prayer-card-title {
  flex: 1;
  min-width: 0;
}
.answered-prayer-card-meta {
  font-size: 0.82rem;
  color: #888;
  margin-top: 0.3rem;
}
.answered-prayer-topic {
  color: #666;
  font-weight: 500;
}
.answered-prayer-card-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* Page container for full-width pages */
.page-container {
  min-height: 100vh;
}
.page-header {
  padding: 2rem 1.5rem 1.5rem;
}
.page-main {
  padding: 2rem 1.5rem;
}
