
/* ═══════════════════════════════════════════════════
   TREASURY OF THE SAINTS — Refined Orthodox Design
   Clean, professional, warm earth-tone aesthetic
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #faf8f4;
  --bg-warm: #f5f2ec;
  --surface: #ffffff;
  --surface-alt: #f9f7f3;
  --border: #e5e0d5;
  --border-light: #ece8e0;
  --text: #2c2520;
  --text-secondary: #5a524a;
  --text-muted: #635b54; /* darkened from #8c837a for WCAG AA contrast */
  --accent: #8c2f2f;
  --accent-light: #a63d3d;
  --accent-faint: rgba(140, 47, 47, 0.06);
  --gold: #b8963a;
  --gold-muted: #c4a555;
  --gold-faint: rgba(184, 150, 58, 0.08);
  --blue: #3a5a8c;
  --green: #3a7a4a;
  --purple: #5a3a7a;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 8px;
}

/* ── DARK MODE VARIABLES ── */
[data-theme="dark"] {
  --bg: #111009;
  --bg-warm: #19160f;
  --surface: #1e1a12;
  --surface-alt: #252019;
  --border: #3a3428;
  --border-light: #302b20;
  --text: #f0e8d8;
  --text-secondary: #c5b89e;
  --text-muted: #8a7e6a;
  --accent: #c9584a;
  --accent-light: #d96a5a;
  --accent-faint: rgba(201, 88, 74, 0.10);
  --gold: #d4a84a;
  --gold-muted: #c49840;
  --gold-faint: rgba(212, 168, 74, 0.10);
  --blue: #6a90c8;
  --green: #5aaa6a;
  --purple: #9a70c8;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
}

/* ── DARK MODE TOGGLE BUTTON ── */
.dark-toggle {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.dark-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-faint);
}

/* ── AUTH CHIP (header sign-in button) ── */
.auth-chip {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s;
  line-height: 1;
  max-width: 180px;
}
.auth-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-faint);
}
.auth-chip-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-chip-icon svg {
  width: 100%;
  height: 100%;
}
.auth-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.auth-chip.signed-in {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-faint);
}
@media (max-width: 520px) {
  .auth-chip {
    padding: 0.4rem;
    gap: 0;
  }
  .auth-chip-label {
    display: none;
  }
  .auth-chip.signed-in .auth-chip-label {
    display: none;
  }
}

