/* Existential — Design System
 *
 * Dark, editorial, contemporary.
 * Serif for ideas. Sans for chrome. Amber for emphasis.
 */

:root {
  /* Color */
  --bg: #0A0A0B;
  --bg-1: #131316;
  --bg-2: #1C1C20;
  --bg-3: #232328;
  --ink: #F5F1E8;
  --ink-2: #B8B6B0;
  --ink-3: #93939A;
  --ink-4: #5A5A60;
  --line: #1F1F23;
  --line-bright: #2E2E33;
  --amber: #E8B454;
  --amber-2: #F2C56F;
  --amber-glow: rgba(232, 180, 84, 0.15);
  --ember: #FF6B35;

  /* Type */
  --serif: 'Fraunces', 'Iowan Old Style', 'Charter', 'Times New Roman', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --max-w: 1100px;
  --max-w-narrow: 720px;
  --header-h: 64px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Easing */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

/* Faint amber spotlight at the top to add warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(60% 40% at 50% -10%, var(--amber-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--amber); }

button { font-family: inherit; }

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.7);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark { font-size: 26px; font-weight: 700; }
.brand-dot { color: var(--amber); }
.brand-word { letter-spacing: -0.02em; }
.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-bright); background: var(--bg-1); }

/* Header link button (inline text, ghost) */
.header-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.header-link:hover { color: var(--ink); background: var(--bg-1); }

/* Avatar button + menu */
.avatar-btn {
  appearance: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
}
.avatar-btn:hover { border-color: var(--amber); }

.header-nav { position: relative; display: flex; align-items: center; gap: 4px; }

.menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-1);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-md);
  padding: 6px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  z-index: 60;
}
.menu-head { padding: 10px 12px 8px; }
.menu-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.menu-email { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.menu-item:hover { background: var(--bg-2); color: var(--ink); }
.menu-divider { height: 1px; background: var(--line); margin: 6px 4px; }

/* ===== STREAK PILL ===== */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(232, 180, 84, 0.1);
  color: var(--amber);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(232, 180, 84, 0.25);
  user-select: none;
  margin-right: var(--s-2);
}
.streak-pill .streak-flame {
  font-size: 14px;
  filter: drop-shadow(0 0 6px var(--amber));
}
.streak-pill .streak-count { letter-spacing: -0.02em; }
.streak-pill[data-cold="true"] { background: var(--bg-1); color: var(--ink-3); border-color: var(--line); }
.streak-pill[data-cold="true"] .streak-flame { filter: none; opacity: 0.6; }

/* ===== MAIN ===== */
#app {
  flex: 1;
  position: relative;
  z-index: 1;
}
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-7) var(--s-5) var(--s-9);
}
.container-narrow { max-width: var(--max-w-narrow); }

.view { animation: fade-up 0.35s var(--ease); }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ===== TODAY HERO ===== */
.today {
  position: relative;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(232, 180, 84, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
  border-radius: var(--r-lg);
  padding: var(--s-7) var(--s-7);
  overflow: hidden;
  margin-bottom: var(--s-6);
}
.today-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-5);
}
.today-eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--amber);
}
.today-question {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 5.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-5);
  max-width: 22ch;
}
.today-meta {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0 0 var(--s-6);
  max-width: 50ch;
}

/* ===== BUTTONS ===== */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  transition: transform 0.06s var(--ease), background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--amber);
  color: #1a1408;
}
.btn-primary:hover { background: var(--amber-2); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-bright);
}
.btn-ghost:hover { background: var(--bg-1); color: var(--ink); }
.btn-icon { width: 44px; height: 44px; padding: 0; justify-content: center; }

/* ===== ASK BAR (home) ===== */
.ask-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 8px 6px 22px;
  margin-bottom: var(--s-8);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.ask-bar:focus-within { border-color: var(--amber); background: var(--bg-2); }
.ask-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  height: 44px;
  outline: none;
  min-width: 0;
}
.ask-bar input::placeholder { color: var(--ink-3); }

/* Mic button (voice input) */
.mic-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.mic-btn:hover { color: var(--ink); background: var(--bg-2); }
.mic-btn[data-recording="true"] {
  color: var(--ember);
  background: rgba(255, 107, 53, 0.12);
  animation: mic-pulse 1.4s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 107, 53, 0); }
}

