/* Smooth cross-fade between page navigations (Chrome/Android support this
   natively — older browsers just ignore it and navigate instantly as before). */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: flood-fade-out 0.16s ease both;
}
::view-transition-new(root) {
  animation: flood-fade-in 0.22s ease both;
}
@keyframes flood-fade-out {
  to { opacity: 0; }
}
@keyframes flood-fade-in {
  from { opacity: 0; transform: translateY(6px); }
}

:root {
  --bg: #0a0a0c;
  --surface: #15161a;
  --surface-2: #1c1d22;
  --border: #2a2b30;
  --text: #f5f5f7;
  --text-dim: #9a9ba3;
  --text-faint: #6b6c74;
  --blue: #3b82f6;
  --blue-dim: #1e3a63;
  --gold: #e8b54a;
  --red: #e5484d;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --nav-h: 76px;
  --nav-bg: rgba(10, 10, 12, 0.94);
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: #e3e5ea;
  --text: #14151a;
  --text-dim: #60636c;
  --text-faint: #9598a1;
  --nav-bg: rgba(255, 255, 255, 0.92);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

a { color: inherit; text-decoration: none; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* Top bar — stays fixed at the top while the page scrolls beneath it */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.brand .mark img { width: 60%; height: 60%; object-fit: contain; }

.brand .word {
  line-height: 1.05;
}

.brand .word b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand .word span {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-weight: 600;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
}
/* position lets the bell carry an unread badge */
.icon-btn { position: relative; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

/* Page content */
.page {
  padding: 20px 20px 32px;
}

h1.page-title {
  font-size: 30px;
  font-weight: 800;
  margin: 4px 0 6px;
  letter-spacing: -0.3px;
}

.page-sub {
  color: var(--text-dim);
  font-size: 14.5px;
  margin: 0 0 20px;
  line-height: 1.5;
}

h2.section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 28px 0 12px;
  letter-spacing: -0.2px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.list-row:hover { border-color: #3a3b42; }

.list-row .row-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}
.list-row .row-icon svg { width: 20px; height: 20px; }

.list-row .row-body { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 700; font-size: 15.5px; margin: 0 0 2px; }
.list-row .row-sub { font-size: 13px; color: var(--text-dim); margin: 0; }
.list-row .chevron { color: var(--text-faint); flex-shrink: 0; }
.list-row .chevron svg { width: 18px; height: 18px; }

/* Pills */
.pill-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.pill-row::-webkit-scrollbar { display: none; }

.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: default;
}

.stat-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 22px;
}
.stat {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 16px 8px;
  text-align: center;
  background: var(--surface);
}
.stat b { display: block; font-size: 17px; font-weight: 800; }
.stat span { display: block; font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* Bottom nav */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-width: 480px;
  margin: 0 auto;
}

.navitem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  flex: 1;
  padding: 8px 0;
}
.navitem svg { width: 23px; height: 23px; }
.navitem.active { color: var(--blue); }

/* Home hero */
.greeting { color: var(--text-dim); font-size: 15px; margin: 6px 0 0; }
.greeting-name { font-size: 26px; font-weight: 800; margin: 2px 0 18px; }

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 190px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, rgba(10,10,12,0.15), rgba(6,7,9,0.9)), radial-gradient(circle at 30% 20%, #b34a1a, transparent 45%), radial-gradient(circle at 75% 10%, #17b0c9, transparent 40%), #101215;
  color: #fff;
  margin-bottom: 16px;
}

.live-tag {
  align-self: flex-start;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: auto;
}
.live-tag .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #fff;
}

.hero h3 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  margin: 10px 0 14px;
  max-width: 90%;
}

.hero-actions { display: flex; gap: 10px; }

.btn {
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center; /* the words sit in the middle of every button, also when it is full width */
  text-align: center;
  text-decoration: none;
  gap: 6px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; }
.btn svg { width: 15px; height: 15px; }

.next-service {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.next-service .label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 13.5px; margin-bottom: 8px;
}
.next-service .label svg { width: 15px; height: 15px; }
.countdown {
  font-size: 26px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.service-meta { color: var(--text-dim); font-size: 13px; line-height: 1.5; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.quick-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.quick-item svg { width: 20px; height: 20px; color: var(--blue); }

.verse-box {
  border: 1px solid #3a2e14;
  background: linear-gradient(180deg, rgba(232,181,74,0.08), rgba(232,181,74,0.02));
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.verse-box .eyebrow {
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.verse-box p {
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  font-style: italic;
}

/* Home — section head with trailing link */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 12px;
}
.section-head h2 { margin: 0; }
.section-head a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue);
  flex-shrink: 0;
}

/* Home — today's devotion */
.devotion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.devotion-card h3 {
  font-size: 16.5px;
  font-weight: 800;
  margin: 0 0 10px;
}
.devotion-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0 0 14px;
}
.devotion-card p b { color: var(--text); font-weight: 700; }
.devotion-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.devotion-date { font-size: 12.5px; color: var(--text-faint); }
.tag-pill {
  border: 1px solid var(--blue-dim);
  color: #79aefc;
  background: rgba(59,130,246,0.08);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
}

/* Home — recent sermons */
.sermon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sermon-card { cursor: pointer; position: relative; }
.sermon-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3.1;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
  background: linear-gradient(160deg, #123842, #0a2027);
  background-size: cover;
  background-position: center;
}
.sermon-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.sermon-save {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sermon-save svg { width: 15px; height: 15px; }
.sermon-save.saved { background: var(--blue); }
.sermon-title { font-weight: 700; font-size: 14.5px; margin: 0 0 3px; line-height: 1.3; }
.sermon-sub { font-size: 12.5px; color: var(--text-dim); margin: 0; }

/* Home — upcoming events */
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 12px;
  cursor: pointer;
}
.event-row .e-title { font-weight: 700; font-size: 15px; margin: 0 0 3px; }
.event-row .e-sub { font-size: 13px; color: var(--text-dim); margin: 0; }
.event-row .chevron svg { width: 18px; height: 18px; }

.conference-banner {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: linear-gradient(135deg, #2f8bff, #3fc7e8);
  color: #04121f;
  margin-bottom: 8px;
}
.conference-banner .eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  opacity: 0.75;
  margin-bottom: 10px;
}
.conference-banner h3 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.3;
}
.conference-banner p {
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.85;
  margin: 0 0 16px;
}
.btn-dark {
  background: #04121f;
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 20px;
  cursor: pointer;
}

/* Home — quick giving */
.quick-giving-card {
  border: 1px solid #3a2e14;
  background: linear-gradient(180deg, rgba(232,181,74,0.07), rgba(232,181,74,0.02));
  border-radius: var(--radius-lg);
  padding: 18px;
}
.quick-giving-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 16px;
}
.btn-gold {
  background: linear-gradient(135deg, #f0c05a, #e0973a);
  color: #241705;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 14.5px;
  padding: 12px 22px;
  cursor: pointer;
}

/* Home — announcements */
.announcement-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 12px;
}
.announcement-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.announcement-icon svg { width: 18px; height: 18px; }
.announcement-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  padding-top: 9px;
}

/* Home — ministry chips */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ministry-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Bible page */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  color: var(--text-faint);
  font-size: 14px;
  margin-bottom: 22px;
}
.search-bar svg { width: 17px; height: 17px; flex-shrink: 0; }

.daily-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 8px;
}
.daily-card .eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.daily-card blockquote {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}
.daily-card cite {
  display: block;
  color: var(--text-dim);
  font-size: 13.5px;
  font-style: normal;
  margin-bottom: 16px;
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: #494a52; color: var(--text); }

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.plan-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.plan-top b { font-size: 15.5px; font-weight: 700; }
.plan-top span { font-size: 13px; color: var(--text-dim); }
.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill { height: 100%; background: var(--blue); border-radius: var(--radius-pill); }
.plan-percent { font-size: 12.5px; color: var(--text-dim); }

/* Media page */
.media-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
}
.media-tile .tile-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: #79aefc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.media-tile .tile-icon svg { width: 21px; height: 21px; }
.media-tile .tile-title { font-weight: 700; font-size: 15.5px; margin-bottom: 2px; }
.media-tile .tile-sub { font-size: 13px; color: var(--text-dim); }