/* ── AUTH MODAL (magic link sign-in) ── */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
  animation: authFadeIn 0.25s ease;
}
.auth-modal.open {
  display: flex;
}
@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 2.25rem 2rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 1px var(--gold-faint) inset;
  position: relative;
  text-align: center;
  animation: authCardIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.auth-card-close:hover {
  color: var(--gold);
  background: var(--gold-faint);
}
.auth-card-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.9rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card-icon svg { width: 100%; height: 100%; }
.auth-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}
.auth-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.3rem;
}
.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  margin-bottom: 0.8rem;
}
.auth-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-faint);
}
.auth-btn {
  width: 100%;
  padding: 0.8rem 1.2rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-feedback {
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: 1.2em;
  color: var(--text-muted);
}
.auth-feedback.success {
  color: var(--gold);
  font-weight: 500;
}
.auth-feedback.error {
  color: #c94444;
}
.auth-footer {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-signout {
  margin-top: 0.7rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
}
.auth-signout:hover {
  border-color: #c94444;
  color: #c94444;
}

/* ── AUTH BANNER (favorites page disclaimer) ── */
.auth-banner {
  position: relative;
  margin: 0 auto 1.8rem;
  max-width: 640px;
  padding: 1.4rem 1.6rem 1.4rem 1.6rem;
  background: linear-gradient(135deg, var(--gold-faint) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  overflow: hidden;
}
.auth-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold);
}
.auth-banner-icon {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-banner-icon svg { width: 1.3rem; height: 1.3rem; }
.auth-banner-text {
  flex: 1;
  min-width: 0;
}
.auth-banner-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}
.auth-banner-body {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.auth-banner-btn {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.auth-banner-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@media (max-width: 560px) {
  .auth-banner {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
    padding: 1.3rem 1.2rem;
  }
  .auth-banner-btn { width: 100%; }
}

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

/* ── GLOBAL OVERFLOW GUARD (prevents horizontal bleed on mobile) ── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; height: auto; }

body {
  font-family: 'Source Sans 3', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2rem 2rem 1.6rem;
  text-align: center;
  position: relative;
}
.masthead-cross {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.masthead-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}
.masthead-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* ── NAVIGATION ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav-tab {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.85rem 1.3rem;
  cursor: pointer;
  letter-spacing: 0.3px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  user-select: none;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text-secondary); }
.nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── MAIN ── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}
.page { display: none; animation: fadeIn 0.25s ease; }
.page.active {
  display: block;
  /* Let the browser skip work on the active panel's off-screen content too */
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── SECTION TITLES ── */
.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ── QUOTE OF THE DAY HERO ── */
.hero-quote {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
}
.hero-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
}
.hero-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.65;
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.hero-attr {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-faint);
}

/* ── CALENDAR PANEL ── */
.cal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cal-header {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cal-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cal-cross { font-size: 1.2rem; color: var(--accent); }
.cal-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.cal-date {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.cal-fast-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  background: var(--gold-faint);
  color: var(--gold);
  border: 1px solid rgba(184,150,58,0.2);
}
.cal-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}
@media(max-width:768px) { .cal-body { grid-template-columns: 1fr; } }
.cal-col {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--border-light);
}
.cal-col:last-child { border-right: none; }
@media(max-width:768px) { .cal-col { border-right: none; border-bottom: 1px solid var(--border-light); } .cal-col:last-child { border-bottom: none; } }
.cal-col-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.cal-saint-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.cal-saint-desc--clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cal-saint-also { font-size: .8rem; color: var(--text-muted); line-height: 1.45; margin-top: .5rem; }
.cal-saint-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.today-panel {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border); border-top: 3px solid var(--gold);
  border-radius: 14px; padding: 1.25rem 1.35rem 1.1rem; margin-bottom: 1.4rem; box-shadow: var(--shadow);
}
.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.today-greeting { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; font-weight: 600; line-height: 1.1; color: var(--text); }
.today-date { font-size: .85rem; color: var(--text-muted); letter-spacing: .04em; margin-top: .2rem; }
.today-season { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(140,47,47,.35); border-radius: 999px; padding: .3rem .75rem; white-space: nowrap; }
.today-season:empty { display: none; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; }
.today-tile { display: flex; flex-direction: column; gap: .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .85rem .95rem; text-decoration: none; color: inherit; transition: border-color .2s, transform .15s; min-width: 0; }
.today-tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.today-tile-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.today-tile-main { font-family: 'Cormorant Garamond', serif; font-size: 1.22rem; font-weight: 600; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.today-tile-sub { font-size: .8rem; color: var(--text-muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.today-tile--quote { grid-column: 1 / -1; }
.today-tile--communion { grid-column: 1 / -1; border-color: var(--gold); background: linear-gradient(135deg, var(--surface), #fbf6ea); }
.today-quote-text { font-weight: 500; font-style: italic; font-size: 1.25rem; line-height: 1.45; }
.today-quote-attr { display: block; -webkit-line-clamp: unset; color: var(--primary); font-weight: 600; font-size: .9rem; margin-top: .15rem; }
.today-quote-actions { margin-top: .6rem; }
.today-tile--quote:hover { transform: none; }
.today-foot { margin-top: .9rem; display: flex; flex-direction: column; gap: .4rem; }
.today-notify { display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: 999px; padding: .5rem .95rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: border-color .2s, color .2s; }
.today-notify:hover { border-color: var(--gold); color: var(--gold); }
.today-notify.on { border-color: var(--accent); color: var(--accent); }
.today-notify svg { width: 1em; height: 1em; }
.today-notify-hint { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }
/* Feast-day banner: appears on the right of the Today panel on the dates in FEAST_CARDS */
.today-body.has-feast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 270px); gap: .7rem; align-items: stretch; }
.today-feast { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; text-align: center; cursor: pointer; font: inherit;
  background: radial-gradient(ellipse at 50% 0%, #5a1a1f 0%, #35100f 55%, #1d0809 100%); color: #f3e6cf;
  border: 1px solid #c9a24a; border-radius: 10px; padding: 1.2rem 1rem; box-shadow: inset 0 0 0 4px #2a0d10, inset 0 0 0 5px rgba(201,162,74,.5); transition: transform .15s, box-shadow .15s; }
.today-feast:hover, .today-feast:focus-visible { transform: translateY(-1px); box-shadow: inset 0 0 0 4px #2a0d10, inset 0 0 0 5px #c9a24a, var(--shadow); outline: none; }
.today-feast svg { width: 26px; height: 37px; }
.today-feast-kicker { font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #c9a24a; }
.today-feast-title { font-family: 'Cormorant Garamond', serif; font-size: 1.45rem; font-weight: 600; line-height: 1.15; color: #f7ecd6; }
.today-feast-line { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.05rem; line-height: 1.35; color: #ead9bb; }
.today-feast-cta { margin-top: .25rem; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #1d0809; background: #c9a24a; border-radius: 999px; padding: .4rem .9rem; }
@media (max-width: 760px) { .today-body.has-feast { grid-template-columns: 1fr; } .today-feast { padding: 1rem; } }
.feast-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(12,4,5,.88); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 3.6rem 1rem 2rem; }
.feast-overlay img { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.feast-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: center; gap: .6rem; padding: .6rem 1rem; background: linear-gradient(#1d0809, rgba(29,8,9,.85)); }
.feast-bar button, .feast-bar a { font: inherit; font-size: .82rem; font-weight: 700; letter-spacing: .04em; cursor: pointer; text-decoration: none; color: #f3e6cf; background: transparent; border: 1px solid #c9a24a; border-radius: 999px; padding: .4rem 1rem; }
.feast-bar button:hover, .feast-bar a:hover { background: #c9a24a; color: #1d0809; }
.cal-read-more {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.4rem;
  transition: color 0.15s;
}
.cal-read-more:hover { text-decoration: underline; color: var(--accent-light); }
.cal-links { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.cal-tag {
  display: inline-block; vertical-align: middle; margin-left: .35rem;
  font-family: 'Source Sans 3', sans-serif; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: .05rem .45rem; opacity: .9;
}
.cal-reading-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}
.cal-reading-item:last-child { border-bottom: none; margin-bottom: 0; }
.cal-reading-type {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: help;
  white-space: nowrap;
}
.cal-reading-type.ot { background: rgba(100,70,30,0.08); color: var(--text-muted); }
.cal-reading-type.ep { background: rgba(58,90,140,0.08); color: var(--blue); }
.cal-reading-type.ap { background: rgba(58,122,74,0.08); color: var(--green); }
.cal-reading-type.go { background: rgba(184,150,58,0.08); color: var(--gold); }
.cal-reading-ref { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.cal-reading-note { font-size: 0.78rem; color: var(--text-muted); }
.cal-quote-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.cal-quote-attr {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}
.cal-stale {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: right;
  padding: 0.4rem 1.25rem 0.5rem;
  border-top: 1px solid var(--border-light);
}

/* ── INFO CARDS ── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}
.info-card-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.info-card-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.info-card-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}
.search-input::placeholder { color: var(--text-muted); }
.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── CATEGORY PILLS ── */
.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  justify-content: center;
}
.cat-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--surface);
  transition: all 0.15s;
  user-select: none;
}
.cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cat-pill.lives-pill {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.cat-pill.lives-pill:hover {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold);
}
.cat-pill.lives-pill.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

/* ── COLLAPSIBLE QUOTE CARDS ── */
.quote-card {
  /* Skip painting off-screen cards until they scroll near the viewport.
     This is a big paint-cost win on the "By Saint" / "By Theme" pages
     where dozens of cards are stacked. Safe fallback for older browsers. */
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.quote-card:hover {
  box-shadow: var(--shadow-md);
}
.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.15rem;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
}
.quote-header:hover {
  background: var(--surface-alt);
}
.quote-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.quote-saint-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quote-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  font-style: italic;
}
.quote-header-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.quote-cat-badge {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--accent-faint);
  color: var(--accent);
  border: 1px solid rgba(140,47,47,0.12);
}
.quote-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.quote-card.open .quote-chevron {
  transform: rotate(180deg);
}
.quote-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.quote-card.open .quote-body {
  max-height: 800px;
}
.quote-body-inner {
  padding: 0 1.15rem 1rem;
  border-top: 1px solid var(--border-light);
}
.quote-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.7;
  font-style: italic;
  color: var(--text);
  padding-top: 0.9rem;
  margin-bottom: 0.75rem;
}
.quote-source {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.quote-source em { font-style: normal; }
.quote-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.quote-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.quote-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-faint);
}

/* ── SAINT SECTION (By Saint view — collapsible) ── */
.saint-section {
  margin-bottom: 0.5rem;
}
.saint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.saint-card:hover { box-shadow: var(--shadow-md); }
.saint-header {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.saint-header:hover { background: var(--surface-alt); }
.saint-cross { color: var(--accent); font-size: 1rem; flex-shrink: 0; }
.saint-name-text { flex: 1; }
.saint-count {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  flex-shrink: 0;
}
.saint-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.saint-card.open .saint-chevron { transform: rotate(180deg); }
.saint-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.saint-card.open .saint-body { max-height: 5000px; }
.saint-body-inner {
  padding: 0 1.15rem 0.75rem;
  border-top: 1px solid var(--border-light);
}
.saint-body-inner .quote-card {
  border-left: 3px solid var(--accent-faint);
  margin-top: 0.5rem;
}

/* ── PRAYER CARD ── */
/* ── PRAYER CATEGORY HEADER ── */
.prayer-category-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  padding: 0.4rem 0;
  margin: 1.6rem 0 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.prayer-category-header:first-child { margin-top: 0; }
.prayer-category-header span { color: var(--accent); }

/* ── PRAYER CARD (collapsible) ── */
.prayer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 0.55rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.prayer-card:hover { box-shadow: var(--shadow-md); }
.prayer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.15rem;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
  transition: background 0.1s;
}
.prayer-header:hover { background: var(--surface-alt); }
.prayer-header-inner { flex: 1; min-width: 0; }
.prayer-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1rem;
}
.prayer-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prayer-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.prayer-card.open .prayer-chevron { transform: rotate(180deg); }
.prayer-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.prayer-card.open .prayer-body { max-height: 4000px; }
.prayer-body-inner {
  padding: 0 1.15rem 1.1rem;
  border-top: 1px solid var(--border-light);
}
.prayer-intro {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0.8rem 0 0.6rem;
  padding: 0.55rem 0.85rem;
  background: var(--accent-faint);
  border-radius: 4px;
  font-style: italic;
}
.prayer-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  padding-top: 0.85rem;
  white-space: pre-line;
}

/* ── SAINT BIO CARD ── */
.saint-bio-section { margin-top: 1.5rem; padding-top: 1.5rem; }
.saint-bio-section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
  text-align: center;
}
.saint-bio-section-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  text-align: center;
}
.saint-bio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
  margin-bottom: 0.75rem;
}
.saint-bio-card:last-child { margin-bottom: 0; }
.saint-bio-card:hover { box-shadow: var(--shadow-md); }
.saint-bio-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.saint-bio-header:hover { background: var(--surface-alt); }
.saint-bio-icon { flex-shrink: 0; line-height: 1; }
.saint-bio-icon .svg-icon { width: 1.4rem; height: 1.4rem; color: var(--gold); }
.saint-bio-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  flex: 1;
  min-width: 0;
}
.saint-bio-dates {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.3;
}
.saint-bio-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.saint-bio-card.open .saint-bio-chevron { transform: rotate(180deg); }
.saint-bio-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}
.saint-bio-card.open .saint-bio-body { max-height: 50000px; }
.saint-bio-body-inner {
  padding: 0.25rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-light);
}
.saint-bio-body-inner h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1.2rem 0 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
.saint-bio-body-inner h4:first-of-type { border-top: none; padding-top: 0.75rem; }
.saint-bio-body-inner p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0.7rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.saint-bio-pull {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
  border-left: 3px solid var(--gold);
  padding: 0.5rem 0.85rem;
  margin: 0.75rem 0;
  background: var(--gold-faint);
  border-radius: 0 4px 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── SAINT BIO SHARE BUTTON ── */
.saint-bio-share-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-light);
}
.saint-bio-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.saint-bio-share-btn:hover { background: var(--accent-faint); color: var(--accent); border-color: var(--accent); }