/* ===== VERSE SECTION (Confused by the Bible?) ===== */
.verse-section { margin-bottom: var(--s-7); }
.verse-card {
  position: relative;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(232, 180, 84, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  overflow: hidden;
}
.verse-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--amber);
}
.verse-eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.verse-card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: var(--s-2) 0 var(--s-2);
}
.verse-card-blurb {
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
  max-width: 60ch;
}
.verse-form {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-pill);
  padding: 6px 6px 6px 22px;
  transition: border-color 0.15s var(--ease);
  margin-top: var(--s-2);
}
.verse-form:focus-within { border-color: var(--amber); }
.verse-form input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  height: 44px;
  outline: none;
  min-width: 0;
}
.verse-form input::placeholder { color: var(--ink-3); }
.verse-form button { padding: 12px 18px; }
.verse-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.verse-chip {
  appearance: none;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.verse-chip:hover {
  background: var(--bg-3);
  border-color: var(--amber);
  color: var(--amber);
}
.verse-chip.today {
  background: var(--amber);
  color: #1a1408;
  border-color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 8px 14px;
}
.verse-chip.today:hover {
  background: var(--amber-2);
  color: #1a1408;
}
.verse-chip.today .today-tag {
  font-size: 10px;
  letter-spacing: 0.16em;
  background: rgba(26,20,8,0.18);
  padding: 2px 6px;
  border-radius: 999px;
}
@media (max-width: 640px) {
  .verse-card { padding: var(--s-5) var(--s-5); }
  .verse-form { padding: 4px 4px 4px 16px; }
  .verse-form button { padding: 10px 14px; font-size: 14px; }
}

/* ===== SECTION HEADINGS ===== */
.section-head { margin-bottom: var(--s-6); }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-2);
}
.section-head p {
  color: var(--ink-3);
  margin: 0;
  font-size: 15px;
  max-width: 60ch;
}

/* ===== TOPIC GRID ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-4);
}
.topic-card {
  text-align: left;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: var(--s-5);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 140px;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.topic-card:hover {
  transform: translateY(-2px);
  background: var(--bg-2);
  border-color: var(--line-bright);
}
.topic-card .num {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--amber);
  font-weight: 600;
}
.topic-card .name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.topic-card .blurb {
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.45;
  margin-top: auto;
}

@media (max-width: 900px) {
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .topic-card { min-height: 120px; padding: var(--s-4); }
  .topic-card .name { font-size: 19px; }
  .container { padding: var(--s-6) var(--s-4) var(--s-9); }
  .today { padding: var(--s-6) var(--s-5); }
}

/* ===== PLANS GRID (home) ===== */
.plans-section { margin-top: var(--s-7); margin-bottom: var(--s-8); }
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 900px) { .plans-grid { grid-template-columns: 1fr; } }

.plan-card {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: var(--s-5);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  text-align: left;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.plan-card:hover { transform: translateY(-2px); border-color: var(--line-bright); }
.plan-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cover, var(--amber));
}
.plan-card .meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.plan-card .meta .days { color: var(--cover, var(--amber)); }
.plan-card .meta .cat { color: var(--ink-3); }
.plan-card .name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.plan-card .blurb { color: var(--ink-3); font-size: 13.5px; line-height: 1.45; flex: 1; }
.plan-card .cta {
  font-size: 13px; font-weight: 600; color: var(--cover, var(--amber));
  display: inline-flex; align-items: center; gap: 6px;
}

.plan-card .progress-meter {
  height: 4px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.plan-card .progress-meter > span {
  display: block;
  height: 100%;
  background: var(--cover, var(--amber));
  transition: width 0.3s var(--ease);
}
.plan-card .progress-text { color: var(--ink-3); font-size: 11px; }

/* ===== PLAN MODAL ===== */
.modal-plan { width: min(680px, 100%); }
.plan-detail-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
  margin: 0 0 var(--s-2);
}
.plan-detail-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 var(--s-3);
}
.plan-detail-blurb { color: var(--ink-2); margin: 0 0 var(--s-5); font-size: 15px; line-height: 1.55; }

.plan-day-list { display: flex; flex-direction: column; gap: var(--s-2); }
.plan-day-row {
  display: flex; align-items: stretch; gap: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
}
.plan-day-row.done { opacity: 0.55; }
.plan-day-row.today { border-color: var(--amber); background: var(--bg-2); }
.plan-day-row .num {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--amber);
  min-width: 36px;
  display: flex; align-items: center; justify-content: center;
}
.plan-day-row .body { flex: 1; min-width: 0; }
.plan-day-row .day-title {
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  margin-bottom: 2px;
}
.plan-day-row .day-meta {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); font-weight: 600; margin-bottom: 6px;
}
.plan-day-row .day-prompt { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.plan-day-row.today .day-prompt { color: var(--ink); }
.plan-day-row .day-actions { margin-top: var(--s-3); display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ===== TOPIC DETAIL VIEW ===== */
.back-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  margin-bottom: var(--s-5);
}
.back-btn:hover { color: var(--ink); }

.topic-detail-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 var(--s-4);
  font-weight: 700;
}
.topic-detail-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 5.5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
}
.topic-detail-blurb {
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.5;
  max-width: 50ch;
  margin: 0 0 var(--s-7);
}
.starter-list { display: flex; flex-direction: column; gap: var(--s-3); }
.starter {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--ink);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.starter:hover { border-color: var(--amber); background: var(--bg-2); }
.starter::after {
  content: '→';
  color: var(--ink-3);
  transition: transform 0.15s var(--ease), color 0.15s var(--ease);
}
.starter:hover::after { color: var(--amber); transform: translateX(3px); }