.podcast-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.podcast-row:last-child { border-bottom: none; }
.podcast-row .mic {
  width: 42px; height: 42px; border-radius: 50%;
  background: #2e250f; color: var(--gold);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.podcast-row .mic svg { width: 19px; height: 19px; }
.podcast-row .p-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.podcast-row .p-sub { font-size: 13px; color: var(--text-dim); }
.podcast-row .play {
  margin-left: auto; color: var(--text-faint); flex-shrink: 0;
}
.podcast-row .play svg { width: 18px; height: 18px; }

/* Give page */
.verse-quote {
  color: var(--text-dim);
  font-size: 14.5px;
  font-style: italic;
  margin: 0 0 24px;
  line-height: 1.5;
}

.fund-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.fund-card {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s ease;
}
.fund-card.active { border-color: var(--gold); background: rgba(232,181,74,0.06); }
.fund-card b { display: block; font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.fund-card span { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; display: block; }

.amount-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.amount-chip {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-dim);
}
.amount-chip.active { border-color: var(--gold); color: var(--gold); }

.amount-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 16px 20px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 22px;
}
.amount-input:focus { outline: none; border-color: var(--blue); }

.pay-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--blue);
  background: var(--blue-dim);
  border-radius: var(--radius-pill);
  padding: 16px 20px;
  margin-bottom: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pay-method.dim { border-color: var(--border); background: var(--surface); font-weight: 600; color: var(--text-dim); }
.radio-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.radio-dot::after { content:""; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.radio-empty {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--text-faint); flex-shrink: 0;
}

.give-submit {
  width: 100%;
  margin-top: 8px;
  padding: 17px;
  font-size: 15.5px;
}

/* Profile page */
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6fb2ff, var(--blue));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
  flex-shrink: 0;
}
.profile-head h2 { font-size: 21px; font-weight: 800; margin: 0 0 3px; }
.profile-head .member-id { color: var(--text-dim); font-size: 13px; margin: 0 0 6px; }
.tag-line { font-size: 13.5px; color: var(--blue); font-weight: 600; }
.tag-line .sep { color: var(--text-faint); margin: 0 6px; }

.ministry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ministry-pill {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  background: var(--surface);
}
.ministry-pill b { color: var(--text); font-weight: 700; }

/* Settings page */
.settings-group {
  margin-bottom: 26px;
}
.settings-group .group-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin: 0 0 10px 4px;
  text-transform: uppercase;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 10px;
}
.toggle-row .t-title { font-weight: 600; font-size: 14.5px; }
.toggle-row .t-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.switch {
  position: relative;
  width: 46px; height: 27px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 21px; height: 21px;
  background: var(--text-faint);
  border-radius: 50%;
  transition: all .2s ease;
}
.switch.on { background: var(--blue); border-color: var(--blue); }
.switch.on::after { left: 23px; background: #fff; }

.danger-row {
  color: var(--red);
  font-weight: 700;
}

.logout-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: var(--radius-pill);
  padding: 15px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 8px;
  cursor: pointer;
}
.app-version {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 18px;
}

/* Auth pages (login / signup) */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.auth-brand .mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px;
  overflow: hidden;
}
.auth-brand .mark img { width: 60%; height: 60%; object-fit: contain; }
.auth-brand .word b { display: block; font-size: 18px; font-weight: 800; letter-spacing: 0.5px; }
.auth-brand .word span { display: block; font-size: 11px; letter-spacing: 2px; color: var(--text-dim); font-weight: 600; }

.auth-page h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.auth-page .auth-sub { color: var(--text-dim); font-size: 14.5px; margin: 0 0 28px; }

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.auth-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
}
.auth-input:focus { outline: none; border-color: var(--blue); }

.auth-error {
  background: rgba(229,72,77,0.1);
  border: 1px solid rgba(229,72,77,0.4);
  color: #ff8b8e;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }

.auth-submit {
  width: 100%;
  padding: 15px;
  font-size: 15.5px;
  margin-top: 6px;
}
.auth-switch {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 22px;
}
.auth-switch a { color: var(--blue); font-weight: 600; }

/* Settings — theme + accent color picker */
.theme-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.theme-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.theme-btn.active {
  border-color: var(--blue);
  color: var(--text);
  background: var(--blue-dim);
}
.swatch-row {
  display: flex;
  gap: 14px;
  padding: 4px 2px;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
}
.swatch.active::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--text);
  border-radius: 50%;
}

/* Help & FAQ — accordion */
.faq-item { padding: 4px 16px; }
.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 14.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.faq-chevron {
  flex-shrink: 0;
  color: var(--text-faint);
  display: flex;
  transition: transform 0.2s ease;
}
.faq-chevron svg { width: 16px; height: 16px; }
.faq-item.open .faq-chevron { transform: rotate(90deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
  transition: max-height 0.2s ease;
}
.faq-item.open .faq-answer {
  max-height: 400px;
  padding-bottom: 16px;
}

/* Bible reader — full-page book-style layout */
.bible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
}
.bible-header-center { text-align: center; flex: 1; min-width: 0; }
.bible-header-center h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bible-header-center span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.bible-header-icons { display: flex; gap: 2px; flex-shrink: 0; }

.reader-page {
  padding: 20px 22px calc(var(--nav-h) + 86px);
  position: relative;
}
.reader-status {
  color: var(--text-dim);
  font-size: 13.5px;
  min-height: 18px;
  margin-bottom: 6px;
}
.book-banner {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 4px 0 28px;
  color: var(--text);
}

.bible-picker {
  display: flex;
  gap: 10px;
}
.bible-picker select { cursor: pointer; }

.reader-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
}
.reader-text::after { content: ""; display: block; clear: both; }
.reader-text .verse-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  vertical-align: super;
  margin: 0 2px 0 7px;
}
.reader-text .verse-num:first-child { margin-left: 0; }
.reader-dropcap {
  float: left;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 66px;
  font-weight: 700;
  line-height: 0.78;
  padding: 4px 10px 0 0;
  color: var(--text);
}

/* Previous / next chapter arrows: pinned to the screen (just above the bottom bar), left and right.
   They never move with the text, and don't creep up on a short chapter. */
.reader-floating-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  box-sizing: border-box;
  padding: 0 18px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 45; /* above the page and the offline notice, below the pop-up sheets */
}
.reader-nav-btn {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.reader-nav-btn svg { width: 20px; height: 20px; }

/* Generic bottom-sheet modal, used for the book/chapter picker, daily
   reading, and reading plans on the Bible page. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(24px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close svg { width: 18px; height: 18px; }

/* Notification bell badge */
.bell-badge {
  position: absolute;
  top: 1px;
  right: -1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  pointer-events: none;
}

/* Notifications list */
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 12px;
  color: inherit;
  text-decoration: none;
}
a.notif-row:hover { border-color: #3a3b42; }
.notif-row.unread { border-color: var(--blue); background: var(--blue-dim); }
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon svg { width: 18px; height: 18px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: 14.5px; margin: 0 0 3px; }
.notif-text { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; margin: 0 0 6px; }
.notif-time { font-size: 12px; color: var(--text-faint); margin: 0; }
.notif-settings-link {
  display: block;
  text-align: center;
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 18px;
}
.push-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
}
.push-banner-text { flex: 1; min-width: 0; }
.push-banner-text b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.push-banner-text span { font-size: 13px; color: var(--text-dim); line-height: 1.45; }

/* Settings — a switch that can't be used (not supported / blocked) */
.switch.disabled { opacity: 0.45; cursor: not-allowed; }

/* Buttons that are finished (e.g. "Done for today") */
.chip:disabled { opacity: 0.55; cursor: default; }

/* Reading plan description */
.plan-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: -4px 0 12px; }

/* Admin dashboard helpers */
.notify-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 4px 0 14px;
  cursor: pointer;
}
.notify-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.post-status { font-size: 12.5px; color: var(--text-dim); margin: 10px 0 0; line-height: 1.5; }

/* ===== Playback, offline, editing, Bible search ===== */

/* Elements marked hidden must stay hidden even when a class sets their display */
[hidden] { display: none !important; }