/* ── SAINT BIO MOBILE ── */
@media(max-width:600px) {
  .saint-bio-header { padding: 0.85rem 0.75rem; gap: 0.6rem; }
  .saint-bio-name { font-size: 1rem; }
  .saint-bio-dates { font-size: 0.7rem; }
  .saint-bio-body-inner { padding: 0.25rem 0.85rem 1rem; }
  .saint-bio-body-inner h4 { font-size: 0.95rem; }
  .saint-bio-body-inner p { font-size: 0.88rem; }
  .saint-bio-pull { font-size: 0.88rem; padding: 0.45rem 0.7rem; }
  .saint-bio-share-bar { padding: 0.6rem 0.75rem 0.85rem; }
  .saint-bio-icon .svg-icon { width: 1.2rem; height: 1.2rem; }
}

/* ── SCRIPTURE MEDITATION BLOCK ── */
.scripture-meditation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-md);
}
.scripture-med-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.scripture-med-icon {
  font-size: 2rem;
  color: var(--gold);
  flex-shrink: 0;
  line-height: 1;
}
.scripture-med-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gold);
  margin-bottom: 0.2rem;
}
.scripture-med-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  line-height: 1.3;
}
.scripture-med-verses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.scripture-verse-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(184,150,58,0.25);
  border-radius: 16px;
  background: var(--gold-faint);
  color: var(--gold);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: background 0.18s, border-color 0.18s;
}
.scripture-verse-chip:hover,
.scripture-verse-chip:focus {
  background: rgba(184,150,58,0.18);
  border-color: var(--gold);
  outline: none;
}
/* Verse tooltip popup */
.verse-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: min(360px, 90vw);
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  padding: 1rem 1.1rem 0.9rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s;
}
.verse-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.verse-tooltip-ref {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.verse-tooltip-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}
.verse-tooltip-source {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: right;
}
.verse-tooltip-loading {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}
.scripture-med-note {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-style: italic;
  border-top: 1px solid var(--border-light);
  padding-top: 0.85rem;
  margin-top: 0.25rem;
}