/* ===== CONVERSATION VIEW ===== */
.convo {
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
  margin-bottom: var(--s-7);
  padding-bottom: 110px; /* clear the sticky follow-up composer so the last QA actions are reachable */
}
.qa { display: flex; flex-direction: column; gap: var(--s-4); }
.qa-q {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.qa-q::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--amber);
  margin-bottom: var(--s-3);
}
.qa-a {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.qa-a p { margin: 0 0 var(--s-4); }
.qa-a p:last-child { margin-bottom: 0; }
.qa-a em { color: var(--amber); font-style: italic; }
.qa-a strong { font-weight: 600; }
.qa-a.error { color: var(--ember); border-left: 3px solid var(--ember); padding-left: var(--s-4); }

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-style: italic;
  font-family: var(--serif);
  font-size: 18px;
}
.thinking .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--ink-3);
  animation: pulse 1.2s infinite ease-in-out;
}
.thinking .dot:nth-child(2) { animation-delay: 0.15s; }
.thinking .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Follow-up composer */
.follow-up {
  position: sticky;
  bottom: var(--s-3);
  display: flex;
  gap: var(--s-2);
  background: rgba(19, 19, 22, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px 8px 8px 16px;
  margin-top: var(--s-7);
  transition: border-color 0.15s var(--ease);
}
.follow-up:focus-within { border-color: var(--amber); }
.follow-up textarea {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  resize: none;
  outline: none;
  padding: 12px 0;
  max-height: 40vh;
  line-height: 1.5;
}
.follow-up textarea::placeholder { color: var(--ink-3); }

/* ===== FOLLOW-UP CHIPS ===== */
/* Verse of the Day home card */
.vod-home-card {
  display: block; text-decoration: none; color: var(--ink);
  margin-bottom: var(--s-6);
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r-lg, 16px);
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(232,180,84,0.10), transparent 55%),
    var(--bg-1);
  transition: border-color 120ms ease, transform 120ms ease;
}
.vod-home-card:hover { border-color: var(--amber); transform: translateY(-1px); }
.vod-home-eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--amber); font-weight: 700; margin-bottom: 8px;
}
.vod-home-ref { font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; color: var(--ink); margin-bottom: 6px; }
.vod-home-meta { color: var(--ink-2); font-size: 14px; }
.vod-home-streak {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 10px;
}
.vod-streak-num { font-family: var(--serif); font-weight: 600; color: var(--amber); font-size: 18px; }
.vod-streak-lbl { font-size: 12px; color: var(--ink-3); }