/* --- Bible: word search results --- */
.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.search-hit:hover { border-color: #3a3b42; }
.search-hit b {
  display: block;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.search-hit span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.6;
}
.reader-text mark,
.search-hit mark {
  background: var(--blue-dim);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* --- Now playing page (sermons, podcasts, live) --- */
.watch-stage { margin: 0 -4px; }
.watch-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
}
.watch-frame iframe,
.watch-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
/* The picture with a big Play button — nothing plays until you press it */
.watch-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.watch-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}
.watch-play svg { width: 28px; height: 28px; margin-left: 4px; }
.watch-poster:active .watch-play { transform: translate(-50%, -50%) scale(0.94); }
.watch-art {
  width: 100%;
  height: 170px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--blue-dim), var(--surface-2));
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.watch-art svg { width: 56px; height: 56px; }
.watch-audio { width: 100%; }
.watch-external {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
}
.watch-external p { color: var(--text-dim); font-size: 14px; margin: 0 0 14px; }
.watch-tools { display: flex; gap: 10px; margin-top: 12px; }
.watch-note { font-size: 13px; color: var(--text-dim); margin: 12px 0 0; line-height: 1.5; }
.watch-note:empty { display: none; }
.watch-note a { color: var(--blue); font-weight: 600; }
.watch-title { font-size: 21px; font-weight: 800; line-height: 1.25; margin: 18px 0 4px; }
.watch-sub { font-size: 14px; color: var(--text-dim); margin: 0 0 22px; }
.sermon-row.now { border-color: var(--blue); background: var(--blue-dim); cursor: default; }

/* Tap-to-play sermon cards on Home */
.sermon-play {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  text-align: left;
}
.sermon-playicon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sermon-playicon svg { width: 18px; height: 18px; margin-left: 2px; }

/* --- Sermons library --- */
.sermon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 12px;
  cursor: pointer;
}
.sermon-row:hover { border-color: #3a3b42; }
.sermon-row-thumb {
  position: relative;
  width: 108px;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
}
.sermon-row-thumb .sermon-playicon { width: 34px; height: 34px; }
.sermon-row-thumb .sermon-playicon svg { width: 15px; height: 15px; }
.sermon-row-body { flex: 1; min-width: 0; }
.sermon-row-body .sermon-title { margin: 0 0 3px; }
.sermon-row-save { flex-shrink: 0; }
.sermon-row-save svg { width: 20px; height: 20px; }
.sermon-row-save.saved { color: var(--blue); }

/* --- Devotions archive --- */
.devo-item { padding: 4px 16px; margin-bottom: 12px; }
.devo-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
}
.devo-item summary::-webkit-details-marker { display: none; }
.devo-item summary b { display: block; font-size: 15px; }
.devo-meta { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.devo-item[open] .faq-chevron { transform: rotate(90deg); }
.devo-body { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin: 0 0 16px; }
.devo-body b { color: var(--text); }

/* --- Offline notice --- */
.offline-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 40;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  max-width: calc(100% - 32px);
  text-align: center;
}

/* --- Admin: editing and reordering --- */
.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--blue-dim);
  border: 1px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}
.edit-banner-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-btns { display: flex; flex-direction: column; flex-shrink: 0; }
.move-btns .icon-btn { width: 28px; height: 20px; }
.move-btns .icon-btn svg { width: 16px; height: 16px; }
.move-btns .icon-btn:disabled { opacity: 0.3; cursor: default; }
.admin-edit svg,
.admin-delete svg { width: 18px; height: 18px; }

/* ===== Side menu, Sermons library, Live TV ===== */

/* --- Top bar: menu button next to the logo --- */
.left-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.left-group .icon-btn { margin-left: -8px; }

/* --- Side menu --- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open { opacity: 1; }
.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(84vw, 330px);
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.drawer-overlay.open .drawer { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.drawer-body { overflow-y: auto; padding: 4px 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
.drawer-group {
  margin: 0;
  padding: 18px 20px 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.drawer-link:hover { background: var(--surface); }
.drawer-link.current { color: var(--blue); }
.drawer-icon { width: 22px; height: 22px; display: flex; color: var(--text-dim); }
.drawer-icon svg { width: 22px; height: 22px; }
.drawer-link.current .drawer-icon { color: var(--blue); }
.drawer-label { flex: 1; }
.drawer-chevron { display: flex; color: var(--text-faint); }
.drawer-chevron svg { width: 16px; height: 16px; }
.menu-badge {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

/* --- Sermons library: search, tabs, series --- */
.sermon-shortcuts { display: flex; gap: 8px; margin: 0 0 14px; }
.sermon-shortcuts .chip svg { width: 16px; height: 16px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  margin: 4px 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-dim);
}
.search-field svg { width: 20px; height: 20px; flex-shrink: 0; }
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.search-field:focus-within { border-color: var(--blue); }
.seg-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.seg {
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
}
.seg.active { color: var(--text); border-bottom-color: var(--blue); }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { flex-shrink: 0; white-space: nowrap; }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.list-count { font-size: 12.5px; font-weight: 600; color: var(--text-faint); margin: 0 0 10px; }
.list-count:empty { display: none; }
.series-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--blue-dim);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}
.sermon-row-thumb .sermon-duration { bottom: 5px; right: 5px; font-size: 10px; padding: 2px 7px; }

/* --- Live TV --- */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(229, 72, 77, 0.15);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: livepulse 1.4s infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.live-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
}
.live-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; color: var(--blue); }
.live-next { font-size: 26px; font-weight: 800; line-height: 1.2; margin: 8px 0 4px; }
.live-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 10px; }
.live-countdown { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0 14px; }
.live-note { color: var(--text-dim); font-size: 13.5px; line-height: 1.55; margin: 0; }
.schedule-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.schedule-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.schedule-row:last-child { border-bottom: 0; }
.schedule-row.next { background: var(--blue-dim); }
.schedule-day { font-size: 14px; font-weight: 700; }
.schedule-title { font-size: 14px; color: var(--text-dim); }
.schedule-time { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.schedule-tag { padding: 2px 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 800; }

/* ===== Downloads ===== */
.download-chip svg { width: 16px; height: 16px; }
.download-chip.saved { color: var(--blue); border-color: var(--blue); }
.download-chip.busy { color: var(--text); }
.download-btn.saved { color: var(--blue); }
.download-btn .pct { font-size: 10px; font-weight: 800; }
.download-btn svg { width: 20px; height: 20px; }
.downloads-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}
.downloads-summary b { display: block; font-size: 15px; }
.downloads-summary span { font-size: 13px; color: var(--text-dim); }
.dl-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.dl-row .icon-btn svg, .later-row .icon-btn svg { width: 18px; height: 18px; }