/* ── FAVORITES EMPTY ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; color: var(--border); }
.empty-state-text { font-size: 0.95rem; }

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}
.footer-cross { color: var(--accent); margin-right: 0.3rem; }
.footer-hubs { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 1rem auto .4rem; max-width: 900px; }
.footer-hubs a { font-size: .74rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .65rem; background: var(--surface); text-decoration: none; }
.footer-hubs a:hover { color: var(--primary); border-color: var(--primary); }
.footer-credit {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.footer-credit a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.footer-credit a:hover {
  text-decoration: underline;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 1000;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── RESPONSIVE ── */
@media(max-width:600px) {
  .masthead { padding: 1.25rem 1rem; }
  .masthead-title { font-size: 1.5rem; }
  main { padding: 1rem 0.75rem; }
  .hero-quote { padding: 1.25rem; }
  .hero-text { font-size: 1.15rem; }
  .nav-tab { padding: 0.7rem 0.8rem; font-size: 0.75rem; }
  .quote-preview { display: none; }
  /* Keep action button rows inside the viewport on phones */
  .hero-actions, .quote-actions { flex-wrap: wrap; gap: 0.4rem; }
  .btn-sm { padding: 0.4rem 0.7rem; font-size: 0.75rem; }
}

html { scroll-behavior: smooth; }