/* Curated home-page feed */
.curated-section { margin: var(--s-7) 0; }
.curated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}
.curated-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px; border-radius: 14px;
  background: var(--bg-1); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: border-color 120ms ease, transform 120ms ease;
}
.curated-card:hover { border-color: var(--amber); transform: translateY(-1px); }
.curated-q { font-family: var(--serif); font-size: 17px; line-height: 1.3; color: var(--ink); }
.curated-meta { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.section-cta { color: var(--amber); text-decoration: none; font-weight: 600; }
.section-cta:hover { text-decoration: underline; }

/* Sermon time-machine — appears inside the cite-card expand */
.time-machine { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.tm-head { margin-bottom: 14px; }
.tm-eyebrow { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); font-weight: 700; margin: 0 0 4px; }
.tm-sub { font-size: 13px; color: var(--ink-3); margin: 0; line-height: 1.5; }
.tm-row { padding: 12px 0; border-top: 1px solid var(--line); }
.tm-row:first-of-type { border-top: none; }
.tm-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.tm-date { font-family: var(--serif); font-size: 13px; color: var(--ink); }
.tm-gap { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.tm-title { font-family: var(--serif); font-size: 15px; color: var(--ink); line-height: 1.3; }
.tm-speaker { color: var(--ink-3); margin-left: 8px; font-size: 13px; }
.tm-snippet { background: var(--bg-2); border-left: 2px solid var(--line); padding: 8px 12px; margin: 8px 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; font-style: italic; }
.tm-link { font-size: 12px; color: var(--amber); text-decoration: none; font-weight: 600; }
.tm-link:hover { text-decoration: underline; }

/* Lectio Divina view */
.lectio-container { padding-top: 32px; padding-bottom: 48px; max-width: 620px; }
.lectio-eyebrow { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: 0 0 12px; }
.lectio-h1 { font-family: var(--serif); font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; color: var(--ink); }
.lectio-sub { color: var(--ink-2); font-size: 16px; line-height: 1.6; margin: 0 0 28px; max-width: 540px; }
.lectio-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.lectio-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.lectio-field textarea {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.55;
  padding: 16px 18px; resize: vertical;
}
.lectio-field textarea:focus { outline: none; border-color: var(--amber); }
.lectio-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; margin: 4px 0 24px; cursor: pointer; }
.lectio-toggle input { accent-color: var(--amber); }

.lectio-session { text-align: center; padding-top: 40px; }
.lectio-phase-name { font-family: var(--serif); font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--amber); font-weight: 700; margin: 0 0 8px; }
.lectio-phase-sub { font-family: var(--serif); font-size: 18px; color: var(--ink-3); font-style: italic; margin: 0 0 32px; }
.lectio-passage {
  background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 14px; padding: 28px 32px;
  font-family: var(--serif); font-size: 22px; line-height: 1.55; color: var(--ink);
  text-align: left; margin: 0 0 32px;
}
.lectio-prompt { font-family: var(--serif); font-size: 24px; line-height: 1.4; color: var(--ink); margin: 32px 0; min-height: 60px; max-width: 480px; margin-left: auto; margin-right: auto; }
.lectio-timer { max-width: 360px; margin: 0 auto 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lectio-timer-bar { width: 100%; height: 3px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.lectio-timer-fill { height: 100%; background: var(--amber); transition: width 1s linear; }
.lectio-timer-num { font-family: var(--serif); font-size: 13px; color: var(--ink-3); letter-spacing: 0.06em; }
.lectio-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.lectio-done { text-align: left; padding-top: 32px; }

/* Pastor on-call — floating pill bottom-right */
.pastor-pill {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(10,10,11,0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: inherit; font-size: 13px; font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, transform 120ms;
}
.pastor-pill:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-1px); }
.pastor-pill svg { color: var(--amber); flex-shrink: 0; }
@media (max-width: 640px) {
  .pastor-pill span { display: none; }
  .pastor-pill { padding: 12px; }
}

.pastor-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-pastor {
  position: relative; max-width: 520px; width: 100%;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 28px;
  max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 999px;
  background: transparent; border: none; cursor: pointer; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--amber); }
.pastor-eyebrow { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: 0 0 12px; }
.pastor-title { font-family: var(--serif); font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 14px; color: var(--ink); }
.pastor-blurb { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0 0 18px; }
.pastor-blurb strong { color: var(--ink); }
.pastor-form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.pastor-field { display: flex; flex-direction: column; gap: 6px; }
.pastor-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.pastor-opt { font-weight: 400; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.pastor-field input, .pastor-field textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-family: inherit; font-size: 15px;
  padding: 12px 14px; resize: vertical;
}
.pastor-field input:focus, .pastor-field textarea:focus { outline: none; border-color: var(--amber); }
.pastor-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.pastor-fineprint { font-size: 12px; color: var(--ink-3); margin: 18px 0 0; text-align: center; }