/* ===== Giving ===== */
.give-min { font-size: 12.5px; color: var(--text-faint); margin: 8px 0 18px; }
.give-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.give-note b { display: block; font-size: 14px; margin-bottom: 4px; }
.give-note span { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.give-error { color: var(--red); font-size: 13.5px; font-weight: 600; margin: 0 0 12px; min-height: 0; }
.give-error:empty { display: none; }

.result-card { text-align: center; padding: 28px 8px 8px; }
.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-icon svg { width: 34px; height: 34px; }
.result-icon.ok { background: rgba(48, 164, 108, 0.16); color: #30a46c; }
.result-icon.wait { background: var(--blue-dim); color: var(--blue); }
.result-icon.bad { background: rgba(229, 72, 77, 0.15); color: var(--red); }
.result-title { font-size: 26px; font-weight: 800; margin: 0 0 10px; }
.result-body { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin: 0 0 18px; }
.result-body b { color: var(--text); }
.result-demo {
  background: rgba(232, 181, 74, 0.14);
  border: 1px solid rgba(232, 181, 74, 0.5);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 18px;
}
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.result-actions .btn { width: 100%; justify-content: center; padding: 14px; text-align: center; }

.report-total { font-size: 15px; margin: 4px 0 10px; }
.report-total b { font-size: 22px; display: block; }
.report-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.report-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.report-row:last-child { border-bottom: 0; }
.report-row em { font-style: normal; color: var(--text-faint); font-size: 12px; margin-left: 6px; }
.report-sub { font-size: 14px; color: var(--text-dim); margin: 18px 0 8px; }
.report-amount { font-size: 14px; flex-shrink: 0; }

/* ===== Phone alerts ===== */
.status-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 13.5px; line-height: 1.45; }
.status-mark { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; margin-top: 1px; background: var(--surface-2); color: var(--text-dim); }
.status-ok .status-mark { background: rgba(48, 164, 108, 0.18); color: #30a46c; }
.status-bad .status-mark { background: rgba(229, 72, 77, 0.16); color: var(--red); }
.status-bad { color: var(--text); }
.status-unknown .status-mark { background: rgba(232, 181, 74, 0.2); color: #e8b54a; }
.push-banner-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.push-banner-actions .btn { padding: 9px 16px; font-size: 14px; }
.push-banner-dismiss { background: none; border: 0; color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; padding: 4px; }

/* ===== Bible versions ===== */
.version-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  margin-top: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  font: inherit;
  color: var(--text-dim);
  cursor: pointer;
}
.version-btn:hover { background: var(--surface); }
.version-btn svg { width: 12px; height: 12px; }
.version-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 10px; }
.version-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.version-item.active { border-color: var(--blue); background: var(--blue-dim); }
.version-item .v-name { font-size: 15px; font-weight: 600; }
.version-item .v-name b { font-weight: 800; margin-right: 8px; letter-spacing: 0.5px; }
.version-item .v-about { grid-column: 1 / -1; font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.version-item .v-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}
.version-item .v-check svg { width: 13px; height: 13px; stroke-width: 3; }
.version-item .v-badge { font-size: 11px; font-weight: 700; color: #30a46c; }

/* ===== Icons in text, and smooth page changes ===== */
/* A small icon that sits in a line of text (replaces typed tick marks). */
.ic-inline { display: inline-flex; align-items: center; vertical-align: middle; }
.ic-inline svg { width: 1.05em; height: 1.05em; stroke-width: 2.6; }
.status-mark svg { width: 12px; height: 12px; stroke-width: 3; }

/* Moving between pages: the old page stays on screen until the new one is ready, then they cross-fade
   (instead of a blank flash). Browsers that don't support this simply load the page as before. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 120ms ease-out both vt-fade-out; }
::view-transition-new(root) { animation: 180ms ease-in both vt-fade-in; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ===== Open to everyone: visitors and the sign-in screen ===== */
/* "Sign in" in the top bar, for someone without an account (where the notifications bell would be) */
.topbar-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* The invitation on Home */
.guest-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 44px 16px 16px;
  margin: 0 0 16px;
}
.guest-card-text b { display: block; font-size: 15px; margin-bottom: 4px; }
.guest-card-text > span { display: block; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.guest-card-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.guest-card-actions .btn { padding: 9px 16px; font-size: 14px; text-decoration: none; }
.guest-link { color: var(--blue); font-weight: 700; font-size: 14px; text-decoration: none; }
.guest-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 50%;
}
.guest-card-close svg { width: 16px; height: 16px; }

/* The same invitation at the top of the side menu, and the lock on account-only items */
.drawer-guest {
  margin: 12px 16px 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.drawer-guest b { display: block; font-size: 15px; margin-bottom: 4px; }
.drawer-guest > span { display: block; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.drawer-guest-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.drawer-guest-actions .btn { padding: 9px 16px; font-size: 14px; text-decoration: none; }
.drawer-signin { color: var(--blue); font-weight: 700; font-size: 14px; text-decoration: none; }
.drawer-lock { display: flex; color: var(--text-faint); }
.drawer-lock svg { width: 15px; height: 15px; }
.drawer-link.locked .drawer-label { color: var(--text-dim); }

/* The friendly "Sign in or create an account to continue" screen */
.gate { text-align: center; margin: 0 0 18px; }
.gate-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.gate-icon svg { width: 30px; height: 30px; }
.gate h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.gate-create { display: block; text-align: center; text-decoration: none; margin: 16px 0 10px; }
.gate-or { font-size: 13px; color: var(--text-dim); margin: 0 0 4px; }
.gate[hidden], #welcome-back[hidden], #new-here[hidden] { display: none; }

/* A calm secondary button (outlined), and the "or" divider above it */
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface); }
.btn-outline svg { width: 16px; height: 16px; flex-shrink: 0; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.auth-or::before,
.auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ===== Posters and flyers ===== */

/* The poster fills the right-hand side of the conference banner on Home */
.conference-banner.has-poster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  gap: 14px;
  align-items: center;
}
.conference-banner.has-poster .conf-text p { margin-bottom: 14px; }
.conf-poster {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  aspect-ratio: 3 / 4;
  box-shadow: 0 10px 24px rgba(4, 18, 31, 0.3);
}
.conf-poster:active { transform: scale(0.98); }
.conf-poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.conf-poster-zoom {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(4, 18, 31, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.conf-poster-zoom svg { width: 15px; height: 15px; }

/* The poster inside an event's details */
.event-poster {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
}
.event-poster[hidden] { display: none; }
.event-poster img { display: block; width: 100%; max-height: 260px; object-fit: cover; object-position: top; }
.event-poster-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(4, 18, 31, 0.78);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}
.event-poster-tag svg { width: 14px; height: 14px; }

/* The full-screen poster viewer */
.poster-viewer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  background: rgba(4, 6, 10, 0.96);
  opacity: 0;
  transition: opacity 0.18s ease;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.poster-viewer[hidden] { display: none; }
.poster-viewer.open { opacity: 1; }
.poster-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.poster-title {
  margin: 0;
  min-width: 0;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poster-actions { display: flex; gap: 8px; flex-shrink: 0; }
.poster-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.poster-btn[hidden] { display: none; }
.poster-btn svg { width: 20px; height: 20px; }
.poster-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 4px 12px;
  touch-action: pan-x pan-y pinch-zoom;
}
.poster-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.poster-img[hidden] { display: none; }
.poster-stage.zoomed { align-items: flex-start; justify-content: flex-start; }
.poster-stage.zoomed .poster-img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.poster-spinner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: poster-spin 0.8s linear infinite;
}
.poster-spinner[hidden] { display: none; }
@keyframes poster-spin { to { transform: rotate(360deg); } }
.poster-error { text-align: center; color: #fff; padding: 20px; max-width: 320px; }
.poster-error[hidden] { display: none; }
.poster-error p { margin: 0 0 14px; line-height: 1.5; }
.poster-hint { margin: 0; padding: 10px 16px 14px; text-align: center; color: rgba(255, 255, 255, 0.65); font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) {
  .poster-viewer { transition: none; }
  .poster-spinner { animation-duration: 1.6s; }
}

/* The dashboard's poster upload: a small preview and a Remove button */
.upload-preview { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.upload-preview[hidden] { display: none; }
.upload-preview img {
  width: 64px;
  height: 84px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.upload-remove { background: none; border: 0; padding: 0; color: var(--red); font-weight: 700; font-size: 13.5px; cursor: pointer; }

/* ===== Event rows on Home: a poster picture on the left ===== */
.event-row { position: relative; }
.event-row .event-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.event-row .event-main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole row opens the event */
.event-row .event-main:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 8px; }
.event-row .event-text { min-width: 0; }
.event-row.has-thumb { gap: 14px; padding: 12px 16px 12px 12px; }
.event-row .event-thumb {
  position: relative;
  z-index: 1; /* above the row's tap area, so the picture opens the poster */
  flex: 0 0 auto;
  width: 56px;
  height: 74px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.event-row .event-thumb:active { transform: scale(0.97); }
.event-row .event-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ===== Sermon love, share and comments ===== */
.social { margin: 18px 0 8px; }
.social-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.social-btn svg { width: 19px; height: 19px; }
.social-btn:disabled { opacity: 0.6; cursor: default; }
.social-count { font-variant-numeric: tabular-nums; }
.social-count[hidden] { display: none; }
.love-btn.loved { color: var(--red); border-color: var(--red); }
.love-btn.loved { background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
.love-btn.loved svg { fill: currentColor; }
.social-note { min-height: 20px; margin: 8px 2px 0; font-size: 13px; color: var(--text-dim); }
.comments-title { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; }
.comments-total { font-size: 14px; font-weight: 700; color: var(--text-dim); }
.comments-total[hidden] { display: none; }

/* The box for writing a comment or a reply */
.composer { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.composer-main { flex: 1; min-width: 0; }
.composer textarea,
.reply-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  padding: 8px 2px;
  min-height: 38px;
  outline: none;
}
.composer textarea:focus,
.reply-form textarea:focus { border-bottom-color: var(--blue); }
.composer-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.composer-row[hidden] { display: none; }
.composer-count { margin-right: auto; font-size: 12.5px; color: var(--text-dim); }
.composer-cancel { background: none; border: 0; color: var(--text-dim); font-weight: 700; font-size: 14px; cursor: pointer; padding: 8px 10px; }
.composer-post { padding: 9px 18px; font-size: 14px; }
.composer-post:disabled { opacity: 0.45; cursor: default; }
.composer-error { margin: 8px 0 0; color: var(--red); font-size: 13px; }
.composer-error[hidden] { display: none; }
.composer-gate { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 18px; }
.composer-gate b { display: block; font-size: 15px; margin-bottom: 4px; }
.composer-gate > span { display: block; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.composer-gate-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.composer-gate-actions .btn { padding: 9px 16px; font-size: 14px; }

/* The comments */
.avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--hue, 210) 55% 42%);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.comment { display: flex; gap: 12px; margin-bottom: 18px; }
.comment.is-reply { margin-bottom: 12px; }
.comment.is-reply .avatar { width: 28px; height: 28px; font-size: 12px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { margin: 0 0 3px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.comment-author { color: var(--text); font-size: 13.5px; }
.comment-text { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.comment-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.comment-actions button:hover { background: var(--surface); }
.comment-actions button:disabled { opacity: 0.6; cursor: default; }
.comment-actions svg { width: 17px; height: 17px; }
.c-love.loved { color: var(--red); }
.c-love.loved svg { fill: currentColor; }
.c-love-count[hidden] { display: none; }
.c-delete { margin-left: auto; }
.replies { margin-top: 10px; }
.reply-slot:empty { display: none; }
.reply-form { margin-top: 8px; }
.comments-status { margin: 6px 0 14px; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.comments-more { width: 100%; margin: 4px 0 16px; }
.comments-more[hidden] { display: none; }

/* ===== Bible: linked versions (the NIV) ===== */
.version-heading { margin: 14px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.v-badge-link { display: inline-flex; align-items: center; gap: 5px; }
.v-badge-link svg { width: 13px; height: 13px; }
.version-item .v-badge.v-badge-link { color: var(--blue); }

/* ===== Growth Groups ===== */
.avatar-lg { width: 46px; height: 46px; font-size: 18px; }
.avatar-xl { width: 76px; height: 76px; font-size: 32px; }
.growth-notice { margin: 8px 0; color: var(--red); font-size: 13.5px; line-height: 1.45; }
.growth-notice[hidden] { display: none; }
.leader-tag { display: inline-block; font-size: 11px; font-weight: 800; color: var(--blue); background: rgba(59, 130, 246, 0.14); padding: 2px 8px; border-radius: 999px; }

/* Home: the "Join a Growth Group" card */
.growth-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue), #6d5ef0);
  color: #fff;
  text-decoration: none;
}
.growth-card-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: flex; align-items: center; justify-content: center; }
.growth-card-icon svg { width: 22px; height: 22px; }
.growth-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.growth-card-text b { font-size: 16px; }
.growth-card-text span { font-size: 13px; opacity: 0.92; }
.growth-card .chevron svg { width: 18px; height: 18px; color: #fff; }
.growth-card-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: #fff; color: var(--blue); font-weight: 800; font-size: 12.5px; display: flex; align-items: center; justify-content: center; }
.growth-card-badge[hidden] { display: none; }

/* The hub: your groups, like a chat list */
.chat-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 18px; }
.chat-row { display: flex; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.chat-row:last-child { border-bottom: 0; }
.chat-row:active { background: rgba(127, 127, 127, 0.1); }
.chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-row-name { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-time { flex-shrink: 0; font-size: 12px; color: var(--text-dim); }
.chat-row-sub { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); }
.chat-row-sub svg { width: 12px; height: 12px; }
.chat-row-bottom { display: flex; align-items: center; gap: 8px; }
.chat-row-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--text-dim); }
.unread-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* The hub: find a group (choose a location, then a group) */
.find-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 18px; }
.find-card .section-title { margin-top: 0; }
.find-intro, .find-empty { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.find-step { margin: 4px 0 10px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.find-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; margin-bottom: 4px; color: var(--blue); font-weight: 700; font-size: 14px; cursor: pointer; }
.find-back svg { width: 16px; height: 16px; }
.location-list, .group-list { display: flex; flex-direction: column; gap: 8px; }
.location-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.location-icon { display: flex; color: var(--blue); }
.location-icon svg { width: 20px; height: 20px; }
.location-name { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.location-count { font-size: 12.5px; color: var(--text-dim); }
.group-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.group-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.group-card-desc { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.group-card-count { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-dim); }
.group-card-count svg { width: 14px; height: 14px; }
.group-card-btn { flex-shrink: 0; padding: 9px 18px; font-size: 14px; }

/* The hub: pastors and admins manage locations and groups */
.manage-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px 16px; margin-bottom: 24px; }
.manage-panel summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-weight: 700; cursor: pointer; list-style: none; }
.manage-panel summary svg { width: 18px; height: 18px; color: var(--blue); }
.manage-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.manage-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.manage-form label { font-size: 13px; font-weight: 700; }
.manage-row { display: flex; gap: 8px; }
.manage-row .auth-input { flex: 1; min-width: 0; }
.manage-list { padding-bottom: 12px; }
.manage-location { margin-top: 10px; }
.manage-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; }
.manage-group { padding-left: 16px; border-left: 2px solid var(--border); }
.manage-group a { color: var(--text); text-decoration: none; font-size: 14px; }
.manage-tools { display: flex; gap: 4px; }
.icon-tool { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 50%; color: var(--text-dim); cursor: pointer; }
.icon-tool svg { width: 16px; height: 16px; }

/* Not in this group yet */
.chat-state { padding: 28px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.join-state .page-title { margin: 6px 0 0; }
.join-state .page-sub { display: flex; align-items: center; gap: 6px; margin: 0; }
.join-state .page-sub svg { width: 15px; height: 15px; }
.join-desc { margin: 4px 0 0; color: var(--text-dim); line-height: 1.5; }
.join-note { margin: 8px 0 4px; font-size: 14px; color: var(--text-dim); }
.join-back { margin-top: 6px; color: var(--blue); font-weight: 700; text-decoration: none; font-size: 14px; }

/* The chat screen */
.chat-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.chat-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-header { display: flex; align-items: center; gap: 4px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-back { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--text); border-radius: 50%; flex-shrink: 0; }
.chat-back svg { width: 22px; height: 22px; }
.chat-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; background: none; border: 0; border-radius: 12px; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.chat-title-text { min-width: 0; display: flex; flex-direction: column; }
.chat-title-text b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chat-sub { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 8px; overscroll-behavior: contain; }
#chat-messages { display: flex; flex-direction: column; }
.chat-older { display: block; margin: 0 auto 10px; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--blue); font-weight: 700; font-size: 13px; cursor: pointer; }
.chat-older[hidden], .chat-jump[hidden], .chat-empty[hidden] { display: none; }
.chat-empty { margin: 40px 20px; text-align: center; color: var(--text-dim); font-size: 14.5px; }
.chat-day { text-align: center; margin: 14px 0 6px; }
.chat-day span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-dim); }
.chat-unread { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; font-size: 12px; font-weight: 800; color: var(--blue); }
.chat-unread::before, .chat-unread::after { content: ""; flex: 1; height: 1px; background: var(--blue); opacity: 0.4; }

.msg { display: flex; flex-direction: column; max-width: 82%; margin-top: 2px; }
.msg.run-start { margin-top: 10px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg-name { margin: 0 8px 2px; font-size: 12.5px; font-weight: 800; color: hsl(var(--hue, 210) 70% 62%); }
.msg-bubble { padding: 8px 11px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; }
.msg.theirs .msg-bubble { border-bottom-left-radius: 5px; }
.msg.mine .msg-bubble { background: var(--blue); border-color: transparent; color: #fff; border-bottom-right-radius: 5px; }
.msg-text { margin: 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; opacity: 0.72; }
.msg-status { display: inline-flex; }
.msg-status svg { width: 13px; height: 13px; }
.msg-status.failed { color: var(--red); font-weight: 900; opacity: 1; }
.msg-actions { display: none; gap: 8px; margin-top: 4px; }
.selected > .msg-actions { display: flex; }
.msg-actions button, .msg-failed button { padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.msg-actions .danger { color: var(--red); }
.msg-failed { margin-top: 4px; font-size: 12.5px; color: var(--red); display: flex; align-items: center; gap: 8px; }
.msg-failed button { color: var(--red); }

.announcement { margin: 12px 0; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--blue); border-left-width: 4px; cursor: pointer; }
.announcement { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
.announcement header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.announcement header svg { width: 16px; height: 16px; color: var(--blue); }
.announcement header b { color: var(--blue); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11.5px; }
.announcement-text { margin: 6px 0 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.chat-jump { position: absolute; right: 14px; bottom: 82px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.chat-jump svg { width: 15px; height: 15px; transform: rotate(90deg); }
.chat-note { margin: 0; padding: 4px 14px; text-align: center; font-size: 13px; color: var(--text-dim); }
.chat-note:empty { display: none; }
.chat-readonly { margin: 0; padding: 14px; text-align: center; font-size: 13.5px; color: var(--text-dim); background: var(--surface); border-top: 1px solid var(--border); }

.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px); background: var(--surface); border-top: 1px solid var(--border); }
.chat-input-wrap { flex: 1; min-width: 0; padding: 6px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 22px; }
.chat-composer.announcing .chat-input-wrap { border-color: var(--blue); }
.chat-input-wrap textarea { display: block; width: 100%; box-sizing: border-box; padding: 4px 0; background: none; border: 0; outline: none; resize: none; color: var(--text); font: inherit; font-size: 15px; line-height: 1.4; max-height: 130px; }
.chat-mode-label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: var(--blue); }
.chat-mode-label[hidden] { display: none; }
.chat-mode-label svg { width: 13px; height: 13px; }
.chat-mode, .chat-send { flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; cursor: pointer; }
.chat-mode { background: var(--bg); border: 1px solid var(--border); color: var(--text-dim); }
.chat-mode[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chat-send { background: var(--blue); color: #fff; }
.chat-send:disabled { opacity: 0.4; cursor: default; }
.chat-mode svg, .chat-send svg { width: 20px; height: 20px; }

/* Group info */
.sheet-overlay { position: fixed; inset: 0; z-index: 300; display: none; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.55); }
.sheet-overlay.open { display: flex; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: 22px 22px 0 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.sheet-body { overflow-y: auto; padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 18px); }
.info-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px; text-align: center; }
.info-top h3 { margin: 6px 0 0; font-size: 20px; }
.info-top p { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 14px; }
.info-top p svg { width: 14px; height: 14px; }
.info-top .info-desc { display: block; line-height: 1.5; margin-top: 4px; }
.info-heading { margin: 16px 0 4px; font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.member-you { font-weight: 400; color: var(--text-dim); }
.member-btn { padding: 6px 11px; background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.member-btn.danger { color: var(--red); }
.leave-btn { width: 100%; margin-top: 18px; color: var(--red); border-color: var(--red); }

/* ===== Growth Groups v2: design polish, pictures, documents, emoji ===== */
/* --- a calmer, clearer header */
.chat-header { position: relative; z-index: 3; box-shadow: 0 1px 0 var(--border), 0 8px 20px rgba(0, 0, 0, 0.08); }
.chat-title .avatar-lg { width: 42px; height: 42px; font-size: 17px; }
.chat-info-icon { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 50%; color: var(--text-dim); cursor: pointer; }
.chat-info-icon svg { width: 22px; height: 22px; }
.chat-scroll { background: radial-gradient(circle at 12% 0%, rgba(59, 130, 246, 0.08), transparent 45%), radial-gradient(circle at 95% 100%, rgba(109, 94, 240, 0.07), transparent 40%); }
.chat-day { position: sticky; top: 6px; z-index: 2; }

/* --- the latest announcement, pinned */
.pinned { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); border-left: 4px solid var(--blue); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.pinned[hidden] { display: none; }
.pinned-icon { display: flex; color: var(--blue); }
.pinned-icon svg { width: 18px; height: 18px; }
.pinned-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinned-text b { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.pinned-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.pinned .chevron svg { width: 16px; height: 16px; color: var(--text-dim); }
.flash { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 16px; transition: outline-color 1.4s; }

/* --- messages */
.msg { max-width: 80%; }
.msg-bubble { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.msg.mine .msg-bubble { background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.08)); }
.msg-text a, .announcement-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.msg.theirs .msg-text a, .announcement-text a { color: var(--blue); }
.msg-bubble.emoji-only { background: transparent; background-image: none; border-color: transparent; box-shadow: none; padding: 2px 4px; color: var(--text); }
.emoji-only .msg-text { font-size: 44px; line-height: 1.1; }
.emoji-only.emoji-2 .msg-text { font-size: 38px; }
.emoji-only.emoji-3 .msg-text { font-size: 32px; }
.emoji-only .msg-meta { justify-content: flex-start; }

/* --- pictures and documents inside messages */
.msg-bubble.has-image { padding: 4px 4px 6px; }
.has-image .msg-text, .has-image .msg-meta { padding: 2px 8px 0; }
.msg-image { position: relative; display: block; width: 100%; min-width: 180px; padding: 0; margin: 0 0 4px; border: 0; border-radius: 12px; overflow: hidden; background: rgba(127, 127, 127, 0.2); cursor: pointer; }
.announcement .msg-image { max-width: 320px; margin-top: 8px; }
.msg-image img { display: block; width: 100%; min-height: 110px; max-height: 320px; object-fit: cover; }
.msg-image.loading { min-height: 170px; animation: sk-pulse 1.2s ease-in-out infinite; }
.msg-image.uploading img { opacity: 0.6; }
.msg-image.broken { min-height: 90px; }
.msg-image.broken img { visibility: hidden; }
.msg-image.broken::after { content: "Picture unavailable"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-dim); }
.msg-file { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 230px; margin-bottom: 4px; padding: 8px; border: 0; border-radius: 12px; background: rgba(127, 127, 127, 0.16); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.announcement .msg-file { margin-top: 8px; max-width: 340px; }
.file-icon { flex: 0 0 auto; width: 42px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 0.02em; }
.tone-pdf { background: #e5484d; }
.tone-word { background: #3b6fd6; }
.tone-sheet { background: #2fa36b; }
.tone-slides { background: #e8833a; }
.tone-text, .tone-file { background: #6b7280; }
.tone-image { background: #8b5cf6; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-info span { font-size: 12px; opacity: 0.75; }
.file-dl { display: flex; opacity: 0.85; }
.file-dl svg { width: 20px; height: 20px; }

/* --- the "latest messages" button */
.chat-jump { width: 44px; height: 44px; padding: 0; justify-content: center; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 50%; }
.chat-jump.has-count { width: auto; padding: 0 14px; background: var(--blue); color: #fff; border-color: transparent; border-radius: 999px; }
.chat-jump svg { width: 20px; height: 20px; transform: none; }

/* --- the message bar */
.composer-area { position: relative; background: var(--surface); border-top: 1px solid var(--border); }
.chat-composer { border-top: 0; }
.chat-input-wrap { padding: 4px 6px; }
.chat-input-row { display: flex; align-items: flex-end; gap: 2px; }
.chat-input-wrap textarea { padding: 9px 4px; }
.chat-mode-label { padding: 4px 10px 0; }
.chat-icon-btn { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 50%; color: var(--text-dim); cursor: pointer; }
.chat-icon-btn svg { width: 22px; height: 22px; }
.chat-icon-btn[aria-expanded="true"] { color: var(--blue); background: rgba(59, 130, 246, 0.14); }
.chat-tray { padding: 8px 12px 0; }
.chat-tray[hidden], .emoji-panel[hidden], .attach-menu[hidden] { display: none; }
.tray-item { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.tray-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--border); }
.tray-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tray-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tray-info span { font-size: 12px; color: var(--text-dim); }
.tray-x { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(127, 127, 127, 0.18); color: var(--text); cursor: pointer; }
.tray-x svg { width: 16px; height: 16px; }
.attach-menu { position: absolute; right: 10px; bottom: 100%; z-index: 6; min-width: 200px; display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.attach-menu button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: none; border: 0; border-radius: 10px; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.attach-menu button:hover { background: rgba(127, 127, 127, 0.14); }
.attach-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; }
.attach-icon svg { width: 18px; height: 18px; }

/* --- emoji */
.emoji-panel { display: flex; flex-direction: column; max-height: 300px; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.emoji-tabs { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px; }
.emoji-tab { flex: 0 0 auto; width: 40px; height: 36px; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 10px; font-size: 20px; color: var(--text-dim); cursor: pointer; }
.emoji-tab svg { width: 18px; height: 18px; }
.emoji-tab.active { background: rgba(59, 130, 246, 0.16); }
.emoji-title { margin: 4px 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 190px; overflow-y: auto; }
.emoji-btn { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 0; background: none; border: 0; border-radius: 10px; font-size: 24px; line-height: 1; cursor: pointer; }
.emoji-btn:hover, .emoji-btn:active { background: rgba(127, 127, 127, 0.18); }

/* --- loading placeholders and friendly empty states */
.sk-line { display: block; height: 12px; border-radius: 6px; background: var(--border); animation: sk-pulse 1.2s ease-in-out infinite; }
.sk-line.short { width: 30%; height: 9px; margin-top: 8px; }
.sk-circle { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--border); animation: sk-pulse 1.2s ease-in-out infinite; }
.sk-title { flex: 1; min-width: 0; }
.chat-skeleton { display: flex; flex-direction: column; height: 100%; }
.sk-msg { max-width: 70%; margin-bottom: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.sk-msg.sk-r { margin-left: auto; }
.hub-skeleton { display: flex; flex-direction: column; gap: 10px; }
.hub-skel-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
@keyframes sk-pulse { 50% { opacity: 0.45; } }
.state-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; border-radius: 50%; background: rgba(59, 130, 246, 0.14); color: var(--blue); }
.state-icon svg { width: 30px; height: 30px; }
.chat-empty { display: flex; flex-direction: column; align-items: center; }
.find-none { text-align: center; padding: 8px 0; }
.preview-icon svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }

/* --- keyboard focus is always visible; motion is gentle */
.chat-icon-btn:focus-visible, .chat-send:focus-visible, .chat-mode:focus-visible, .emoji-btn:focus-visible, .emoji-tab:focus-visible, .attach-menu button:focus-visible, .pinned:focus-visible, .chat-jump:focus-visible, .msg-file:focus-visible, .msg-image:focus-visible, .tray-x:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sk-line, .sk-circle, .msg-image.loading { animation: none; } .flash { transition: none; } }

/* ===== Growth Groups: location pins ===== */
.tone-location { background: #10b981; }
.tray-pin { flex: 0 0 auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #10b981; color: #fff; }
.tray-pin svg { width: 22px; height: 22px; }
.tray-pin.finding { animation: pin-pulse 1.2s ease-in-out infinite; }
@keyframes pin-pulse { 50% { transform: scale(0.88); opacity: 0.7; } }
@media (prefers-reduced-motion: reduce) { .tray-pin.finding { animation: none; opacity: 0.8; } }
.tray-info span + span { margin-top: 1px; }
.msg-location { width: 100%; min-width: 240px; margin-bottom: 4px; border-radius: 12px; overflow: hidden; background: rgba(127, 127, 127, 0.16); }
.announcement .msg-location { margin-top: 8px; max-width: 340px; }
.loc-art { height: 96px; display: flex; align-items: center; justify-content: center; background: linear-gradient(rgba(127, 127, 127, 0.18) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(90deg, rgba(127, 127, 127, 0.18) 1px, transparent 1px) 0 0 / 26px 26px, rgba(16, 185, 129, 0.16); }
.loc-pin { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #e5484d; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.loc-pin svg { width: 24px; height: 24px; }
.loc-info { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 4px; }
.loc-info b { font-size: 14px; }
.loc-info span { font-size: 12.5px; opacity: 0.75; word-break: break-all; }
.loc-actions { display: flex; gap: 8px; padding: 6px 10px 10px; }
.loc-btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 999px; background: rgba(127, 127, 127, 0.22); color: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.loc-btn svg { width: 15px; height: 15px; }
.has-location .msg-text, .has-location .msg-meta { padding: 2px 8px 0; }

/* ===== Verse of the Day: tappable, and the verse you land on in the Bible ===== */
a.verse-box { display: block; color: inherit; text-decoration: none; }
a.verse-box[href]:active { transform: scale(0.99); }
.verse-cta { display: flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--gold); font-size: 13px; font-weight: 700; }
.verse-cta[hidden] { display: none; }
.verse-cta svg { width: 14px; height: 14px; }
.reader-text mark.verse-flash { padding: 2px 0; border-radius: 3px; color: inherit; background: rgba(232, 181, 74, 0.5); box-decoration-break: clone; -webkit-box-decoration-break: clone; animation: verse-flash 6s ease-out forwards; }
@keyframes verse-flash { to { background: rgba(232, 181, 74, 0.18); } }
@media (prefers-reduced-motion: reduce) { .reader-text mark.verse-flash { animation: none; background: rgba(232, 181, 74, 0.28); } }

/* ===== Readable accent: whichever accent a person picks, text and buttons stay legible (set up by theme.js) ===== */
.list-row .row-icon,
.navitem.active,
.countdown,
.quick-item svg,
.section-head a,
.announcement-icon,
.tag-line,
.auth-switch a,
.reader-text .verse-num,
.notif-icon,
.notif-settings-link,
.search-hit b,
.watch-art,
.watch-note a,
.sermon-row-save.saved,
.drawer-link.current,
.drawer-link.current .drawer-icon,
.series-tag,
.live-label,
.download-chip.saved,
.download-btn.saved,
.result-icon.wait,
.guest-link,
.drawer-signin,
.gate-icon,
.version-item .v-badge.v-badge-link,
.leader-tag,
.growth-card-badge,
.find-back,
.location-icon,
.manage-panel summary svg,
.join-back,
.chat-older,
.chat-unread,
.announcement header svg,
.announcement header b,
.chat-mode-label,
.pinned-icon,
.pinned-text b,
.msg.theirs .msg-text a,
.announcement-text a,
.chat-icon-btn[aria-expanded="true"],
.state-icon { color: var(--accent-text, var(--blue)); }
.brand .mark,
.btn-primary,
.auth-brand .mark,
.watch-play,
.chip.active,
.schedule-tag,
.version-item .v-check,
.topbar-signin,
.unread-badge,
.msg.mine .msg-bubble,
.chat-jump,
.chat-mode[aria-pressed="true"],
.chat-send,
.chat-jump.has-count { background: var(--accent-fill, var(--blue)); color: var(--on-accent, #fff); }
.growth-card { background: linear-gradient(135deg, var(--accent-fill, var(--blue)), var(--accent-fill-2, #6d5ef0)); color: var(--on-accent, #fff); }
.avatar { background: linear-gradient(135deg, var(--accent-fill, var(--blue)), var(--accent-fill-2, #6d5ef0)); color: var(--on-accent, #fff); }
.growth-card-text span, .growth-card .chevron { color: var(--on-accent, #fff); opacity: 1; font-weight: 500; }
.msg.mine .msg-meta, .msg.mine .msg-status { color: var(--on-accent, #fff); opacity: 1; }
[data-on-accent="dark"] .msg.mine .msg-bubble a { color: inherit; text-decoration: underline; }

/* ===== Design v2: typeface, depth and polish. This layer only refines the rules above; it removes nothing. ===== */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -- colours, depth and shape (every colour still follows the person's own theme and accent choice) -- */
:root {
  --bg: #0b0c10;
  --surface: #14161c;
  --surface-2: #1b1e26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f5f8;
  --text-dim: #a4a7b2;
  --text-faint: #8a8e9b;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-btn: 14px;
  --nav-bg: rgba(11, 12, 16, 0.98);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 65%), var(--surface);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 14px 32px -16px rgba(0, 0, 0, 0.75);
  --accent-soft: var(--blue-dim);
  --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #eceef4;
  --border: rgba(16, 24, 40, 0.08);
  --text: #12141b;
  --text-dim: #565a66;
  --text-faint: #666a78;
  --nav-bg: rgba(255, 255, 255, 0.98);
  --card-bg: var(--surface);
  --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 14px 30px -16px rgba(16, 24, 40, 0.22);
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root { --accent-soft: color-mix(in srgb, var(--blue) 16%, transparent); }
  :root[data-theme="light"] { --accent-soft: color-mix(in srgb, var(--blue) 11%, transparent); }
}

html { -webkit-text-size-adjust: 100%; }
body, button, input, textarea, select { font-family: var(--font-ui); }
body { letter-spacing: -0.003em; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* -- cards everywhere get the same soft depth -- */
.card, .list-row, .devotion-card, .event-row, .announcement-row, .daily-card, .plan-card, .media-tile, .notif-row, .push-banner, .watch-external,
.sermon-row, .live-card, .schedule-list, .give-note, .guest-card, .drawer-guest, .chat-list, .find-card, .manage-panel {
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}
.card, .devotion-card { border-radius: var(--radius-lg); }
.list-row, .event-row, .announcement-row { border-radius: 14px; }

/* -- top bar and bottom bar -- */
.topbar { padding: 14px 20px 12px; border-bottom: 0; box-shadow: 0 1px 0 var(--border); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); }
.icon-btn { min-width: 44px; min-height: 44px; }
.topbar .icon-btn { width: 44px; height: 44px; background: var(--surface-2); color: var(--text); }
.brand .mark { box-shadow: 0 0 0 3px var(--accent-soft); }
.brand .word b { letter-spacing: 0.06em; }
.bottomnav { z-index: 30; border-top: 0; box-shadow: 0 -1px 0 var(--border), 0 -20px 40px -26px rgba(0, 0, 0, 0.55); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); }
.navitem { gap: 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; transition: color 0.2s ease; }
.navitem svg { box-sizing: content-box; width: 22px; height: 22px; padding: 5px 17px; border-radius: 999px; transition: background-color 0.25s ease, transform 0.15s ease; }
.navitem.active svg { background: var(--accent-soft); }
.navitem:active svg { transform: scale(0.9); }

/* -- buttons -- */
.btn { min-height: 46px; padding: 12px 22px; line-height: 1.3; border-radius: var(--radius-btn); font-size: 14.5px; transition: transform 0.12s ease, box-shadow 0.2s ease; }
.btn-primary { box-shadow: 0 10px 22px -10px var(--accent-fill, var(--blue)); }
.btn-ghost { background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-gold { min-height: 46px; border-radius: var(--radius-btn); box-shadow: 0 10px 22px -10px rgba(224, 151, 58, 0.8); }
.btn-dark { border-radius: var(--radius-btn); }
.stat, .amount-input { border-radius: 14px; }
.gate-create { display: flex; align-items: center; justify-content: center; }
.btn:active, .btn-gold:active, .quick-item:active, .event-row:active, .announcement-row:active, .podcast-row:active, .growth-card:active, .list-row:active { transform: scale(0.97); }
.quick-item, .event-row, .announcement-row, .podcast-row, .growth-card, .list-row { transition: transform 0.12s ease, box-shadow 0.2s ease; }

/* -- Home -- */
.greeting { font-size: 14.5px; font-weight: 500; }
.greeting-name { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; margin: 2px 0 18px; }
.hero {
  min-height: 244px; margin-bottom: 0; padding: 22px 22px 54px; border-radius: 20px; box-shadow: var(--card-shadow);
  background: radial-gradient(120% 95% at 88% -10%, var(--blue-dim), transparent 62%), radial-gradient(90% 80% at 0% 105%, rgba(139, 92, 246, 0.42), transparent 62%), linear-gradient(165deg, #131722, #07080c);
}
@supports (color: color-mix(in srgb, red, blue)) {
  .hero { background: radial-gradient(120% 95% at 88% -10%, color-mix(in srgb, var(--blue) 70%, transparent), transparent 62%), radial-gradient(90% 80% at 0% 105%, rgba(139, 92, 246, 0.42), transparent 62%), linear-gradient(165deg, #131722, #07080c); }
}
.hero h3 { font-size: 23px; line-height: 1.22; letter-spacing: -0.02em; margin: 12px 0 18px; max-width: 94%; }
.live-tag { font-size: 11px; padding: 6px 12px 6px 10px; letter-spacing: 0.08em; box-shadow: 0 8px 18px -8px rgba(229, 72, 77, 0.8); }
.next-service { position: relative; z-index: 2; margin: -36px 12px 18px; padding: 18px 20px; border-radius: 16px; background: var(--card-bg); box-shadow: var(--card-shadow); }
.next-service .label { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-dim); }
.countdown { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.service-meta { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }

.quick-grid { gap: 12px; margin-bottom: 18px; }
.quick-item { background: var(--card-bg); box-shadow: var(--card-shadow); border-radius: 14px; padding: 14px 4px 13px; gap: 9px; font-size: 12px; font-weight: 700; color: var(--text); }
.quick-item svg { box-sizing: content-box; width: 22px; height: 22px; padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--tint, var(--blue)); }
.quick-item:nth-child(1) { --tint: #a78bfa; }
.quick-item:nth-child(3) { --tint: #fb7185; }
.quick-item:nth-child(4) { --tint: #fbbf24; }
@supports (color: color-mix(in srgb, red, blue)) {
  .quick-item svg { background: color-mix(in srgb, var(--tint, var(--blue)) 17%, transparent); }
}
.growth-card { border-radius: 16px; padding: 16px 18px; box-shadow: 0 18px 34px -18px var(--accent-fill, var(--blue)); }

.verse-box { position: relative; overflow: hidden; border-radius: 16px; padding: 22px 22px 18px; border-color: rgba(232, 181, 74, 0.3); background: radial-gradient(130% 120% at 100% 0%, rgba(232, 181, 74, 0.2), transparent 58%), var(--card-bg); box-shadow: var(--card-shadow); }
.verse-box::before { content: "\201C"; position: absolute; top: -8px; right: 18px; font: 700 112px/1 Georgia, "Times New Roman", serif; color: rgba(232, 181, 74, 0.24); pointer-events: none; }
.verse-box .eyebrow { font-size: 11px; letter-spacing: 0.14em; }
.verse-box p { position: relative; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.verse-cta { width: fit-content; margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: rgba(232, 181, 74, 0.16); }
[data-theme="light"] .verse-box .eyebrow, [data-theme="light"] .verse-cta { color: #96610a; }
[data-theme="light"] .verse-box::before { color: rgba(184, 123, 15, 0.22); }

.section-head { align-items: center; margin: 32px 0 14px; }
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.section-head a { padding: 7px 13px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; font-weight: 700; text-decoration: none; }
.devotion-card { position: relative; overflow: hidden; padding: 20px 20px 18px 24px; }
.devotion-card::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent-text, var(--blue)); }
.devotion-card h3 { font-size: 18px; letter-spacing: -0.015em; margin: 0 0 8px; }

.sermon-thumb { isolation: isolate; aspect-ratio: 4 / 3; border-radius: 14px; box-shadow: var(--card-shadow); }
.sermon-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.5)); pointer-events: none; }
.sermon-playicon { z-index: 1; width: 46px; height: 46px; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.34); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sermon-duration { z-index: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sermon-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }

.date-badge { flex: none; width: 52px; height: 58px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; line-height: 1; background: var(--accent-soft); color: var(--accent-text, var(--blue)); }
.date-badge span { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; }
.date-badge b { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.event-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.event-text { flex: 1; min-width: 0; }
.event-row { gap: 14px; padding: 12px 14px; }
.e-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.e-sub { color: var(--text-dim); font-size: 13px; }

.conference-banner { border-radius: 20px; padding: 22px; box-shadow: 0 20px 38px -20px rgba(47, 139, 255, 0.75); }
.quick-giving-card { border-radius: 16px; padding: 20px; box-shadow: var(--card-shadow); }
.announcement-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text, var(--blue)); }
.ministry-chip { background: var(--card-bg); box-shadow: var(--card-shadow); font-weight: 700; }

/* -- Growth Groups: the location card's buttons never wrap, and the bible's arrows stay out of the way -- */
.loc-actions { gap: 6px; }
.loc-btn { white-space: nowrap; padding: 0 10px; font-size: 13px; }
.loc-btn svg { flex: none; }
.reader-nav-btn { width: 42px; height: 42px; opacity: 0.92; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.reader-text::after { content: ""; display: block; height: 96px; clear: both; }

[data-theme="light"] .bottomnav { box-shadow: 0 -1px 0 var(--border), 0 -10px 28px -22px rgba(16, 24, 40, 0.2); }

@media (prefers-reduced-motion: reduce) {
  .btn, .quick-item, .event-row, .announcement-row, .podcast-row, .growth-card, .list-row, .navitem, .navitem svg { transition: none; }
  .btn:active, .quick-item:active, .event-row:active, .announcement-row:active, .podcast-row:active, .growth-card:active, .list-row:active, .navitem:active svg { transform: none; }
}

/* -- Long words and titles never push the page sideways: they break where they must, and grids and rows can shrink around them -- */
.app { overflow-wrap: anywhere; }
.sermon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.event-text, .event-main, .sermon-card, .podcast-row > div, .announcement-row > p, .announcement-text, .list-row > :not(button):not(.icon-btn), .card, .devotion-card { min-width: 0; }