/* ── JOURNEY / PROSE ARTICLE ── */
.journey-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-md);
  line-height: 1.8;
}
@media(max-width:600px) { .journey-article { padding: 1.25rem 1rem; } }
.journey-byline {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}
.journey-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1.75rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}
.journey-heading:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.journey-article p {
  color: var(--text-secondary);
  font-size: 0.97rem;
  margin-bottom: 1rem;
}
.journey-article p:last-child { margin-bottom: 0; }
.journey-pull-quote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--accent-faint);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.journey-ref-list {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
.journey-ref-list strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── ASK THE FATHERS CHAT ── */
.atf-chat-wrap {
  max-width: 800px;
  margin: 1.5rem auto 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.atf-sources-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.atf-source-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  background: var(--gold-faint);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(184,150,58,0.15);
}
.atf-messages {
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}
.atf-welcome {
  text-align: center;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.atf-welcome-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.atf-welcome-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 500px;
  line-height: 1.5;
}
.atf-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 480px;
}
.atf-suggestion {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}
.atf-suggestion:hover {
  background: var(--accent-faint);
  border-color: var(--accent);
  color: var(--text);
}
.atf-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.atf-msg--user {
  flex-direction: row-reverse;
}
.atf-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
}
.atf-msg--user .atf-msg-avatar {
  background: var(--accent);
  color: #fff;
}
.atf-msg--ai .atf-msg-avatar {
  background: var(--gold-faint);
  color: var(--gold);
  border: 1px solid rgba(184,150,58,0.2);
}
.atf-msg-bubble {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.6;
}
.atf-msg--user .atf-msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.atf-msg--ai .atf-msg-bubble {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
  color: var(--text);
}
.atf-msg--ai .atf-msg-bubble p { margin: 0 0 0.6rem; line-height: 1.75; }
.atf-msg--ai .atf-msg-bubble p:last-child { margin: 0; }
/* Patristic quote blocks — indented, italicised, gold left border */
.atf-msg--ai .atf-msg-bubble blockquote {
  margin: 0.85rem 0 0.9rem 0;
  padding: 0.7rem 1rem 0.7rem 1.15rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-faint);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.78;
  font-size: 0.97em;
}
.atf-msg--ai .atf-msg-bubble blockquote p { margin: 0; color: inherit; }
.atf-msg--ai .atf-msg-bubble strong { color: var(--text); font-weight: 650; }
.atf-msg--ai .atf-msg-bubble em { font-style: italic; color: var(--text-secondary); }
.atf-msg--ai .atf-msg-bubble .atf-source-label {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--gold);
  opacity: 0.85;
  margin-top: 0.15rem;
}
.atf-msg--ai .atf-msg-bubble hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1rem 0;
}
/* Streaming cursor shown while response is being typed */
.atf-msg-bubble--streaming .atf-stream-last::after {
  content: '▋';
  display: inline-block;
  margin-left: 2px;
  animation: atf-cursor-blink 0.65s step-end infinite;
  color: var(--accent, #8b4513);
  vertical-align: baseline;
}
@keyframes atf-cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.atf-citations {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}
.atf-citation-toggle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.atf-citation-toggle:hover { color: var(--accent); }
.atf-citation-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}
.atf-citation-toggle.open svg { transform: rotate(90deg); }
.atf-citation-list {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.atf-citation-list.open { display: block; }
.atf-citation-item {
  padding: 0.5rem 0.6rem;
  border-left: 3px solid var(--gold);
  margin-bottom: 0.5rem;
  background: rgba(184,150,58,0.04);
  border-radius: 0 4px 4px 0;
}
.atf-citation-source {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.2rem;
}
.atf-citation-text {
  font-style: italic;
  line-height: 1.5;
}
.atf-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem 0;
}
.atf-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: atfBounce 1.2s ease-in-out infinite;
}
.atf-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.atf-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes atfBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}
.atf-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-end;
}
.atf-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
}
.atf-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-faint);
}
.atf-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.atf-send-btn:hover { background: var(--accent-light); }
.atf-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.atf-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 1rem 0.75rem;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media(max-width:600px) {
  .atf-messages { min-height: 300px; max-height: 450px; padding: 1rem; }
  .atf-welcome { padding: 1rem 0.5rem; }
  .atf-msg-bubble { max-width: 92%; }
}