/* "Sit with this" 60-second pause — gates follow-up chips on heavy answers */
.qa-sit-with {
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  background: rgba(232, 180, 84, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.sit-btn {
  background: transparent;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: inherit;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 240px;
  transition: background-color 120ms ease, transform 120ms ease;
}
.sit-btn:hover { background-color: rgba(232, 180, 84, 0.08); transform: translateY(-1px); }
.sit-btn-label { font-weight: 600; font-size: 15px; letter-spacing: 0.02em; }
.sit-btn-sub { font-size: 11px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; }
.sit-skip {
  background: transparent; border: none; color: var(--ink-3);
  font-family: inherit; font-size: 11px; cursor: pointer; padding: 4px 8px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.sit-skip:hover { color: var(--amber); }

.sit-timer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sit-timer-num {
  font-family: var(--serif); font-weight: 700; font-size: 64px;
  line-height: 1; letter-spacing: -0.02em; color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.sit-timer-label { font-family: var(--serif); font-size: 14px; color: var(--ink-2); font-style: italic; }
.sit-timer-progress {
  width: 240px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden;
  margin: 4px 0;
}
.sit-timer-fill { height: 100%; background: var(--amber); transition: width 1s linear; }

/* While the pause is running, dim everything except the most recent answer */
.view-convo.is-sitting .qa:not(:last-of-type) { opacity: 0.35; transition: opacity 200ms ease; }
.view-convo.is-sitting .follow-up { opacity: 0.4; pointer-events: none; transition: opacity 200ms ease; }
.view-convo.is-sitting .qa-citations,
.view-convo.is-sitting .qa-related,
.view-convo.is-sitting .qa-actions { opacity: 0.35; transition: opacity 200ms ease; }

/* Lament Mode entry — small, deliberate, not a CTA-y button */
.lament-entry-row { text-align: center; margin: 8px 0 0; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.entry-sep { color: var(--ink-3); font-size: 13px; }

/* Voice mode visual treatment on conversation view */
.view-convo.is-voice .container-narrow { max-width: 600px; }
.view-convo.is-voice .convo { padding-top: 24px; }
.view-convo.is-voice .qa-actions,
.view-convo.is-voice .qa-citations,
.view-convo.is-voice .qa-related,
.view-convo.is-voice .qa-followups,
.view-convo.is-voice .qa-sit-with { display: none !important; }
.view-convo.is-voice .qa-q { color: var(--ink-3); font-size: 14px; font-style: italic; }
.view-convo.is-voice .follow-up { display: none; }
.voice-orb {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin: 16px auto 24px; padding: 24px;
}
.voice-orb-circle {
  width: 96px; height: 96px; border-radius: 50%;
  border: 2px solid var(--amber);
  background: rgba(232,180,84,0.06);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 200ms ease, background-color 200ms ease;
}
.voice-orb-circle:hover { background-color: rgba(232,180,84,0.12); }
.voice-orb-circle.is-listening { animation: voice-pulse 1.2s ease-in-out infinite; background-color: rgba(232,180,84,0.18); }
.voice-orb-circle.is-speaking { animation: voice-glow 2s ease-in-out infinite; }
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232,180,84,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(232,180,84,0); }
}
@keyframes voice-glow {
  0%, 100% { box-shadow: 0 0 24px rgba(232,180,84,0.2); }
  50% { box-shadow: 0 0 48px rgba(232,180,84,0.5); }
}
.voice-orb-circle svg { color: var(--amber); }
.voice-orb-label { font-family: var(--serif); font-size: 14px; color: var(--ink-3); font-style: italic; min-height: 20px; text-align: center; }
.voice-orb-exit {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-3); font-family: inherit; font-size: 12px;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; letter-spacing: 0.04em;
}
.voice-orb-exit:hover { color: var(--amber); border-color: var(--amber); }
.lament-entry {
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--ink-3);
  padding: 6px 10px; line-height: 1.4;
}
.lament-entry-link { color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.lament-entry:hover .lament-entry-link { color: var(--amber); border-bottom-color: var(--amber); }
.lament-suggest {
  margin-top: 12px; padding: 14px 16px; background: rgba(232,180,84,0.06);
  border: 1px solid rgba(232,180,84,0.25); border-radius: 12px;
  font-size: 14px; color: var(--ink-2); line-height: 1.55; text-align: center;
}
.lament-suggest-link {
  background: transparent; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: inherit; color: var(--amber);
  font-weight: 600; border-bottom: 1px solid var(--amber);
}

/* Lament Mode — quieter visual treatment on the conversation view */
.view-convo.is-lament .container-narrow { max-width: 600px; }
.view-convo.is-lament .convo { padding-top: 32px; }
.view-convo.is-lament .qa-question { color: var(--ink-3); font-style: italic; font-family: var(--serif); }
.view-convo.is-lament .qa-answer { font-family: var(--serif); font-size: 19px; line-height: 1.75; }
.view-convo.is-lament .qa-answer p { margin: 1.4em 0; }   /* extra breathing room */
.view-convo.is-lament .qa-actions,
.view-convo.is-lament .qa-citations,
.view-convo.is-lament .qa-followups,
.view-convo.is-lament .qa-related { display: none !important; }   /* no chrome around the answer */
.view-convo.is-lament .follow-up textarea::placeholder { color: var(--ink-3); }
.view-convo.is-lament .follow-up { background: transparent; border-color: var(--line); }
.view-convo.is-lament .lament-banner {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--amber); text-align: center; padding: 14px 0 6px;
  font-weight: 700;
}
.view-convo.is-lament .lament-leave {
  display: block; margin: 24px auto 0; background: transparent; border: 1px solid var(--line);
  color: var(--ink-3); font-family: inherit; font-size: 12px; padding: 8px 18px;
  border-radius: 999px; cursor: pointer; letter-spacing: 0.04em;
}
.view-convo.is-lament .lament-leave:hover { color: var(--amber); border-color: var(--amber); }

/* Community thoughts surface on home */
.community-home-section { margin: var(--s-7) 0; }
.community-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}
.community-home-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 20px; border-radius: 14px;
  background: var(--bg-1); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: border-color 120ms ease, transform 120ms ease;
  position: relative;
}
.community-home-card:hover { border-color: var(--amber); transform: translateY(-1px); }
.community-home-card .anchor {
  font-family: var(--serif); font-size: 13px; color: var(--amber);
  margin: 0;
}
.community-home-card .body {
  font-family: var(--serif); font-size: 16px; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; word-wrap: break-word;
}
.community-home-card .meta {
  font-size: 11px; color: var(--ink-3); display: flex; gap: 10px; align-items: center;
  letter-spacing: 0.04em;
}
.community-home-card .meta .react-summary { color: var(--ink-2); }

/* People-also-asked panel */
.qa-related {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
}
.qa-related .label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-bottom: 8px;
}
.related-chip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-1); color: var(--ink-2);
  text-decoration: none; font-size: 14px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.related-chip:hover { border-color: var(--amber); color: var(--ink); background: rgba(232,180,84,0.05); }
.related-arrow { color: var(--amber); margin-left: 8px; }

.qa-followups {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.qa-followups .label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-right: 4px;
}
.followup-chip {
  appearance: none;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.followup-chip:hover { border-color: var(--amber); color: var(--amber); background: var(--bg-2); }
.followup-chip:disabled { opacity: 0.5; cursor: default; }

/* Headings + blockquotes inside answers */
.qa-a .qa-h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: var(--s-5) 0 var(--s-2); letter-spacing: -0.01em; }
.qa-a .qa-h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; margin: var(--s-4) 0 var(--s-2); letter-spacing: -0.005em; color: var(--amber); }
.qa-a blockquote {
  margin: var(--s-3) 0;
  padding: var(--s-2) var(--s-4);
  border-left: 3px solid var(--amber);
  font-style: italic;
  color: var(--ink);
  background: rgba(232, 180, 84, 0.04);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.qa-a hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }

/* ===== QA ACTIONS (under each answer) ===== */
.qa-actions {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-4);
  flex-wrap: wrap;
}
.qa-action {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.qa-action:hover { border-color: var(--amber); color: var(--amber); background: var(--bg-1); }
.qa-action svg { opacity: 0.85; }
.qa-action.qa-action-quiet { border-color: transparent; color: var(--ink-3); padding: 8px 10px; }
.qa-action.qa-action-quiet:hover { color: var(--amber); border-color: var(--line); background: transparent; }

.flag-modal {
  max-width: 520px; width: 92%;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; color: var(--ink); font-family: var(--sans);
}
.flag-modal h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.flag-sub { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.flag-reasons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.flag-reasons label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: background 100ms; }
.flag-reasons label:hover { background: rgba(255,255,255,0.04); }
.flag-reasons input[type="radio"] { accent-color: var(--amber); }
.flag-modal textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-family: var(--sans); font-size: 14px;
  resize: vertical; min-height: 64px;
}
.flag-modal textarea:focus { outline: none; border-color: var(--amber); }
.flag-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.flag-actions .btn-primary { background: var(--amber); color: #1a1408; border: 0; padding: 10px 18px; border-radius: 999px; font-weight: 600; cursor: pointer; }
.flag-actions .btn-secondary { background: transparent; color: var(--ink-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; cursor: pointer; }
.flag-status { color: var(--ink-3); font-size: 13px; margin: 12px 0 0; }

/* ===== SHARE MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  animation: fade-in 0.2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-1);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-lg);
  width: min(560px, 100%);
  max-height: 90dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
}
.modal-body {
  padding: var(--s-5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.share-preview {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3);
  display: grid;
  place-items: center;
}
.share-preview canvas {
  width: 100%;
  height: auto;
  max-height: 50dvh;
  display: block;
  border-radius: 4px;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.modal-actions .btn { flex: 1 1 auto; justify-content: center; }

/* Public share section in share modal */
.share-public { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.share-public-result {
  display: flex; gap: 8px; margin-top: var(--s-3);
}
.share-public-result input {
  flex: 1; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink); font-family: ui-monospace, monospace; font-size: 13px;
  padding: 10px 14px; border-radius: var(--r-pill); outline: none;
}
.share-public-help { color: var(--ink-3); font-size: 12px; margin: var(--s-2) 0 0; line-height: 1.5; }

/* ===== ONBOARDING MODAL ===== */
.modal-onboard { width: min(560px, 100%); }
.modal-onboard .modal-body { padding: var(--s-7); }
.onboard-eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--amber); font-weight: 700; margin: 0 0 var(--s-3);
}
.onboard-title {
  font-family: var(--serif); font-weight: 600;
  font-size: 28px; letter-spacing: -0.015em; line-height: 1.15;
  margin: 0 0 var(--s-3);
}
.onboard-blurb { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin: 0 0 var(--s-5); }
.onboard-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s-4); }
.onboard-pill {
  appearance: none; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-family: inherit;
  text-align: left; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.onboard-pill:hover { border-color: var(--amber); background: var(--bg-2); }
.onboard-pill .t { display: block; font-family: var(--serif); font-weight: 600; font-size: 17px; }
.onboard-pill .d { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.onboard-skip {
  appearance: none; border: 0; background: transparent;
  color: var(--ink-3); font-family: inherit; font-size: 13px;
  cursor: pointer; padding: 8px 0;
}
.onboard-skip:hover { color: var(--ink); }

/* ===== LOGIN MODAL ===== */
.modal-login .modal-body { gap: var(--s-3); }
.btn-block { width: 100%; justify-content: center; }
.login-blurb { color: var(--ink-2); font-size: 14px; margin: 0 0 var(--s-3); }
.divider-or {
  display: flex; align-items: center; gap: var(--s-3);
  color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  margin: var(--s-3) 0;
}
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-label {
  display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px; font-weight: 600;
}
.login-input-row { display: flex; gap: 8px; }
.login-input-row input {
  flex: 1; min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  outline: none;
}
.login-input-row input:focus { border-color: var(--amber); }
.login-msg { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; min-height: 18px; }
.login-msg.success { color: var(--amber); }
.login-msg.error { color: var(--ember); }
.login-fine { color: var(--ink-4); font-size: 11px; line-height: 1.5; margin-top: var(--s-3); }

/* ===== HISTORY DRAWER ===== */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(380px, 100%);
  background: var(--bg-1);
  border-left: 1px solid var(--line-bright);
  z-index: 90;
  display: flex; flex-direction: column;
  animation: slide-in 0.22s var(--ease);
  box-shadow: -10px 0 40px rgba(0,0,0,0.4);
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: 18px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-3); }
.drawer-body .empty { color: var(--ink-3); padding: var(--s-4); text-align: center; }
.history-item {
  display: block; width: 100%; text-align: left; appearance: none;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); cursor: pointer; margin-bottom: 8px;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.history-item:hover { border-color: var(--amber); background: var(--bg-2); }