/* ── HISTORICAL NOTE BADGE ── */
.hist-note {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(90,58,122,0.08);
  color: var(--purple);
  border: 1px solid rgba(90,58,122,0.18);
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ── SKIP NAVIGATION (accessibility) ── */
.skip-nav {
  position: absolute;
  top: -50px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-nav:focus { top: 0; outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── SCREEN READER ONLY ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── FOCUS RING (keyboard navigation) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.nav-tab:focus-visible {
  outline-offset: -3px;
}
.quote-header:focus-visible,
.saint-header:focus-visible,
.cat-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── PROLOGUE OF OHRID ── */
.prologue-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}
.prologue-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}
.prologue-icon { font-size: 1.5rem; }
.prologue-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.prologue-date { font-size: 0.8rem; color: var(--text-muted); }
.prologue-body { margin-bottom: 0.6rem; }
.prologue-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}
.prologue-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.prologue-link:hover { background: var(--accent-light); }
.prologue-credit {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

/* ── LITURGICAL PANEL (Fasting + Feast combined) ── */
.liturgical-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lit-row {
  display: flex;
  align-items: stretch;
}
@media(max-width:640px) {
  .lit-row { flex-direction: column; }
  .lit-divider { width: 100% !important; height: 1px !important; }
}
.lit-cell {
  flex: 1;
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
}
.lit-cell-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}
.lit-divider {
  width: 1px;
  background: var(--border-light);
  flex-shrink: 0;
}
.fasting-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.fasting-rule {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.fasting-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.fasting-level {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}
.fasting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s;
}
.fasting-dot.active { background: var(--gold); }
.fasting-dot.strict { background: var(--accent); }
.feast-countdown-header {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.feast-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.feast-timer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.feast-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.feast-num {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.feast-lbl {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.feast-today-banner {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  padding: 0.3rem 0;
}
.feast-season-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 0.35rem;
}
.feast-season-badge.lent {
  background: rgba(93, 42, 106, 0.1);
  color: #6d3a7d;
  border: 1px solid rgba(93, 42, 106, 0.2);
}
.feast-season-badge.pascha {
  background: rgba(184, 150, 58, 0.1);
  color: var(--gold);
  border: 1px solid rgba(184, 150, 58, 0.2);
}
.feast-season-badge.advent {
  background: rgba(42, 60, 106, 0.1);
  color: #4a6491;
  border: 1px solid rgba(42, 60, 106, 0.2);
}
.feast-season-badge.dormition {
  background: rgba(42, 90, 70, 0.1);
  color: #3a7d5a;
  border: 1px solid rgba(42, 90, 70, 0.2);
}

/* ── TROPARION & KONTAKION ── */
.hymns-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hymns-header {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hymns-icon { font-size: 1.1rem; color: var(--gold); }
.hymns-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.hymns-body { padding: 1rem 1.25rem; }
.hymn-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.hymn-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.hymn-type {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-bottom: 0.15rem;
}
.hymn-saint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.hymn-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.55;
}
.hymns-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}
.hymns-tone {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

/* ── UNIFIED SEARCH ── */
.unified-search-wrap { position: relative; margin-bottom: 1.2rem; }
.unified-search-wrap::before {
  content: '';
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat center;
  pointer-events: none;
  z-index: 1;
}
.unified-search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}
.unified-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.unified-filters[hidden] { display: none; }
.unified-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .5rem 0 .2rem; }
.uf-chip { font: inherit; font-size: .76rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; }
.uf-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.uf-count { margin-left: auto; font-size: .76rem; color: var(--text-muted); }
.ur-more { display: block; width: 100%; font: inherit; font-size: .82rem; font-weight: 600; color: var(--primary); background: none; border: 1px dashed var(--border); border-radius: 8px; padding: .45rem; margin: .3rem 0 .6rem; cursor: pointer; }
.unified-results {
  margin-top: 0.5rem;
  display: none;
}
.unified-results.has-results { display: block; }
.ur-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
}
.ur-group-label:first-child { margin-top: 0.3rem; }
.ur-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: all 0.15s;
}
.ur-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.ur-item-title { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.ur-item-preview { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.4; }
.ur-item-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-faint);
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.3rem;
}
.ur-clear {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ur-clear a, .ur-clear button { color: var(--accent); cursor: pointer; text-decoration: underline; background: none; border: none; font: inherit; padding: 0; }

/* ── FOR YOU GRID ── */
.fy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 0.75rem; margin-top: 0.5rem; }
.fy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.fy-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); transform: translateY(-2px); }
.fy-icon { font-size: 2rem; margin-bottom: 0.6rem; line-height: 1; }
.fy-icon .svg-icon { width: 2rem; height: 2rem; }
.fy-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.fy-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.fy-count { font-size: 0.72rem; color: var(--accent); margin-top: 0.5rem; font-weight: 600; }
.fy-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 1rem;
  font-weight: 600;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0.3rem 0;
}
.fy-back:hover { text-decoration: underline; }
.fy-situation-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.fy-situation-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.2rem; }

/* ── SUBMIT QUOTE ── */
.submit-quote-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.submit-quote-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.modal-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.3rem; line-height: 1.5; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.form-group .req { color: var(--accent); }
.form-group .opt { color: var(--text-muted); font-weight: 400; }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface-alt);
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}
.form-group textarea { resize: vertical; }
.submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.submit-btn:hover { background: var(--accent-light); }
.submit-success { text-align: center; padding: 2rem 0; }
.success-icon { font-size: 2.5rem; color: var(--gold); margin-bottom: 0.75rem; }
.submit-success p { color: var(--text-secondary); line-height: 1.6; }