.history-item .h-title {
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  line-height: 1.3; color: var(--ink); margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.history-item .h-meta { font-size: 11px; color: var(--ink-3); }

/* Profile drawer is wider than history */
.drawer-wide { width: min(440px, 100%); }

/* Profile sections */
.profile-section { margin-bottom: var(--s-6); }
.profile-section h4 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin: 0 0 var(--s-3);
}
.profile-section p.help { color: var(--ink-3); font-size: 12px; margin: 4px 0 var(--s-2); line-height: 1.4; }

.profile-account {
  display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line); margin-bottom: var(--s-5);
}
.profile-account .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line-bright);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 22px; font-weight: 600;
}
.profile-account .info .name { font-weight: 600; color: var(--ink); }
.profile-account .info .email { font-size: 12px; color: var(--ink-3); }
.profile-account .info .joined { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

.field-input, .field-textarea {
  display: block; width: 100%;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: 14px;
  padding: 10px 14px; border-radius: var(--r-md);
  outline: none; resize: none;
}
.field-input:focus, .field-textarea:focus { border-color: var(--amber); }
.field-textarea { min-height: 64px; line-height: 1.5; }

.stance-row { display: flex; flex-wrap: wrap; gap: 6px; }
.stance-pill {
  appearance: none; border: 1px solid var(--line);
  background: var(--bg-1); color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px;
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.stance-pill:hover { border-color: var(--line-bright); color: var(--ink); }
.stance-pill[aria-pressed="true"] {
  background: var(--amber); color: #1a1408; border-color: var(--amber);
}

.memory-item {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); margin-bottom: 8px;
  display: flex; align-items: flex-start; gap: var(--s-3);
}
.memory-item .body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.memory-item .source { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.memory-item .delete-btn {
  appearance: none; border: 0; background: transparent; color: var(--ink-3);
  cursor: pointer; padding: 4px;
}
.memory-item .delete-btn:hover { color: var(--ember); }

.memory-add {
  display: flex; gap: 8px; margin-top: var(--s-3);
}
.memory-add input { flex: 1; }

.profile-signout {
  margin-top: var(--s-5); padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.save-status {
  display: inline-block; font-size: 12px; color: var(--ink-3); margin-left: var(--s-3); transition: opacity 0.3s;
}
.save-status.saved { color: var(--amber); }

/* ===== SAVED ANSWERS DRAWER ===== */
.saved-item {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: 8px;
}
.saved-q {
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  line-height: 1.3; margin-bottom: 6px;
}
.saved-a {
  color: var(--ink-2); font-size: 13px; line-height: 1.45; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.saved-meta {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: 11px; color: var(--ink-3);
}
.saved-action {
  appearance: none; border: 0; background: transparent; padding: 4px 10px;
  border-radius: 999px; color: var(--ink-2); font-family: inherit; font-size: 11px;
  cursor: pointer;
}
.saved-action:hover { background: var(--bg-2); color: var(--ink); }
.saved-action.danger:hover { color: var(--ember); }

.saved-section-label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  margin-bottom: var(--s-2);
}
.saved-sermon-list { margin-bottom: 12px; }
.saved-sermon-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 6px;
  gap: 10px;
}
.saved-sermon-link {
  appearance: none; border: 0; background: transparent;
  color: var(--ink); font: inherit; cursor: pointer; text-align: left; flex: 1;
  padding: 0; font-family: var(--serif); font-size: 14px;
}
.saved-sermon-link:hover strong { color: var(--amber); }
.saved-sermon-link .dim { color: var(--ink-3); font-family: var(--sans); font-size: 12px; }

/* ===== CITATIONS UNDER ANSWER ===== */
.qa-citations {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--sans);
}
.qa-citations .label {
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-3); margin-bottom: 4px;
}
.qa-citations .cite {
  display: inline-block; margin-right: var(--s-3); margin-bottom: 4px;
  color: var(--ink-2);
  background: transparent; border: 0; padding: 0;
  font: inherit; text-align: left;
}
.qa-citations .cite em { color: var(--amber); font-style: normal; }
.qa-citations .cite-clickable {
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.qa-citations .cite-clickable:hover {
  border-color: var(--amber);
  background: rgba(255, 178, 60, 0.08);
}
.qa-citations .cite-clickable.is-open {
  border-color: var(--amber);
  background: rgba(255, 178, 60, 0.12);
  color: var(--ink-1);
}
.qa-citations .cite-arrow {
  display: inline-block; margin-left: 6px; opacity: 0.55;
  transition: transform 160ms ease;
}
.qa-citations .cite-clickable.is-open .cite-arrow {
  transform: rotate(180deg); opacity: 1;
}
.qa-citations .cite-expand { margin-top: var(--s-3); }
.qa-citations .cite-loading,
.qa-citations .cite-error {
  font-size: 13px; color: var(--ink-3); padding: var(--s-2);
}
.qa-citations .cite-error { color: #d97757; }
.qa-citations .cite-card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: var(--s-3) var(--s-4);
  font-family: var(--sans);
}
.qa-citations .cite-card-head {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline;
  font-size: 13px; color: var(--ink-1); margin-bottom: var(--s-2);
}
.qa-citations .cite-card-head strong { color: var(--ink-1); font-weight: 600; }
.qa-citations .cite-card-date,
.qa-citations .cite-card-speaker { color: var(--ink-3); font-size: 12px; }
.qa-citations .cite-card-body {
  margin: 0 0 var(--s-2) 0; padding: 0;
  border: 0; font-style: normal;
  font-family: var(--serif);
  font-size: 15px; line-height: 1.65;
  color: var(--ink-1); white-space: pre-wrap;
}
.qa-citations .cite-card-link {
  display: inline-block; font-size: 12px; color: var(--amber);
  text-decoration: none; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--amber);
  padding-bottom: 1px;
}
.qa-citations .cite-card-link:hover { color: var(--ink-1); border-color: var(--ink-1); }