/* ── IMAGE THEME PICKER ── */
.img-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1001;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.img-picker-overlay.open { display: flex; }
.img-picker {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.75rem 2rem 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  position: relative;
  text-align: center;
}
.img-picker-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.img-picker-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.img-picker-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.img-picker-close:hover { color: var(--text); }
.img-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.img-theme-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}
.img-theme-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.img-theme-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.img-theme-preview {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
}
.img-theme-preview.parchment {
  background: linear-gradient(135deg, #f7f2e8, #e3d8c2);
}
.img-theme-preview.dark {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.img-theme-preview.gold {
  background: linear-gradient(135deg, #f5e6c8, #c9a84c, #f5e6c8);
}
.img-theme-preview-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.3;
  max-width: 80%;
  text-align: center;
}
.img-theme-preview.parchment .img-theme-preview-text { color: #2c2520; }
.img-theme-preview.dark .img-theme-preview-text { color: #e8dcc8; }
.img-theme-preview.gold .img-theme-preview-text { color: #2c2018; }
.img-theme-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.55rem 0;
}
@media(max-width:400px) {
  .img-picker-grid { grid-template-columns: 1fr; max-width: 200px; margin: 0 auto; }
  .img-theme-preview { height: 90px; }
}

/* ── SHARED QUOTE HIGHLIGHT ── */
.shared-highlight {
  animation: sharedGlow 2.5s ease-out;
}
@keyframes sharedGlow {
  0% { box-shadow: 0 0 0 4px var(--gold), var(--shadow-md); }
  100% { box-shadow: 0 0 0 0px transparent, var(--shadow-md); }
}

/* ── SVG ICON SYSTEM (replaces all emojis) ── */
.svg-icon { display: inline-block; vertical-align: middle; fill: currentColor; flex-shrink: 0; }
.svg-icon svg { display: block; width: 100%; height: 100%; }

/* Size variants */
.svg-icon--sm { width: 1em; height: 1em; }
.svg-icon--md { width: 1.2em; height: 1.2em; }
.svg-icon--lg { width: 1.5em; height: 1.5em; }
.svg-icon--xl { width: 2em; height: 2em; }
.svg-icon--hero { width: 4rem; height: 4rem; }

/* Fasting icon sizing */
.lit-cell-icon .svg-icon { width: 2rem; height: 2rem; }

/* Masthead cross sizing */
.masthead-cross .svg-icon { width: 4rem; height: 4rem; }

/* Calendar cross sizing */
.cal-cross .svg-icon { width: 1.2rem; height: 1.2rem; }

/* Footer cross */
.footer-cross .svg-icon { width: 1em; height: 1em; }

/* Prologue icon */
.prologue-icon .svg-icon { width: 1.4rem; height: 1.4rem; }

/* Hymns icon */
.hymns-icon .svg-icon { width: 1.2rem; height: 1.2rem; }

/* Dark toggle icon */
.dark-toggle .svg-icon { width: 1.1rem; height: 1.1rem; }

/* For You grid icon */
.for-you-icon .svg-icon { width: 2rem; height: 2rem; }

/* ════════════════════════════════════════════════════
   FEATURE: Subscribe Panel (Daily Quote Email)
   ════════════════════════════════════════════════════ */
.subscribe-panel { max-width: 600px; margin: 2rem auto; padding: 0 1rem; }
.subscribe-inner { background: var(--card-bg, var(--surface)); border: 1px solid var(--border-light); border-radius: 1rem; padding: 2rem; text-align: center; }
.subscribe-icon { display: inline-block; margin-bottom: .75rem; }
.subscribe-icon .svg-icon { width: 2rem; height: 2rem; color: var(--gold); }
.subscribe-title { font-family: var(--heading-font, serif); font-size: 1.25rem; color: var(--text); margin-bottom: .5rem; font-weight: 600; }
.subscribe-desc { color: var(--text-primary); font-size: .9rem; margin-bottom: 1.25rem; }
.subscribe-form { margin: 0; }
.subscribe-row { display: flex; gap: .5rem; max-width: 400px; margin: 0 auto; }
.subscribe-input { flex: 1; padding: .65rem 1rem; border: 1px solid var(--border-light); border-radius: .5rem; background: var(--bg); color: var(--text); font-size: .95rem; font-family: inherit; }
.subscribe-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 150, 58, .15); }
.subscribe-btn { padding: .65rem 1.25rem; background: var(--gold); color: #1a1a2e; border: none; border-radius: .5rem; font-weight: 600; font-size: .95rem; cursor: pointer; white-space: nowrap; transition: opacity .2s ease; }
.subscribe-btn:hover { opacity: .9; }
.subscribe-success { color: var(--gold); font-size: .95rem; margin-top: .75rem; }
@media (max-width: 480px) { .subscribe-row { flex-direction: column; } .subscribe-btn { width: 100%; } }

/* ════════════════════════════════════════════════════
   FEATURE: My Treasury (Favorites)
   ════════════════════════════════════════════════════ */
.treasury-empty { text-align: center; padding: 3rem 1rem; }
.treasury-empty .svg-icon { width: 3rem; height: 3rem; color: var(--gold); display: block; margin: 0 auto 1rem; }
.treasury-empty p { color: var(--text-secondary); font-size: .95rem; }
.treasury-actions { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; margin-bottom: 1rem; }
.treasury-count { color: var(--text-muted); font-size: .9rem; }
.treasury-btn.is-saved svg path { fill: var(--gold); stroke: var(--gold); }
.btn-sm { padding: .5rem .75rem; font-size: .85rem; border: 1px solid var(--border); border-radius: .4rem; background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.btn-sm:hover { background: var(--surface-alt); }


/* ═══════════════════════════════════════
   FEATURE: The Early Church Speaks (Audio Series)
   ═══════════════════════════════════════ */
.ecs-intro {
  background: linear-gradient(135deg, var(--accent-faint), var(--gold-faint));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.ecs-intro strong { color: var(--accent); font-weight: 600; }
.ecs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.ecs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ecs-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.ecs-cover { position: relative; aspect-ratio: 16/9; background: #2c0f0f; }
.ecs-cover svg { display: block; width: 100%; height: 100%; }
.ecs-badge {
  position: absolute; top: .7rem; left: .7rem;
  background: rgba(20,8,8,.55); color: #f0e2c0;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  padding: .28rem .65rem; border-radius: 999px;
  border: 1px solid rgba(240,226,192,.35);
}
.ecs-badge--right { left: auto; right: .7rem; top: auto; bottom: .7rem; display: inline-flex; align-items: center; gap: .3rem; }
.ecs-body { padding: 1.2rem 1.35rem 1.35rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.ecs-title { font-family: 'Cormorant Garamond', serif; font-size: 1.65rem; font-weight: 700; color: var(--text); line-height: 1.12; }
.ecs-sub { font-size: .85rem; color: var(--text-muted); font-style: italic; margin-top: -.4rem; }
.ecs-desc { font-size: .92rem; color: var(--text-secondary); line-height: 1.6; }
.ecs-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.ecs-pill {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--gold); color: var(--gold);
  padding: .24rem .62rem; border-radius: 999px; background: var(--gold-faint);
}
.ecs-actions { display: flex; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.ecs-play-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: .72rem 1.2rem; font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .2s ease, transform .15s ease;
}
.ecs-play-btn:hover { background: var(--accent-light); }
.ecs-play-btn:active { transform: scale(.98); }
.ecs-play-btn svg { width: 1em; height: 1em; }
.ecs-pdf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid var(--border); color: var(--text-secondary); background: var(--surface-alt);
  border-radius: 999px; padding: .72rem 1.1rem; font-size: .88rem; font-weight: 500;
  text-decoration: none; transition: border-color .2s, color .2s;
}
.ecs-pdf-btn:hover { border-color: var(--gold); color: var(--gold); }
.ecs-pdf-btn svg { width: .95em; height: .95em; }
.ecs-share-btn {
  /* compact share icon overlaid on the cover art, top-right (era badge is top-left) */
  position: absolute; top: .55rem; right: .55rem; z-index: 2;
  width: 2.1rem; height: 2.1rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20,8,8,.55); color: #f0e2c0;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(240,226,192,.35); border-radius: 50%;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.ecs-share-btn:hover, .ecs-share-btn:focus-visible { background: rgba(20,8,8,.8); color: #e8c56a; border-color: #e8c56a; transform: scale(1.06); outline: none; }
.ecs-share-btn svg { width: 1rem; height: 1rem; }
.ecs-dock-share {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--border); background: var(--surface-alt); color: var(--text-secondary);
  font-size: .78rem; font-weight: 700; padding: .38rem .8rem; border-radius: 999px; cursor: pointer; font-family: inherit;
  transition: border-color .2s, color .2s;
}
.ecs-dock-share:hover { border-color: var(--gold); color: var(--gold); }
.ecs-dock-share svg { width: .9em; height: .9em; }
.ecs-coming {
  border: 1px dashed var(--border); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 2.5rem 1.5rem; color: var(--text-muted); text-align: center;
  font-size: .9rem; background: var(--surface-alt); min-height: 220px;
}
.ecs-coming .svg-icon { width: 2rem; height: 2rem; color: var(--gold); opacity: .7; }

/* ── Docked audio player ── */
.ecs-dock {
  position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 900;
  max-width: 620px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 36px rgba(0,0,0,.22);
  transform: translateY(130%); opacity: 0;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.ecs-dock.active { transform: translateY(0); opacity: 1; }
.ecs-dock-progress { position: absolute; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .25s linear; }
.ecs-mini { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; cursor: pointer; }
.ecs-dock.expanded .ecs-mini { display: none; }
.ecs-mini-art { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.ecs-mini-art svg { display: block; width: 100%; height: 100%; }
.ecs-mini-meta { flex: 1; min-width: 0; }
.ecs-mini-title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.02rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecs-mini-sub { font-size: .74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecs-icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text);
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.ecs-icon-btn:hover { background: var(--surface-alt); }
.ecs-icon-btn svg { width: 22px; height: 22px; }
.ecs-full { display: none; padding: 1.4rem 1.5rem 1.5rem; text-align: center; }
.ecs-dock.expanded .ecs-full { display: block; }
.ecs-full-art { width: min(200px, 48vw); aspect-ratio: 1; margin: .4rem auto .9rem; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ecs-full-art svg { display: block; width: 100%; height: 100%; }
.ecs-full-title { font-family: 'Cormorant Garamond', serif; font-size: 1.45rem; font-weight: 700; color: var(--text); line-height: 1.15; }
.ecs-full-sub { font-size: .8rem; color: var(--text-muted); font-style: italic; margin-top: .15rem; }
.ecs-seek-wrap { margin: 1.1rem 0 .2rem; }
.ecs-seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
  border-radius: 999px; background: var(--border); outline: none; cursor: pointer;
  accent-color: var(--accent);
}
.ecs-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.ecs-seek::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.ecs-times { display: flex; justify-content: space-between; font-size: .74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ecs-controls { display: flex; align-items: center; justify-content: center; gap: 1.4rem; margin-top: .7rem; }
.ecs-skip-btn {
  background: none; border: none; cursor: pointer; color: var(--text-secondary);
  display: inline-flex; flex-direction: column; align-items: center; gap: .1rem;
  font-size: .62rem; font-weight: 600; padding: .4rem; border-radius: 10px; transition: color .2s;
}
.ecs-skip-btn:hover { color: var(--accent); }
.ecs-skip-btn svg { width: 26px; height: 26px; }
.ecs-big-play {
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(140,47,47,.4);
  transition: background .2s, transform .15s;
}
.ecs-big-play:hover { background: var(--accent-light); }
.ecs-big-play:active { transform: scale(.95); }
.ecs-big-play svg { width: 28px; height: 28px; }
.ecs-extra-row { display: flex; align-items: center; justify-content: space-between; margin-top: .9rem; }
.ecs-speed-btn {
  border: 1px solid var(--border); background: var(--surface-alt); color: var(--text-secondary);
  font-size: .78rem; font-weight: 700; padding: .38rem .8rem; border-radius: 999px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: border-color .2s, color .2s;
}
.ecs-speed-btn:hover { border-color: var(--gold); color: var(--gold); }
.ecs-collapse-btn { border: none; background: none; color: var(--text-muted); cursor: pointer; padding: .4rem; border-radius: 8px; display: inline-flex; }
.ecs-collapse-btn:hover { color: var(--text); }
.ecs-collapse-btn svg { width: 20px; height: 20px; }
body.ecs-dock-open { padding-bottom: 86px; }
@media (max-width: 480px) {
  .ecs-grid { grid-template-columns: 1fr; }
  .ecs-actions { flex-direction: column; }
  .ecs-dock { left: .5rem; right: .5rem; bottom: .5rem; }
}