/* Inline numbered citation markers in answer text */
.qa-a sup.cite-ref { font-size: 10px; line-height: 0; padding: 0 1px; vertical-align: super; }
.qa-a sup.cite-ref a {
  display: inline-block;
  min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; border-radius: 999px;
  background: rgba(255, 178, 60, 0.15);
  color: var(--amber);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--sans);
  transition: background 120ms ease, color 120ms ease;
}
.qa-a sup.cite-ref a:hover {
  background: var(--amber);
  color: #1a1408;
}
.qa-citations .cite.cite-flash {
  animation: cite-flash 1.4s ease;
}
@keyframes cite-flash {
  0%   { box-shadow: 0 0 0 0 rgba(232,180,84,0.0); border-color: var(--line); }
  20%  { box-shadow: 0 0 0 6px rgba(232,180,84,0.35); border-color: var(--amber); }
  100% { box-shadow: 0 0 0 0 rgba(232,180,84,0.0); border-color: var(--amber); }
}

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
  padding: var(--s-6) var(--s-4);
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.app-footer p { margin: 0; max-width: 60ch; margin-inline: auto; }
.app-footer a { color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--line-bright); }
.app-footer a:hover { color: var(--amber); }
.app-footer .footer-links { margin-top: var(--s-2); display: inline-flex; gap: var(--s-2); justify-content: center; }
.app-footer .footer-links a { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; padding: 0 8px; }
.app-footer .footer-links a:hover { color: var(--amber); }
.app-footer .footer-links span { color: var(--ink-4); }

/* ===== UTIL ===== */
.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;
}
[hidden] { display: none !important; }
